File tree 2 files changed +8
-1
lines changed
2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ ZigbeeCore::ZigbeeCore() {
21
21
_started = false ;
22
22
_connected = false ;
23
23
_scan_duration = 4 ; // maximum scan duration
24
+ _rx_on_when_idle = true ;
24
25
if (!lock) {
25
26
lock = xSemaphoreCreateBinary ();
26
27
if (lock == NULL ) {
@@ -98,7 +99,7 @@ static void esp_zb_task(void *pvParameters) {
98
99
99
100
// NOTE: This is a workaround to make battery powered devices to be discovered as battery powered
100
101
if (((zigbee_role_t )Zigbee.getRole () == ZIGBEE_END_DEVICE) && edBatteryPowered) {
101
- zb_set_ed_node_descriptor (0 , 0 , 0 );
102
+ zb_set_ed_node_descriptor (0 , _rx_on_when_idle, 1 );
102
103
}
103
104
104
105
esp_zb_stack_main_loop ();
Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ class ZigbeeCore {
67
67
uint32_t _primary_channel_mask;
68
68
int16_t _scan_status;
69
69
uint8_t _scan_duration;
70
+ bool _rx_on_when_idle;
70
71
71
72
esp_zb_ep_list_t *_zb_ep_list;
72
73
zigbee_role_t _role;
@@ -112,12 +113,17 @@ class ZigbeeCore {
112
113
void setHostConfig (esp_zb_host_config_t config);
113
114
esp_zb_host_config_t getHostConfig ();
114
115
116
+ void setPrimaryChannelMask (uint32_t mask);
115
117
void setPrimaryChannelMask (uint32_t mask); // By default all channels are scanned (11-26) -> mask 0x07FFF800
116
118
void setScanDuration (uint8_t duration); // Can be set from 1 - 4. 1 is fastest, 4 is slowest
117
119
uint8_t getScanDuration () {
118
120
return _scan_duration;
119
121
}
120
122
123
+ void setRxOnWhenIdle (bool rx_on_when_idle) {
124
+ _rx_on_when_idle = rx_on_when_idle;
125
+ }
126
+
121
127
void setRebootOpenNetwork (uint8_t time);
122
128
void openNetwork (uint8_t time);
123
129
You can’t perform that action at this time.
0 commit comments