getExpectedLength

open fun getExpectedLength(@NotNull scheme: @NotNull McuMgrScheme, bytes: @NotNull Array<Byte>): Int

This method parses the given bytes and reads the LENGTH field from the header. Returns the LENGTH + length of the header. This method may be used to determine whether more bytes must be received before parsing them into a response.

Return

The size of an array containing the header and complete response.

Parameters

scheme

must be BLE. COAP schemes are not supported.

bytes

an array containing the whole or beginning of the message. It must contain at least the whole header.

Throws

thrown when the header could not be parsed.

when scheme is not equal to BLE.