From 40644f990ee91a1a860ce7c7dd58c85eaba3f600 Mon Sep 17 00:00:00 2001 From: "7u83@mail.ru" <7u83@mail.ru@noemail.net> Date: Sun, 13 Mar 2016 17:50:56 +0000 Subject: [PATCH] Improved debugging output. FossilOrigin-Name: f28669afe1de17cdefdbd23e38ed1797eea1f547c59544a370e6a6842d187e2a --- src/cw/cw_in_wtp_board_data.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/cw/cw_in_wtp_board_data.c b/src/cw/cw_in_wtp_board_data.c index 5d55afaa..301c4fbb 100644 --- a/src/cw/cw_in_wtp_board_data.c +++ b/src/cw/cw_in_wtp_board_data.c @@ -39,11 +39,14 @@ static void readsubelems_wtp_board_data(mbag_t itemstore, uint8_t * msgelem, return; int i = 0; - uint32_t val; +// uint32_t val; do { - val = ntohl(*((uint32_t *) (msgelem + i))); - int subtype = (val >> 16) & 0xffff; - int sublen = val & 0xffff; +// val = ntohl(*((uint32_t *) (msgelem + i))); +// int subtype = (val >> 16) & 0xffff; +// int sublen = val & 0xffff; +// + int subtype = cw_get_word(msgelem+i); + int sublen = cw_get_word(msgelem+i+2); i += 4; if (sublen + i > len) { cw_dbg(DBG_ELEM_ERR, @@ -52,8 +55,10 @@ static void readsubelems_wtp_board_data(mbag_t itemstore, uint8_t * msgelem, return; } - cw_dbg(DBG_SUBELEM, "Reading WTP board data sub-element, type=%d, len=%d", - subtype, sublen); + cw_dbg(DBG_SUBELEM, "board data sub-element, type=%d (%s), len=%d", + subtype, cw_strboardelem(subtype),sublen); + + cw_dbg_dmp(DBG_SUBELEM,msgelem+i,sublen,"Dump..."); switch (subtype) { case CW_BOARDDATA_MODELNO: