pub enum CodecCapability {
SupportedSamplingFrequencies(HashSet<SamplingFrequency>),
SupportedFrameDurations(FrameDurationSupport),
SupportedAudioChannelCounts(HashSet<u8>),
SupportedMaxCodecFramesPerSdu(u8),
SupportedOctetsPerCodecFrame {
min: u16,
max: u16,
},
}
Expand description
Codec Capability LTV Structures
Defined in Assigned Numbers Section 6.12.4.
Variants§
SupportedSamplingFrequencies(HashSet<SamplingFrequency>)
SupportedFrameDurations(FrameDurationSupport)
SupportedAudioChannelCounts(HashSet<u8>)
SupportedMaxCodecFramesPerSdu(u8)
SupportedOctetsPerCodecFrame
Trait Implementations§
Source§impl Clone for CodecCapability
impl Clone for CodecCapability
Source§fn clone(&self) -> CodecCapability
fn clone(&self) -> CodecCapability
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for CodecCapability
impl Debug for CodecCapability
Source§impl LtValue for CodecCapability
impl LtValue for CodecCapability
const NAME: &'static str = "Codec Compatability"
type Type = CodecCapabilityType
Source§fn type_from_octet(x: u8) -> Option<Self::Type>
fn type_from_octet(x: u8) -> Option<Self::Type>
Given a type octet, return the associated Type if it is possible.
Returns None if the value is unrecognized.
Source§fn length_range_from_type(ty: Self::Type) -> RangeInclusive<u8>
fn length_range_from_type(ty: Self::Type) -> RangeInclusive<u8>
Returns length bounds for the type indicated, including the type
byte. Note that the assigned numbers from the Bluetooth SIG include
the type byte in their Length specifications.
Source§fn value_encoded_len(&self) -> u8
fn value_encoded_len(&self) -> u8
The length of the encoded value, without the length and type byte.
This cannot be 255 in practice, as the length byte is only one octet
long.
Source§fn encode_value(&self, buf: &mut [u8]) -> Result<(), Error>
fn encode_value(&self, buf: &mut [u8]) -> Result<(), Error>
Encodes a value into
buf
, which is verified to be the correct length
as indicated by LtValue::value_encoded_len.Source§fn decode_value(ty: &CodecCapabilityType, buf: &[u8]) -> Result<Self, Error>
fn decode_value(ty: &CodecCapabilityType, buf: &[u8]) -> Result<Self, Error>
Decodes the value from a buffer, which does not include the type or
length bytes. The
buf
slice length is exactly what was specified
for this value in the encoded source.Source§fn decode_all(buf: &[u8]) -> (Vec<Result<Self, Error<Self::Type>>>, usize)
fn decode_all(buf: &[u8]) -> (Vec<Result<Self, Error<Self::Type>>>, usize)
Decode a collection of LtValue structures that are present in a buffer.
If it is possible to continue decoding after encountering an error, does
so and includes the error. If an unrecoverable error occurs, does
not consume the final item and the last element in the result is the
error.
Source§impl PartialEq for CodecCapability
impl PartialEq for CodecCapability
impl Eq for CodecCapability
impl StructuralPartialEq for CodecCapability
Auto Trait Implementations§
impl Freeze for CodecCapability
impl RefUnwindSafe for CodecCapability
impl Send for CodecCapability
impl Sync for CodecCapability
impl Unpin for CodecCapability
impl UnwindSafe for CodecCapability
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Decodable for Twhere
T: LtValue,
impl<T> Decodable for Twhere
T: LtValue,
type Error = Error<<T as LtValue>::Type>
Source§fn decode(buf: &[u8]) -> (Result<T, <T as Decodable>::Error>, usize)
fn decode(buf: &[u8]) -> (Result<T, <T as Decodable>::Error>, usize)
Decodes into a new object or an error, and the number of bytes that
the decoding consumed. Should attempt to consume the entire item from
the buffer in the case of an error. If the item end cannot be determined,
return an error and consume the entirety of the bufer (
buf.len()
)Source§fn decode_multiple(
buf: &[u8],
max: Option<usize>,
) -> (Vec<Result<Self, Self::Error>>, usize)
fn decode_multiple( buf: &[u8], max: Option<usize>, ) -> (Vec<Result<Self, Self::Error>>, usize)
Tries to decode a collection of this object concatenated in a buffer.
Returns a vector of items (or errors) and the number of bytes consumed to
decode them.
Continues to decode items until the buffer is consumed or the max items.
If None, will decode the entire buffer.