publish

suspend fun publish(message: MeshMessage, model: Model): MessageHandle?

This method tries to publish the given message using the publication information set in the Model.

If the retransmission is set to a value greater than 0, and the message is unacknowledged, this method will retransmit it number of times with the count and interval specified in the retransmission object.

If the publication is not configured for the given Model, this method does nothing.

Note: This method does not check whether the given Model does support the given message. It will publish whatever message is given using the publication configuration of the given Model.

An appropriate callback of the `MeshNetworkDelegate` will be called when the message has been sent successfully or a problem occurred.

Parameters

message

: The message to be sent.

model

: The model from which to send the message.