mirror of
https://github.com/azaion/autopilot.git
synced 2026-04-22 21:56:35 +00:00
29 lines
637 B
C++
29 lines
637 B
C++
#pragma once
|
|
|
|
#include <QByteArray>
|
|
#include <QList>
|
|
#include <QString>
|
|
#include "defines.hpp"
|
|
|
|
struct Command
|
|
{
|
|
COMMAND_ID id;
|
|
QByteArray command;
|
|
QString description;
|
|
};
|
|
|
|
class SerialCommand {
|
|
public:
|
|
SerialCommand();
|
|
void printCommands(void);
|
|
QByteArray getCommandForUI(COMMAND_ID commandId);
|
|
QByteArray getCommandForInternal(COMMAND_ID commandId);
|
|
uint8_t getCommandCount();
|
|
|
|
private:
|
|
void setExtraValues(COMMAND_ID commandId);
|
|
QByteArray createByteArray(const std::initializer_list<int> &bytes);
|
|
int16_t getCommandIndex(COMMAND_ID commandId);
|
|
std::vector<Command> mSerialCommands;
|
|
};
|