aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32wb/src/bin/mac_ffd.rs
diff options
context:
space:
mode:
authorgoueslati <[email protected]>2023-07-12 16:49:37 +0100
committergoueslati <[email protected]>2023-07-12 16:49:37 +0100
commiteccd2ecebf01753e70705a6ca1e21bc83b2c204c (patch)
treeef355c98cce0872969eadeacc568c56acbe6ccea /examples/stm32wb/src/bin/mac_ffd.rs
parentd5a4457b5e3a95a12f249315fb1d9b6a577307f2 (diff)
change MacAddress to a union instead of an enum
Diffstat (limited to 'examples/stm32wb/src/bin/mac_ffd.rs')
-rw-r--r--examples/stm32wb/src/bin/mac_ffd.rs18
1 files changed, 8 insertions, 10 deletions
diff --git a/examples/stm32wb/src/bin/mac_ffd.rs b/examples/stm32wb/src/bin/mac_ffd.rs
index 18b29362b..4e2578a21 100644
--- a/examples/stm32wb/src/bin/mac_ffd.rs
+++ b/examples/stm32wb/src/bin/mac_ffd.rs
@@ -66,7 +66,7 @@ async fn main(spawner: Spawner) {
66 66
67 info!("resetting"); 67 info!("resetting");
68 mbox.mac_subsystem 68 mbox.mac_subsystem
69 .send_command(ResetRequest { set_default_pib: true }) 69 .send_command(&ResetRequest { set_default_pib: true })
70 .await 70 .await
71 .unwrap(); 71 .unwrap();
72 let evt = mbox.mac_subsystem.read().await; 72 let evt = mbox.mac_subsystem.read().await;
@@ -75,7 +75,7 @@ async fn main(spawner: Spawner) {
75 info!("setting extended address"); 75 info!("setting extended address");
76 let extended_address: u64 = 0xACDE480000000001; 76 let extended_address: u64 = 0xACDE480000000001;
77 mbox.mac_subsystem 77 mbox.mac_subsystem
78 .send_command(SetRequest { 78 .send_command(&SetRequest {
79 pib_attribute_ptr: &extended_address as *const _ as *const u8, 79 pib_attribute_ptr: &extended_address as *const _ as *const u8,
80 pib_attribute: PibId::ExtendedAddress, 80 pib_attribute: PibId::ExtendedAddress,
81 }) 81 })
@@ -87,7 +87,7 @@ async fn main(spawner: Spawner) {
87 info!("setting short address"); 87 info!("setting short address");
88 let short_address: u16 = 0x1122; 88 let short_address: u16 = 0x1122;
89 mbox.mac_subsystem 89 mbox.mac_subsystem
90 .send_command(SetRequest { 90 .send_command(&SetRequest {
91 pib_attribute_ptr: &short_address as *const _ as *const u8, 91 pib_attribute_ptr: &short_address as *const _ as *const u8,
92 pib_attribute: PibId::ShortAddress, 92 pib_attribute: PibId::ShortAddress,
93 }) 93 })
@@ -99,7 +99,7 @@ async fn main(spawner: Spawner) {
99 info!("setting association permit"); 99 info!("setting association permit");
100 let association_permit: bool = true; 100 let association_permit: bool = true;
101 mbox.mac_subsystem 101 mbox.mac_subsystem
102 .send_command(SetRequest { 102 .send_command(&SetRequest {
103 pib_attribute_ptr: &association_permit as *const _ as *const u8, 103 pib_attribute_ptr: &association_permit as *const _ as *const u8,
104 pib_attribute: PibId::AssociationPermit, 104 pib_attribute: PibId::AssociationPermit,
105 }) 105 })
@@ -111,7 +111,7 @@ async fn main(spawner: Spawner) {
111 info!("setting TX power"); 111 info!("setting TX power");
112 let transmit_power: i8 = 2; 112 let transmit_power: i8 = 2;
113 mbox.mac_subsystem 113 mbox.mac_subsystem
114 .send_command(SetRequest { 114 .send_command(&SetRequest {
115 pib_attribute_ptr: &transmit_power as *const _ as *const u8, 115 pib_attribute_ptr: &transmit_power as *const _ as *const u8,
116 pib_attribute: PibId::TransmitPower, 116 pib_attribute: PibId::TransmitPower,
117 }) 117 })
@@ -122,7 +122,8 @@ async fn main(spawner: Spawner) {
122 122
123 info!("starting FFD device"); 123 info!("starting FFD device");
124 mbox.mac_subsystem 124 mbox.mac_subsystem
125 .send_command(StartRequest { 125 .send_command(&StartRequest {
126 pan_id: [0xAA, 0x1A],
126 channel_number: MacChannel::Channel16, 127 channel_number: MacChannel::Channel16,
127 beacon_order: 0x0F, 128 beacon_order: 0x0F,
128 superframe_order: 0x0F, 129 superframe_order: 0x0F,
@@ -138,7 +139,7 @@ async fn main(spawner: Spawner) {
138 info!("setting RX on when idle"); 139 info!("setting RX on when idle");
139 let rx_on_while_idle: bool = true; 140 let rx_on_while_idle: bool = true;
140 mbox.mac_subsystem 141 mbox.mac_subsystem
141 .send_command(SetRequest { 142 .send_command(&SetRequest {
142 pib_attribute_ptr: &rx_on_while_idle as *const _ as *const u8, 143 pib_attribute_ptr: &rx_on_while_idle as *const _ as *const u8,
143 pib_attribute: PibId::RxOnWhenIdle, 144 pib_attribute: PibId::RxOnWhenIdle,
144 }) 145 })
@@ -151,7 +152,4 @@ async fn main(spawner: Spawner) {
151 let evt = mbox.mac_subsystem.read().await; 152 let evt = mbox.mac_subsystem.read().await;
152 defmt::info!("{:#x}", evt); 153 defmt::info!("{:#x}", evt);
153 } 154 }
154
155 info!("Test OK");
156 cortex_m::asm::bkpt();
157} 155}