aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorxoviat <[email protected]>2023-07-17 00:01:27 +0000
committerGitHub <[email protected]>2023-07-17 00:01:27 +0000
commit6b5df4523aa1c4902f02e803450ae4b418e0e3ca (patch)
tree085cc415abeede5760f6b2e0595233c9d4af08a3 /tests
parentc7ec45a004750f590c1d9ea4a721972efe133b8e (diff)
parent7b34f5e866958f2ff28d7deb6888666690fe2837 (diff)
Merge pull request #1662 from xoviat/mac-2
wpan/mac: use slice view to avoid copy
Diffstat (limited to 'tests')
-rw-r--r--tests/stm32/src/bin/wpan_mac.rs38
1 files changed, 25 insertions, 13 deletions
diff --git a/tests/stm32/src/bin/wpan_mac.rs b/tests/stm32/src/bin/wpan_mac.rs
index cfa0aca3b..d64a5ef81 100644
--- a/tests/stm32/src/bin/wpan_mac.rs
+++ b/tests/stm32/src/bin/wpan_mac.rs
@@ -49,11 +49,16 @@ async fn main(spawner: Spawner) {
49 49
50 info!("resetting"); 50 info!("resetting");
51 mbox.mac_subsystem 51 mbox.mac_subsystem
52 .send_command(&ResetRequest { set_default_pib: true }) 52 .send_command(&ResetRequest {
53 set_default_pib: true,
54 ..Default::default()
55 })
53 .await 56 .await
54 .unwrap(); 57 .unwrap();
55 let evt = mbox.mac_subsystem.read().await; 58 {
56 info!("{:#x}", evt); 59 let evt = mbox.mac_subsystem.read().await;
60 info!("{:#x}", evt.mac_event());
61 }
57 62
58 info!("setting extended address"); 63 info!("setting extended address");
59 let extended_address: u64 = 0xACDE480000000002; 64 let extended_address: u64 = 0xACDE480000000002;
@@ -64,24 +69,29 @@ async fn main(spawner: Spawner) {
64 }) 69 })
65 .await 70 .await
66 .unwrap(); 71 .unwrap();
67 let evt = mbox.mac_subsystem.read().await; 72 {
68 info!("{:#x}", evt); 73 let evt = mbox.mac_subsystem.read().await;
74 info!("{:#x}", evt.mac_event());
75 }
69 76
70 info!("getting extended address"); 77 info!("getting extended address");
71 mbox.mac_subsystem 78 mbox.mac_subsystem
72 .send_command(&GetRequest { 79 .send_command(&GetRequest {
73 pib_attribute: PibId::ExtendedAddress, 80 pib_attribute: PibId::ExtendedAddress,
81 ..Default::default()
74 }) 82 })
75 .await 83 .await
76 .unwrap(); 84 .unwrap();
77 let evt = mbox.mac_subsystem.read().await; 85 {
78 info!("{:#x}", evt); 86 let evt = mbox.mac_subsystem.read().await;
87 info!("{:#x}", evt.mac_event());
79 88
80 if let Ok(MacEvent::MlmeGetCnf(evt)) = evt { 89 if let Ok(MacEvent::MlmeGetCnf(evt)) = evt.mac_event() {
81 if evt.pib_attribute_value_len == 8 { 90 if evt.pib_attribute_value_len == 8 {
82 let value = unsafe { core::ptr::read_unaligned(evt.pib_attribute_value_ptr as *const u64) }; 91 let value = unsafe { core::ptr::read_unaligned(evt.pib_attribute_value_ptr as *const u64) };
83 92
84 info!("value {:#x}", value) 93 info!("value {:#x}", value)
94 }
85 } 95 }
86 } 96 }
87 97
@@ -100,8 +110,10 @@ async fn main(spawner: Spawner) {
100 }; 110 };
101 info!("{}", a); 111 info!("{}", a);
102 mbox.mac_subsystem.send_command(&a).await.unwrap(); 112 mbox.mac_subsystem.send_command(&a).await.unwrap();
103 let evt = mbox.mac_subsystem.read().await; 113 {
104 info!("{:#x}", evt); 114 let evt = mbox.mac_subsystem.read().await;
115 info!("{:#x}", evt.mac_event());
116 }
105 117
106 info!("Test OK"); 118 info!("Test OK");
107 cortex_m::asm::bkpt(); 119 cortex_m::asm::bkpt();