From 603b754d24f6c6871b98d2dc49cce0d538ea2c5b Mon Sep 17 00:00:00 2001
From: Koen Zandberg <koen@bergzand.net>
Date: Mon, 3 Dec 2018 10:15:33 +0100
Subject: [PATCH] kw2xrf: Add NETOPT_CHANNEL to getters

---
 drivers/kw2xrf/kw2xrf_netdev.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/kw2xrf/kw2xrf_netdev.c b/drivers/kw2xrf/kw2xrf_netdev.c
index 532e200851..6c7ec90a4a 100644
--- a/drivers/kw2xrf/kw2xrf_netdev.c
+++ b/drivers/kw2xrf/kw2xrf_netdev.c
@@ -318,6 +318,13 @@ int _get(netdev_t *netdev, netopt_t opt, void *value, size_t len)
                 !!(dev->netdev.flags & KW2XRF_OPT_AUTOCCA);
             return sizeof(netopt_enable_t);
 
+        case NETOPT_CHANNEL:
+            if (len < sizeof(uint16_t)) {
+                return -EOVERFLOW;
+            }
+            *((uint16_t *)value) = kw2xrf_get_channel(dev);
+            return sizeof(uint16_t);
+
         case NETOPT_TX_POWER:
             if (len < sizeof(int16_t)) {
                 return -EOVERFLOW;
-- 
GitLab