src.bluetooth_sig.types.mesh¶
Bluetooth Mesh protocol types per Bluetooth Mesh Profile Specification.
This module contains types for Bluetooth Mesh protocol structures including beacon types, provisioning PDUs, and mesh network data.
Reference: Bluetooth Mesh Profile Specification v1.1
Attributes¶
Name | Description |
|---|---|
Classes¶
Name | Description |
|---|---|
Mesh beacon types per Bluetooth Mesh Profile 3.10. |
|
Mesh Provisioning Capabilities per Bluetooth Mesh Profile 5.4.1.2. |
|
Mesh Network PDU message per Bluetooth Mesh Profile 3.4. |
|
Provisioning Bearer (PB-ADV) data per Bluetooth Mesh Profile 5.3. |
|
Mesh Provisioning PDU types per Bluetooth Mesh Profile 5.4. |
|
Mesh Secure Network Beacon per Bluetooth Mesh Profile 3.10.3. |
|
Secure Network Beacon flags per Bluetooth Mesh Profile 3.10.3. |
|
Mesh Unprovisioned Device Beacon per Bluetooth Mesh Profile 3.10.2. |
Module Contents¶
- class src.bluetooth_sig.types.mesh.MeshBeaconType¶
Bases:
enum.IntEnumMesh beacon types per Bluetooth Mesh Profile 3.10.
These identify the type of mesh beacon being broadcast.
- SECURE_NETWORK = 1¶
- UNPROVISIONED_DEVICE = 0¶
- class src.bluetooth_sig.types.mesh.MeshCapabilities¶
Bases:
msgspec.StructMesh Provisioning Capabilities per Bluetooth Mesh Profile 5.4.1.2.
This structure describes the device’s provisioning capabilities and is sent in response to a Provisioning Invite PDU.
- num_elements¶
Number of elements supported by the device
- algorithms¶
Supported provisioning algorithms (bitmask)
- public_key_type¶
Supported public key types
- static_oob_type¶
Supported static OOB types
- output_oob_size¶
Maximum size of Output OOB
- output_oob_action¶
Supported Output OOB actions
- input_oob_size¶
Maximum size of Input OOB
- input_oob_action¶
Supported Input OOB actions
- class src.bluetooth_sig.types.mesh.MeshMessage¶
Bases:
msgspec.StructMesh Network PDU message per Bluetooth Mesh Profile 3.4.
- ivi¶
IV Index least significant bit
- nid¶
Network ID (7 bits)
- ctl¶
Control message flag
- ttl¶
Time To Live
- seq¶
Sequence number (24 bits)
- src¶
Source address
- dst¶
Destination address
- transport_pdu¶
Encrypted transport PDU
- net_mic¶
Network MIC (32 or 64 bits)
- classmethod decode(data: bytes | bytearray) MeshMessage¶
Decode from Network PDU bytes.
- Parameters:
data – Raw Network PDU bytes
- Returns:
Parsed MeshMessage
- Raises:
ValueError – If data is too short
- class src.bluetooth_sig.types.mesh.ProvisioningBearerData¶
Bases:
msgspec.StructProvisioning Bearer (PB-ADV) data per Bluetooth Mesh Profile 5.3.
- link_id¶
Link identifier (32 bits)
- transaction_number¶
Transaction number
- pdu_type¶
Provisioning PDU type
- pdu_data¶
Raw PDU payload
- classmethod decode(data: bytes | bytearray) ProvisioningBearerData¶
Decode from PB-ADV bytes.
- Parameters:
data – Raw PB-ADV bytes
- Returns:
Parsed ProvisioningBearerData
- Raises:
ValueError – If data is too short
- pdu_type: ProvisioningPDUType¶
- class src.bluetooth_sig.types.mesh.ProvisioningPDUType¶
Bases:
enum.IntEnumMesh Provisioning PDU types per Bluetooth Mesh Profile 5.4.
These identify the provisioning protocol message type.
- CAPABILITIES = 1¶
- COMPLETE = 8¶
- CONFIRMATION = 5¶
- DATA = 7¶
- FAILED = 9¶
- INPUT_COMPLETE = 4¶
- INVITE = 0¶
- PUBLIC_KEY = 3¶
- RANDOM = 6¶
- START = 2¶
- class src.bluetooth_sig.types.mesh.SecureNetworkBeacon¶
Bases:
msgspec.StructMesh Secure Network Beacon per Bluetooth Mesh Profile 3.10.3.
This beacon is broadcast by provisioned nodes to announce network presence and IV index.
- network_id¶
8-byte Network ID derived from network key
- iv_index¶
Current IV Index
- key_refresh_flag¶
Key Refresh Flag
- iv_update_flag¶
IV Update Flag
- authentication_value¶
8-byte authentication value
- classmethod decode(data: bytes | bytearray) SecureNetworkBeacon¶
Decode from beacon bytes.
- Parameters:
data – Raw beacon bytes (without beacon type byte)
- Returns:
Parsed SecureNetworkBeacon
- Raises:
ValueError – If data is too short
- encode() bytearray¶
Encode to beacon format.
- Returns:
Encoded beacon bytes
- Raises:
ValueError – If network_id is not 8 bytes
- class src.bluetooth_sig.types.mesh.SecureNetworkBeaconFlags¶
Bases:
enum.IntFlagSecure Network Beacon flags per Bluetooth Mesh Profile 3.10.3.
These flags are combined in the beacon’s flags byte.
- IV_UPDATE = 2¶
- KEY_REFRESH = 1¶
- NONE = 0¶
- class src.bluetooth_sig.types.mesh.UnprovisionedDeviceBeacon¶
Bases:
msgspec.StructMesh Unprovisioned Device Beacon per Bluetooth Mesh Profile 3.10.2.
This beacon is broadcast by unprovisioned devices to announce their presence and provisioning capabilities.
- device_uuid¶
16-byte device UUID
- oob_info¶
OOB information flags
- uri_hash¶
Optional 4-byte URI hash
- classmethod decode(data: bytes | bytearray) UnprovisionedDeviceBeacon¶
Decode from beacon bytes.
- Parameters:
data – Raw beacon bytes (without beacon type byte)
- Returns:
Parsed UnprovisionedDeviceBeacon
- Raises:
ValueError – If data is too short
- encode() bytearray¶
Encode to beacon format.
- Returns:
Encoded beacon bytes
- Raises:
ValueError – If device_uuid is not 16 bytes
- src.bluetooth_sig.types.mesh.ACCESS_MESSAGE_MIC_LENGTH = 4¶
- src.bluetooth_sig.types.mesh.ALGORITHM_FIPS_P256 = 1¶
- src.bluetooth_sig.types.mesh.AUTHENTICATION_VALUE_LENGTH = 8¶
- src.bluetooth_sig.types.mesh.CONTROL_MESSAGE_MIC_LENGTH = 8¶
- src.bluetooth_sig.types.mesh.DEVICE_UUID_LENGTH = 16¶
- src.bluetooth_sig.types.mesh.MESH_MESSAGE_CTL_MASK = 128¶
- src.bluetooth_sig.types.mesh.MESH_MESSAGE_IVI_MASK = 128¶
- src.bluetooth_sig.types.mesh.MESH_MESSAGE_MIN_LENGTH = 9¶
- src.bluetooth_sig.types.mesh.MESH_MESSAGE_NID_MASK = 127¶
- src.bluetooth_sig.types.mesh.MESH_MESSAGE_TTL_MASK = 127¶
- src.bluetooth_sig.types.mesh.NETWORK_ID_LENGTH = 8¶
- src.bluetooth_sig.types.mesh.NETWORK_KEY_LENGTH = 16¶
- src.bluetooth_sig.types.mesh.OOB_INFO_LENGTH = 2¶
- src.bluetooth_sig.types.mesh.PB_ADV_MIN_LENGTH = 6¶
- src.bluetooth_sig.types.mesh.PUBLIC_KEY_TYPE_NONE = 0¶
- src.bluetooth_sig.types.mesh.STATIC_OOB_TYPE_NONE = 0¶
- src.bluetooth_sig.types.mesh.UNPROVISIONED_BEACON_MIN_LENGTH = 18¶
- src.bluetooth_sig.types.mesh.UNPROVISIONED_BEACON_WITH_HASH_LENGTH = 22¶
- src.bluetooth_sig.types.mesh.URI_HASH_LENGTH = 4¶