pub struct CommissionableSubtypes { /* private fields */ }Expand description
Builds a commissionable advertisement’s subtypes from what §4.3.1.3 says to publish.
The five subtypes are not independent: _CM appears only in commissioning mode, _V and
_T only if the device chooses to publish them at all (“a vendor MAY choose not to include
it at all, for privacy reasons”), and the two discriminator subtypes always. Assembling
them in one place is what keeps a device from publishing _CM while advertising CM=0,
which §4.3.1.3 forbids and which nothing else would catch.
Implementations§
Source§impl CommissionableSubtypes
impl CommissionableSubtypes
Sourcepub fn new(discriminator: u16, mode: CommissioningMode) -> Self
pub fn new(discriminator: u16, mode: CommissioningMode) -> Self
The subtypes for a device with this discriminator and commissioning mode.
Sourcepub fn with_vendor(self, vendor_id: VendorId) -> Self
pub fn with_vendor(self, vendor_id: VendorId) -> Self
Also publish _V<vendor>.
Sourcepub fn with_device_type(self, device_type: u32) -> Self
pub fn with_device_type(self, device_type: u32) -> Self
Also publish _T<device-type>.
“In case the device combines multiple device types, the manufacturer SHOULD choose the device type identifier of the primary function of the device.”