Communicator banner + single char commands
This commit is contained in:
+12
-1
@@ -12,6 +12,7 @@ struct transport_callbacks {
|
||||
virtual void on_connected(transport*) = 0;
|
||||
virtual void on_disconnected(transport*) = 0;
|
||||
virtual void on_line_received(std::string line, transport* ) = 0;
|
||||
virtual void on_banner(std::string version, transport* ) = 0;
|
||||
};
|
||||
|
||||
struct transport {
|
||||
@@ -28,6 +29,14 @@ struct tcp_transport : public transport {
|
||||
void close() override;
|
||||
void send(std::string line) override;
|
||||
|
||||
void request_realtime_report();
|
||||
|
||||
void request_cycle_start();
|
||||
|
||||
void request_feed_hold();
|
||||
|
||||
void parser_state_report();
|
||||
|
||||
private:
|
||||
|
||||
void worker();
|
||||
@@ -40,7 +49,9 @@ private:
|
||||
std::thread live_check_thread;
|
||||
std::queue<std::string> send_queue;
|
||||
volatile bool should_quit = false;
|
||||
bool is_empty_line(std::string line);
|
||||
static bool is_empty_line(const std::string& line);
|
||||
|
||||
void send_single_char_command(uint8_t data) const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user