aboutsummaryrefslogtreecommitdiff
path: root/embassy-stm32-wpan/src/mac/driver.rs
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-stm32-wpan/src/mac/driver.rs')
-rw-r--r--embassy-stm32-wpan/src/mac/driver.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/embassy-stm32-wpan/src/mac/driver.rs b/embassy-stm32-wpan/src/mac/driver.rs
index 819299b48..5592723a2 100644
--- a/embassy-stm32-wpan/src/mac/driver.rs
+++ b/embassy-stm32-wpan/src/mac/driver.rs
@@ -17,6 +17,8 @@ use crate::sub::mac::{Mac, MacRx, MacTx};
17 17
18pub struct NetworkState { 18pub struct NetworkState {
19 pub mac_addr: [u8; 8], 19 pub mac_addr: [u8; 8],
20 pub short_addr: [u8; 2],
21 pub pan_id: [u8; 2],
20 pub link_state: LinkState, 22 pub link_state: LinkState,
21 pub link_waker: AtomicWaker, 23 pub link_waker: AtomicWaker,
22} 24}
@@ -25,6 +27,8 @@ impl NetworkState {
25 pub const fn new() -> Self { 27 pub const fn new() -> Self {
26 Self { 28 Self {
27 mac_addr: [0u8; 8], 29 mac_addr: [0u8; 8],
30 short_addr: [0u8; 2],
31 pan_id: [0u8; 2],
28 link_state: LinkState::Down, 32 link_state: LinkState::Down,
29 link_waker: AtomicWaker::new(), 33 link_waker: AtomicWaker::new(),
30 } 34 }
@@ -68,7 +72,11 @@ pub struct Driver<'d> {
68} 72}
69 73
70impl<'d> Driver<'d> { 74impl<'d> Driver<'d> {
71 pub fn new(driver_state: &'d mut DriverState<'d>) -> (Self, Runner<'d>, Control<'d>) { 75 pub fn new(
76 driver_state: &'d mut DriverState<'d>,
77 short_address: [u8; 2],
78 mac_address: [u8; 8],
79 ) -> (Self, Runner<'d>, Control<'d>) {
72 ( 80 (
73 Self { 81 Self {
74 tx_data_channel: &driver_state.tx_data_channel, 82 tx_data_channel: &driver_state.tx_data_channel,
@@ -85,6 +93,8 @@ impl<'d> Driver<'d> {
85 &driver_state.mac_tx, 93 &driver_state.mac_tx,
86 &mut driver_state.tx_buf_queue, 94 &mut driver_state.tx_buf_queue,
87 &driver_state.network_state, 95 &driver_state.network_state,
96 short_address,
97 mac_address,
88 ), 98 ),
89 Control::new( 99 Control::new(
90 &driver_state.rx_event_channel, 100 &driver_state.rx_event_channel,