1
0

update cmd client

This commit is contained in:
2026-01-08 19:37:25 +08:00
parent 64368b7837
commit 7b22dfb66b
13 changed files with 105 additions and 93 deletions

View File

@@ -10,9 +10,9 @@ namespace basalt::presenter::cmd_client {
HANDSHAKE_RESPONSE = 0x62, ///< Presenter -> Trainer
DATA_READY = 0x01, ///< Presenter -> Trainer
DATA_RECEIVED = 0x02, ///< Trainer -> Presenter
ACTIVELY_STOP = 0x21, ///< Presenter-->Trainer
STOP_REQUEST = 0X71, ///< Presenter<--Trainer
STOP_RESPONSE = 0x72, //< Presenter-->Trainer
ACTIVELY_STOP = 0x21, ///< Presenter-->Trainer
STOP_REQUEST = 0X71, ///< Presenter<--Trainer
STOP_RESPONSE = 0x72, ///< Presenter-->Trainer
};
// Pixel kind values
@@ -32,26 +32,26 @@ namespace basalt::presenter::cmd_client {
#pragma pack(pop)
// Status
enum class ClientStatus {
enum class CmdClientStatus {
Ready,
Running,
Stop,
};
class CommandClient {
class CmdClient {
public:
CommandClient();
~CommandClient();
CmdClient();
~CmdClient();
public:
// Wait for handshake from Trainer, send response with data properties
HandshakePayload WaitHandshake();
HandshakePayload wait_handshake();
// Tick function called every frame to send data ready and wait for response
bool Tick(bool actively_stop = false);
bool tick(bool actively_stop = false);
private:
Shared::PipeOperator m_PipeOperator;
ClientStatus m_Status;
shared::pipe_operator::PipeOperator m_PipeOperator;
CmdClientStatus m_Status;
};
} // namespace Basalt::Presenter
} // namespace basalt::presenter::cmd_client