Merged in merlin17/apps/ieee802154 (pull request #77)

wireless/ieee802154: msdu_length in meta data converted to a seperate length argument

Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
Anthony Merlino 2017-05-05 18:55:00 +00:00 committed by Gregory Nutt
commit 9c8429f23e

View File

@ -121,12 +121,12 @@ static int tx(int fd, FAR const char *str, int verbose)
/* Each byte is represented by 2 chars */ /* Each byte is represented by 2 chars */
tx.meta.msdu_length = str_len >> 1; tx.length = str_len >> 1;
/* Check if the number of chars is a multiple of 2 and that the number of /* Check if the number of chars is a multiple of 2 and that the number of
* bytes does not exceed the max MAC frame payload supported */ * bytes does not exceed the max MAC frame payload supported */
if ((str_len & 1) || (tx.meta.msdu_length > IEEE802154_MAX_MAC_PAYLOAD_SIZE)) if ((str_len & 1) || (tx.length > IEEE802154_MAX_MAC_PAYLOAD_SIZE))
{ {
goto data_error; goto data_error;
} }
@ -150,7 +150,7 @@ static int tx(int fd, FAR const char *str, int verbose)
if (verbose) if (verbose)
{ {
for (i = 0; i < tx.meta.msdu_length; i++) for (i = 0; i < tx.length; i++)
{ {
printf("%02X", g_txframe[i]); printf("%02X", g_txframe[i]);
} }