diff options
| author | xoviat <[email protected]> | 2023-07-16 16:16:56 -0500 |
|---|---|---|
| committer | xoviat <[email protected]> | 2023-07-16 16:16:56 -0500 |
| commit | a0515ca7ac9f4aebeadede7c6a2fa312b60b5d55 (patch) | |
| tree | 0980110ac00142981ba90caefcdcdfdd83041f62 /embassy-stm32-wpan/src | |
| parent | 28b419d65ede6ff29c79dbcaa27145f1c3458a57 (diff) | |
wpan: add repr(c) to mac responses
Diffstat (limited to 'embassy-stm32-wpan/src')
| -rw-r--r-- | embassy-stm32-wpan/src/mac/indications.rs | 11 | ||||
| -rw-r--r-- | embassy-stm32-wpan/src/mac/responses.rs | 15 |
2 files changed, 25 insertions, 1 deletions
diff --git a/embassy-stm32-wpan/src/mac/indications.rs b/embassy-stm32-wpan/src/mac/indications.rs index c7e9be84a..66819dc9d 100644 --- a/embassy-stm32-wpan/src/mac/indications.rs +++ b/embassy-stm32-wpan/src/mac/indications.rs | |||
| @@ -7,6 +7,7 @@ use super::typedefs::{ | |||
| 7 | 7 | ||
| 8 | /// MLME ASSOCIATE Indication which will be used by the MAC | 8 | /// MLME ASSOCIATE Indication which will be used by the MAC |
| 9 | /// to indicate the reception of an association request command | 9 | /// to indicate the reception of an association request command |
| 10 | #[repr(C)] | ||
| 10 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 11 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 11 | pub struct AssociateIndication { | 12 | pub struct AssociateIndication { |
| 12 | /// Extended address of the device requesting association | 13 | /// Extended address of the device requesting association |
| @@ -27,6 +28,7 @@ impl ParseableMacEvent for AssociateIndication {} | |||
| 27 | 28 | ||
| 28 | /// MLME DISASSOCIATE indication which will be used to send | 29 | /// MLME DISASSOCIATE indication which will be used to send |
| 29 | /// disassociation indication to the application. | 30 | /// disassociation indication to the application. |
| 31 | #[repr(C)] | ||
| 30 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 32 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 31 | pub struct DisassociateIndication { | 33 | pub struct DisassociateIndication { |
| 32 | /// Extended address of the device requesting association | 34 | /// Extended address of the device requesting association |
| @@ -47,6 +49,7 @@ impl ParseableMacEvent for DisassociateIndication {} | |||
| 47 | 49 | ||
| 48 | /// MLME BEACON NOTIIFY Indication which is used to send parameters contained | 50 | /// MLME BEACON NOTIIFY Indication which is used to send parameters contained |
| 49 | /// within a beacon frame received by the MAC to the application | 51 | /// within a beacon frame received by the MAC to the application |
| 52 | #[repr(C)] | ||
| 50 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 53 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 51 | pub struct BeaconNotifyIndication { | 54 | pub struct BeaconNotifyIndication { |
| 52 | /// he set of octets comprising the beacon payload to be transferred | 55 | /// he set of octets comprising the beacon payload to be transferred |
| @@ -67,6 +70,7 @@ pub struct BeaconNotifyIndication { | |||
| 67 | impl ParseableMacEvent for BeaconNotifyIndication {} | 70 | impl ParseableMacEvent for BeaconNotifyIndication {} |
| 68 | 71 | ||
| 69 | /// MLME COMM STATUS Indication which is used by the MAC to indicate a communications status | 72 | /// MLME COMM STATUS Indication which is used by the MAC to indicate a communications status |
| 73 | #[repr(C)] | ||
| 70 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 74 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 71 | pub struct CommStatusIndication { | 75 | pub struct CommStatusIndication { |
| 72 | /// The 16-bit PAN identifier of the device from which the frame | 76 | /// The 16-bit PAN identifier of the device from which the frame |
| @@ -96,6 +100,7 @@ impl ParseableMacEvent for CommStatusIndication {} | |||
| 96 | 100 | ||
| 97 | /// MLME GTS Indication indicates that a GTS has been allocated or that a | 101 | /// MLME GTS Indication indicates that a GTS has been allocated or that a |
| 98 | /// previously allocated GTS has been deallocated | 102 | /// previously allocated GTS has been deallocated |
| 103 | #[repr(C)] | ||
| 99 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 104 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 100 | pub struct GtsIndication { | 105 | pub struct GtsIndication { |
| 101 | /// The short address of the device that has been allocated or deallocated a GTS | 106 | /// The short address of the device that has been allocated or deallocated a GTS |
| @@ -118,6 +123,7 @@ impl ParseableMacEvent for GtsIndication {} | |||
| 118 | 123 | ||
| 119 | /// MLME ORPHAN Indication which is used by the coordinator to notify the | 124 | /// MLME ORPHAN Indication which is used by the coordinator to notify the |
| 120 | /// application of the presence of an orphaned device | 125 | /// application of the presence of an orphaned device |
| 126 | #[repr(C)] | ||
| 121 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 127 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 122 | pub struct OrphanIndication { | 128 | pub struct OrphanIndication { |
| 123 | /// Extended address of the orphaned device | 129 | /// Extended address of the orphaned device |
| @@ -138,6 +144,7 @@ impl ParseableMacEvent for OrphanIndication {} | |||
| 138 | 144 | ||
| 139 | /// MLME SYNC LOSS Indication which is used by the MAC to indicate the loss | 145 | /// MLME SYNC LOSS Indication which is used by the MAC to indicate the loss |
| 140 | /// of synchronization with the coordinator | 146 | /// of synchronization with the coordinator |
| 147 | #[repr(C)] | ||
| 141 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 148 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 142 | pub struct SyncLossIndication { | 149 | pub struct SyncLossIndication { |
| 143 | /// The PAN identifier with which the device lost synchronization or to which it was realigned | 150 | /// The PAN identifier with which the device lost synchronization or to which it was realigned |
| @@ -162,6 +169,7 @@ impl ParseableMacEvent for SyncLossIndication {} | |||
| 162 | 169 | ||
| 163 | /// MLME DPS Indication which indicates the expiration of the DPSIndexDuration | 170 | /// MLME DPS Indication which indicates the expiration of the DPSIndexDuration |
| 164 | /// and the resetting of the DPS values in the PHY | 171 | /// and the resetting of the DPS values in the PHY |
| 172 | #[repr(C)] | ||
| 165 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 173 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 166 | pub struct DpsIndication { | 174 | pub struct DpsIndication { |
| 167 | /// byte stuffing to keep 32 bit alignment | 175 | /// byte stuffing to keep 32 bit alignment |
| @@ -170,8 +178,8 @@ pub struct DpsIndication { | |||
| 170 | 178 | ||
| 171 | impl ParseableMacEvent for DpsIndication {} | 179 | impl ParseableMacEvent for DpsIndication {} |
| 172 | 180 | ||
| 173 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||
| 174 | #[repr(C)] | 181 | #[repr(C)] |
| 182 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||
| 175 | pub struct DataIndication { | 183 | pub struct DataIndication { |
| 176 | /// Pointer to the set of octets forming the MSDU being indicated | 184 | /// Pointer to the set of octets forming the MSDU being indicated |
| 177 | pub msdu_ptr: *const u8, | 185 | pub msdu_ptr: *const u8, |
| @@ -227,6 +235,7 @@ impl ParseableMacEvent for DataIndication {} | |||
| 227 | 235 | ||
| 228 | /// MLME POLL Indication which will be used for indicating the Data Request | 236 | /// MLME POLL Indication which will be used for indicating the Data Request |
| 229 | /// reception to upper layer as defined in Zigbee r22 - D.8.2 | 237 | /// reception to upper layer as defined in Zigbee r22 - D.8.2 |
| 238 | #[repr(C)] | ||
| 230 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 239 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 231 | pub struct PollIndication { | 240 | pub struct PollIndication { |
| 232 | /// addressing mode used | 241 | /// addressing mode used |
diff --git a/embassy-stm32-wpan/src/mac/responses.rs b/embassy-stm32-wpan/src/mac/responses.rs index e0376a7f5..5d203084c 100644 --- a/embassy-stm32-wpan/src/mac/responses.rs +++ b/embassy-stm32-wpan/src/mac/responses.rs | |||
| @@ -7,6 +7,7 @@ use super::typedefs::{ | |||
| 7 | 7 | ||
| 8 | /// MLME ASSOCIATE Confirm used to inform of the initiating device whether | 8 | /// MLME ASSOCIATE Confirm used to inform of the initiating device whether |
| 9 | /// its request to associate was successful or unsuccessful | 9 | /// its request to associate was successful or unsuccessful |
| 10 | #[repr(C)] | ||
| 10 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 11 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 11 | pub struct AssociateConfirm { | 12 | pub struct AssociateConfirm { |
| 12 | /// short address allocated by the coordinator on successful association | 13 | /// short address allocated by the coordinator on successful association |
| @@ -28,6 +29,7 @@ pub struct AssociateConfirm { | |||
| 28 | impl ParseableMacEvent for AssociateConfirm {} | 29 | impl ParseableMacEvent for AssociateConfirm {} |
| 29 | 30 | ||
| 30 | /// MLME DISASSOCIATE Confirm used to send disassociation Confirmation to the application. | 31 | /// MLME DISASSOCIATE Confirm used to send disassociation Confirmation to the application. |
| 32 | #[repr(C)] | ||
| 31 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 33 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 32 | pub struct DisassociateConfirm { | 34 | pub struct DisassociateConfirm { |
| 33 | /// status of the disassociation attempt | 35 | /// status of the disassociation attempt |
| @@ -43,6 +45,7 @@ pub struct DisassociateConfirm { | |||
| 43 | impl ParseableMacEvent for DisassociateConfirm {} | 45 | impl ParseableMacEvent for DisassociateConfirm {} |
| 44 | 46 | ||
| 45 | /// MLME GET Confirm which requests information about a given PIB attribute | 47 | /// MLME GET Confirm which requests information about a given PIB attribute |
| 48 | #[repr(C)] | ||
| 46 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 49 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 47 | pub struct GetConfirm { | 50 | pub struct GetConfirm { |
| 48 | /// The pointer to the value of the PIB attribute attempted to read | 51 | /// The pointer to the value of the PIB attribute attempted to read |
| @@ -61,6 +64,7 @@ impl ParseableMacEvent for GetConfirm {} | |||
| 61 | 64 | ||
| 62 | /// MLME GTS Confirm which eports the results of a request to allocate a new GTS | 65 | /// MLME GTS Confirm which eports the results of a request to allocate a new GTS |
| 63 | /// or to deallocate an existing GTS | 66 | /// or to deallocate an existing GTS |
| 67 | #[repr(C)] | ||
| 64 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 68 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 65 | pub struct GtsConfirm { | 69 | pub struct GtsConfirm { |
| 66 | /// The characteristics of the GTS | 70 | /// The characteristics of the GTS |
| @@ -74,6 +78,7 @@ pub struct GtsConfirm { | |||
| 74 | impl ParseableMacEvent for GtsConfirm {} | 78 | impl ParseableMacEvent for GtsConfirm {} |
| 75 | 79 | ||
| 76 | /// MLME RESET Confirm which is used to report the results of the reset operation | 80 | /// MLME RESET Confirm which is used to report the results of the reset operation |
| 81 | #[repr(C)] | ||
| 77 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 82 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 78 | pub struct ResetConfirm { | 83 | pub struct ResetConfirm { |
| 79 | /// The result of the reset operation | 84 | /// The result of the reset operation |
| @@ -86,6 +91,7 @@ impl ParseableMacEvent for ResetConfirm {} | |||
| 86 | 91 | ||
| 87 | /// MLME RX ENABLE Confirm which is used to report the results of the attempt | 92 | /// MLME RX ENABLE Confirm which is used to report the results of the attempt |
| 88 | /// to enable or disable the receiver | 93 | /// to enable or disable the receiver |
| 94 | #[repr(C)] | ||
| 89 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 95 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 90 | pub struct RxEnableConfirm { | 96 | pub struct RxEnableConfirm { |
| 91 | /// Result of the request to enable or disable the receiver | 97 | /// Result of the request to enable or disable the receiver |
| @@ -97,6 +103,7 @@ pub struct RxEnableConfirm { | |||
| 97 | impl ParseableMacEvent for RxEnableConfirm {} | 103 | impl ParseableMacEvent for RxEnableConfirm {} |
| 98 | 104 | ||
| 99 | /// MLME SCAN Confirm which is used to report the result of the channel scan request | 105 | /// MLME SCAN Confirm which is used to report the result of the channel scan request |
| 106 | #[repr(C)] | ||
| 100 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 107 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 101 | pub struct ScanConfirm { | 108 | pub struct ScanConfirm { |
| 102 | /// Status of the scan request | 109 | /// Status of the scan request |
| @@ -122,6 +129,7 @@ pub struct ScanConfirm { | |||
| 122 | impl ParseableMacEvent for ScanConfirm {} | 129 | impl ParseableMacEvent for ScanConfirm {} |
| 123 | 130 | ||
| 124 | /// MLME SET Confirm which reports the result of an attempt to write a value to a PIB attribute | 131 | /// MLME SET Confirm which reports the result of an attempt to write a value to a PIB attribute |
| 132 | #[repr(C)] | ||
| 125 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 133 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 126 | pub struct SetConfirm { | 134 | pub struct SetConfirm { |
| 127 | /// The result of the set operation | 135 | /// The result of the set operation |
| @@ -136,6 +144,7 @@ impl ParseableMacEvent for SetConfirm {} | |||
| 136 | 144 | ||
| 137 | /// MLME START Confirm which is used to report the results of the attempt to | 145 | /// MLME START Confirm which is used to report the results of the attempt to |
| 138 | /// start using a new superframe configuration | 146 | /// start using a new superframe configuration |
| 147 | #[repr(C)] | ||
| 139 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 148 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 140 | pub struct StartConfirm { | 149 | pub struct StartConfirm { |
| 141 | /// Result of the attempt to start using an updated superframe configuration | 150 | /// Result of the attempt to start using an updated superframe configuration |
| @@ -147,6 +156,7 @@ pub struct StartConfirm { | |||
| 147 | impl ParseableMacEvent for StartConfirm {} | 156 | impl ParseableMacEvent for StartConfirm {} |
| 148 | 157 | ||
| 149 | /// MLME POLL Confirm which is used to report the result of a request to poll the coordinator for data | 158 | /// MLME POLL Confirm which is used to report the result of a request to poll the coordinator for data |
| 159 | #[repr(C)] | ||
| 150 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 160 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 151 | pub struct PollConfirm { | 161 | pub struct PollConfirm { |
| 152 | /// The status of the data request | 162 | /// The status of the data request |
| @@ -158,6 +168,7 @@ pub struct PollConfirm { | |||
| 158 | impl ParseableMacEvent for PollConfirm {} | 168 | impl ParseableMacEvent for PollConfirm {} |
| 159 | 169 | ||
| 160 | /// MLME DPS Confirm which reports the results of the attempt to enable or disable the DPS | 170 | /// MLME DPS Confirm which reports the results of the attempt to enable or disable the DPS |
| 171 | #[repr(C)] | ||
| 161 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 172 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 162 | pub struct DpsConfirm { | 173 | pub struct DpsConfirm { |
| 163 | /// The status of the DPS request | 174 | /// The status of the DPS request |
| @@ -170,6 +181,7 @@ impl ParseableMacEvent for DpsConfirm {} | |||
| 170 | 181 | ||
| 171 | /// MLME SOUNDING Confirm which reports the result of a request to the PHY to provide | 182 | /// MLME SOUNDING Confirm which reports the result of a request to the PHY to provide |
| 172 | /// channel sounding information | 183 | /// channel sounding information |
| 184 | #[repr(C)] | ||
| 173 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 185 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 174 | pub struct SoundingConfirm { | 186 | pub struct SoundingConfirm { |
| 175 | /// Results of the sounding measurement | 187 | /// Results of the sounding measurement |
| @@ -182,6 +194,7 @@ impl ParseableMacEvent for SoundingConfirm {} | |||
| 182 | 194 | ||
| 183 | /// MLME CALIBRATE Confirm which reports the result of a request to the PHY | 195 | /// MLME CALIBRATE Confirm which reports the result of a request to the PHY |
| 184 | /// to provide internal propagation path information | 196 | /// to provide internal propagation path information |
| 197 | #[repr(C)] | ||
| 185 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 198 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 186 | pub struct CalibrateConfirm { | 199 | pub struct CalibrateConfirm { |
| 187 | /// The status of the attempt to return sounding data | 200 | /// The status of the attempt to return sounding data |
| @@ -200,6 +213,7 @@ impl ParseableMacEvent for CalibrateConfirm {} | |||
| 200 | 213 | ||
| 201 | /// MCPS DATA Confirm which will be used for reporting the results of | 214 | /// MCPS DATA Confirm which will be used for reporting the results of |
| 202 | /// MAC data related requests from the application | 215 | /// MAC data related requests from the application |
| 216 | #[repr(C)] | ||
| 203 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 217 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 204 | pub struct DataConfirm { | 218 | pub struct DataConfirm { |
| 205 | /// The handle associated with the MSDU being confirmed | 219 | /// The handle associated with the MSDU being confirmed |
| @@ -230,6 +244,7 @@ impl ParseableMacEvent for DataConfirm {} | |||
| 230 | 244 | ||
| 231 | /// MCPS PURGE Confirm which will be used by the MAC to notify the application of | 245 | /// MCPS PURGE Confirm which will be used by the MAC to notify the application of |
| 232 | /// the status of its request to purge an MSDU from the transaction queue | 246 | /// the status of its request to purge an MSDU from the transaction queue |
| 247 | #[repr(C)] | ||
| 233 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 248 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 234 | pub struct PurgeConfirm { | 249 | pub struct PurgeConfirm { |
| 235 | /// Handle associated with the MSDU requested to be purged from the transaction queue | 250 | /// Handle associated with the MSDU requested to be purged from the transaction queue |
