From 67517ad1636ba0ca6002295aa98fa9510d9b2ca9 Mon Sep 17 00:00:00 2001 From: "7u83@mail.ru" <7u83@mail.ru@noemail.net> Date: Tue, 28 Apr 2015 12:28:47 +0000 Subject: [PATCH] Throws an error message if the element is mandatory and ca't be set. FossilOrigin-Name: c6ebc9257f3096e1145257eaedf4ef261e5e899ecf1898cf1c2df3d0f6f00b4b --- src/capwap/cw_out_radio_operational_state.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/capwap/cw_out_radio_operational_state.c b/src/capwap/cw_out_radio_operational_state.c index 0be15a96..37bcc344 100644 --- a/src/capwap/cw_out_radio_operational_state.c +++ b/src/capwap/cw_out_radio_operational_state.c @@ -15,12 +15,16 @@ int cw_out_radio_operational_states(struct conn *conn, struct cw_action_out *a, the Radio Admin state, adds a CW_RADIO_OPER_STATE item to the radio, depending on results. */ + int nerror=0; + MAVLITER_DEFINE(it,conn->radios); mavliter_foreach(&it){ mbag_item_t * radioitem = mavliter_get(&it); mbag_item_t *ositem = mbag_get(radioitem->data,CW_RADIO_OPER_STATE); - if (!ositem) + if (!ositem){ + nerror++; continue; + } /* Put the radio ID */ cw_put_byte(d+4,radioitem->id); @@ -50,6 +54,14 @@ int cw_out_radio_operational_states(struct conn *conn, struct cw_action_out *a, } + if (nerror) { + if (a->mand) { + cw_log(LOG_ERROR,"Could not send Radio Operational State for all radios. Sent %d out of %d.", + conn->radios->count-nerror,conn->radios->count); + + } + } + return d-dst; }