diff --git a/netutils/netlib/Kconfig b/netutils/netlib/Kconfig index 48cd20a50..9d7884bba 100644 --- a/netutils/netlib/Kconfig +++ b/netutils/netlib/Kconfig @@ -7,6 +7,8 @@ config NETUTILS_NETLIB bool "Network support library" default n depends on NET + select IEEE802154_LIBRADIO if DRIVERS_IEEE802154 + select IEEE802154_LIBMAC if WIRELESS_IEEE802154 ---help--- Enable support for the network support library. diff --git a/netutils/netlib/netlib_getpanid.c b/netutils/netlib/netlib_getpanid.c index 9325b8395..07139b0bf 100644 --- a/netutils/netlib/netlib_getpanid.c +++ b/netutils/netlib/netlib_getpanid.c @@ -46,6 +46,7 @@ #include #include +#include "wireless/ieee802154.h" #include "netutils/netlib.h" #if defined(CONFIG_NET_6LOWPAN) && CONFIG_NSOCKET_DESCRIPTORS > 0 @@ -80,13 +81,10 @@ int netlib_getpanid(FAR const char *ifname, FAR uint16_t *panid) int sockfd = socket(PF_INET6, NETLIB_SOCK_IOCTL, 0); if (sockfd >= 0) { - /* Put the driver name into the request */ -#warning Missing logic - /* Perform the ioctl to get the current PAN ID */ + /* Use the helper provided in libradio */ + ret = ieee802154_getpanid(sockfd, ifname, panid); close(sockfd); - - /* Reuturn the current PAN ID */ } } diff --git a/netutils/netlib/netlib_setpanid.c b/netutils/netlib/netlib_setpanid.c index a227c7a19..7dd4ff3ba 100644 --- a/netutils/netlib/netlib_setpanid.c +++ b/netutils/netlib/netlib_setpanid.c @@ -80,12 +80,9 @@ int netlib_setpanid(FAR const char *ifname, uint16_t panid) int sockfd = socket(PF_INET6, NETLIB_SOCK_IOCTL, 0); if (sockfd >= 0) { - /* Put the driver name into the request */ -# warning Missing Logic - /* Put the new PAN ID into the request */ - - /* Perform the ioctl to set the new PAN ID */ + /* Use the helper provided in libradio */ + ret = ieee802154_setpanid(sockfd, ifname, panid); close(sockfd); } }