// // Created by Johnathon Slightham on 2026-02-16. // #ifndef REMOTEMANAGEMENT_H #define REMOTEMANAGEMENT_H #include #include #include #include "flatbuffers/OTAPacketBuilder.h" #include "libcontrol.h" class RemoteManagement { public: RemoteManagement(uint8_t module_id, const std::string &path, std::shared_ptr controller) : m_module_id(module_id), m_file(path, std::ios::binary), m_builder(std::make_unique()), 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 &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 m_builder; std::shared_ptr m_robot_controller; }; #endif // REMOTEMANAGEMENT_H