SendBuilder
Builder for an outbound MeshPacket. Created by RadioClient.send (DSL form).
Exactly one payload setter (text, data, position, or proto) must be called per builder. Calling more than one — or calling none — throws IllegalStateException from build.
When proto is used the entire packet is taken as-is; subsequent calls to to, channel, wantAck, or hopLimit throw IllegalStateException because they would silently overwrite caller-supplied wire fields. Set those on the MeshPacket you pass to proto instead.
Example:
val handle = client.send {
text("hello world")
to(NodeId(0xa1b2c3d4.toInt()))
channel(ChannelIndex(2))
wantAck()
hopLimit(3)
}Content copied to clipboard
Since
0.1.0
Functions
Link copied to clipboard
Set the ChannelIndex this packet is sent on. Defaults to channel 0.
Link copied to clipboard
Set the destination NodeId. Defaults to NodeId.BROADCAST.