Skip to content

Commit

Permalink
coap: Use OS RNG
Browse files Browse the repository at this point in the history
  • Loading branch information
chrysn committed Apr 11, 2024
1 parent eda422a commit a8595f5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion examples/coap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ coap-message = "0.3.1"
embassy-futures = "0.1.1"
coap-message-demos = { version = "0.4.0", default-features = false }
coap-request-implementations = "0.1.0-alpha.4"
rand = { version = "0.8.5", default-features = false, features = [ "small_rng" ] }
# ... and we ensure that it is usable by laze-depending on rng
riot-rs-random = { version = "0.1.0", path = "../../src/riot-rs-random" }

[features]
default = [ "proto-ipv4" ] # shame
Expand Down
1 change: 1 addition & 0 deletions examples/coap/laze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ apps:
selects:
- ?release
- network
- rng
3 changes: 1 addition & 2 deletions examples/coap/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ where
// Sync, and async_std expects to work in multiple threads
embassy_futures::join::join(
async {
let mut rand = rand::rngs::SmallRng::seed_from_u64(4);
use rand::SeedableRng;
let mut rand = riot_rs_random::get_rng();
server
.run(
&mut sock,
Expand Down

0 comments on commit a8595f5

Please sign in to comment.