- re-assign ID via I_ID_RESPONSE

- implement getParentNodeID()
This commit is contained in:
tekka007
2016-05-07 10:12:14 +02:00
parent 460ae09811
commit 0c4c578921
3 changed files with 10 additions and 1 deletions
@@ -203,6 +203,10 @@ uint8_t getNodeId() {
return _nc.nodeId;
}
uint8_t getParentNodeId() {
return _nc.parentNodeId;
}
ControllerConfig getConfig() {
return _cc;
}
+5
View File
@@ -71,6 +71,11 @@ struct ControllerConfig {
*/
uint8_t getNodeId();
/**
* Return the parent node id.
*/
uint8_t getParentNodeId();
/**
* Each node must present all attached sensors before any values can be handled correctly by the controller.
* It is usually good to present all attached sensors after power-up in setup().
+1 -1
View File
@@ -159,7 +159,7 @@ inline void transportProcess() {
}
return;
} else if (sender == GATEWAY_ADDRESS) {
if (type == I_ID_RESPONSE && _nc.nodeId == AUTO) {
if (type == I_ID_RESPONSE) {
_nc.nodeId = _msg.getByte();
if (_nc.nodeId == AUTO) {
// sensor net gateway will return max id if all sensor id are taken