Cleanup for release

This commit is contained in:
2026-03-31 23:09:11 -04:00
parent 5bcd57a5c4
commit 78bc3b4b33
34 changed files with 2263 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
//
// Created by Johnathon Slightham on 2026-02-16.
//
#ifndef NEW_DEV_TOOLS_REMOTECONFIG_H
#define NEW_DEV_TOOLS_REMOTECONFIG_H
#include <cstdint>
#include <string>
#include "libcontrol.h"
#include "flatbuffers_generated/RobotModule_generated.h"
class RemoteConfig {
public:
RemoteConfig(std::shared_ptr<RobotController> controller) : m_robot_controller(controller) {}
bool set_module_id(uint8_t current_module_id, uint16_t new_module_id);
bool set_module_type(uint8_t module_id, ModuleType module_type);
bool set_wifi_ssid(uint8_t module_id, const std::string& ssid);
bool set_wifi_password(uint8_t module_id, const std::string& password);
bool set_communication_method(uint8_t module_id, uint8_t communication_method); // only option is 0 (wireless)
void restart(uint8_t module_id);
private:
std::shared_ptr<RobotController> m_robot_controller;
};
#endif //NEW_DEV_TOOLS_REMOTECONFIG_H

View File

@@ -0,0 +1,24 @@
//
// Created by Johnathon Slightham on 2026-02-16.
//
#ifndef NEW_DEV_TOOLS_REMOTEDEBUGGING_H
#define NEW_DEV_TOOLS_REMOTEDEBUGGING_H
#include <cstdint>
#include <string>
#include "libcontrol.h"
class RemoteDebugging {
public:
RemoteDebugging(std::shared_ptr<RobotController> controller) : m_robot_controller(controller) {}
std::string get_task_manager(uint8_t module_id);
std::string get_logs(uint8_t module_id);
std::string get_coredump(uint8_t module_id);
private:
std::shared_ptr<RobotController> m_robot_controller;
};
#endif //NEW_DEV_TOOLS_REMOTEDEBUGGING_H

View File

@@ -0,0 +1,40 @@
//
// Created by Johnathon Slightham on 2026-02-16.
//
#ifndef REMOTEMANAGEMENT_H
#define REMOTEMANAGEMENT_H
#include <cstdint>
#include <fstream>
#include <memory>
#include "flatbuffers/OTAPacketBuilder.h"
#include "libcontrol.h"
class RemoteManagement {
public:
RemoteManagement(uint8_t module_id, const std::string &path,
std::shared_ptr<RobotController> controller)
: m_module_id(module_id), m_file(path, std::ios::binary),
m_builder(std::make_unique<Flatbuffers::OTAPacketBuilder>()),
m_robot_controller(controller) {
}
bool perform_ota();
double ota_progress(); // 0 to 1 representing % progress.
void restart();
private:
bool start_ota();
bool write_ota(std::vector<uint8_t> &transmit_buffer);
bool ota_end();
uint16_t m_sequence_num = 0;
uint16_t m_total_packets = 0;
uint8_t m_module_id;
std::ifstream m_file;
std::unique_ptr<Flatbuffers::OTAPacketBuilder> m_builder;
std::shared_ptr<RobotController> m_robot_controller;
};
#endif // REMOTEMANAGEMENT_H