diff --git a/beginner/apps/src/bin/radio-recv.rs b/beginner/apps/src/bin/radio-recv.rs index db05634..1bc1c14 100644 --- a/beginner/apps/src/bin/radio-recv.rs +++ b/beginner/apps/src/bin/radio-recv.rs @@ -5,7 +5,7 @@ use core::str; use cortex_m_rt::entry; -use dk::ieee802154::{Error, Packet}; +use dk::ieee802154::{Channel, Error, Packet}; use panic_log as _; // the panicking behavior const TEN_MS: u32 = 10_000; @@ -17,6 +17,8 @@ fn main() -> ! { let mut radio = board.radio; let mut timer = board.timer; + radio.set_channel(Channel::_20); + let mut packet = Packet::new(); let msg = b"olleh"; packet.copy_from_slice(msg); diff --git a/embedded-workshop-book/src/radio-in.md b/embedded-workshop-book/src/radio-in.md index ad48d98..7faa2f8 100644 --- a/embedded-workshop-book/src/radio-in.md +++ b/embedded-workshop-book/src/radio-in.md @@ -4,7 +4,7 @@ In this section we'll explore the `recv_timeout` method of the Radio API. As the The `loopback` application running on the Dongle will broadcast a radio packet after receiving one over channel 20. The contents of this outgoing packet will be the contents of the received one but reversed. -✅ Open the `src/bin/radio-recv.rs` file and click the "Run" button. +✅ Open the `src/bin/radio-recv.rs` file. Make sure that the Dongle and the Radio are set to the same channel. Click the "Run" button. The Dongle expects the packet to contain only ASCII characters and will not respond to packets that contain non-ASCII data. If you only send packets that contain byte string literals *with no escaped characters* (e.g. `b"hello"`) then this requirement will be satisfied. At the same time the Dongle will always respond with ASCII data so calling `str::from_utf8` on the response should never fail, unless the packet contents got corrupted in the transmission but the CRC should detect this scenario.