Cisco AP can connect up to a data channel
FossilOrigin-Name: 3019e0265c564fb45223620a60ea7f4f1702fa00804804d5c9351a4f7e7d4205
This commit is contained in:
@ -73,7 +73,8 @@ struct conn {
|
||||
|
||||
|
||||
mavl_t remote_cfg;
|
||||
/* mavl_t default_cfg;*/
|
||||
mavl_t default_cfg;
|
||||
mavl_t update_cfg;
|
||||
mavl_t local_cfg;
|
||||
mavl_t global_cfg;
|
||||
|
||||
|
@ -70,3 +70,33 @@ int cw_ktv_idx_get(mavl_t ktv, const char *key)
|
||||
|
||||
return atoi(d+1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
int cw_ktv_idx_get_next(mavl_t ktv, const char *key, int n)
|
||||
{
|
||||
char ikey[CW_KTV_MAX_KEY_LEN];
|
||||
cw_KTV_t search, * result;
|
||||
char *d;
|
||||
|
||||
sprintf(ikey,"%s.%d",key,n);
|
||||
|
||||
search.key=ikey;
|
||||
/*//result = ktvn(ktv,&search);*/
|
||||
|
||||
result = mavl_get_first(ktv,&search);
|
||||
|
||||
if (result == NULL){
|
||||
return -1;
|
||||
}
|
||||
|
||||
d = strchr(result->key,'.');
|
||||
if (d==NULL){
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (strncmp(result->key,ikey,d-result->key)!=0)
|
||||
return -1;
|
||||
|
||||
return atoi(d+1);
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ int cw_ktv_write_struct(mavl_t ktv, const cw_KTVStruct_t * stru, const char *pke
|
||||
printf("Type mismatch: %s != %s\n",stru[i].type->name,result->type->name);
|
||||
if (stru[i].type->cast != NULL){
|
||||
if (!stru[i].type->cast(result)){
|
||||
cw_log(LOG_ERR,"Can't cast from %s to %s",result->type->name,stru[i].type->name);
|
||||
cw_log(LOG_ERR,"Can't cast '%s' from %s to %s",key,result->type->name,stru[i].type->name);
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,8 @@
|
||||
#include "cw.h"
|
||||
#include "dbg.h"
|
||||
|
||||
int cw_ktv_idx_get_next(mavl_t ktv, const char *key, int n);
|
||||
|
||||
int cw_out_radio_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams * params
|
||||
, uint8_t * dst)
|
||||
{
|
||||
@ -9,6 +11,15 @@ int cw_out_radio_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerP
|
||||
int radios;
|
||||
len =0;
|
||||
|
||||
/* int idx=0;*/
|
||||
|
||||
/* while(1){
|
||||
char key[CW_KTV_MAX_KEY_LEN];
|
||||
sprintf(key,"radio.%d",idx);
|
||||
idx = cw_ktv_idx_get_next(params->conn->local_cfg,key,idx);
|
||||
idx++;
|
||||
}
|
||||
*/
|
||||
radios = cw_ktv_get_byte(params->conn->local_cfg,"wtp-descriptor/max-radios",0);
|
||||
|
||||
for(i=0;i<radios;i++){
|
||||
|
@ -2,27 +2,43 @@
|
||||
#include "cw.h"
|
||||
#include "dbg.h"
|
||||
|
||||
int cw_ktv_idx_get_next(mavl_t ktv, const char *key, int n);
|
||||
|
||||
int cw_out_radio_generic_struct(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams * params
|
||||
, uint8_t * dst)
|
||||
{
|
||||
int i,l, offset;
|
||||
int radios;
|
||||
/* int radios;*/
|
||||
uint8_t * cdst;
|
||||
|
||||
cdst = dst;
|
||||
|
||||
radios = cw_ktv_get_byte(params->conn->local_cfg,"wtp-descriptor/max-radios",0);
|
||||
/* radios = cw_ktv_get_byte(params->conn->local_cfg,"wtp-descriptor/max-radios",0);*/
|
||||
|
||||
/* int idx=0;
|
||||
while(1){
|
||||
|
||||
idx = cw_ktv_idx_get_next(params->conn->local_cfg,"radio",idx);
|
||||
idx++;
|
||||
}
|
||||
*/
|
||||
|
||||
offset = params->conn->header_len(handler);
|
||||
for(i=0;i<radios;i++){
|
||||
/* for(i=0;i<radios;i++){*/
|
||||
i=-1;
|
||||
while(1){
|
||||
char basekey[CW_KTV_MAX_KEY_LEN];
|
||||
cw_KTV_t * result;
|
||||
|
||||
i = cw_ktv_idx_get_next(params->conn->local_cfg,"radio",i+1);
|
||||
if (i==-1)
|
||||
break;
|
||||
sprintf(basekey,"radio.%d/%s",i,handler->key);
|
||||
|
||||
result = cw_ktv_base_exists(params->conn->local_cfg,basekey);
|
||||
if (result == NULL)
|
||||
if (result == NULL){
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
l=0;
|
||||
@ -32,7 +48,7 @@ int cw_out_radio_generic_struct(struct cw_ElemHandler * handler, struct cw_ElemH
|
||||
|
||||
cdst+=params->conn->write_header(handler,cdst,l);
|
||||
|
||||
|
||||
|
||||
/* l = cw_write_radio_element(handler,params,i,dst+len);
|
||||
cw_dbg_elem(DBG_ELEM_OUT,params->conn,params->msgdata->type,handler,dst,l);
|
||||
len+=l;*/
|
||||
|
Reference in New Issue
Block a user