Define composable command interface

This commit is contained in:
GHOSCHT 2023-03-30 20:36:16 +02:00
parent 0c9e08af05
commit d335746ddc

View file

@ -1,9 +1,21 @@
#pragma once
#include "Protocol.h"
#include <etl/optional.h>
#include <etl/span.h>
#include <etl/string.h>
namespace message {
namespace composer {
enum class ComposableType {
MESSAGE_LIGHTDATA,
MESSAGE_INFO,
MESSAGE_WARNING,
MESSAGE_ERROR,
MESSAGE_SUCCESS,
COMMAND_HELP,
COMMAND_VERSION,
};
using Composable = etl::pair<ComposableType, etl::optional<etl::span<uint8_t>>>;
bool sendMessage(protocol::Message type, etl::string_view content);
} // namespace composer
} // namespace message