coap-server 0.1.1

Robust async CoAP server
Documentation
1
2
3
4
5
6
7
8
9
10
11
use coap_lite::{BlockHandler, BlockHandlerConfig};

pub fn new_block_handler<Endpoint: Ord + Clone>(mtu: Option<u32>) -> BlockHandler<Endpoint> {
    let mut config = BlockHandlerConfig::default();
    if let Some(mtu) = mtu {
        if let Ok(mtu) = usize::try_from(mtu) {
            config.max_total_message_size = mtu;
        }
    }
    BlockHandler::new(config)
}