pub fn parse(data: &[u8]) -> Result<HighThroughputOperation, Error> {
        if data.len() == 22 {
            let secondary_channel = match data[1] & 0x03 {
                1 => data[0] + 1,
                3 => data[0] - 1,
                _ => 0,
            };
            let width = if data[1] & 0x04 == 0 { 20 } else { 40 };
            // There are lots of other information in this IE
            return Ok(HighThroughputOperation {
                primary_channel: data[0],
                secondary_channel,
                width,
            });
        }
        Err(io::Error::new(io::ErrorKind::InvalidData, "Invalid VHT element").into())
    }
/// Parse high throughput operation from information element payload
Parse high throughput operation from information element payload
Parse high throughput operation from information element payload
pub fn parse(data: &[u8]) -> Result<HighThroughputOperation, Error> {
        if data.len() == 22 {
            let secondary_channel = match data[1] & 0x03 {
                1 => data[0] + 1,
                3 => data[0] - 1,
                _ => 0,
            };
            let width = if data[1] & 0x04 == 0 { 20 } else { 40 };
            // There are lots of other information in this IE
            return Ok(HighThroughputOperation {
                primary_channel: data[0],
                secondary_channel,
                width,
            });
        }
        Err(io::Error::new(io::ErrorKind::InvalidData, "Invalid VHT element").into())
    }
pub fn parse ( data : & [ u8 ] ) -> Result < HighThroughputOperation , Error > { if data . len ( ) == 22 { let secondary_channel = match data [ 1 ] & 0x03 { 1 => data [ 0 ] + 1 , 3 => data [ 0 ] - 1 , _ => 0 , } ; let width = if data [ 1 ] & 0x04 == 0 { 20 } else { 40 } ; // There are lots of other information in this IE return Ok ( HighThroughputOperation { primary_channel : data [ 0 ] , secondary_channel , width , } ) ; } Err ( io :: Error :: new ( io :: ErrorKind :: InvalidData , " " ) . into ( ) ) }
Parse high throughput operation from information element payload
Parse high throughput operation from information element payload
data
&[u8]
data
&[u8]