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)
223
223
224
224
uint8_t getNodeId (void )
225
225
{
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 ();
230
231
#endif
232
+ return result;
231
233
}
232
234
233
235
uint8_t getParentNodeId (void )
234
236
{
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 ();
239
242
#endif
243
+ return result;
240
244
}
241
245
242
246
uint8_t getDistanceGW (void )
243
247
{
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 ();
248
253
#endif
254
+ return result;
249
255
}
250
256
251
257
controllerConfig_t getConfig (void )
Original file line number Diff line number Diff line change 83
83
#define MY_SLEEP_NOT_POSSIBLE ((int8_t)-2) //!< Sleeping not possible
84
84
#define INTERRUPT_NOT_DEFINED ((uint8_t)255) //!< _sleep() param: no interrupt defined
85
85
#define MODE_NOT_DEFINED ((uint8_t)255) //!< _sleep() param: no mode defined
86
+ #define VALUE_NOT_DEFINED ((uint8_t)255) //!< Value not defined
86
87
87
88
88
89
#ifdef MY_DEBUG
You can’t perform that action at this time.
0 commit comments