LivoxProto1: ExecuteHandshake uses udpCommandDemuxer
UdpCommandDemuxer also now supports devices "under construction".
This commit is contained in:
@@ -90,6 +90,18 @@ public:
|
||||
uint8_t smoSubnetNbits;
|
||||
uint16_t dataPort, cmdPort, imuPort;
|
||||
|
||||
// Static collection for devices being constructed (not yet in DeviceManager)
|
||||
// Maps device IP to list of command-specific UDP handlers for that device
|
||||
struct CommandHandler {
|
||||
uint8_t cmd_set;
|
||||
uint8_t cmd_id;
|
||||
std::function<void(
|
||||
const uint8_t* data, ssize_t bytesReceived,
|
||||
const struct sockaddr_in& senderAddr)> handler;
|
||||
};
|
||||
static std::unordered_map<std::string, std::vector<CommandHandler>>
|
||||
devicesUnderConstruction;
|
||||
|
||||
private:
|
||||
// Heartbeat mechanism
|
||||
void startHeartbeat();
|
||||
@@ -162,8 +174,11 @@ public:
|
||||
uint8_t cmd_set, uint8_t cmd_id,
|
||||
std::function<void(
|
||||
const uint8_t* data, ssize_t bytesReceived,
|
||||
const struct sockaddr_in& senderAddr)> handler);
|
||||
void unregisterUdpCommandHandler(uint8_t cmd_set, uint8_t cmd_id);
|
||||
const struct sockaddr_in& senderAddr)> handler,
|
||||
const std::string& deviceIP = "");
|
||||
|
||||
void unregisterUdpCommandHandler(
|
||||
uint8_t cmd_set, uint8_t cmd_id, const std::string& deviceIP = "");
|
||||
|
||||
private:
|
||||
// Point cloud data setup
|
||||
|
||||
Reference in New Issue
Block a user