createCommand

abstract fun createCommand(commandType: CommandType, value: CommandValue = CommandValue.None): ByteArray(source)

Encode a command. Returns an owned byte array, or an empty array when unsupported, invalid or blocked by protocol state. The session must surface an empty result as failure.


open fun createCommand(commandId: String, value: CommandValue = CommandValue.None): ByteArray(source)

Open-ID encoder extension point; existing protocols retain their enum encoder.