Response

sealed class Response

Sealed class which encapsulates all command responses. So the responses to any Command.Request.

Inheritors

Types

Link copied to clipboard
data class AvailableContexts(val contexts: List<String>) : Command.Response
Link copied to clipboard
object Companion
Link copied to clipboard
data class Error(val message: String) : Command.Response

Be warned: the message must not be longer than 100 characters. Any longer message will be cut off to fit into a BLE command

Link copied to clipboard
Link copied to clipboard
data class PollResult(val items: List<Pair<TopicName, ByteArray>>, val contextAvailabilityChanges: List<Pair<String, Boolean>>) : Command.Response
Link copied to clipboard
Link copied to clipboard
data class SwitchToWifi(val ssid: String, val wifiPassword: String, val brokerIpAddress: String) : Command.Response

Functions

Link copied to clipboard
abstract fun serialize(): ByteArray

Method to serialize the given command into a ByteArray. The serialization logic needs to be in sync with the de-serialization logic in the parseCommand method.