work on out_idx_genirci struct

FossilOrigin-Name: 16c28e079794c931e21de2c62b63d45146a20cd7d1e7b35e936c8a1f67819dbf
This commit is contained in:
7u83@mail.ru 2018-04-13 10:54:58 +00:00
parent 7fee816c8e
commit 17e9f1636d
2 changed files with 37 additions and 9 deletions

View File

@ -10,14 +10,20 @@ int cw_out_idx_generic_struct(struct cw_ElemHandler * handler, struct cw_ElemHan
int len,i,l;
int radios;
int fint, sr;
int idx, sr;
int pos;
uint8_t * mdst;
len =0;
i=0;
pos = 0;
mdst = dst;
do {
sprintf(key,handler->key,i);
search.key=key;
/*elem = mavl_get(params->conn->local_cfg, &search);*/
@ -25,15 +31,37 @@ int cw_out_idx_generic_struct(struct cw_ElemHandler * handler, struct cw_ElemHan
if(elem != NULL){
printf("Elem key: %s",elem->key);
}
sr = sscanf(elem->key,handler->key,&fint);
sr = sscanf(elem->key,handler->key,&idx);
if (sr!=1)
break;
if (fint<=i)
if (idx<=i)
break;
printf("Here we are '%s'! --> %d\n",key,fint);
i=fint+1;
sprintf(key,handler->key,idx);
printf("Here we are '%s'! --> %d\n",key,idx);
pos = params->conn->header_len(handler);
pos += cw_put_byte(mdst+pos,idx);
pos += cw_ktv_write_struct(params->conn->local_cfg,handler->type,key,mdst+pos);
mdst += params->conn->write_header(handler,mdst,pos);
i=idx+1;
}while(1);

View File

@ -65,8 +65,8 @@ cisco/regulatory-domain/019/code0 :Byte: 0
cisco/regulatory-domain/019/code1 :Byte: 1
cisco/regulatory-domain/019/set :Bool: true
cisco/regulatory-domain/019/slot :Byte: 0
cisco/regulatory-domain/01/code0 :Byte: 0
cisco/regulatory-domain/01/code1 :Byte: 1
cisco/regulatory-domain/01/set :Bool: true
cisco/regulatory-domain/01/slot :Byte: 1
cisco/regulatory-domain/001/code0 :Byte: 0
cisco/regulatory-domain/001/code1 :Byte: 1
cisco/regulatory-domain/001/set :Bool: true
cisco/regulatory-domain/001/slot :Byte: 1