Skip to content

Commit

Permalink
fixup! feat(coap): auto-start CoAP server as needed
Browse files Browse the repository at this point in the history
  • Loading branch information
chrysn committed Jan 30, 2025
1 parent 372e817 commit 5ce1b53
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/ariel-os-coap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ pub async fn coap_run(handler: impl coap_handler::Handler + coap_handler::Report
coap_run_impl(handler).await
}

/// Workhorse of [`coap_run`], see there for details.
///
/// This is a separate function because if that function is not exposed publicly (i.e. when the
/// laze feature `coap-server` is not active), it is called automatically in a separate task.
///
/// # Panics
///
/// This can only be run once, as it sets up a system wide CoAP handler.
async fn coap_run_impl(handler: impl coap_handler::Handler + coap_handler::Reporting) -> ! {
static COAP: StaticCell<embedded_nal_coap::CoAPShared<CONCURRENT_REQUESTS>> = StaticCell::new();

Expand Down

0 comments on commit 5ce1b53

Please sign in to comment.