From e795fb71d03800dbce80986e6bc27c7f21ae5651 Mon Sep 17 00:00:00 2001 From: "7u83@mail.ru" <7u83@mail.ru@noemail.net> Date: Sun, 15 Mar 2015 19:45:52 +0000 Subject: [PATCH] Inital commit LWAPP support. FossilOrigin-Name: a529e32f33574b7c87b3707eaad936f292a28e595e93b71d3c6d5f1e2706d22c --- src/capwap/lw_readelem_wtp_board_data.c | 42 +++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/capwap/lw_readelem_wtp_board_data.c diff --git a/src/capwap/lw_readelem_wtp_board_data.c b/src/capwap/lw_readelem_wtp_board_data.c new file mode 100644 index 00000000..883d653a --- /dev/null +++ b/src/capwap/lw_readelem_wtp_board_data.c @@ -0,0 +1,42 @@ +/** + * @file + * @brief Implementation of lw_readelem_wtp_board_data + */ + +#include + +#include "cw_log.h" +#include "wtpinfo.h" + +#include "lwapp.h" + + +/** + * Read LWAPP board data element + * @param wtpinfo results are stored here + * @param type type of msg element (must be LWMSGELEM_WTP_BOARD_DATA) + * @param msgelem msg element data + * @param len length of msg element + * @return 0 if msg is not wtp board data\n + * 1 board data successful read + */ +int lw_readelem_wtp_board_data(struct wtpinfo *wtpinfo, int type, uint8_t *msgelem, int len) +{ + if (type != LWMSGELEM_WTP_BOARD_DATA) + return 0; + + if ( len != 46 ) { + cw_dbg(DBG_CW_MSG_ERR,"LWAPP msg size wrong. (WTP BOARD DATA) must be 46"); + exit(0); + return -1; + } + + uint16_t card_id = htonl( * ( (uint16_t*)(msgelem) ) ); + uint16_t card_rev = htonl( * ( (uint16_t*)(msgelem +2 ) ) ); + + + + return 1; +} + +