More cisco stuff added

FossilOrigin-Name: 940b3e54ef6cd3ebff77761fa19302d762feab4e0f65a4dfa365a8f98cf98c97
This commit is contained in:
7u83@mail.ru
2018-04-27 12:04:03 +00:00
parent 07f02708bb
commit 7c81c59b64
11 changed files with 176 additions and 76 deletions

View File

@ -8,6 +8,9 @@ int cw_ktv_read_struct(mavl_t ktv,const cw_KTVStruct_t * stru, const char *pkey,
int pos, i,l;
cw_KTV_t * result;
if (strcmp(pkey,"radio.0/cisco/wtp-radio-config")==0)
i = 99;
pos=0; i=0;
while (stru[i].type != NULL){
@ -15,7 +18,10 @@ int cw_ktv_read_struct(mavl_t ktv,const cw_KTVStruct_t * stru, const char *pkey,
if(stru[i].position!=-1)
pos=stru[i].position;
sprintf(key,"%s/%s",pkey,stru[i].key);
if (stru[i].key!=NULL)
sprintf(key,"%s/%s",pkey,stru[i].key);
else
sprintf(key,"%s",pkey);
switch (stru[i].len){
case CW_KTVSTRUCT_L8:
@ -31,7 +37,7 @@ int cw_ktv_read_struct(mavl_t ktv,const cw_KTVStruct_t * stru, const char *pkey,
break;
default:
l = stru[i].len;
if (pos+l > l){
if (pos+l > len){
l = len-pos;
}

View File

@ -18,7 +18,13 @@ int cw_ktv_write_struct(mavl_t ktv, const cw_KTVStruct_t * stru, const char *pke
if (stru[i].len!=-1)
memset(dst+pos,0,stru[i].len);
sprintf(key,"%s/%s",pkey,stru[i].key);
if (stru[i].key!=NULL)
sprintf(key,"%s/%s",pkey,stru[i].key);
else
sprintf(key,"%s",pkey);
result = cw_ktv_get(ktv,key,NULL);