mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Wait on the correct netid for the correct time for serial numbers
Serial number decoding not implemented yet
This commit is contained in:
@@ -85,7 +85,7 @@ bool Communication::getSettingsSync(std::vector<uint8_t>& data, std::chrono::mil
|
||||
|
||||
bool Communication::getSerialNumberSync(std::string& serial, std::chrono::milliseconds timeout) {
|
||||
sendCommand(Command::RequestSerialNumber);
|
||||
std::shared_ptr<Message> msg = waitForMessageSync(MessageFilter(Network::NetID::Main51), timeout);
|
||||
std::shared_ptr<Message> msg = waitForMessageSync(MessageFilter(Network::NetID::RED_OLDFORMAT), timeout);
|
||||
if(!msg)
|
||||
return false;
|
||||
|
||||
@@ -95,6 +95,7 @@ bool Communication::getSerialNumberSync(std::string& serial, std::chrono::millis
|
||||
if(i % 16 == 15)
|
||||
std::cout << std::endl;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
int Communication::addMessageCallback(const MessageCallback& cb) {
|
||||
|
||||
@@ -37,12 +37,12 @@ public:
|
||||
};
|
||||
virtual bool sendCommand(Command cmd, bool boolean) { return sendCommand(cmd, std::vector<uint8_t>({ (uint8_t)boolean })); }
|
||||
virtual bool sendCommand(Command cmd, std::vector<uint8_t> arguments = {});
|
||||
bool getSettingsSync(std::vector<uint8_t>& data, std::chrono::milliseconds timeout = std::chrono::milliseconds(10));
|
||||
bool getSerialNumberSync(std::string& serial, std::chrono::milliseconds timeout = std::chrono::milliseconds(10));
|
||||
bool getSettingsSync(std::vector<uint8_t>& data, std::chrono::milliseconds timeout = std::chrono::milliseconds(50));
|
||||
bool getSerialNumberSync(std::string& serial, std::chrono::milliseconds timeout = std::chrono::milliseconds(50));
|
||||
|
||||
int addMessageCallback(const MessageCallback& cb);
|
||||
bool removeMessageCallback(int id);
|
||||
std::shared_ptr<Message> waitForMessageSync(MessageFilter f = MessageFilter(), std::chrono::milliseconds timeout = std::chrono::milliseconds(10));
|
||||
std::shared_ptr<Message> waitForMessageSync(MessageFilter f = MessageFilter(), std::chrono::milliseconds timeout = std::chrono::milliseconds(50));
|
||||
|
||||
void setAlign16Bit(bool enable) { align16bit = enable; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user