Implement Improv via Serial component (#2423)

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
Jesse Hills
2021-11-11 08:55:45 +13:00
committed by GitHub
parent 0bdb48bcac
commit 5ff7c8418c
17 changed files with 391 additions and 14 deletions
+6 -4
View File
@@ -1,8 +1,8 @@
#pragma once
#ifdef USE_ARDUINO
#ifdef ARDUINO
#include "WString.h"
#endif // USE_ARDUINO
#endif // ARDUINO
#include <cstdint>
#include <string>
@@ -38,6 +38,8 @@ enum Command : uint8_t {
UNKNOWN = 0x00,
WIFI_SETTINGS = 0x01,
IDENTIFY = 0x02,
GET_CURRENT_STATE = 0x02,
GET_DEVICE_INFO = 0x03,
BAD_CHECKSUM = 0xFF,
};
@@ -53,8 +55,8 @@ ImprovCommand parse_improv_data(const std::vector<uint8_t> &data);
ImprovCommand parse_improv_data(const uint8_t *data, size_t length);
std::vector<uint8_t> build_rpc_response(Command command, const std::vector<std::string> &datum);
#ifdef USE_ARDUINO
#ifdef ARDUINO
std::vector<uint8_t> build_rpc_response(Command command, const std::vector<String> &datum);
#endif // USE_ARDUINO
#endif // ARDUINO
} // namespace improv