Minor cleanup

This commit is contained in:
2022-07-08 16:56:32 -07:00
parent a9eb47debe
commit 3c154a7679
4 changed files with 68 additions and 41 deletions

View File

@ -219,4 +219,13 @@ bool Ergodox::read() {
// Simple connectivity check
void Ergodox::test_connection() {
write(CMD_RUTHERE, NULL, 0);
}
// Block until a connection is established.
void Ergodox::connect_loop() {
wprintf(L"Trying to connect...\n");
while (!connected) {
try_connect();
std::this_thread::sleep_for(std::chrono::milliseconds(RECONNECT_SLEEP_MS));
}
}