mirror of
https://github.com/BotChain-Robots/firmware.git
synced 2026-07-08 17:47:21 +02:00
Cleanup rpc interfaces
This commit is contained in:
@@ -12,19 +12,15 @@
|
||||
class LoopManager {
|
||||
public:
|
||||
LoopManager() : m_config_manager(ConfigManager::get_instance()),
|
||||
m_messaging_interface(std::make_unique<MessagingInterface>(std::make_unique<WifiManager>())) {}
|
||||
[[noreturn]] void control_loop() const;
|
||||
[[noreturn]] static void metadata_tx_loop(char * args);
|
||||
[[noreturn]] static void metadata_rx_loop(char * args);
|
||||
m_messaging_interface(std::make_unique<MessagingInterface>()) {}
|
||||
[[noreturn]] void control_loop() const; // gets control commands
|
||||
[[noreturn]] void sensor_loop() const; // sends sensor data commands continually
|
||||
[[noreturn]] static void metadata_tx_loop(char * args); // sends metadata continually (low duty cycle)
|
||||
[[noreturn]] static void metadata_rx_loop(char * args); // gets other commands from PC (ie. f/w updates, nvs updates)
|
||||
|
||||
private:
|
||||
ConfigManager& m_config_manager;
|
||||
std::unique_ptr<MessagingInterface> m_messaging_interface;
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif //LOOPMANAGER_H
|
||||
|
||||
14
main/include/control/ISensor.h
Normal file
14
main/include/control/ISensor.h
Normal file
@@ -0,0 +1,14 @@
|
||||
//
|
||||
// Created by Johnathon Slightham on 2025-10-16.
|
||||
//
|
||||
|
||||
#ifndef ISENSOR_H
|
||||
#define ISENSOR_H
|
||||
|
||||
class ISensor {
|
||||
public:
|
||||
virtual ~ISensor() {}
|
||||
virtual void get_reading() = 0; // todo: return a flatbuffer object
|
||||
};
|
||||
|
||||
#endif //ISENSOR_H
|
||||
13
main/include/control/SensorFactory.h
Normal file
13
main/include/control/SensorFactory.h
Normal file
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// Created by Johnathon Slightham on 2025-10-16.
|
||||
//
|
||||
|
||||
#ifndef SENSORFACTORY_H
|
||||
#define SENSORFACTORY_H
|
||||
|
||||
class SensorFactory {
|
||||
public:
|
||||
static std::unique_ptr<ISensor> create_sensor(ModuleType type);
|
||||
};
|
||||
|
||||
#endif //SENSORFACTORY_H
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#include <cstdint>
|
||||
#include "IActuator.h"
|
||||
#include "ISensor.h"
|
||||
|
||||
class Servo1Actuator final : public IActuator {
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user