2016-04-02 09:05:07 +02:00
|
|
|
#include "cw/cw.h"
|
|
|
|
#include "cw/dbg.h"
|
|
|
|
#include "cw/capwap_items.h"
|
|
|
|
|
|
|
|
|
2016-04-13 09:32:55 +02:00
|
|
|
int cisco_out_radio_operational_state(struct conn *conn, struct cw_action_out *a, uint8_t * dst)
|
2016-04-02 09:05:07 +02:00
|
|
|
{
|
2018-02-23 01:41:32 +01:00
|
|
|
cw_dbg(DBG_X,"haaaaaalllooo");
|
2018-02-22 23:04:15 +01:00
|
|
|
cw_dbg(DBG_X,"Try send oper state");
|
|
|
|
|
2018-02-23 01:41:32 +01:00
|
|
|
//exit(0);
|
2016-04-13 09:32:55 +02:00
|
|
|
|
2016-04-02 09:05:07 +02:00
|
|
|
int l=0;
|
|
|
|
MAVLITER_DEFINE(it,conn->radios_upd);
|
|
|
|
mavliter_foreach(&it){
|
|
|
|
struct mbag_item *i = mavliter_get(&it);
|
|
|
|
if ( i->type != MBAG_MBAG ) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2018-03-04 16:59:20 +01:00
|
|
|
int state = mbag_get_word(i->u2.data,CW_RADIOITEM_OPER_STATE,CW_RADIO_OPER_STATE_DISABLED<<8);
|
2016-04-13 09:32:55 +02:00
|
|
|
int oper_state = (state >> 8) & 0xff;
|
|
|
|
int oper_cause = state & 0xff;
|
|
|
|
|
|
|
|
int oper_state_t = oper_state;
|
|
|
|
if (oper_state == CW_RADIO_OPER_STATE_ENABLED)
|
|
|
|
oper_state_t = CW_RADIO_OPER_STATE_ENABLED_7;
|
|
|
|
if (oper_state == CW_RADIO_OPER_STATE_DISABLED)
|
|
|
|
oper_state_t = CW_RADIO_OPER_STATE_DISABLED_7;
|
|
|
|
|
|
|
|
cw_dbg(DBG_X,"Translated oper state for output from %d to %d",oper_state, oper_state_t);
|
|
|
|
|
2018-02-23 01:41:32 +01:00
|
|
|
l+=cw_put_elem_radio_operational_state(dst+l,255,oper_state_t, oper_cause);
|
2018-03-04 16:59:20 +01:00
|
|
|
l+=cw_put_elem_radio_operational_state(dst+l,i->u1.iid,oper_state_t, oper_cause);
|
2018-02-23 01:41:32 +01:00
|
|
|
|
|
|
|
|
2018-02-22 23:04:15 +01:00
|
|
|
|
2018-03-18 21:48:34 +01:00
|
|
|
cw_dbg_elem(DBG_ELEM_IN,conn,1,1,dst+l,l);
|
2016-04-02 09:05:07 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
return l;
|
|
|
|
}
|
|
|
|
|
|
|
|
|