From 88e0312897115d41409521a50f4fd3a2b4dc121f Mon Sep 17 00:00:00 2001 From: Anthony Merlino Date: Wed, 21 Jun 2017 15:01:39 -0400 Subject: [PATCH 1/3] ieee802154: Changes to support beacon-enabled networks --- include/wireless/ieee802154.h | 2 + wireless/ieee802154/i8sak/i8sak_acceptassoc.c | 10 +++ wireless/ieee802154/i8sak/i8sak_startpan.c | 24 +++++-- wireless/ieee802154/libmac/Makefile | 2 +- .../libmac/ieee802154_setassocpermit.c | 64 +++++++++++++++++++ 5 files changed, 97 insertions(+), 5 deletions(-) create mode 100644 wireless/ieee802154/libmac/ieee802154_setassocpermit.c diff --git a/include/wireless/ieee802154.h b/include/wireless/ieee802154.h index 7822a4e5c..276c90ad6 100644 --- a/include/wireless/ieee802154.h +++ b/include/wireless/ieee802154.h @@ -112,6 +112,8 @@ int ieee802154_getcca(int fd, FAR struct ieee802154_cca_s *cca); int ieee802154_getdevmode(int fd, FAR enum ieee802154_devmode_e *devmode); +int ieee802154_setassocpermit(int fd, bool assocpermit); + #ifdef CONFIG_NET_6LOWPAN /* Netork driver IOCTL helpers */ diff --git a/wireless/ieee802154/i8sak/i8sak_acceptassoc.c b/wireless/ieee802154/i8sak/i8sak_acceptassoc.c index c68caa466..6a896a76b 100644 --- a/wireless/ieee802154/i8sak/i8sak_acceptassoc.c +++ b/wireless/ieee802154/i8sak/i8sak_acceptassoc.c @@ -76,6 +76,7 @@ void i8sak_acceptassoc_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[] bool acceptall = true; /* start off assuming we are going to allow all connections */ int option; int optcnt; + int fd; optcnt = 0; while ((option = getopt(argc, argv, ":he:")) != ERROR) @@ -115,6 +116,15 @@ void i8sak_acceptassoc_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[] } } + fd = open(i8sak->devname, O_RDWR); + if (fd < 0) + { + printf("cannot open %s, errno=%d\n", i8sak->devname, errno); + i8sak_cmd_error(i8sak); + } + + ieee802154_setassocpermit(fd, true); + if (!optcnt) { i8sak->acceptall = acceptall; diff --git a/wireless/ieee802154/i8sak/i8sak_startpan.c b/wireless/ieee802154/i8sak/i8sak_startpan.c index 409e83ea2..5a09a58d7 100644 --- a/wireless/ieee802154/i8sak/i8sak_startpan.c +++ b/wireless/ieee802154/i8sak/i8sak_startpan.c @@ -73,11 +73,12 @@ void i8sak_startpan_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]) { struct ieee802154_reset_req_s resetreq; struct ieee802154_start_req_s startreq; + bool beaconenabled = false; int option; int fd; int i; - while ((option = getopt(argc, argv, ":h")) != ERROR) + while ((option = getopt(argc, argv, ":hb")) != ERROR) { switch (option) { @@ -85,11 +86,15 @@ void i8sak_startpan_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]) fprintf(stderr, "Starts PAN as PAN Coordinator\n" "Usage: %s [-h]\n" " -h = this help menu\n" + " -b = start beacon-enabled PAN\n" , argv[0]); /* Must manually reset optind if we are going to exit early */ optind = -1; return; + case 'b': + beaconenabled = true; + break; case ':': fprintf(stderr, "ERROR: missing argument\n"); /* Must manually reset optind if we are going to exit early */ @@ -184,11 +189,22 @@ void i8sak_startpan_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]) printf("i8sak: starting PAN\n"); IEEE802154_PANIDCOPY(startreq.panid, i8sak->addr.panid); - startreq.chnum = i8sak->chnum; + startreq.chnum = i8sak->chnum; startreq.chpage = i8sak->chpage; - startreq.beaconorder = 15; - startreq.pancoord = true; + + if (beaconenabled) + { + startreq.beaconorder = 6; + startreq.superframeorder = 5; + } + else + { + startreq.beaconorder = 15; + } + + startreq.pancoord = true; startreq.coordrealign = false; + startreq.battlifeext = false; ieee802154_start_req(fd, &startreq); diff --git a/wireless/ieee802154/libmac/Makefile b/wireless/ieee802154/libmac/Makefile index fe4022108..6dbf07cf4 100644 --- a/wireless/ieee802154/libmac/Makefile +++ b/wireless/ieee802154/libmac/Makefile @@ -54,7 +54,7 @@ CSRCS += ieee802154_seteaddr.c ieee802154_geteaddr.c CSRCS += ieee802154_setpromisc.c ieee802154_getpromisc.c CSRCS += ieee802154_setrxonidle.c ieee802154_getrxonidle.c CSRCS += ieee802154_settxpwr.c ieee802154_gettxpwr.c -CSRCS += ieee802154_getdevmode.c +CSRCS += ieee802154_getdevmode.c ieee802154_setassocpermit.c ifeq ($(CONFIG_NET_6LOWPAN),y) # Add Get/Set Attribute helpers diff --git a/wireless/ieee802154/libmac/ieee802154_setassocpermit.c b/wireless/ieee802154/libmac/ieee802154_setassocpermit.c new file mode 100644 index 000000000..9336e4699 --- /dev/null +++ b/wireless/ieee802154/libmac/ieee802154_setassocpermit.c @@ -0,0 +1,64 @@ +/**************************************************************************** + * apps/wireless/ieee802154/libmac/ieee802154_assocpermit.c + * + * Copyright (C) 2017 Verge Inc. All rights reserved. + * Author: Anthony Merlino + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include +#include + +#include + +#include "wireless/ieee802154.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +int ieee802154_setassocpermit(int fd, bool assocpermit) +{ + struct ieee802154_set_req_s req; + + req.attr = IEEE802154_ATTR_MAC_ASSOCIATION_PERMIT; + req.attrval.mac.assocpermit = assocpermit; + + return ieee802154_set_req(fd, &req); +} From eee82fbc99ac60bb0a8c3bb0d929a67d95e612de Mon Sep 17 00:00:00 2001 From: Anthony Merlino Date: Sun, 25 Jun 2017 20:01:16 -0400 Subject: [PATCH 2/3] ieee802154: Adds scan command --- wireless/ieee802154/i8sak/Makefile | 5 +- wireless/ieee802154/i8sak/i8sak.h | 7 +- wireless/ieee802154/i8sak/i8sak_assoc.c | 34 ++- wireless/ieee802154/i8sak/i8sak_chan.c | 139 ++++++++++ wireless/ieee802154/i8sak/i8sak_main.c | 8 +- wireless/ieee802154/i8sak/i8sak_poll.c | 6 - wireless/ieee802154/i8sak/i8sak_scan.c | 253 ++++++++++++++++++ wireless/ieee802154/i8sak/i8sak_startpan.c | 2 +- wireless/ieee802154/i8sak/i8sak_tx.c | 8 +- .../ieee802154/libmac/ieee802154_getchan.c | 4 +- .../ieee802154/libmac/ieee802154_geteaddr.c | 2 +- .../ieee802154/libmac/ieee802154_getsaddr.c | 2 +- .../ieee802154/libmac/ieee802154_setchan.c | 4 +- .../ieee802154/libmac/ieee802154_seteaddr.c | 2 +- .../ieee802154/libmac/ieee802154_setsaddr.c | 2 +- .../ieee802154/libmac/sixlowpan_getchan.c | 4 +- .../ieee802154/libmac/sixlowpan_geteaddr.c | 2 +- .../ieee802154/libmac/sixlowpan_getsaddr.c | 2 +- .../ieee802154/libmac/sixlowpan_setchan.c | 4 +- .../ieee802154/libmac/sixlowpan_seteaddr.c | 2 +- .../ieee802154/libmac/sixlowpan_setsaddr.c | 2 +- 21 files changed, 449 insertions(+), 45 deletions(-) create mode 100644 wireless/ieee802154/i8sak/i8sak_chan.c create mode 100644 wireless/ieee802154/i8sak/i8sak_scan.c diff --git a/wireless/ieee802154/i8sak/Makefile b/wireless/ieee802154/i8sak/Makefile index 530740af5..cef46ecfe 100644 --- a/wireless/ieee802154/i8sak/Makefile +++ b/wireless/ieee802154/i8sak/Makefile @@ -47,8 +47,9 @@ STACKSIZE = 4096 # IEEE 802.15.4 SAK (Swiss Army Knife) ASRCS = -CSRCS = i8sak_acceptassoc.c i8sak_assoc.c i8sak_blaster.c i8sak_poll.c -CSRCS += i8sak_sniffer.c i8sak_startpan.c i8sak_tx.c wpanlistener.c +CSRCS = i8sak_acceptassoc.c i8sak_assoc.c i8sak_scan.c i8sak_blaster.c i8sak_poll.c +CSRCS += i8sak_sniffer.c i8sak_startpan.c i8sak_tx.c i8sak_chan.c +CSRCS += wpanlistener.c MAINSRC = i8sak_main.c AOBJS = $(ASRCS:.S=$(OBJEXT)) diff --git a/wireless/ieee802154/i8sak/i8sak.h b/wireless/ieee802154/i8sak/i8sak.h index c9508ce14..0d6d1395a 100644 --- a/wireless/ieee802154/i8sak/i8sak.h +++ b/wireless/ieee802154/i8sak/i8sak.h @@ -146,7 +146,7 @@ struct i8sak_s /* Settings */ - uint8_t chnum; + uint8_t chan; uint8_t chpage; struct ieee802154_addr_s addr; struct ieee802154_addr_s ep; @@ -154,6 +154,9 @@ struct i8sak_s uint8_t payload[IEEE802154_MAX_MAC_PAYLOAD_SIZE]; uint16_t payload_len; int blasterperiod; + + struct ieee802154_pandesc_s pandescs[CONFIG_MAC802154_NPANDESC]; + uint8_t npandesc; }; /**************************************************************************** @@ -175,10 +178,12 @@ bool i8sak_str2bool(FAR const char *str); void i8sak_startpan_cmd (FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]); void i8sak_acceptassoc_cmd (FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]); void i8sak_assoc_cmd (FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]); +void i8sak_scan_cmd (FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]); void i8sak_tx_cmd (FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]); void i8sak_poll_cmd (FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]); void i8sak_sniffer_cmd (FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]); void i8sak_blaster_cmd (FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]); +void i8sak_chan_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]); /**************************************************************************** * Inline Functions diff --git a/wireless/ieee802154/i8sak/i8sak_assoc.c b/wireless/ieee802154/i8sak/i8sak_assoc.c index da34816ab..d8ef39b41 100644 --- a/wireless/ieee802154/i8sak/i8sak_assoc.c +++ b/wireless/ieee802154/i8sak/i8sak_assoc.c @@ -79,10 +79,12 @@ void i8sak_assoc_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]) { struct ieee802154_assoc_req_s assocreq; struct wpanlistener_eventfilter_s filter; + FAR struct ieee802154_pandesc_s *pandesc; int fd; int option; int optcnt; int ret; + uint8_t resindex; /* If the addresses has never been automatically or manually set before, set * it assuming that we are the default device address and the endpoint is the @@ -96,7 +98,7 @@ void i8sak_assoc_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]) } optcnt = 0; - while ((option = getopt(argc, argv, ":hs:e:")) != ERROR) + while ((option = getopt(argc, argv, ":hr:s:e:")) != ERROR) { optcnt++; switch (option) @@ -105,12 +107,31 @@ void i8sak_assoc_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]) fprintf(stderr, "Requests association with endpoint\n" "Usage: %s [-h]\n" " -h = this help menu\n" + " -r = use scan result index\n" , argv[0]); /* Must manually reset optind if we are going to exit early */ optind = -1; return; + case 'r': + resindex = i8sak_str2luint8(optarg); + + if (resindex >= i8sak->npandesc) + { + fprintf(stderr, "ERROR: missing argument\n"); + /* Must manually reset optind if we are going to exit early */ + + optind = -1; + i8sak_cmd_error(i8sak); /* This exits for us */ + } + + pandesc = &i8sak->pandescs[resindex]; + + i8sak->chan = pandesc->chan; + i8sak->chpage = pandesc->chpage; + memcpy(&i8sak->ep, &pandesc->coordaddr, sizeof(struct ieee802154_addr_s)); + break; case 's': /* Parse extended address and put it into the i8sak instance */ @@ -158,15 +179,6 @@ void i8sak_assoc_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]) i8sak_cmd_error(i8sak); } - if (argc < 2) - { - /* TODO: Perform a scan operation here, to determine addressing information - * of coordinator. - */ - - fprintf(stderr, "i8sak: scan not implemented. Using default values\n"); - } - /* Register new callback for receiving the association notifications */ memset(&filter, 0, sizeof(struct wpanlistener_eventfilter_s)); @@ -177,7 +189,7 @@ void i8sak_assoc_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]) printf("i8sak: issuing ASSOC. request\n"); - assocreq.chnum = i8sak->chnum; + assocreq.chan = i8sak->chan; assocreq.chpage = i8sak->chpage; memcpy(&assocreq.coordaddr, &i8sak->ep, sizeof(struct ieee802154_addr_s)); diff --git a/wireless/ieee802154/i8sak/i8sak_chan.c b/wireless/ieee802154/i8sak/i8sak_chan.c new file mode 100644 index 000000000..0c27999ef --- /dev/null +++ b/wireless/ieee802154/i8sak/i8sak_chan.c @@ -0,0 +1,139 @@ +/**************************************************************************** + * apps/wireless/ieee802154/i8sak/i8sak_chan.c + * IEEE 802.15.4 Swiss Army Knife + * + * Copyright (C) 2017 Verge Inc. All rights reserved. + * Author: Anthony Merlino + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + + /**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "i8sak.h" + +#include +#include +#include "wireless/ieee802154.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name : i8sak_chan_cmd + * + * Description : + * Try and extract data from the coordinator + ****************************************************************************/ + +void i8sak_chan_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]) +{ + int option; + int fd; + int argind; + bool getchan = false; + uint8_t channel; + + argind = 1; + while ((option = getopt(argc, argv, ":hg")) != ERROR) + { + switch (option) + { + argind++; + case 'h': + fprintf(stderr, "Polls coordinator for data\n" + "Usage: %s [-h]\n" + " -h = this help menu\n" + , argv[0]); + /* Must manually reset optind if we are going to exit early */ + + optind = -1; + return; + case 'g': + getchan = true; + break; + + case ':': + fprintf(stderr, "ERROR: missing argument\n"); + /* Must manually reset optind if we are going to exit early */ + + optind = -1; + i8sak_cmd_error(i8sak); /* This exits for us */ + case '?': + fprintf(stderr, "ERROR: unknown argument\n"); + /* Must manually reset optind if we are going to exit early */ + + optind = -1; + i8sak_cmd_error(i8sak); /* This exits for us */ + } + } + + if (!getchan) + { + if (argc < argind + 1) + { + fprintf(stderr, "ERROR: missing channel\n"); + i8sak_cmd_error(i8sak); /* This exits for us */ + } + + channel = i8sak_str2luint8(argv[argind]); + } + + fd = open(i8sak->devname, O_RDWR); + if (fd < 0) + { + printf("cannot open %s, errno=%d\n", i8sak->devname, errno); + i8sak_cmd_error(i8sak); + } + + if (getchan) + { + ieee802154_getchan(fd, &channel); + printf("i8sak: Channel: %d\n", (int)channel); + } + else + { + printf("i8sak: Setting Channel: %d\n", (int)channel); + ieee802154_setchan(fd, channel); + } + + close(fd); +} diff --git a/wireless/ieee802154/i8sak/i8sak_main.c b/wireless/ieee802154/i8sak/i8sak_main.c index 96586778f..0e15fe48e 100644 --- a/wireless/ieee802154/i8sak/i8sak_main.c +++ b/wireless/ieee802154/i8sak/i8sak_main.c @@ -104,10 +104,12 @@ static const struct i8sak_command_s g_i8sak_commands[] = {"startpan", (CODE void *)i8sak_startpan_cmd}, {"acceptassoc", (CODE void *)i8sak_acceptassoc_cmd}, {"assoc", (CODE void *)i8sak_assoc_cmd}, + {"scan", (CODE void *)i8sak_scan_cmd}, {"tx", (CODE void *)i8sak_tx_cmd}, {"poll", (CODE void *)i8sak_poll_cmd}, {"sniffer", (CODE void *)i8sak_sniffer_cmd}, {"blaster", (CODE void *)i8sak_blaster_cmd}, + {"chan", (CODE void *)i8sak_chan_cmd}, }; #define NCOMMANDS (sizeof(g_i8sak_commands) / sizeof(struct i8sak_command_s)) @@ -559,7 +561,7 @@ static int i8sak_setup(FAR struct i8sak_s *i8sak, FAR const char *devname) i8sak->daemon_started = false; i8sak->daemon_shutdown = false; - i8sak->chnum = CONFIG_IEEE802154_I8SAK_CHNUM; + i8sak->chan = CONFIG_IEEE802154_I8SAK_CHNUM; i8sak->chpage = CONFIG_IEEE802154_I8SAK_CHPAGE; if (strlen(devname) > I8SAK_MAX_DEVNAME) @@ -730,11 +732,13 @@ static int i8sak_showusage(FAR const char *progname, int exitcode) fprintf(stderr, "Usage: %s\n" " startpan [-h]\n" " acceptassoc [-h|e ]\n" - " assoc [-h] [] \n" + " scan [-h|p|a|e] minch-maxch\n" + " assoc [-h] []\n" " tx [-h|d] \n" " poll [-h]\n" " blaster [-h|q|f |p ]\n" " sniffer [-h|q]\n" + " chan [-h|g] []" , progname); exit(exitcode); } diff --git a/wireless/ieee802154/i8sak/i8sak_poll.c b/wireless/ieee802154/i8sak/i8sak_poll.c index 7db6eaf48..e62a7f7a9 100644 --- a/wireless/ieee802154/i8sak/i8sak_poll.c +++ b/wireless/ieee802154/i8sak/i8sak_poll.c @@ -83,7 +83,6 @@ void i8sak_poll_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]) int fd; int ret; - ret = OK; while ((option = getopt(argc, argv, ":h")) != ERROR) { switch (option) @@ -112,11 +111,6 @@ void i8sak_poll_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]) } } - if (ret != OK) - { - i8sak_cmd_error(i8sak); - } - fd = open(i8sak->devname, O_RDWR); if (fd < 0) { diff --git a/wireless/ieee802154/i8sak/i8sak_scan.c b/wireless/ieee802154/i8sak/i8sak_scan.c new file mode 100644 index 000000000..3e22b2599 --- /dev/null +++ b/wireless/ieee802154/i8sak/i8sak_scan.c @@ -0,0 +1,253 @@ +/**************************************************************************** + * apps/wireless/ieee802154/i8sak/i8sak_scan.c + * IEEE 802.15.4 Swiss Army Knife + * + * Copyright (C) 2014-2015, 2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2017 Verge Inc. All rights reserved. + * + * Author: Anthony Merlino + * Author: Gregory Nuttx + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "i8sak.h" + +#include +#include +#include "wireless/ieee802154.h" + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +static void scan_eventcb(FAR struct ieee802154_notif_s *notif, FAR void *arg); + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name : i8sak_scan_cmd + * + * Description : + * Request association with the Coordinator + ****************************************************************************/ + +void i8sak_scan_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]) +{ + struct ieee802154_scan_req_s scan; + struct wpanlistener_eventfilter_s filter; + int fd; + int option; + int argind; + int i; + int minchannel; + int maxchannel; + + scan.type = IEEE802154_SCANTYPE_PASSIVE; + + argind = 1; + while ((option = getopt(argc, argv, ":hpae")) != ERROR) + { + argind++; + switch (option) + { + case 'h': + fprintf(stderr, "Requests association with endpoint\n" + "Usage: %s [-h|p|a|e] minCh-maxCh\n" + " -h = this help menu\n" + " -p = passive scan (default)\n" + " -a = active scan\n" + " -e = energy scan\n" + , argv[0]); + + /* Must manually reset optind if we are going to exit early */ + + optind = -1; + return; + + case 'p': + scan.type = IEEE802154_SCANTYPE_PASSIVE; + break; + + case 'a': + scan.type = IEEE802154_SCANTYPE_ACTIVE; + break; + + case 'e': + scan.type = IEEE802154_SCANTYPE_ED; + break; + + case ':': + fprintf(stderr, "ERROR: missing argument\n"); + /* Must manually reset optind if we are going to exit early */ + + optind = -1; + i8sak_cmd_error(i8sak); /* This exits for us */ + + case '?': + fprintf(stderr, "ERROR: unknown argument\n"); + /* Must manually reset optind if we are going to exit early */ + + optind = -1; + i8sak_cmd_error(i8sak); /* This exits for us */ + } + } + + /* There should always be one argument after the list option argument */ + + if (argc != argind + 1) + { + fprintf(stderr, "ERROR: invalid channel list\n"); + i8sak_cmd_error(i8sak); + } + + scan.duration = 5; + scan.chpage = i8sak->chpage; + + /* Parse channel list */ + + sscanf(argv[argind], "%d-%d", &minchannel, &maxchannel); + + scan.numchan = maxchannel - minchannel + 1; + + if (scan.numchan > 15) + { + fprintf(stderr, "ERROR: too many channels\n"); + i8sak_cmd_error(i8sak); + } + + for (i = 0; i < scan.numchan; i++) + { + scan.channels[i] = minchannel + i; + } + + fd = open(i8sak->devname, O_RDWR); + if (fd < 0) + { + printf("i8sak: cannot open %s, errno=%d\n", i8sak->devname, errno); + i8sak_cmd_error(i8sak); + } + + /* Register new callback for receiving the scan confirmation notification */ + + memset(&filter, 0, sizeof(struct wpanlistener_eventfilter_s)); + filter.confevents.scan = true; + + wpanlistener_add_eventreceiver(&i8sak->wpanlistener, scan_eventcb, &filter, + (FAR void *)i8sak, true); + + printf("i8sak: starting scan\n"); + + ieee802154_scan_req(fd, &scan); + + close(fd); +} + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +static void scan_eventcb(FAR struct ieee802154_notif_s *notif, FAR void *arg) +{ + FAR struct i8sak_s *i8sak = (FAR struct i8sak_s *)arg; + FAR struct ieee802154_scan_conf_s *scan = ¬if->u.scanconf; + int i; + + printf("\n\ni8sak: Scan complete: %s\n", + IEEE802154_STATUS_STRING[scan->status]); + + printf("Scan type: "); + + switch (scan->type) + { + case IEEE802154_SCANTYPE_ACTIVE: + printf("Active\n"); + break; + case IEEE802154_SCANTYPE_PASSIVE: + printf("Passive\n"); + break; + case IEEE802154_SCANTYPE_ED: + printf("Energy\n"); + break; + default: + printf("Unknown\n"); + break; + } + + /* Copy the results from the notification */ + + i8sak->npandesc = scan->numdesc; + memcpy(i8sak->pandescs, scan->pandescs, + sizeof(struct ieee802154_pandesc_s) * i8sak->npandesc); + + printf("Scan results: \n"); + + for (i = 0; i < scan->numdesc; i++) + { + printf("Result %d\n", i); + printf(" Channel: %u\n", scan->pandescs[i].chan); + printf(" PAN ID: %02X:%02X\n", + scan->pandescs[i].coordaddr.panid[0], + scan->pandescs[i].coordaddr.panid[1]); + + if (scan->pandescs[i].coordaddr.mode == IEEE802154_ADDRMODE_SHORT) + { + printf(" Coordinator saddr: %02X:%02X\n", + scan->pandescs[i].coordaddr.saddr[0], + scan->pandescs[i].coordaddr.saddr[1]); + } + else + { + printf(" Coordinator eaddr: %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X\n", + scan->pandescs[i].coordaddr.eaddr[0], + scan->pandescs[i].coordaddr.eaddr[1], + scan->pandescs[i].coordaddr.eaddr[2], + scan->pandescs[i].coordaddr.eaddr[3], + scan->pandescs[i].coordaddr.eaddr[4], + scan->pandescs[i].coordaddr.eaddr[5], + scan->pandescs[i].coordaddr.eaddr[6], + scan->pandescs[i].coordaddr.eaddr[7]); + } + } +} diff --git a/wireless/ieee802154/i8sak/i8sak_startpan.c b/wireless/ieee802154/i8sak/i8sak_startpan.c index 5a09a58d7..1f45a534b 100644 --- a/wireless/ieee802154/i8sak/i8sak_startpan.c +++ b/wireless/ieee802154/i8sak/i8sak_startpan.c @@ -189,7 +189,7 @@ void i8sak_startpan_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]) printf("i8sak: starting PAN\n"); IEEE802154_PANIDCOPY(startreq.panid, i8sak->addr.panid); - startreq.chnum = i8sak->chnum; + startreq.chan = i8sak->chan; startreq.chpage = i8sak->chpage; if (beaconenabled) diff --git a/wireless/ieee802154/i8sak/i8sak_tx.c b/wireless/ieee802154/i8sak/i8sak_tx.c index 56fc83454..00a67aabe 100644 --- a/wireless/ieee802154/i8sak/i8sak_tx.c +++ b/wireless/ieee802154/i8sak/i8sak_tx.c @@ -126,15 +126,11 @@ void i8sak_tx_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]) case '?': fprintf(stderr, "ERROR: unknown argument\n"); ret = ERROR; - break; + optind = -1; + i8sak_cmd_error(i8sak); } } - if (ret != OK) - { - i8sak_cmd_error(i8sak); - } - if (argc == argind + 1) { i8sak->payload_len = i8sak_str2payload(argv[1], &i8sak->payload[0]); diff --git a/wireless/ieee802154/libmac/ieee802154_getchan.c b/wireless/ieee802154/libmac/ieee802154_getchan.c index c988e373b..132e03bb9 100644 --- a/wireless/ieee802154/libmac/ieee802154_getchan.c +++ b/wireless/ieee802154/libmac/ieee802154_getchan.c @@ -58,10 +58,10 @@ int ieee802154_getchan(int fd, FAR uint8_t *chan) struct ieee802154_get_req_s req; int ret; - req.attr = IEEE802154_ATTR_PHY_CURRENT_CHANNEL; + req.attr = IEEE802154_ATTR_PHY_CHAN; ret = ieee802154_get_req(fd, &req); - *chan = req.attrval.phy.channel; + *chan = req.attrval.phy.chan; return ret; } diff --git a/wireless/ieee802154/libmac/ieee802154_geteaddr.c b/wireless/ieee802154/libmac/ieee802154_geteaddr.c index 773c7ffe8..0e7b26c41 100644 --- a/wireless/ieee802154/libmac/ieee802154_geteaddr.c +++ b/wireless/ieee802154/libmac/ieee802154_geteaddr.c @@ -58,7 +58,7 @@ int ieee802154_geteaddr(int fd, FAR uint8_t *eaddr) struct ieee802154_get_req_s req; int ret; - req.attr = IEEE802154_ATTR_MAC_EXTENDED_ADDR; + req.attr = IEEE802154_ATTR_MAC_EADDR; ret = ieee802154_get_req(fd, &req); IEEE802154_EADDRCOPY(eaddr, req.attrval.mac.eaddr); diff --git a/wireless/ieee802154/libmac/ieee802154_getsaddr.c b/wireless/ieee802154/libmac/ieee802154_getsaddr.c index cd20cc126..850e82ead 100644 --- a/wireless/ieee802154/libmac/ieee802154_getsaddr.c +++ b/wireless/ieee802154/libmac/ieee802154_getsaddr.c @@ -58,7 +58,7 @@ int ieee802154_getsaddr(int fd, FAR uint8_t *saddr) struct ieee802154_get_req_s req; int ret; - req.attr = IEEE802154_ATTR_MAC_SHORT_ADDRESS; + req.attr = IEEE802154_ATTR_MAC_SADDR; ret = ieee802154_get_req(fd, &req); IEEE802154_SADDRCOPY(saddr, req.attrval.mac.saddr); diff --git a/wireless/ieee802154/libmac/ieee802154_setchan.c b/wireless/ieee802154/libmac/ieee802154_setchan.c index bac4bc6f7..4f3488dc2 100644 --- a/wireless/ieee802154/libmac/ieee802154_setchan.c +++ b/wireless/ieee802154/libmac/ieee802154_setchan.c @@ -57,8 +57,8 @@ int ieee802154_setchan(int fd, uint8_t chan) { struct ieee802154_set_req_s req; - req.attr = IEEE802154_ATTR_PHY_CURRENT_CHANNEL; - req.attrval.phy.channel = chan; + req.attr = IEEE802154_ATTR_PHY_CHAN; + req.attrval.phy.chan = chan; return ieee802154_set_req(fd, &req); } diff --git a/wireless/ieee802154/libmac/ieee802154_seteaddr.c b/wireless/ieee802154/libmac/ieee802154_seteaddr.c index 19494eafd..d7f22d97a 100644 --- a/wireless/ieee802154/libmac/ieee802154_seteaddr.c +++ b/wireless/ieee802154/libmac/ieee802154_seteaddr.c @@ -58,7 +58,7 @@ int ieee802154_seteaddr(int fd, FAR const uint8_t *eaddr) { struct ieee802154_set_req_s req; - req.attr = IEEE802154_ATTR_MAC_EXTENDED_ADDR; + req.attr = IEEE802154_ATTR_MAC_EADDR; IEEE802154_EADDRCOPY(req.attrval.mac.eaddr, eaddr); return ieee802154_set_req(fd, &req); diff --git a/wireless/ieee802154/libmac/ieee802154_setsaddr.c b/wireless/ieee802154/libmac/ieee802154_setsaddr.c index 20f2fa544..31675cce8 100644 --- a/wireless/ieee802154/libmac/ieee802154_setsaddr.c +++ b/wireless/ieee802154/libmac/ieee802154_setsaddr.c @@ -58,7 +58,7 @@ int ieee802154_setsaddr(int fd, FAR const uint8_t *saddr) { struct ieee802154_set_req_s req; - req.attr = IEEE802154_ATTR_MAC_SHORT_ADDRESS; + req.attr = IEEE802154_ATTR_MAC_SADDR; IEEE802154_SADDRCOPY(req.attrval.mac.saddr, saddr); return ieee802154_set_req(fd, &req); diff --git a/wireless/ieee802154/libmac/sixlowpan_getchan.c b/wireless/ieee802154/libmac/sixlowpan_getchan.c index f445d421e..fddc17f77 100644 --- a/wireless/ieee802154/libmac/sixlowpan_getchan.c +++ b/wireless/ieee802154/libmac/sixlowpan_getchan.c @@ -58,10 +58,10 @@ int sixlowpan_getchan(int sock, FAR const char *ifname, FAR uint8_t *chan) struct ieee802154_get_req_s req; int ret; - req.attr = IEEE802154_ATTR_PHY_CURRENT_CHANNEL; + req.attr = IEEE802154_ATTR_PHY_CHAN; ret = sixlowpan_get_req(sock, ifname, &req); - *chan = req.attrval.phy.channel; + *chan = req.attrval.phy.chan; return ret; } diff --git a/wireless/ieee802154/libmac/sixlowpan_geteaddr.c b/wireless/ieee802154/libmac/sixlowpan_geteaddr.c index 0344d43c6..18a23d2df 100644 --- a/wireless/ieee802154/libmac/sixlowpan_geteaddr.c +++ b/wireless/ieee802154/libmac/sixlowpan_geteaddr.c @@ -58,7 +58,7 @@ int sixlowpan_geteaddr(int sock, FAR const char *ifname, FAR uint8_t *eaddr) struct ieee802154_get_req_s req; int ret; - req.attr = IEEE802154_ATTR_MAC_EXTENDED_ADDR; + req.attr = IEEE802154_ATTR_MAC_EADDR; ret = sixlowpan_get_req(sock, ifname, &req); IEEE802154_EADDRCOPY(eaddr, req.attrval.mac.eaddr); diff --git a/wireless/ieee802154/libmac/sixlowpan_getsaddr.c b/wireless/ieee802154/libmac/sixlowpan_getsaddr.c index ef221190c..e721ca3bb 100644 --- a/wireless/ieee802154/libmac/sixlowpan_getsaddr.c +++ b/wireless/ieee802154/libmac/sixlowpan_getsaddr.c @@ -58,7 +58,7 @@ int sixlowpan_getsaddr(int sock, FAR const char *ifname, FAR uint8_t *saddr) struct ieee802154_get_req_s req; int ret; - req.attr = IEEE802154_ATTR_MAC_SHORT_ADDRESS; + req.attr = IEEE802154_ATTR_MAC_SADDR; ret = sixlowpan_get_req(sock, ifname, &req); IEEE802154_SADDRCOPY(saddr, req.attrval.mac.saddr); diff --git a/wireless/ieee802154/libmac/sixlowpan_setchan.c b/wireless/ieee802154/libmac/sixlowpan_setchan.c index c4e746b8c..04d44f382 100644 --- a/wireless/ieee802154/libmac/sixlowpan_setchan.c +++ b/wireless/ieee802154/libmac/sixlowpan_setchan.c @@ -57,8 +57,8 @@ int sixlowpan_setchan(int sock, FAR const char *ifname, uint8_t chan) { struct ieee802154_set_req_s req; - req.attr = IEEE802154_ATTR_PHY_CURRENT_CHANNEL; - req.attrval.phy.channel = chan; + req.attr = IEEE802154_ATTR_PHY_CHAN; + req.attrval.phy.chan = chan; return sixlowpan_set_req(sock, ifname, &req); } diff --git a/wireless/ieee802154/libmac/sixlowpan_seteaddr.c b/wireless/ieee802154/libmac/sixlowpan_seteaddr.c index 9f3dcb46d..3aa114f95 100644 --- a/wireless/ieee802154/libmac/sixlowpan_seteaddr.c +++ b/wireless/ieee802154/libmac/sixlowpan_seteaddr.c @@ -57,7 +57,7 @@ int sixlowpan_seteaddr(int sock, FAR const char *ifname, FAR const uint8_t *eadd { struct ieee802154_set_req_s req; - req.attr = IEEE802154_ATTR_MAC_EXTENDED_ADDR; + req.attr = IEEE802154_ATTR_MAC_EADDR; IEEE802154_EADDRCOPY(req.attrval.mac.eaddr, eaddr); return sixlowpan_set_req(sock, ifname, &req); diff --git a/wireless/ieee802154/libmac/sixlowpan_setsaddr.c b/wireless/ieee802154/libmac/sixlowpan_setsaddr.c index 49c46f28b..02260d73c 100644 --- a/wireless/ieee802154/libmac/sixlowpan_setsaddr.c +++ b/wireless/ieee802154/libmac/sixlowpan_setsaddr.c @@ -57,7 +57,7 @@ int sixlowpan_setsaddr(int sock, FAR const char *ifname, FAR const uint8_t *sadd { struct ieee802154_set_req_s req; - req.attr = IEEE802154_ATTR_MAC_SHORT_ADDRESS; + req.attr = IEEE802154_ATTR_MAC_SADDR; IEEE802154_SADDRCOPY(req.attrval.mac.saddr, saddr); return sixlowpan_set_req(sock, ifname, &req); From 3563a05fcd9e5cb3c6e7856463bf80fd3cb2946a Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 26 Jun 2017 11:12:53 -0600 Subject: [PATCH 3/3] Remove dangling white space --- wireless/ieee802154/i8sak/i8sak_acceptassoc.c | 2 +- wireless/ieee802154/i8sak/i8sak_chan.c | 6 ++-- wireless/ieee802154/i8sak/i8sak_scan.c | 4 +-- wireless/ieee802154/i8sak/i8sak_tx.c | 4 +-- wireless/ieee802154/libmac/Makefile | 32 +++++++++---------- wireless/iwpan/src/Make.defs | 2 +- wireless/wapi/LICENSE | 8 ++--- 7 files changed, 29 insertions(+), 29 deletions(-) diff --git a/wireless/ieee802154/i8sak/i8sak_acceptassoc.c b/wireless/ieee802154/i8sak/i8sak_acceptassoc.c index 6a896a76b..949ca0dc6 100644 --- a/wireless/ieee802154/i8sak/i8sak_acceptassoc.c +++ b/wireless/ieee802154/i8sak/i8sak_acceptassoc.c @@ -122,7 +122,7 @@ void i8sak_acceptassoc_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[] printf("cannot open %s, errno=%d\n", i8sak->devname, errno); i8sak_cmd_error(i8sak); } - + ieee802154_setassocpermit(fd, true); if (!optcnt) diff --git a/wireless/ieee802154/i8sak/i8sak_chan.c b/wireless/ieee802154/i8sak/i8sak_chan.c index 0c27999ef..f3f924a42 100644 --- a/wireless/ieee802154/i8sak/i8sak_chan.c +++ b/wireless/ieee802154/i8sak/i8sak_chan.c @@ -105,7 +105,7 @@ void i8sak_chan_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]) i8sak_cmd_error(i8sak); /* This exits for us */ } } - + if (!getchan) { if (argc < argind + 1) @@ -113,7 +113,7 @@ void i8sak_chan_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]) fprintf(stderr, "ERROR: missing channel\n"); i8sak_cmd_error(i8sak); /* This exits for us */ } - + channel = i8sak_str2luint8(argv[argind]); } @@ -124,7 +124,7 @@ void i8sak_chan_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]) i8sak_cmd_error(i8sak); } - if (getchan) + if (getchan) { ieee802154_getchan(fd, &channel); printf("i8sak: Channel: %d\n", (int)channel); diff --git a/wireless/ieee802154/i8sak/i8sak_scan.c b/wireless/ieee802154/i8sak/i8sak_scan.c index 3e22b2599..afacc60a9 100644 --- a/wireless/ieee802154/i8sak/i8sak_scan.c +++ b/wireless/ieee802154/i8sak/i8sak_scan.c @@ -105,7 +105,7 @@ void i8sak_scan_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]) optind = -1; return; - + case 'p': scan.type = IEEE802154_SCANTYPE_PASSIVE; break; @@ -144,7 +144,7 @@ void i8sak_scan_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]) scan.duration = 5; scan.chpage = i8sak->chpage; - + /* Parse channel list */ sscanf(argv[argind], "%d-%d", &minchannel, &maxchannel); diff --git a/wireless/ieee802154/i8sak/i8sak_tx.c b/wireless/ieee802154/i8sak/i8sak_tx.c index 00a67aabe..d60668f86 100644 --- a/wireless/ieee802154/i8sak/i8sak_tx.c +++ b/wireless/ieee802154/i8sak/i8sak_tx.c @@ -109,7 +109,7 @@ void i8sak_tx_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]) sendasdev = true; argind++; break; - + case 'm': sendmax = true; argind++; @@ -135,7 +135,7 @@ 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; diff --git a/wireless/ieee802154/libmac/Makefile b/wireless/ieee802154/libmac/Makefile index 6dbf07cf4..76c817573 100644 --- a/wireless/ieee802154/libmac/Makefile +++ b/wireless/ieee802154/libmac/Makefile @@ -47,16 +47,16 @@ CSRCS += ieee802154_resetreq.c ieee802154_rxenabreq.c ieee802154_scanreq.c CSRCS += ieee802154_setreq.c ieee802154_startreq.c ieee802154_syncreq.c CSRCS += ieee802154_pollreq.c ieee802154_enableevents.c # Add Get/Set Attribute helpers -CSRCS += ieee802154_setchan.c ieee802154_getchan.c -CSRCS += ieee802154_setpanid.c ieee802154_getpanid.c -CSRCS += ieee802154_setsaddr.c ieee802154_getsaddr.c -CSRCS += ieee802154_seteaddr.c ieee802154_geteaddr.c -CSRCS += ieee802154_setpromisc.c ieee802154_getpromisc.c -CSRCS += ieee802154_setrxonidle.c ieee802154_getrxonidle.c -CSRCS += ieee802154_settxpwr.c ieee802154_gettxpwr.c +CSRCS += ieee802154_setchan.c ieee802154_getchan.c +CSRCS += ieee802154_setpanid.c ieee802154_getpanid.c +CSRCS += ieee802154_setsaddr.c ieee802154_getsaddr.c +CSRCS += ieee802154_seteaddr.c ieee802154_geteaddr.c +CSRCS += ieee802154_setpromisc.c ieee802154_getpromisc.c +CSRCS += ieee802154_setrxonidle.c ieee802154_getrxonidle.c +CSRCS += ieee802154_settxpwr.c ieee802154_gettxpwr.c CSRCS += ieee802154_getdevmode.c ieee802154_setassocpermit.c -ifeq ($(CONFIG_NET_6LOWPAN),y) +ifeq ($(CONFIG_NET_6LOWPAN),y) # Add Get/Set Attribute helpers CSRCS += sixlowpan_assocreq.c sixlowpan_assocresp.c sixlowpan_disassocreq.c CSRCS += sixlowpan_getreq.c sixlowpan_gtsreq.c sixlowpan_orphanresp.c @@ -64,14 +64,14 @@ CSRCS += sixlowpan_resetreq.c sixlowpan_rxenabreq.c sixlowpan_scanreq.c CSRCS += sixlowpan_setreq.c sixlowpan_startreq.c sixlowpan_syncreq.c CSRCS += sixlowpan_pollreq.c # Add IOCTL helpers -CSRCS += sixlowpan_setchan.c sixlowpan_getchan.c -CSRCS += sixlowpan_setpanid.c sixlowpan_getpanid.c -CSRCS += sixlowpan_setsaddr.c sixlowpan_getsaddr.c -CSRCS += sixlowpan_seteaddr.c sixlowpan_geteaddr.c -CSRCS += sixlowpan_setpromisc.c sixlowpan_getpromisc.c -CSRCS += sixlowpan_setrxonidle.c sixlowpan_getrxonidle.c -CSRCS += sixlowpan_settxpwr.c sixlowpan_gettxpwr.c -endif +CSRCS += sixlowpan_setchan.c sixlowpan_getchan.c +CSRCS += sixlowpan_setpanid.c sixlowpan_getpanid.c +CSRCS += sixlowpan_setsaddr.c sixlowpan_getsaddr.c +CSRCS += sixlowpan_seteaddr.c sixlowpan_geteaddr.c +CSRCS += sixlowpan_setpromisc.c sixlowpan_getpromisc.c +CSRCS += sixlowpan_setrxonidle.c sixlowpan_getrxonidle.c +CSRCS += sixlowpan_settxpwr.c sixlowpan_gettxpwr.c +endif AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/wireless/iwpan/src/Make.defs b/wireless/iwpan/src/Make.defs index e7577e3ac..935fcb23d 100644 --- a/wireless/iwpan/src/Make.defs +++ b/wireless/iwpan/src/Make.defs @@ -36,7 +36,7 @@ ifeq ($(CONFIG_WIRELESS_IWPAN),y) -CSRCS = +CSRCS = MAINSRC = iwpan.c DEPPATH += --dep-path src diff --git a/wireless/wapi/LICENSE b/wireless/wapi/LICENSE index eeb3ddaae..cdade89e1 100644 --- a/wireless/wapi/LICENSE +++ b/wireless/wapi/LICENSE @@ -1,16 +1,16 @@ Copyright (c) 2010, Volkan YAZICI All rights reserved. - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - + - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - + - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE