Skip to content

Commit 5c650dc

Browse files
committed
Merge pull request arduino#435 from tekka007/reassignID
re-assign node ID
2 parents e12c46d + 0c4c578 commit 5c650dc

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

libraries/MySensors/core/MySensorCore.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,10 @@ uint8_t getNodeId() {
203203
return _nc.nodeId;
204204
}
205205

206+
uint8_t getParentNodeId() {
207+
return _nc.parentNodeId;
208+
}
209+
206210
ControllerConfig getConfig() {
207211
return _cc;
208212
}

libraries/MySensors/core/MySensorCore.h

+5
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ struct ControllerConfig {
7171
*/
7272
uint8_t getNodeId();
7373

74+
/**
75+
* Return the parent node id.
76+
*/
77+
uint8_t getParentNodeId();
78+
7479
/**
7580
* Each node must present all attached sensors before any values can be handled correctly by the controller.
7681
* It is usually good to present all attached sensors after power-up in setup().

libraries/MySensors/core/MyTransport.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ inline void transportProcess() {
159159
}
160160
return;
161161
} else if (sender == GATEWAY_ADDRESS) {
162-
if (type == I_ID_RESPONSE && _nc.nodeId == AUTO) {
162+
if (type == I_ID_RESPONSE) {
163163
_nc.nodeId = _msg.getByte();
164164
if (_nc.nodeId == AUTO) {
165165
// sensor net gateway will return max id if all sensor id are taken

0 commit comments

Comments
 (0)