- re-assign ID via I_ID_RESPONSE
- implement getParentNodeID()
This commit is contained in:
@@ -203,6 +203,10 @@ uint8_t getNodeId() {
|
||||
return _nc.nodeId;
|
||||
}
|
||||
|
||||
uint8_t getParentNodeId() {
|
||||
return _nc.parentNodeId;
|
||||
}
|
||||
|
||||
ControllerConfig getConfig() {
|
||||
return _cc;
|
||||
}
|
||||
|
||||
@@ -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().
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user