encode

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.

Parameters

limit

Maximum number of Key Indexes to encode.

indexes

An array of 12-bit Key Indexes.