Skip to content

Commit

Permalink
Merge pull request mysensors#435 from tekka007/reassignID
Browse files Browse the repository at this point in the history
re-assign node ID
  • Loading branch information
henrikekblad committed May 7, 2016
2 parents e12c46d + 0c4c578 commit 5c650dc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions libraries/MySensors/core/MySensorCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ uint8_t getNodeId() {
return _nc.nodeId;
}

uint8_t getParentNodeId() {
return _nc.parentNodeId;
}

ControllerConfig getConfig() {
return _cc;
}
Expand Down
5 changes: 5 additions & 0 deletions libraries/MySensors/core/MySensorCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -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().
Expand Down
2 changes: 1 addition & 1 deletion libraries/MySensors/core/MyTransport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5c650dc

Please sign in to comment.