ac descriptor works

FossilOrigin-Name: 8e68ed51a2c8ee448474ab13ef8d0edbd8cfda5b5384684e2ed9ffa1fca4e799
This commit is contained in:
7u83@mail.ru
2018-03-24 06:56:05 +00:00
parent a9bb2d523c
commit 257f1189b0
39 changed files with 337 additions and 199 deletions

View File

@ -1,16 +1,24 @@
#include "cw.h"
#include "dbg.h"
#include "ktv.h"
/*
int cw_read_ac_descriptor(mbag_t store, uint8_t *data, int len,
static struct cw_DescriptorSubelemDef allowed_default[] = {
{0,CW_SUBELEM_AC_HARDWARE_VERSION, "ac_hardware_versision", 1024,1},
{0,CW_SUBELEM_AC_SOFTWARE_VERSION, "ac_software_version", 1024,1},
{0,0, NULL,0, 0}
};
int cw_read_ac_descriptor(mavl_t store, uint8_t *data, int len,
struct cw_DescriptorSubelemDef *allowed)
{
struct cw_ac_status *status = malloc(sizeof(struct cw_ac_status));
if (!status)
return 0;
char key[CW_KTV_MAX_KEY_LEN];
cw_KTV_t * stations, *limit;
status->stations = cw_get_word(data);
stations = cw_ktv_add(store,"ac-descriptor/stations",CW_TYPE_WORD,data,4);
/* status->stations = cw_get_word(data);
status->limit = cw_get_word(data + 2);
status->active_wtps = cw_get_word(data + 4);
status->max_wtps = cw_get_word(data + 6);
@ -22,14 +30,9 @@ int cw_read_ac_descriptor(mbag_t store, uint8_t *data, int len,
"AC Descriptor: WTPs:%d/%d, Stations:%d/%d, Security:%d, Rmac:%d, DTLS-Policy:%d",
status->active_wtps, status->max_wtps, status->stations, status->limit,
status->security, status->rmac_field, status->dtls_policy);
*/
/* mbag_set_ptr(store, CW_ITEM_AC_STATUS, status);*/
mbag_set_ptr(store, CW_ITEM_AC_STATUS, status);
static struct cw_DescriptorSubelemDef allowed_default[] = {
{0,CW_SUBELEM_AC_HARDWARE_VERSION, "ac_hardware_versision", 1024,1},
{0,CW_SUBELEM_AC_SOFTWARE_VERSION, "ac_software_version", 1024,1},
{0,0, NULL,0, 0}
};
if (!allowed)
allowed=allowed_default;
@ -38,4 +41,4 @@ int cw_read_ac_descriptor(mbag_t store, uint8_t *data, int len,
}
*/