20151212_CORE

This commit is contained in:
tekka007
2015-12-12 10:25:20 +01:00
parent 1b2aefaefb
commit 813c5b3f38
3 changed files with 8 additions and 14 deletions
+2 -2
View File
@@ -163,10 +163,10 @@ typedef enum {
I_INCLUSION_MODE, I_CONFIG, I_FIND_PARENT, I_FIND_PARENT_RESPONSE,
I_LOG_MESSAGE, I_CHILDREN, I_SKETCH_NAME, I_SKETCH_VERSION,
I_REBOOT, I_GATEWAY_READY,
I_REQUEST_SIGNING, /*!< Indicates senter require signed messages (bool param) */
I_REQUEST_SIGNING, /*!< Indicates sender require signed messages (bool param) */
I_GET_NONCE, /*!< Request for a nonce */
I_GET_NONCE_RESPONSE, /*!< Payload is nonce data */
I_HEARTBEAT, I_PRESENTATION, I_DISCOVER, I_DISCOVER_RESPONSE
I_HEARTBEAT, I_PRESENTATION, I_DISCOVER, I_DISCOVER_RESPONSE, I_HEARTBEAT_RESPONSE
} mysensor_internal;
+3 -10
View File
@@ -215,7 +215,7 @@ void sendBatteryLevel(uint8_t value, bool enableAck) {
}
void sendHeartbeat(void) {
_sendRoute(build(_msg, _nc.nodeId, GATEWAY_ADDRESS, NODE_SENSOR_ID, C_INTERNAL, I_HEARTBEAT, false).set(_heartbeat++));
_sendRoute(build(_msg, _nc.nodeId, GATEWAY_ADDRESS, NODE_SENSOR_ID, C_INTERNAL, I_HEARTBEAT_RESPONSE, false).set(_heartbeat++));
}
@@ -271,15 +271,8 @@ void _processInternalMessages() {
presentation();
}
} else if (type == I_HEARTBEAT) {
if (!mGetAck(_msg)) {
// Send heartbeat ack message back to sender (with the same payload)
_msgTmp = _msg;
mSetRequestAck(_msgTmp,false); // Reply without ack flag (otherwise we would end up in an eternal loop)
mSetAck(_msgTmp,true);
_msgTmp.sender = _nc.nodeId;
_msgTmp.destination = _msg.sender;
_sendRoute(_msgTmp);
}
// Send heartbeat ack message back to sender (with the same payload)
_sendRoute(build(_msg, _nc.nodeId, _msg.sender, _msg.sensor, C_INTERNAL, I_HEARTBEAT_RESPONSE, false).set(_heartbeat++));
} else if (type == I_TIME && receiveTime) {
// Deliver time to callback
if (receiveTime)
+3 -2
View File
@@ -94,8 +94,9 @@ inline void transportProcess() {
!mGetAck(_msg) &&
(mGetCommand(_msg) != C_INTERNAL ||
(type != I_GET_NONCE_RESPONSE && type != I_GET_NONCE && type != I_REQUEST_SIGNING &&
type != I_ID_REQUEST && type != I_ID_RESPONSE &&
type != I_FIND_PARENT && type != I_FIND_PARENT_RESPONSE))) {
type != I_ID_REQUEST && type != I_ID_RESPONSE &&
type != I_FIND_PARENT && type != I_FIND_PARENT_RESPONSE &&
type != I_HEARTBEAT))) {
if (!mGetSigned(_msg)) {
// Got unsigned message that should have been signed
debug(PSTR("no sign\n"));