Skip to content

Commit

Permalink
Temp fix for unhandled case of advanced advertising
Browse files Browse the repository at this point in the history
  • Loading branch information
jmichelp committed Jul 6, 2023
1 parent 929f32d commit d545f4f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions rubble/src/link/advertising.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ pub enum Pdu<'a> {
/// AD structures sent along with the advertisement.
advertising_data: BytesOr<'a, [AdStructure<'a>]>,
},
ExtendedAdvertising {},

/// Scan request sent from a scanner to an advertising device.
///
Expand Down Expand Up @@ -230,6 +231,7 @@ impl<'a> Pdu<'a> {
},
lldata: ConnectRequestData::from_bytes(payload)?,
},
PduType::AdvExtInd => todo!(),
PduType::Unknown(_) => return Err(Error::InvalidValue),
})
}
Expand Down Expand Up @@ -258,6 +260,8 @@ impl<'a> Pdu<'a> {
ScanRequest { scanner_addr, .. } => scanner_addr,

ConnectRequest { initiator_addr, .. } => initiator_addr,

ExtendedAdvertising => todo!(),
}
}

Expand All @@ -280,6 +284,7 @@ impl<'a> Pdu<'a> {
| ConnectRequest {
advertiser_addr, ..
} => Some(advertiser_addr),
ExtendedAdvertising => todo!(),
}
}

Expand All @@ -291,6 +296,7 @@ impl<'a> Pdu<'a> {
ConnectableUndirected { .. } => PduType::AdvInd,
ConnectableDirected { .. } => PduType::AdvDirectInd,
NonconnectableUndirected { .. } => PduType::AdvNonconnInd,
ExtendedAdvertising { .. } => PduType::AdvExtInd,
ScannableUndirected { .. } => PduType::AdvScanInd,
ScanRequest { .. } => PduType::ScanReq,
ScanResponse { .. } => PduType::ScanRsp,
Expand All @@ -316,6 +322,7 @@ impl<'a> Pdu<'a> {
} => Some(advertising_data.iter()),
ScanResponse { scan_data, .. } => Some(scan_data.iter()),
ScanRequest { .. } | ConnectableDirected { .. } | ConnectRequest { .. } => None,
ExtendedAdvertising => todo!(),
}
}
}
Expand Down Expand Up @@ -842,6 +849,7 @@ impl PduType {
true
}
PduType::AdvDirectInd
| PduType::AdvExtInd
| PduType::ScanReq
| PduType::ConnectReq
| PduType::Unknown(_) => false,
Expand Down

0 comments on commit d545f4f

Please sign in to comment.