You can send messages by triggering a publication from a model on the local node. This method follows the Bluetooth Mesh Protocol specification and requires the model to be properly configured first.
Prerequisites:
- The model must be bound to an Application Key using a
ConfigModelAppBind message. - The model must have a publication set using
ConfigModelPublicationSet or ConfigModelPublicationVirtualAddressSet.
Execution:
Call ModelDelegate/publish(using:) or ModelDelegate/publish(_:using:). The message will be sent to the destination specified in the Publish object.
Handling Responses:
If the message requires an acknowledgment, the response is delivered via the ModelDelegate/model(_:didReceiveResponse:toAcknowledgedMessage:from:) method.
// Trigger a publication from a model delegate
delegate.publish(using: publishObject)