McuMgrTransport

interface McuMgrTransport

An McuMgrTransport is tasked with sending requests to, and receiving responses from a device. Transport implementations should conform to one of the McuMgrSchemes. Furthermore, the McuManager does not maintain the state of the transporter, and so the transport must set-up and tear-down connections on its own accord.

Types

Link copied to clipboard
Receives callbacks from an explicit call to connect.
Link copied to clipboard
Receives connection state changes independent of explicit calls to connect or release.
Link copied to clipboard
Receives callbacks from an explicit call to changeMode.

Functions

Link copied to clipboard
abstract fun addObserver(@NotNull observer: @NotNull McuMgrTransport.ConnectionObserver)
Adds the connection observer.
Link copied to clipboard
abstract fun changeMode(@NotNull name: @NotNull String, @Nullable callback: @Nullable McuMgrTransport.ModeChangeCallback): Boolean
Changes the transport mode.
Link copied to clipboard
abstract fun connect(@Nullable callback: @Nullable McuMgrTransport.ConnectionCallback)
Connect the transporter to the remote device.
Link copied to clipboard
@NotNull
abstract fun getScheme(): @NotNull McuMgrScheme
Gets the scheme for this transport (see McuMgrScheme).
Link copied to clipboard
abstract fun release()
Releases the transport connection.
Link copied to clipboard
abstract fun removeObserver(@NotNull observer: @NotNull McuMgrTransport.ConnectionObserver)
Removes previously registered observer.
Link copied to clipboard
@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.
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.