File tree Expand file tree Collapse file tree 2 files changed +19
-12
lines changed Expand file tree Collapse file tree 2 files changed +19
-12
lines changed Original file line number Diff line number Diff line change @@ -223,29 +223,35 @@ void presentNode(void)
223223
224224uint8_t getNodeId (void )
225225{
226- #if defined(MY_SENSOR_NETWORK)
227- return transportGetNodeId ();
228- #else
229- return 0xFF ;
226+ uint8_t result = VALUE_NOT_DEFINED;
227+ #if defined(MY_GATEWAY_FEATURE)
228+ result = GATEWAY_ADDRESS;
229+ #elif defined(MY_SENSOR_NETWORK)
230+ result = transportGetNodeId ();
230231#endif
232+ return result;
231233}
232234
233235uint8_t getParentNodeId (void )
234236{
235- #if defined(MY_SENSOR_NETWORK)
236- return transportGetParentNodeId ();
237- #else
238- return 0xFF ;
237+ uint8_t result = VALUE_NOT_DEFINED;
238+ #if defined(MY_GATEWAY_FEATURE)
239+ result = VALUE_NOT_DEFINED; // GW doesn't have a parent
240+ #elif defined(MY_SENSOR_NETWORK)
241+ result = transportGetParentNodeId ();
239242#endif
243+ return result;
240244}
241245
242246uint8_t getDistanceGW (void )
243247{
244- #if defined(MY_SENSOR_NETWORK)
245- return transportGetDistanceGW ();
246- #else
247- return 0xFF ;
248+ uint8_t result = VALUE_NOT_DEFINED;
249+ #if defined(MY_GATEWAY_FEATURE)
250+ result = 0 ;
251+ #elif defined(MY_SENSOR_NETWORK)
252+ result = transportGetDistanceGW ();
248253#endif
254+ return result;
249255}
250256
251257controllerConfig_t getConfig (void )
Original file line number Diff line number Diff line change 8383#define MY_SLEEP_NOT_POSSIBLE ((int8_t)-2) //!< Sleeping not possible
8484#define INTERRUPT_NOT_DEFINED ((uint8_t)255) //!< _sleep() param: no interrupt defined
8585#define MODE_NOT_DEFINED ((uint8_t)255) //!< _sleep() param: no mode defined
86+ #define VALUE_NOT_DEFINED ((uint8_t)255) //!< Value not defined
8687
8788
8889#ifdef MY_DEBUG
You can’t perform that action at this time.
0 commit comments