diff --git a/sys/include/net/netopt.h b/sys/include/net/netopt.h index 2f084a0c8c..3d24b2bcc1 100644 --- a/sys/include/net/netopt.h +++ b/sys/include/net/netopt.h @@ -270,6 +270,18 @@ typedef enum { */ NETOPT_IS_WIRED, + /** + * @brief (@ref netopt_enable_t) Phy link status. + * + * Returns NETOPT_ENABLE when the the link of the interface is up, + * NETOPT_DISABLE when the link is down. If the interface is wireless or + * doesn't support link status detection this function will return + * -ENOTSUP. + * + * @note Setting this option will always return -ENOTSUP. + */ + NETOPT_LINK_CONNECTED, + /** * @brief get a device's "type", e.g., ethernet, 802.15.4, ... */ diff --git a/sys/net/crosslayer/netopt/netopt.c b/sys/net/crosslayer/netopt/netopt.c index 6df4bd1d14..dfe7bc983a 100644 --- a/sys/net/crosslayer/netopt/netopt.c +++ b/sys/net/crosslayer/netopt/netopt.c @@ -61,6 +61,7 @@ static const char *_netopt_strmap[] = { [NETOPT_CSMA_MINBE] = "NETOPT_CSMA_MINBE", [NETOPT_MAC_NO_SLEEP] = "NETOPT_MAC_NO_SLEEP", [NETOPT_IS_WIRED] = "NETOPT_IS_WIRED", + [NETOPT_LINK_CONNECTED] = "NETOPT_LINK_CONNECTED", [NETOPT_DEVICE_TYPE] = "NETOPT_DEVICE_TYPE", [NETOPT_CHANNEL_PAGE] = "NETOPT_CHANNEL_PAGE", [NETOPT_CCA_THRESHOLD] = "NETOPT_CCA_THRESHOLD",