MeshNetwork

@Serializable
class MeshNetwork

MeshNetwork representing a Bluetooth mesh network.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

List of app keys that includes information about app keys used in the mesh network.

Link copied to clipboard

List of groups that includes information about groups configured in the mesh network.

Link copied to clipboard

IV Index of the network received via the last Secure Network Beacon and its current state.

Link copied to clipboard

Main provisioner of the network which is the first provisioner in the list of provisioners.

Link copied to clipboard

Human-readable name for the mesh network.

Link copied to clipboard

List of network keys that includes information about network keys used in the mesh network.

Link copied to clipboard

Returns the next available application key index that can be used when construction an application key.

Link copied to clipboard

THe next available network key index, or null if the index 4095 is already in use.

Link copied to clipboard

List of nodes that includes information about mesh nodes in the mesh network.

Link copied to clipboard

Indicates if this Mesh Configuration Database is part of a larger database.

Link copied to clipboard
Link copied to clipboard

List of known Provisioners and ranges of addresses that have been allocated to these Provisioners.

Link copied to clipboard

List of scenes that includes information about scenes configured in the mesh network.

Link copied to clipboard
var timestamp: Instant

Represents the last time the Mesh Object has been modified. The timestamp is based on Coordinated Universal Time.

Link copied to clipboard
@Serializable(with = UUIDSerializer::class)
val uuid: UUID

128-bit Universally Unique Identifier (Uuid), which allows differentiation among multiple mesh networks.

Functions

Link copied to clipboard
fun add(group: Group)

Adds a given Group to the list of groups in the mesh network.

fun add(node: Node)

Adds a given Node to the list of nodes in the mesh network.

fun add(provisioner: Provisioner)

Adds the given Provisioner to the list of provisioners in the network.

fun add(name: String, number: SceneNumber): Scene

Adds a given Scene with the given name and the scene number to the mesh network.

fun add(provisioner: Provisioner, address: UnicastAddress?)

Adds the given Provisioner with the given address to the list of provisioners in the network.

fun add(name: String, key: ByteArray = Crypto.generateRandomKey(), index: KeyIndex? = null): NetworkKey

Adds the given NetworkKey to the list of network keys in the network.

fun add(name: String, key: ByteArray = Crypto.generateRandomKey(), index: KeyIndex? = null, boundNetworkKey: NetworkKey): ApplicationKey

Adds the given ApplicationKey to the list of network keys in the network.

Link copied to clipboard

Returns the application key with a given key index.

Link copied to clipboard

Disables the configuration capabilities by un-assigning provisioner's address. Un-assigning an address will delete the provisioner's node. This results in the provisioner not being able to send or receive mesh messages in the mesh network. However, the provisioner will still retain it's provisioning capabilities.

Link copied to clipboard
fun isAddressAvailable(address: UnicastAddress, elementCount: Int): Boolean

Checks if the address is available to be assigned to a node with the given number of elements or false otherwise.

Checks if the address is available to be assigned to a node with the given number of elements.

Link copied to clipboard

Checks if the address range is available for use.

Link copied to clipboard
fun matches(networkId: ByteArray): Boolean

Checks if the given Network ID matches with any of the network keys in the network.

Checks if the given Network Identity beacon matches with any of the network keys in the network.

fun matches(nodeIdentity: NodeIdentity): Boolean

This method may be used to match the Node Identity or Private Node Identity beacons.

Link copied to clipboard
fun move(provisioner: Provisioner, to: Int)

Moves the given provisioner to the specified index.

Link copied to clipboard

Returns the network key with a given key index.

Link copied to clipboard

Returns the next available Group from the Provisioner's range that can be assigned to a new Group.

Link copied to clipboard

Next available unicast address range for a given range size.

Link copied to clipboard
fun nextAvailableScene(provisioner: Provisioner = provisioners.first()): SceneNumber?

Returns the next available Scene number from the Provisioner's range that can be assigned to a new Scene.

Link copied to clipboard

Next available unicast address range for a given range size.

Link copied to clipboard
fun nextAvailableUnicastAddress(offset: UnicastAddress = UnicastAddress(minUnicastAddress), elementCount: Int, provisioner: Provisioner): UnicastAddress?

Returns the next available unicast address from the provisioner's range that can be assigned to a new node based on the given number of elements. The zeroth element is identified by the node's Unicast Address. Each following element is identified by a subsequent Unicast Address.

Link copied to clipboard

Next available unicast address range for a given range size.

Link copied to clipboard
fun node(): Node?

Returns the provisioned node for an unprovisioned device.

fun node(uuid: UUID): Node?

Returns the node with the given uuid.

fun node(address: Address): Node?

Returns the provisioned node containing an element with the given address.

fun node(address: MeshAddress): Node?

Returns the provisioned node containing an element with the given mesh address.

fun node(provisioner: Provisioner): Node?

Returns the provisioner's node or null, if the provisioner is not a part of the network or does not have an address assigned.

fun node(nodeIdentity: NodeIdentity): Node?

Returns the node with the given node identity.

Link copied to clipboard

Returns a provisioner with the given UUID.

Link copied to clipboard

Removes a given ApplicationKey from the list of application keys in the mesh network.

fun remove(group: Group)

Removes a given Group from the list of groups in the mesh network.

fun remove(key: NetworkKey)

Removes a given NetworkKey from the list of network keys in the mesh network.

fun remove(node: Node)

Removes a given node from the list of nodes in the mesh network.

fun remove(provisioner: Provisioner)

Removes the given provisioner from the list of provisioners in the network.

fun remove(scene: Scene)

Removes a given Scene from the list of groups in the mesh network.

Link copied to clipboard
fun scene(number: SceneNumber): Scene

Returns the Scene key with a given scene number.