[riot-notifications] [RIOT-OS/RIOT] drivers/cc110x: add power off (sleep) functions (#16232)

Marian Buschsieweke notifications at github.com
Tue Jun 8 11:17:05 CEST 2021


@maribu commented on this pull request.



> +        assert(len == sizeof(netopt_enable_t));
+        return cc110x_set_promiscuous_mode(dev, *((const netopt_enable_t *)val));
+    case NETOPT_STATE:
+        assert(len == sizeof(netopt_state_t));
+        switch (*((netopt_state_t *)val)) {
+        case NETOPT_STATE_RESET:
+        case NETOPT_STATE_IDLE:
+            if (cc110x_acquire(dev)) {
+                return -EIO;
+            }
+            cc110x_enter_rx_mode(dev);
+            cc110x_release(dev);
+            return sizeof(netopt_state_t);
+        case NETOPT_STATE_OFF:
+        case NETOPT_STATE_SLEEP:
+            cc110x_sleep(dev);

No, `cc110x_sleep()` is also intended to be usable directly by users (if they have good reason to do so), hence it internally acquires and releases the device.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16232#discussion_r647268030
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210608/e8819e94/attachment.htm>


More information about the notifications mailing list