ProxyProtocolHandler

Helper class for handling segmentation and reassembly of messages that are sent via the proxy protocol. This is defined in Bluetooth Mesh Protocol Specification 1.1

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun reassemble(data: ByteArray): Pdu?

This method consumes the given data. If the data were segmented, they are buffered until the last segment is received. This method returns the message and its type when the last segment (or the only one) has been received, otherwise it returns null.

Link copied to clipboard
fun segment(data: ByteArray, type: PduType, mtu: Int): List<ByteArray>

Segments the given data with given message type to 1+ messages where all but the last one are of the MTU size and the last one is MTU size or smaller. This method implements the Proxy Protocol from Bluetooth Mesh specification.