File tree 6 files changed +59
-27
lines changed
applications/zigbee_weather_station/src
6 files changed +59
-27
lines changed Original file line number Diff line number Diff line change @@ -177,11 +177,17 @@ static void start_identifying(zb_bufid_t bufid)
177
177
*/
178
178
if (dev_ctx .identify_attr .identify_time ==
179
179
ZB_ZCL_IDENTIFY_IDENTIFY_TIME_DEFAULT_VALUE ) {
180
- LOG_INF ("Manually enter identify mode" );
181
180
182
181
zb_ret_t zb_err_code = zb_bdb_finding_binding_target (
183
182
WEATHER_STATION_ENDPOINT_NB );
184
- ZB_ERROR_CHECK (zb_err_code );
183
+
184
+ if (zb_err_code == RET_OK ) {
185
+ LOG_INF ("Manually enter identify mode" );
186
+ } else if (zb_err_code == RET_INVALID_STATE ) {
187
+ LOG_WRN ("RET_INVALID_STATE - Cannot enter identify mode" );
188
+ } else {
189
+ ZB_ERROR_CHECK (zb_err_code );
190
+ }
185
191
} else {
186
192
LOG_INF ("Manually cancel identify mode" );
187
193
zb_bdb_finding_binding_target_cancel ();
Original file line number Diff line number Diff line change @@ -195,8 +195,6 @@ ZBOSS_DECLARE_DEVICE_CTX_1_EP(
195
195
*/
196
196
static void start_identifying (zb_bufid_t bufid )
197
197
{
198
- zb_ret_t zb_err_code ;
199
-
200
198
ZVUNUSED (bufid );
201
199
202
200
if (ZB_JOINED ()) {
@@ -205,10 +203,17 @@ static void start_identifying(zb_bufid_t bufid)
205
203
*/
206
204
if (dev_ctx .identify_attr .identify_time ==
207
205
ZB_ZCL_IDENTIFY_IDENTIFY_TIME_DEFAULT_VALUE ) {
208
- LOG_INF ("Enter identify mode" );
209
206
210
- zb_err_code = zb_bdb_finding_binding_target (DIMMABLE_LIGHT_ENDPOINT );
211
- ZB_ERROR_CHECK (zb_err_code );
207
+ zb_ret_t zb_err_code = zb_bdb_finding_binding_target (
208
+ DIMMABLE_LIGHT_ENDPOINT );
209
+
210
+ if (zb_err_code == RET_OK ) {
211
+ LOG_INF ("Enter identify mode" );
212
+ } else if (zb_err_code == RET_INVALID_STATE ) {
213
+ LOG_WRN ("RET_INVALID_STATE - Cannot enter identify mode" );
214
+ } else {
215
+ ZB_ERROR_CHECK (zb_err_code );
216
+ }
212
217
} else {
213
218
LOG_INF ("Cancel identify mode" );
214
219
zb_bdb_finding_binding_target_cancel ();
Original file line number Diff line number Diff line change @@ -198,8 +198,6 @@ static void light_switch_send_on_off(zb_bufid_t bufid, zb_uint16_t on_off);
198
198
*/
199
199
static void start_identifying (zb_bufid_t bufid )
200
200
{
201
- zb_ret_t zb_err_code ;
202
-
203
201
ZVUNUSED (bufid );
204
202
205
203
if (ZB_JOINED ()) {
@@ -208,9 +206,16 @@ static void start_identifying(zb_bufid_t bufid)
208
206
*/
209
207
if (dev_ctx .identify_attr .identify_time ==
210
208
ZB_ZCL_IDENTIFY_IDENTIFY_TIME_DEFAULT_VALUE ) {
211
- LOG_INF ("Enter identify mode" );
212
- zb_err_code = zb_bdb_finding_binding_target (LIGHT_SWITCH_ENDPOINT );
213
- ZB_ERROR_CHECK (zb_err_code );
209
+
210
+ zb_ret_t zb_err_code = zb_bdb_finding_binding_target (LIGHT_SWITCH_ENDPOINT );
211
+
212
+ if (zb_err_code == RET_OK ) {
213
+ LOG_INF ("Enter identify mode" );
214
+ } else if (zb_err_code == RET_INVALID_STATE ) {
215
+ LOG_WRN ("RET_INVALID_STATE - Cannot enter identify mode" );
216
+ } else {
217
+ ZB_ERROR_CHECK (zb_err_code );
218
+ }
214
219
} else {
215
220
LOG_INF ("Cancel identify mode" );
216
221
zb_bdb_finding_binding_target_cancel ();
Original file line number Diff line number Diff line change @@ -142,8 +142,6 @@ static void identify_cb(zb_bufid_t bufid)
142
142
*/
143
143
static void start_identifying (zb_bufid_t bufid )
144
144
{
145
- zb_ret_t zb_err_code ;
146
-
147
145
ZVUNUSED (bufid );
148
146
149
147
if (ZB_JOINED ()) {
@@ -152,9 +150,17 @@ static void start_identifying(zb_bufid_t bufid)
152
150
*/
153
151
if (dev_ctx .identify_attr .identify_time ==
154
152
ZB_ZCL_IDENTIFY_IDENTIFY_TIME_DEFAULT_VALUE ) {
155
- LOG_INF ("Enter identify mode" );
156
- zb_err_code = zb_bdb_finding_binding_target (ZIGBEE_COORDINATOR_ENDPOINT );
157
- ZB_ERROR_CHECK (zb_err_code );
153
+
154
+ zb_ret_t zb_err_code = zb_bdb_finding_binding_target (
155
+ ZIGBEE_COORDINATOR_ENDPOINT );
156
+
157
+ if (zb_err_code == RET_OK ) {
158
+ LOG_INF ("Enter identify mode" );
159
+ } else if (zb_err_code == RET_INVALID_STATE ) {
160
+ LOG_WRN ("RET_INVALID_STATE - Cannot enter identify mode" );
161
+ } else {
162
+ ZB_ERROR_CHECK (zb_err_code );
163
+ }
158
164
} else {
159
165
LOG_INF ("Cancel identify mode" );
160
166
zb_bdb_finding_binding_target_cancel ();
Original file line number Diff line number Diff line change @@ -124,8 +124,6 @@ static void identify_cb(zb_bufid_t bufid)
124
124
*/
125
125
static void start_identifying (zb_bufid_t bufid )
126
126
{
127
- zb_ret_t zb_err_code ;
128
-
129
127
ZVUNUSED (bufid );
130
128
131
129
if (ZB_JOINED ()) {
@@ -134,10 +132,17 @@ static void start_identifying(zb_bufid_t bufid)
134
132
*/
135
133
if (dev_ctx .identify_attr .identify_time ==
136
134
ZB_ZCL_IDENTIFY_IDENTIFY_TIME_DEFAULT_VALUE ) {
137
- LOG_INF ( "Enter identify mode" );
138
- zb_err_code = zb_bdb_finding_binding_target (
135
+
136
+ zb_ret_t zb_err_code = zb_bdb_finding_binding_target (
139
137
APP_ZIGBEE_ENDPOINT );
140
- ZB_ERROR_CHECK (zb_err_code );
138
+
139
+ if (zb_err_code == RET_OK ) {
140
+ LOG_INF ("Enter identify mode" );
141
+ } else if (zb_err_code == RET_INVALID_STATE ) {
142
+ LOG_WRN ("RET_INVALID_STATE - Cannot enter identify mode" );
143
+ } else {
144
+ ZB_ERROR_CHECK (zb_err_code );
145
+ }
141
146
} else {
142
147
LOG_INF ("Cancel identify mode" );
143
148
zb_bdb_finding_binding_target_cancel ();
Original file line number Diff line number Diff line change @@ -127,8 +127,6 @@ static void identify_cb(zb_bufid_t bufid)
127
127
*/
128
128
static void start_identifying (zb_bufid_t bufid )
129
129
{
130
- zb_ret_t zb_err_code ;
131
-
132
130
ZVUNUSED (bufid );
133
131
134
132
if (ZB_JOINED ()) {
@@ -137,10 +135,17 @@ static void start_identifying(zb_bufid_t bufid)
137
135
*/
138
136
if (dev_ctx .identify_attr .identify_time ==
139
137
ZB_ZCL_IDENTIFY_IDENTIFY_TIME_DEFAULT_VALUE ) {
140
- LOG_INF ( "Enter identify mode" );
141
- zb_err_code = zb_bdb_finding_binding_target (
138
+
139
+ zb_ret_t zb_err_code = zb_bdb_finding_binding_target (
142
140
APP_TEMPLATE_ENDPOINT );
143
- ZB_ERROR_CHECK (zb_err_code );
141
+
142
+ if (zb_err_code == RET_OK ) {
143
+ LOG_INF ("Enter identify mode" );
144
+ } else if (zb_err_code == RET_INVALID_STATE ) {
145
+ LOG_WRN ("RET_INVALID_STATE - Cannot enter identify mode" );
146
+ } else {
147
+ ZB_ERROR_CHECK (zb_err_code );
148
+ }
144
149
} else {
145
150
LOG_INF ("Cancel identify mode" );
146
151
zb_bdb_finding_binding_target_cancel ();
You can’t perform that action at this time.
0 commit comments