Merge pull request #15 from alagoutte/wtp_board

Add WTP Boot and Other version

FossilOrigin-Name: fed71fd417e07fa055484105d86050b3709570c7238cfe5dd1517cf0d5d28602
This commit is contained in:
7u83@mail.ru 2016-03-25 17:12:46 +00:00
commit e294f30f04
3 changed files with 40 additions and 25 deletions

View File

@ -21,6 +21,8 @@ const char CW_ITEM_WTP_HARDWARE_VENDOR=
const char CW_ITEM_WTP_HARDWARE_VERSION[]="wtp_hardware_version";
const char CW_ITEM_WTP_SOFTWARE_VERSION[]="wtp_software_version";
const char CW_ITEM_WTP_BOOT_VERSION[]="wtp_boot_version";
const char CW_ITEM_WTP_OTHER_VERSION[]="wtp_other_version";
/*
const char CW_ITEM_WTP_SOFTWARE_VENDOR,
@ -86,7 +88,7 @@ const char CW_ITEM_RADIO_OPER_STATE[]="radio_oper_state";
const char CW_ITEM_WTP_BOARD_VENDOR[]="vendor_id";
const char CW_ITEM_WTP_BOARD_MODELNO[]="model_no";
const char CW_ITEM_WTP_BOARD_MACADDRESS[]="wtp_board_macadddress";
const char CW_ITEM_WTP_BOARD_MACADDRESS[]="wtp_board_macaddress";
const char CW_ITEM_WTP_BOARD_ID[]="wtp_board_id";
const char CW_ITEM_WTP_BOARD_REVISION[]="wtp_board_revision";
const char CW_ITEM_WTP_BOARD_SERIALNO[]="serial_no";
@ -105,6 +107,8 @@ struct cw_itemdef capwap_itemdefs[] = {
{CW_ITEM_LOCATION_DATA,CW_ITEM_NONE,MBAG_STR},
{CW_ITEM_WTP_HARDWARE_VERSION,CW_ITEM_NONE,MBAG_VENDORSTR},
{CW_ITEM_WTP_SOFTWARE_VERSION,CW_ITEM_NONE,MBAG_VENDORSTR},
{CW_ITEM_WTP_BOOT_VERSION,CW_ITEM_NONE,MBAG_VENDORSTR},
{CW_ITEM_WTP_OTHER_VERSION,CW_ITEM_NONE,MBAG_VENDORSTR},
{CW_ITEM_WTP_GROUP_NAME,CW_ITEM_NONE,MBAG_STR},
{CW_ITEM_MAXIMUM_MESSAGE_LENGTH,CW_ITEM_NONE,MBAG_WORD},
{CW_ITEM_STATISTICS_TIMER,CW_ITEM_NONE,MBAG_WORD},
@ -154,9 +158,3 @@ struct cw_itemdef capwap_radiodefs[] = {
{CW_ITEM_NONE}
};

View File

@ -165,6 +165,8 @@ extern const char CW_ITEM_WTP_BOARD_SERIALNO[];
extern const char CW_ITEM_WTP_SOFTWARE_VERSION[];
extern const char CW_ITEM_WTP_HARDWARE_VERSION[];
extern const char CW_ITEM_WTP_BOOT_VERSION[];
extern const char CW_ITEM_WTP_OTHER_VERSION[];
extern const char CW_ITEM_WTP_BOOTLOADER_VERSION[];

View File

@ -61,6 +61,21 @@ int cw_out_wtp_descriptor(struct conn *conn, struct cw_action_out *a, uint8_t *
cw_log(LOG_ERR, "Can't send Software Version in WTP descriptor, not set.");
}
i = mbag_get(mbag,CW_ITEM_WTP_BOOT_VERSION);
if ( i ) {
d += cw_put_version(d,CW_SUBELEM_WTP_BOOTLOADER_VERSION,i->data);
}
else {
cw_log(LOG_INFO, "Can't send Boot Version in WTP descriptor, not set.");
}
i = mbag_get(mbag,CW_ITEM_WTP_OTHER_VERSION);
if ( i ) {
d += cw_put_version(d,CW_SUBELEM_WTP_OTHERSOFTWARE_VERSION,i->data);
}
else {
cw_log(LOG_INFO, "Can't send Other Version in WTP descriptor, not set.");
}
int len = d-dst-4;
return len + cw_put_elem_hdr(dst,a->elem_id,len);