diff --git a/include/wireless/ieee802154.h b/include/wireless/ieee802154.h index fe4456761..a7993108f 100644 --- a/include/wireless/ieee802154.h +++ b/include/wireless/ieee802154.h @@ -122,6 +122,12 @@ int sixlowpan_energydetect(int sock, FAR const char *ifname, /* libmac *******************************************************************/ /* Character driver IOCTL helpers */ +#if 0 +int ieee802154_mcps_register(int fd, + FAR struct ieee802154_mcps_register_s *info); +int ieee802154_mlme_register(int fd, + FAR struct ieee802154_mlme_register_s *info); +#endif int ieee802154_assoc_req(int fd, FAR struct ieee802154_assoc_req_s *req); int ieee802154_desassoc_req(int fd, FAR struct ieee802154_disassoc_req_s *req); @@ -147,35 +153,43 @@ int ieee802154_calibrate_req(int fd, #ifdef CONFIG_NET_6LOWPAN /* Netork driver IOCTL helpers */ +#if 0 +int sixlowpan_mcps_register(int fd, FAR const char *ifname, + FAR const struct ieee802154_mcps_register_s *info); +int sixlowpan_mlme_register(int fd, FAR const char *ifname, + FAR const struct ieee802154_mlme_register_s *info); +#endif int sixlowpan_assoc_req(int sock, FAR const char *ifname, - FAR struct ieee802154_assoc_req_s *req); + FAR const struct ieee802154_assoc_req_s *req); +int sixlowpan_assoc_resp(int sock, FAR const char *ifname, + FAR struct ieee802154_assoc_resp_s *resp); int sixlowpan_desassoc_req(int sock, FAR const char *ifname, - FAR struct ieee802154_disassoc_req_s *req); + FAR const struct ieee802154_disassoc_req_s *req); int sixlowpan_get_req(int sock, FAR const char *ifname, - FAR struct ieee802154_get_req_s *req); + FAR const struct ieee802154_get_req_s *req); int sixlowpan_gts_req(int sock, FAR const char *ifname, - FAR struct ieee802154_gts_req_s *req); + FAR const struct ieee802154_gts_req_s *req); int sixlowpan_orphan_resp(int sock, FAR const char *ifname, FAR struct ieee802154_orphan_resp_s *resp); int sixlowpan_rxenable_req(int sock, FAR const char *ifname, - FAR struct ieee802154_rxenable_req_s *req); + FAR const struct ieee802154_rxenable_req_s *req); int sixlowpan_scan_req(int sock, FAR const char *ifname, - FAR struct ieee802154_scan_req_s *req); + FAR const struct ieee802154_scan_req_s *req); int sixlowpan_set_req(int sock, FAR const char *ifname, - FAR struct ieee802154_set_req_s *req); + FAR const struct ieee802154_set_req_s *req); int sixlowpan_start_req(int sock, FAR const char *ifname, - FAR struct ieee802154_start_req_s *req); + FAR const struct ieee802154_start_req_s *req); int sixlowpan_sync_req(int sock, FAR const char *ifname, - FAR struct ieee802154_sync_req_s *req); + FAR const struct ieee802154_sync_req_s *req); int sixlowpan_poll_req(int sock, FAR const char *ifname, - FAR struct ieee802154_poll_req_s *req); + FAR const struct ieee802154_poll_req_s *req); #if 0 int sixlowpan_dps_req(int sock, FAR const char *ifname, - FAR struct ieee802154_dps_req_s *req); + FAR const struct ieee802154_dps_req_s *req); int sixlowpan_sounding_req(int sock, FAR const char *ifname, - FAR struct ieee802154_sounding_req_s *req); + FAR const struct ieee802154_sounding_req_s *req); int sixlowpan_calibrate_req(int sock, FAR const char *ifname, - FAR struct ieee802154_calibrate_req_s *req); + FAR const struct ieee802154_calibrate_req_s *req); #endif #endif /* CONFIG_NET_6LOWPAN*/ diff --git a/wireless/ieee802154/Kconfig b/wireless/ieee802154/Kconfig index 51b65b870..1276f0cc3 100644 --- a/wireless/ieee802154/Kconfig +++ b/wireless/ieee802154/Kconfig @@ -6,6 +6,7 @@ menu "IEEE 802.15.4 applications" source "$APPSDIR/wireless/ieee802154/libradio/Kconfig" +source "$APPSDIR/wireless/ieee802154/libmac/Kconfig" source "$APPSDIR/wireless/ieee802154/libutils/Kconfig" source "$APPSDIR/wireless/ieee802154/coord/Kconfig" source "$APPSDIR/wireless/ieee802154/i8sak/Kconfig" diff --git a/wireless/ieee802154/libmac/.gitignore b/wireless/ieee802154/libmac/.gitignore new file mode 100644 index 000000000..fa1ec7579 --- /dev/null +++ b/wireless/ieee802154/libmac/.gitignore @@ -0,0 +1,11 @@ +/Make.dep +/.depend +/.built +/*.asm +/*.obj +/*.rel +/*.lst +/*.sym +/*.adb +/*.lib +/*.src diff --git a/wireless/ieee802154/libmac/Makefile b/wireless/ieee802154/libmac/Makefile index 352e58398..58d3d1cb0 100644 --- a/wireless/ieee802154/libmac/Makefile +++ b/wireless/ieee802154/libmac/Makefile @@ -40,9 +40,10 @@ include $(APPDIR)/Make.defs # libmac source files ASRCS = -CSRCS = +CSRCS = ieee802154_assocreq.c ieee802154_assocresp.c ieee802154_disassocreq.c ifeq ($(CONFIG_NET_6LOWPAN),y) +CSRCS += sixlowpan_assocreq.c sixlowpan_assocresp.c sixlowpan_disassocreq.c endif AOBJS = $(ASRCS:.S=$(OBJEXT)) diff --git a/wireless/ieee802154/libmac/ieee802154_assocreq.c b/wireless/ieee802154/libmac/ieee802154_assocreq.c new file mode 100644 index 000000000..2d9752846 --- /dev/null +++ b/wireless/ieee802154/libmac/ieee802154_assocreq.c @@ -0,0 +1,69 @@ +/**************************************************************************** + * apps/wireless/ieee802154/libmac/ieee802154_assocreq.c + * + * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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_assoc_req(int fd, FAR struct ieee802154_assoc_req_s *req) +{ + int ret; + + ret = ioctl(fd, MAC802154IOC_MLME_ASSOC_REQUEST, (unsigned long)((uintptr_t)req)); + if (ret < 0) + { + int errcode = errno; + printf("MAC802154IOC_MLME_ASSOC_REQUEST failed: %d\n", errcode); + return ret; + } + + return ret; +} diff --git a/wireless/ieee802154/libmac/ieee802154_assocresp.c b/wireless/ieee802154/libmac/ieee802154_assocresp.c new file mode 100644 index 000000000..c7ee4f22d --- /dev/null +++ b/wireless/ieee802154/libmac/ieee802154_assocresp.c @@ -0,0 +1,72 @@ +/**************************************************************************** + * apps/wireless/ieee802154/libmac/ieee802154_assocresp.c + * + * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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 "wireless/ieee802154.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +int ieee802154_assoc_resp(int fd, FAR struct ieee802154_assoc_resp_s *resp) +{ + union ieee802154_macarg_u arg; + int ret; + + ret = ioctl(fd, MAC802154IOC_MLME_ASSOC_RESPONSE, (unsigned long)((uintptr_t)&arg)); + if (ret < 0) + { + int errcode = errno; + printf("MAC802154IOC_MLME_ASSOC_RESPONSE failed: %d\n", errcode); + return ret; + } + + memcpy(resp, &arg.assocresp, sizeof(struct ieee802154_assoc_resp_s)); + return ret; +} diff --git a/wireless/ieee802154/libmac/ieee802154_disassocreq.c b/wireless/ieee802154/libmac/ieee802154_disassocreq.c new file mode 100644 index 000000000..1dcd58d57 --- /dev/null +++ b/wireless/ieee802154/libmac/ieee802154_disassocreq.c @@ -0,0 +1,69 @@ +/**************************************************************************** + * apps/wireless/ieee802154/libmac/ieee802154_assocreq.c + * + * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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_disassoc_req(int fd, FAR struct ieee802154_disassoc_req_s *req) +{ + int ret; + + ret = ioctl(fd, MAC802154IOC_MLME_DISASSOC_REQUEST, (unsigned long)((uintptr_t)req)); + if (ret < 0) + { + int errcode = errno; + printf("MAC802154IOC_MLME_DISASSOC_REQUEST failed: %d\n", errcode); + return ret; + } + + return ret; +} diff --git a/wireless/ieee802154/libmac/sixlowpan_assocreq.c b/wireless/ieee802154/libmac/sixlowpan_assocreq.c new file mode 100644 index 000000000..754010f40 --- /dev/null +++ b/wireless/ieee802154/libmac/sixlowpan_assocreq.c @@ -0,0 +1,76 @@ +/**************************************************************************** + * apps/wireless/ieee802154/libmac/sixlowpan_assocreq.c + * + * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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 "wireless/ieee802154.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +int sixlowpan_assoc_req(int sock, FAR const char *ifname, + FAR const struct ieee802154_assoc_req_s *req) +{ + struct ieee802154_netmac_s arg; + int ret; + + strncpy(arg.ifr_name, ifname, IFNAMSIZ); + memcpy(&arg.u.assocreq, req, sizeof(struct ieee802154_assoc_req_s)); + + ret = ioctl(sock, MAC802154IOC_MLME_ASSOC_REQUEST, + (unsigned long)((uintptr_t)&arg)); + if (ret < 0) + { + int errcode = errno; + printf("MAC802154IOC_MLME_ASSOC_REQUEST failed: %d\n", errcode); + return ret; + } + + return ret; +} diff --git a/wireless/ieee802154/libmac/sixlowpan_assocresp.c b/wireless/ieee802154/libmac/sixlowpan_assocresp.c new file mode 100644 index 000000000..a210576e6 --- /dev/null +++ b/wireless/ieee802154/libmac/sixlowpan_assocresp.c @@ -0,0 +1,76 @@ +/**************************************************************************** + * apps/wireless/ieee802154/libmac/sixlowpan_assocresp.c + * + * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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 "wireless/ieee802154.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +int sixlowpan_assoc_resp(int sock, FAR const char *ifname, + FAR struct ieee802154_assoc_resp_s *resp) +{ + struct ieee802154_netmac_s arg; + int ret; + + strncpy(arg.ifr_name, ifname, IFNAMSIZ); + + ret = ioctl(sock, MAC802154IOC_MLME_ASSOC_RESPONSE, + (unsigned long)((uintptr_t)&arg)); + if (ret < 0) + { + int errcode = errno; + printf("MAC802154IOC_MLME_ASSOC_RESPONSE failed: %d\n", errcode); + return ret; + } + + memcpy(resp, &arg.u.assocresp, sizeof(struct ieee802154_assoc_resp_s)); + return ret; +} diff --git a/wireless/ieee802154/libmac/sixlowpan_disassocreq.c b/wireless/ieee802154/libmac/sixlowpan_disassocreq.c new file mode 100644 index 000000000..ee6f9d7f5 --- /dev/null +++ b/wireless/ieee802154/libmac/sixlowpan_disassocreq.c @@ -0,0 +1,76 @@ +/**************************************************************************** + * apps/wireless/ieee802154/libmac/sixlowpan_disassocreq.c + * + * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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 "wireless/ieee802154.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +int sixlowpan_desassoc_req(int sock, FAR const char *ifname, + FAR const struct ieee802154_disassoc_req_s *req) +{ + struct ieee802154_netmac_s arg; + int ret; + + strncpy(arg.ifr_name, ifname, IFNAMSIZ); + memcpy(&arg.u.disassocreq, req, sizeof(struct ieee802154_disassoc_req_s)); + + ret = ioctl(sock, MAC802154IOC_MLME_DISASSOC_REQUEST, + (unsigned long)((uintptr_t)&arg)); + if (ret < 0) + { + int errcode = errno; + printf("MAC802154IOC_MLME_DISASSOC_REQUEST failed: %d\n", errcode); + return ret; + } + + return ret; +} diff --git a/wireless/ieee802154/libradio/sixlowpan_getpromisc.c b/wireless/ieee802154/libradio/sixlowpan_getpromisc.c index 234460076..ef3596f2c 100644 --- a/wireless/ieee802154/libradio/sixlowpan_getpromisc.c +++ b/wireless/ieee802154/libradio/sixlowpan_getpromisc.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include diff --git a/wireless/ieee802154/libradio/sixlowpan_getsaddr.c b/wireless/ieee802154/libradio/sixlowpan_getsaddr.c index 69fa8d01d..8c5e30ab2 100644 --- a/wireless/ieee802154/libradio/sixlowpan_getsaddr.c +++ b/wireless/ieee802154/libradio/sixlowpan_getsaddr.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include