-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Major surgery to add Observe support
- Loading branch information
Showing
19 changed files
with
1,208 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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) | ||
} |
Oops, something went wrong.