mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Fixed wait check in device online/offline
This commit is contained in:
@@ -21,9 +21,26 @@ public:
|
||||
|
||||
static void ResetInstance();
|
||||
|
||||
void downgradeErrorsOnCurrentThread();
|
||||
// If this thread is not in the map, add it to be ignored
|
||||
// If it is, set it to be ignored
|
||||
void downgradeErrorsOnCurrentThread() {
|
||||
std::lock_guard<std::mutex> lk(downgradedThreadsMutex);
|
||||
auto i = downgradedThreads.find(std::this_thread::get_id());
|
||||
if(i != downgradedThreads.end()) {
|
||||
i->second = true;
|
||||
} else {
|
||||
downgradedThreads.insert({std::this_thread::get_id(), true});
|
||||
}
|
||||
}
|
||||
|
||||
void cancelErrorDowngradingOnCurrentThread();
|
||||
// If this thread exists in the map, turn off downgrading
|
||||
void cancelErrorDowngradingOnCurrentThread() {
|
||||
std::lock_guard<std::mutex> lk(downgradedThreadsMutex);
|
||||
auto i = downgradedThreads.find(std::this_thread::get_id());
|
||||
if(i != downgradedThreads.end()) {
|
||||
i->second = false;
|
||||
}
|
||||
}
|
||||
|
||||
int addEventCallback(const EventCallback &cb);
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ enum class Command : uint8_t {
|
||||
//GetSettings = 0xA5, // Previously known as RED_CMD_READ_BAUD_REQ, now unused
|
||||
SaveSettings = 0xA6,
|
||||
SetDefaultSettings = 0xA8, // Follow up with SaveSettings to write to EEPROM
|
||||
RequestStatusUpdate = 0xBC,
|
||||
ReadSettings = 0xC7, // Previously known as 3G_READ_SETTINGS_EX
|
||||
UpdateLEDState = 0xA7
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user