riot_coap_handler_demos::led

Function all_leds

Source
pub fn all_leds() -> impl Handler + Reporting
Expand description

A handler that contains sub-resources for all LEDs present on a system.

It has sub-resources 0 up to 7 (depending on which LEDs are present on the board).

Use this with .below(); if no extra Uri-Path option is present (eg. when placed .at(&["leds"], ...) requesting coap://.../leds), it does not even implement a resource there.

This is subtly different from the crate::saul module where SAUL reports a single resource in .well-known/core. There are no hard rules to follow in which to pick, but generally there are few LEDs and there can be many SAUL resources.