send

@NotNull
abstract fun <T : McuMgrResponse?> send(payload: @NotNull Array<Byte>, timeout: Long, @NotNull responseType: @NotNull Class<T>): @NotNull T

Send a synchronous Mcu Manager request. This method implementation should block until a response has been received or a error has occurred.

Return

The response.

Parameters

payload

the request packet data to send to the device.

timeout

the timeout for receiving a response for the packet, in milliseconds.

responseType

the response type.

<T>

the response type.

Throws

thrown on error. Set the cause of the error if caused by a different type of exception.


abstract fun <T : McuMgrResponse?> send(payload: @NotNull Array<Byte>, timeout: Long, @NotNull responseType: @NotNull Class<T>, @NotNull callback: @NotNull McuMgrCallback<T>)

Send an asynchronous Mcu Manager request. This method should not be blocked. When the response has been received or an error occurs, the appropriate method of the callback should be called.

Parameters

payload

the request packet data to send to the device.

timeout

the timeout for receiving a response for the packet, in milliseconds.

responseType

the response type.

callback

the callback to call on response or error.

<T>

the response type.