pub struct BluetoothDeviceList { /* private fields */ }Expand description
Bluetooth device list structure
This structure represents a list of up to 10 Bluetooth devices, including their configuration and connection status. Itโs used for managing multiple Bluetooth devices in embedded systems.
ยงMemory Layout
The structure uses #[repr(C)] to ensure predictable memory layout,
making it suitable for serialization and inter-process communication.
ยงSecurity Note
This structure may store sensitive pairing data. Ensure proper memory protection and secure storage mechanisms when persisting this data.
ยงFields
magic: Structure validation (0x42544C53)devices: Array of up to 10 device configurationsdevice_count: Number of valid devices in the list_padding: Ensures 4-byte alignment
ยงErrors
Error::DeviceListFullif adding more than 10 devicesError::IndexOutOfBoundsfor invalid indices
ยงExamples
use renik::{BluetoothDeviceInfo, BluetoothDeviceList};
let mac_addr1 = [0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC];
let mac_addr2 = [0x98, 0x76, 0x54, 0x32, 0x10, 0xFE];
let device1 = BluetoothDeviceInfo::new(&mac_addr1, b"Device 1").unwrap();
let device2 = BluetoothDeviceInfo::new(&mac_addr2, b"Device 2").unwrap();
let mut device_list = BluetoothDeviceList::default();
device_list.add_device(device1).unwrap();
device_list.add_device(device2).unwrap();
assert_eq!(device_list.len(), 2);Implementationsยง
Sourceยงimpl BluetoothDeviceList
impl BluetoothDeviceList
Trait Implementationsยง
Sourceยงimpl Clone for BluetoothDeviceList
impl Clone for BluetoothDeviceList
Sourceยงfn clone(&self) -> BluetoothDeviceList
fn clone(&self) -> BluetoothDeviceList
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 BluetoothDeviceList
impl Debug for BluetoothDeviceList
Sourceยงimpl Default for BluetoothDeviceList
impl Default for BluetoothDeviceList
impl Copy for BluetoothDeviceList
impl Pod for BluetoothDeviceList
Auto Trait Implementationsยง
impl Freeze for BluetoothDeviceList
impl RefUnwindSafe for BluetoothDeviceList
impl Send for BluetoothDeviceList
impl Sync for BluetoothDeviceList
impl Unpin for BluetoothDeviceList
impl UnwindSafe for BluetoothDeviceList
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> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Sourceยงtype Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Sourceยงfn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self.