ConfigMessageUtils

Functions

Link copied to clipboard
fun decode(limit: Int = 10000, data: ByteArray, offset: Int): Array<KeyIndex>

Decodes number of Key Indexes from the given Data from the given offset. This will decode as many Indexes as possible, until the end of data is reached.

Link copied to clipboard
fun encode(limit: Int = 10000, indexes: List<KeyIndex>): ByteArray

Encodes given list of Key Indexes into a Data. As each Key Index is 12 bits long, a pair of them can fit 3 bytes. This method ensures that they are packed in compliance to the Bluetooth Mesh specification.

Link copied to clipboard