bluetooth_mesh.application¶
Application¶
-
class
bluetooth_mesh.application.CompositionDataMixin[source]¶ Provides propertied to company id, product id, version id and replay protection list size.
These are used by
bluetooth_mesh.interfaces.ApplicationInterfaceto expose them via D-Bus.-
COMPANY_ID= 65253¶
-
CRPL= 32767¶
-
PRODUCT_ID= 66¶
-
VERSION_ID= 1¶
-
property
company_id¶ - Return type
int
-
property
crpl¶ - Return type
int
-
property
product_id¶ - Return type
int
-
property
version_id¶ - Return type
int
-
-
class
bluetooth_mesh.application.TokenRingMixin[source]¶ Provides token property via persistent, UUID-based token storage.
See
bluetooth_mesh.tokenring.TokenRingfor details.-
property
token¶ - Return type
int
-
property
-
class
bluetooth_mesh.application.MachineUUIDMixin[source]¶ Provides uuid property based on systemd’s machine-id.
-
property
uuid¶ - Return type
UUID
-
property
-
class
bluetooth_mesh.application.PathMixin[source]¶ Provides path property under which py:class:bluetooth_mesh.interfaces.ApplicationInterface will be registered on D-Bus.
-
PATH= '/com/silvair/application'¶
-
property
path¶ - Return type
str
-
-
class
bluetooth_mesh.application.DeviceKeyMixin[source]¶ -
property
dev_key¶ Application’s device_key. Used when creating a new node, see
Application.import_node().- Return type
DeviceKey
-
property
-
class
bluetooth_mesh.application.NetworkKeyMixin[source]¶ -
property
net_keys¶ Indexes and keyes of the subnets.
- Return type
List[Tuple[int,NetworkKey]]
-
property
primary_net_key¶ Index and key of the network that the application belongs to. Used when creating a new node, see
Application.import_node().- Return type
Tuple[int,NetworkKey]
-
property
-
class
bluetooth_mesh.application.Application(loop)[source]¶ Base class for mesh applications.
-
DBUS_SERVICE¶ alias of
bluetooth_mesh.interfaces.MeshService
-
ELEMENTS= {}¶
-
async
add_app_key(net_key_index, app_key_index, app_key)[source]¶ Imports an application key into daemon’s keyring.
- Parameters
net_key_index (
int) – Index of the network key the new application key is bound toapp_key_index (
int) – Index of the new application keyapp_key (
ApplicationKey) – Value of the new application key
- Return type
AppKeyStatus
-
async
add_net_key(net_key_index, net_key)[source]¶ Imports an application key into daemon’s keyring.
- Parameters
net_key_index (
int) – Index of the network keynet_key (
NetworkKey) – Value of the new network key
- Return type
Any
-
async
attach(token=None)[source]¶ Attach to existing node using a token.
Returns current node configuration, see documentation for Attach() method in mesh-api.txt_.
-
async
bind_app_key(app_key_index, model)[source]¶ See
Model.bind()instead.- Return type
ModelBindStatus
-
async
clear_subscriptions(model)[source]¶ See
Model.unsubscribe()instead.- Return type
ModelSubscriptionStatus
-
async
connect(addr, iv_index=0)[source]¶ Connect to BlueZ. If a node doesn’t exist yet, it gets created via Import() call.
Returns current node configuration, see documentation for Attach() method in mesh-api.txt_.
- Return type
Mapping[int,Dict[Tuple[int,int],Dict[str,Tuple[Any,int]]]]
-
async
import_node(dev_key=None, net_key=None, iv_index=0, addr=None, flags=None)[source]¶ Create a self-provisioned node.
- Return type
int
-
Element¶
-
class
bluetooth_mesh.application.LocationMixin[source]¶ Provides location property.
-
LOCATION= None¶
-
property
location¶ - Return type
int
-
-
class
bluetooth_mesh.application.Element(application, index)[source]¶ Base class for elements.
-
MODELS= []¶
-
dev_key_message_received(source, remote, net_index, data)[source]¶ Called by
bluetooth_mesh.interfaces.ElementInterfacewhen receiving a message encrypted with device key.The message is parsed using
bluetooth_mesh.messages.AccessMessageand (depending on the opcode) passed to relevant models’bluetooth_mesh.models.Model.dev_key_message_received().
-
message_received(source, app_index, destination, data)[source]¶ Called by
bluetooth_mesh.interfaces.ElementInterfacewhen receiving a message encrypted with application key.The message is parsed using
bluetooth_mesh.messages.AccessMessageand (depending on the opcode) passed to relevant models’message_received().
-
property
models¶ Used by
bluetooth_mesh.interfaces.ApplicationInterfaceto expose a list of supported SIG models via D-Bus.- Return type
List[int]
-
update_model_configuration(model_id, configuration)[source]¶ Called by
bluetooth_mesh.interfaces.ElementInterfacewhen model configuration is updated via daemon’s internal Config Server model.Passes the configuration to relevant model’s
bluetooth_mesh.models.Model.update_configuration().
-
property
vendor_models¶ Used by
bluetooth_mesh.interfaces.ApplicationInterfaceto expose a list of supported vendor models via D-Bus.- Return type
List[Tuple[int,int]]
-