Merge pull request #426 from mysensors/present-node-after-id-received

Present attached sensors after node-id received
This commit is contained in:
Henrik Ekblad
2016-05-05 17:47:42 +02:00
+10 -1
View File
@@ -169,6 +169,8 @@ inline void transportProcess() {
} }
transportPresentNode(); transportPresentNode();
if (presentation)
presentation();
// Write id to EEPROM // Write id to EEPROM
hwWriteConfig(EEPROM_NODE_ID_ADDRESS, _nc.nodeId); hwWriteConfig(EEPROM_NODE_ID_ADDRESS, _nc.nodeId);
debug(PSTR("id=%d\n"), _nc.nodeId); debug(PSTR("id=%d\n"), _nc.nodeId);
@@ -452,7 +454,14 @@ void transportPresentNode() {
// Open reading pipe for messages directed to this node (set write pipe to same) // Open reading pipe for messages directed to this node (set write pipe to same)
transportSetAddress(_nc.nodeId); transportSetAddress(_nc.nodeId);
// Present node and request config // Present node and request config
#ifndef MY_GATEWAY_FEATURE #ifdef MY_GATEWAY_FEATURE
// Send presentation for this gateway device
#ifdef MY_REPEATER_FEATURE
present(NODE_SENSOR_ID, S_ARDUINO_REPEATER_NODE);
#else
present(NODE_SENSOR_ID, S_ARDUINO_NODE);
#endif
else
if (_nc.nodeId != AUTO) { if (_nc.nodeId != AUTO) {
// Send signing preferences for this node // Send signing preferences for this node
signerPresentation(_msg); signerPresentation(_msg);