From f96b4b15f4c41f1e0f69bf6f6c60a9b7086d7094 Mon Sep 17 00:00:00 2001 From: Anthony Merlino Date: Wed, 21 Jun 2017 15:27:04 -0400 Subject: [PATCH] wireless/ieee802154: Adds option to make it easy to send large frame for testing purposes --- wireless/ieee802154/i8sak/i8sak_tx.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/wireless/ieee802154/i8sak/i8sak_tx.c b/wireless/ieee802154/i8sak/i8sak_tx.c index 856d7dcb3..56fc83454 100644 --- a/wireless/ieee802154/i8sak/i8sak_tx.c +++ b/wireless/ieee802154/i8sak/i8sak_tx.c @@ -80,6 +80,7 @@ void i8sak_tx_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]) enum ieee802154_devmode_e devmode; struct wpanlistener_eventfilter_s eventfilter; bool sendasdev = false; + bool sendmax = false; int argind; int option; int fd; @@ -87,7 +88,7 @@ void i8sak_tx_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]) ret = OK; argind = 1; - while ((option = getopt(argc, argv, ":hd")) != ERROR) + while ((option = getopt(argc, argv, ":hdm")) != ERROR) { switch (option) { @@ -96,6 +97,7 @@ void i8sak_tx_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]) "Usage: %s [-h|d] []\n" " -h = this help menu\n" " -d = send as device instead of coord\n" + " -m = send the largest frame possible" , argv[0]); /* Must manually reset optind if we are going to exit early */ @@ -107,6 +109,11 @@ void i8sak_tx_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]) sendasdev = true; argind++; break; + + case 'm': + sendmax = true; + argind++; + break; case ':': fprintf(stderr, "ERROR: missing argument\n"); @@ -132,6 +139,11 @@ void i8sak_tx_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]) { i8sak->payload_len = i8sak_str2payload(argv[1], &i8sak->payload[0]); } + + if (sendmax) + { + i8sak->payload_len = IEEE802154_MAX_SAFE_MAC_PAYLOAD_SIZE; + } fd = open(i8sak->devname, O_RDWR); if (fd < 0)