{"action":"created","issue":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/3867","labels_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/3867/labels{/name}","comments_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/3867/comments","events_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/3867/events","html_url":"https://github.com/RIOT-OS/RIOT/pull/3867","id":106818505,"number":3867,"title":"at86rf2xx: implement sleep mode","user":{"login":"daniel-k","id":224128,"avatar_url":"https://avatars.githubusercontent.com/u/224128?v=3","gravatar_id":"","url":"https://api.github.com/users/daniel-k","html_url":"https://github.com/daniel-k","followers_url":"https://api.github.com/users/daniel-k/followers","following_url":"https://api.github.com/users/daniel-k/following{/other_user}","gists_url":"https://api.github.com/users/daniel-k/gists{/gist_id}","starred_url":"https://api.github.com/users/daniel-k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daniel-k/subscriptions","organizations_url":"https://api.github.com/users/daniel-k/orgs","repos_url":"https://api.github.com/users/daniel-k/repos","events_url":"https://api.github.com/users/daniel-k/events{/privacy}","received_events_url":"https://api.github.com/users/daniel-k/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/Device%20driver","name":"Device driver","color":"0052cc"},{"url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/enhancement","name":"enhancement","color":"f17070"},{"url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/NEEDS%20SQUASHING","name":"NEEDS SQUASHING","color":"009800"},{"url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/Request%20for%20Comments","name":"Request for Comments","color":"23F823"}],"state":"open","locked":false,"assignee":{"login":"gebart","id":317506,"avatar_url":"https://avatars.githubusercontent.com/u/317506?v=3","gravatar_id":"","url":"https://api.github.com/users/gebart","html_url":"https://github.com/gebart","followers_url":"https://api.github.com/users/gebart/followers","following_url":"https://api.github.com/users/gebart/following{/other_user}","gists_url":"https://api.github.com/users/gebart/gists{/gist_id}","starred_url":"https://api.github.com/users/gebart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gebart/subscriptions","organizations_url":"https://api.github.com/users/gebart/orgs","repos_url":"https://api.github.com/users/gebart/repos","events_url":"https://api.github.com/users/gebart/events{/privacy}","received_events_url":"https://api.github.com/users/gebart/received_events","type":"User","site_admin":false},"milestone":null,"comments":16,"created_at":"2015-09-16T17:13:01Z","updated_at":"2015-09-18T14:27:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/3867","html_url":"https://github.com/RIOT-OS/RIOT/pull/3867","diff_url":"https://github.com/RIOT-OS/RIOT/pull/3867.diff","patch_url":"https://github.com/RIOT-OS/RIOT/pull/3867.patch"},"body":"The `at86rf2xx` driver can now reach the `SLEEP` state by setting its state via netapi to `NETOPT_STATE_SLEEP`. Everything except the framebuffer is retained in the power mode. Wake up takes approx. 300us, power consumption is about 0.2uA.\r\n\r\nThe netapi is blocked in sleep mode except for setting and getting the state. But using some driver functions directly by including the header file might lead to a deadlock. On the other hand putting a `at86rf2xx_assert_awake()` everywhere seems wrong too."},"comment":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/comments/141467952","html_url":"https://github.com/RIOT-OS/RIOT/pull/3867#issuecomment-141467952","issue_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/3867","id":141467952,"user":{"login":"thomaseichinger","id":56618,"avatar_url":"https://avatars.githubusercontent.com/u/56618?v=3","gravatar_id":"","url":"https://api.github.com/users/thomaseichinger","html_url":"https://github.com/thomaseichinger","followers_url":"https://api.github.com/users/thomaseichinger/followers","following_url":"https://api.github.com/users/thomaseichinger/following{/other_user}","gists_url":"https://api.github.com/users/thomaseichinger/gists{/gist_id}","starred_url":"https://api.github.com/users/thomaseichinger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomaseichinger/subscriptions","organizations_url":"https://api.github.com/users/thomaseichinger/orgs","repos_url":"https://api.github.com/users/thomaseichinger/repos","events_url":"https://api.github.com/users/thomaseichinger/events{/privacy}","received_events_url":"https://api.github.com/users/thomaseichinger/received_events","type":"User","site_admin":false},"created_at":"2015-09-18T14:27:16Z","updated_at":"2015-09-18T14:27:16Z","body":"@gebart \r\n> We could introduce another state (NETOPT_STATE_STANDBY or something), and let that map to TRX_OFF. Do the other supported transceiver hardware device have similar states as the at86rf2xx which could map to this new state as well?\r\nThe downside is that adding more states may make the API more confusing/complex for new developers to learn.\r\n\r\nI wonder if we can't already map this with the existing states. To my knowledge, on most boards you can't really power off the radio module completely. So how about we change the states' description to:\r\n\r\n| `netopt_state_t` | radio state |\r\n|:-------------------:|:----------------|\r\n| `NETOPT_STATE_OFF` | (deep) sleep, the module is not reachable by the MCU. From a MCU perspective this is comparable to `OFF`.\r\n| `NETOPT_STATE_SLEEP` | turn off radio synthesizer but reachable by the MCU |"}}