@@ -25,6 +25,7 @@ use crate::mac::command::Command;
2525/// [decode]: #method.decode
2626/// [encode]: #method.encode
2727#[ derive( Clone , Copy , Debug , Eq , Hash , PartialEq ) ]
28+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
2829pub struct Frame < ' p > {
2930 /// Header
3031 pub header : Header ,
@@ -225,6 +226,7 @@ pub enum WriteFooter {
225226
226227/// MAC frame header
227228#[ derive( Clone , Copy , Debug , Eq , Hash , PartialEq ) ]
229+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
228230pub struct Header {
229231 /// Frame Type
230232 pub frame_type : FrameType ,
@@ -485,6 +487,7 @@ impl Header {
485487///
486488/// Part of [`Header`].
487489#[ derive( Clone , Copy , Debug , Eq , Hash , PartialEq ) ]
490+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
488491pub enum FrameType {
489492 /// Beacon
490493 Beacon = 0b000 ,
@@ -538,6 +541,7 @@ impl FrameType {
538541/// Part of [`Header`]. Auxiliary security headers are currently unsupported by
539542/// this implementation.
540543#[ derive( Clone , Copy , Debug , Eq , Hash , PartialEq ) ]
544+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
541545pub enum Security {
542546 /// No auxiliary security header is present
543547 None = 0b0 ,
@@ -567,6 +571,7 @@ impl Security {
567571
568572/// Defines version information for a frame
569573#[ derive( Clone , Copy , Debug , Eq , Hash , PartialEq ) ]
574+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
570575pub enum FrameVersion {
571576 /// A frame conforming to the 802.15.4-2003 standard
572577 Ieee802154_2003 = 0b00 ,
@@ -602,6 +607,7 @@ impl FrameVersion {
602607
603608/// Defines the type of Address
604609#[ derive( Clone , Copy , Debug , Eq , Hash , PartialEq ) ]
610+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
605611pub enum AddressMode {
606612 /// PAN identifier and address field are not present
607613 None = 0b00 ,
@@ -647,6 +653,7 @@ impl AddressMode {
647653/// let pan_id = PanId(0x0123);
648654/// ```
649655#[ derive( Clone , Copy , Debug , Eq , Hash , Hash32 , PartialEq ) ]
656+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
650657pub struct PanId ( pub u16 ) ;
651658
652659impl PanId {
@@ -732,6 +739,7 @@ impl PanId {
732739/// let short_address = ShortAddress(0x0123);
733740/// ```
734741#[ derive( Clone , Copy , Debug , Eq , Hash , Hash32 , PartialEq ) ]
742+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
735743pub struct ShortAddress ( pub u16 ) ;
736744
737745impl ShortAddress {
@@ -822,6 +830,7 @@ impl ShortAddress {
822830/// let ext_address = ExtendedAddress(0x0123456789abcdef);
823831/// ```
824832#[ derive( Clone , Copy , Debug , Eq , Hash , Hash32 , PartialEq ) ]
833+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
825834pub struct ExtendedAddress ( pub u64 ) ;
826835
827836impl ExtendedAddress {
@@ -851,6 +860,7 @@ impl ExtendedAddress {
851860
852861/// An address that might contain an PAN ID and address
853862#[ derive( Clone , Copy , Debug , Eq , Hash , PartialEq ) ]
863+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
854864pub enum Address {
855865 /// No address
856866 None ,
@@ -964,6 +974,7 @@ impl Address {
964974
965975/// Content of a frame
966976#[ derive( Clone , Copy , Debug , Eq , Hash , PartialEq ) ]
977+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
967978pub enum FrameContent
968979{
969980 /// Beacon frame content
@@ -1017,6 +1028,7 @@ impl FrameContent {
10171028
10181029/// Signals an error that occured while decoding bytes
10191030#[ derive( Clone , Copy , Debug , Eq , Hash , PartialEq ) ]
1031+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
10201032pub enum DecodeError {
10211033 /// Buffer does not contain enough bytes
10221034 NotEnoughBytes ,
0 commit comments