Define composable command interface

This commit is contained in:
GHOSCHT 2023-03-30 20:36:16 +02:00
parent 2c6396fbf5
commit 0af1561820
No known key found for this signature in database

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