wpan: add repr(c) to mac responses

This commit is contained in:
xoviat 2023-07-16 16:16:56 -05:00
parent 28b419d65e
commit a0515ca7ac
2 changed files with 25 additions and 1 deletions

View File

@ -7,6 +7,7 @@ use super::typedefs::{
/// MLME ASSOCIATE Indication which will be used by the MAC /// MLME ASSOCIATE Indication which will be used by the MAC
/// to indicate the reception of an association request command /// to indicate the reception of an association request command
#[repr(C)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))] #[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct AssociateIndication { pub struct AssociateIndication {
/// Extended address of the device requesting association /// Extended address of the device requesting association
@ -27,6 +28,7 @@ impl ParseableMacEvent for AssociateIndication {}
/// MLME DISASSOCIATE indication which will be used to send /// MLME DISASSOCIATE indication which will be used to send
/// disassociation indication to the application. /// disassociation indication to the application.
#[repr(C)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))] #[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct DisassociateIndication { pub struct DisassociateIndication {
/// Extended address of the device requesting association /// Extended address of the device requesting association
@ -47,6 +49,7 @@ impl ParseableMacEvent for DisassociateIndication {}
/// MLME BEACON NOTIIFY Indication which is used to send parameters contained /// MLME BEACON NOTIIFY Indication which is used to send parameters contained
/// within a beacon frame received by the MAC to the application /// within a beacon frame received by the MAC to the application
#[repr(C)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))] #[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct BeaconNotifyIndication { pub struct BeaconNotifyIndication {
/// he set of octets comprising the beacon payload to be transferred /// he set of octets comprising the beacon payload to be transferred
@ -67,6 +70,7 @@ pub struct BeaconNotifyIndication {
impl ParseableMacEvent for BeaconNotifyIndication {} impl ParseableMacEvent for BeaconNotifyIndication {}
/// MLME COMM STATUS Indication which is used by the MAC to indicate a communications status /// MLME COMM STATUS Indication which is used by the MAC to indicate a communications status
#[repr(C)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))] #[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct CommStatusIndication { pub struct CommStatusIndication {
/// The 16-bit PAN identifier of the device from which the frame /// The 16-bit PAN identifier of the device from which the frame
@ -96,6 +100,7 @@ impl ParseableMacEvent for CommStatusIndication {}
/// MLME GTS Indication indicates that a GTS has been allocated or that a /// MLME GTS Indication indicates that a GTS has been allocated or that a
/// previously allocated GTS has been deallocated /// previously allocated GTS has been deallocated
#[repr(C)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))] #[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct GtsIndication { pub struct GtsIndication {
/// The short address of the device that has been allocated or deallocated a GTS /// The short address of the device that has been allocated or deallocated a GTS
@ -118,6 +123,7 @@ impl ParseableMacEvent for GtsIndication {}
/// MLME ORPHAN Indication which is used by the coordinator to notify the /// MLME ORPHAN Indication which is used by the coordinator to notify the
/// application of the presence of an orphaned device /// application of the presence of an orphaned device
#[repr(C)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))] #[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct OrphanIndication { pub struct OrphanIndication {
/// Extended address of the orphaned device /// Extended address of the orphaned device
@ -138,6 +144,7 @@ impl ParseableMacEvent for OrphanIndication {}
/// MLME SYNC LOSS Indication which is used by the MAC to indicate the loss /// MLME SYNC LOSS Indication which is used by the MAC to indicate the loss
/// of synchronization with the coordinator /// of synchronization with the coordinator
#[repr(C)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))] #[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct SyncLossIndication { pub struct SyncLossIndication {
/// The PAN identifier with which the device lost synchronization or to which it was realigned /// The PAN identifier with which the device lost synchronization or to which it was realigned
@ -162,6 +169,7 @@ impl ParseableMacEvent for SyncLossIndication {}
/// MLME DPS Indication which indicates the expiration of the DPSIndexDuration /// MLME DPS Indication which indicates the expiration of the DPSIndexDuration
/// and the resetting of the DPS values in the PHY /// and the resetting of the DPS values in the PHY
#[repr(C)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))] #[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct DpsIndication { pub struct DpsIndication {
/// byte stuffing to keep 32 bit alignment /// byte stuffing to keep 32 bit alignment
@ -170,8 +178,8 @@ pub struct DpsIndication {
impl ParseableMacEvent for DpsIndication {} impl ParseableMacEvent for DpsIndication {}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[repr(C)] #[repr(C)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct DataIndication { pub struct DataIndication {
/// Pointer to the set of octets forming the MSDU being indicated /// Pointer to the set of octets forming the MSDU being indicated
pub msdu_ptr: *const u8, pub msdu_ptr: *const u8,
@ -227,6 +235,7 @@ impl ParseableMacEvent for DataIndication {}
/// MLME POLL Indication which will be used for indicating the Data Request /// MLME POLL Indication which will be used for indicating the Data Request
/// reception to upper layer as defined in Zigbee r22 - D.8.2 /// reception to upper layer as defined in Zigbee r22 - D.8.2
#[repr(C)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))] #[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct PollIndication { pub struct PollIndication {
/// addressing mode used /// addressing mode used

View File

@ -7,6 +7,7 @@ use super::typedefs::{
/// MLME ASSOCIATE Confirm used to inform of the initiating device whether /// MLME ASSOCIATE Confirm used to inform of the initiating device whether
/// its request to associate was successful or unsuccessful /// its request to associate was successful or unsuccessful
#[repr(C)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))] #[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct AssociateConfirm { pub struct AssociateConfirm {
/// short address allocated by the coordinator on successful association /// short address allocated by the coordinator on successful association
@ -28,6 +29,7 @@ pub struct AssociateConfirm {
impl ParseableMacEvent for AssociateConfirm {} impl ParseableMacEvent for AssociateConfirm {}
/// MLME DISASSOCIATE Confirm used to send disassociation Confirmation to the application. /// MLME DISASSOCIATE Confirm used to send disassociation Confirmation to the application.
#[repr(C)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))] #[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct DisassociateConfirm { pub struct DisassociateConfirm {
/// status of the disassociation attempt /// status of the disassociation attempt
@ -43,6 +45,7 @@ pub struct DisassociateConfirm {
impl ParseableMacEvent for DisassociateConfirm {} impl ParseableMacEvent for DisassociateConfirm {}
/// MLME GET Confirm which requests information about a given PIB attribute /// MLME GET Confirm which requests information about a given PIB attribute
#[repr(C)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))] #[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct GetConfirm { pub struct GetConfirm {
/// The pointer to the value of the PIB attribute attempted to read /// The pointer to the value of the PIB attribute attempted to read
@ -61,6 +64,7 @@ impl ParseableMacEvent for GetConfirm {}
/// MLME GTS Confirm which eports the results of a request to allocate a new GTS /// MLME GTS Confirm which eports the results of a request to allocate a new GTS
/// or to deallocate an existing GTS /// or to deallocate an existing GTS
#[repr(C)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))] #[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct GtsConfirm { pub struct GtsConfirm {
/// The characteristics of the GTS /// The characteristics of the GTS
@ -74,6 +78,7 @@ pub struct GtsConfirm {
impl ParseableMacEvent for GtsConfirm {} impl ParseableMacEvent for GtsConfirm {}
/// MLME RESET Confirm which is used to report the results of the reset operation /// MLME RESET Confirm which is used to report the results of the reset operation
#[repr(C)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))] #[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct ResetConfirm { pub struct ResetConfirm {
/// The result of the reset operation /// The result of the reset operation
@ -86,6 +91,7 @@ impl ParseableMacEvent for ResetConfirm {}
/// MLME RX ENABLE Confirm which is used to report the results of the attempt /// MLME RX ENABLE Confirm which is used to report the results of the attempt
/// to enable or disable the receiver /// to enable or disable the receiver
#[repr(C)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))] #[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct RxEnableConfirm { pub struct RxEnableConfirm {
/// Result of the request to enable or disable the receiver /// Result of the request to enable or disable the receiver
@ -97,6 +103,7 @@ pub struct RxEnableConfirm {
impl ParseableMacEvent for RxEnableConfirm {} impl ParseableMacEvent for RxEnableConfirm {}
/// MLME SCAN Confirm which is used to report the result of the channel scan request /// MLME SCAN Confirm which is used to report the result of the channel scan request
#[repr(C)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))] #[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct ScanConfirm { pub struct ScanConfirm {
/// Status of the scan request /// Status of the scan request
@ -122,6 +129,7 @@ pub struct ScanConfirm {
impl ParseableMacEvent for ScanConfirm {} impl ParseableMacEvent for ScanConfirm {}
/// MLME SET Confirm which reports the result of an attempt to write a value to a PIB attribute /// MLME SET Confirm which reports the result of an attempt to write a value to a PIB attribute
#[repr(C)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))] #[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct SetConfirm { pub struct SetConfirm {
/// The result of the set operation /// The result of the set operation
@ -136,6 +144,7 @@ impl ParseableMacEvent for SetConfirm {}
/// MLME START Confirm which is used to report the results of the attempt to /// MLME START Confirm which is used to report the results of the attempt to
/// start using a new superframe configuration /// start using a new superframe configuration
#[repr(C)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))] #[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct StartConfirm { pub struct StartConfirm {
/// Result of the attempt to start using an updated superframe configuration /// Result of the attempt to start using an updated superframe configuration
@ -147,6 +156,7 @@ pub struct StartConfirm {
impl ParseableMacEvent for StartConfirm {} impl ParseableMacEvent for StartConfirm {}
/// MLME POLL Confirm which is used to report the result of a request to poll the coordinator for data /// MLME POLL Confirm which is used to report the result of a request to poll the coordinator for data
#[repr(C)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))] #[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct PollConfirm { pub struct PollConfirm {
/// The status of the data request /// The status of the data request
@ -158,6 +168,7 @@ pub struct PollConfirm {
impl ParseableMacEvent for PollConfirm {} impl ParseableMacEvent for PollConfirm {}
/// MLME DPS Confirm which reports the results of the attempt to enable or disable the DPS /// MLME DPS Confirm which reports the results of the attempt to enable or disable the DPS
#[repr(C)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))] #[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct DpsConfirm { pub struct DpsConfirm {
/// The status of the DPS request /// The status of the DPS request
@ -170,6 +181,7 @@ impl ParseableMacEvent for DpsConfirm {}
/// MLME SOUNDING Confirm which reports the result of a request to the PHY to provide /// MLME SOUNDING Confirm which reports the result of a request to the PHY to provide
/// channel sounding information /// channel sounding information
#[repr(C)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))] #[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct SoundingConfirm { pub struct SoundingConfirm {
/// Results of the sounding measurement /// Results of the sounding measurement
@ -182,6 +194,7 @@ impl ParseableMacEvent for SoundingConfirm {}
/// MLME CALIBRATE Confirm which reports the result of a request to the PHY /// MLME CALIBRATE Confirm which reports the result of a request to the PHY
/// to provide internal propagation path information /// to provide internal propagation path information
#[repr(C)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))] #[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct CalibrateConfirm { pub struct CalibrateConfirm {
/// The status of the attempt to return sounding data /// The status of the attempt to return sounding data
@ -200,6 +213,7 @@ impl ParseableMacEvent for CalibrateConfirm {}
/// MCPS DATA Confirm which will be used for reporting the results of /// MCPS DATA Confirm which will be used for reporting the results of
/// MAC data related requests from the application /// MAC data related requests from the application
#[repr(C)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))] #[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct DataConfirm { pub struct DataConfirm {
/// The handle associated with the MSDU being confirmed /// The handle associated with the MSDU being confirmed
@ -230,6 +244,7 @@ impl ParseableMacEvent for DataConfirm {}
/// MCPS PURGE Confirm which will be used by the MAC to notify the application of /// MCPS PURGE Confirm which will be used by the MAC to notify the application of
/// the status of its request to purge an MSDU from the transaction queue /// the status of its request to purge an MSDU from the transaction queue
#[repr(C)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))] #[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct PurgeConfirm { pub struct PurgeConfirm {
/// Handle associated with the MSDU requested to be purged from the transaction queue /// Handle associated with the MSDU requested to be purged from the transaction queue