pub fn parse(data: &[u8]) -> Result<Self, Error> {
        if data.len() == 4 {
            return Ok(ChannelSwitchAnnouncement {
                switch_mode: ChannelSwitchMode::from(data[0]),
                new_channel: data[1],
                switch_count: data[2],
            });
        }
        Err(io::Error::new(io::ErrorKind::InvalidData, "Invalid CSA element").into())
    }
/// Parse channel switch announcement from information element payload
Parse channel switch announcement from information element payload
Parse channel switch announcement from information element payload
pub fn parse(data: &[u8]) -> Result<Self, Error> {
        if data.len() == 4 {
            return Ok(ChannelSwitchAnnouncement {
                switch_mode: ChannelSwitchMode::from(data[0]),
                new_channel: data[1],
                switch_count: data[2],
            });
        }
        Err(io::Error::new(io::ErrorKind::InvalidData, "Invalid CSA element").into())
    }
pub fn parse ( data : & [ u8 ] ) -> Result < Self , Error > { if data . len ( ) == 4 { return Ok ( ChannelSwitchAnnouncement { switch_mode : ChannelSwitchMode :: from ( data [ 0 ] ) , new_channel : data [ 1 ] , switch_count : data [ 2 ] , } ) ; } Err ( io :: Error :: new ( io :: ErrorKind :: InvalidData , " " ) . into ( ) ) }
Parse channel switch announcement from information element payload
Parse channel switch announcement from information element payload
data
&[u8]
data
&[u8]