Skip to content

Commit

Permalink
[InertialSense] Reconnect after failure with delay
Browse files Browse the repository at this point in the history
  • Loading branch information
FloopCZ authored and honzov committed Apr 3, 2024
1 parent ad111cf commit d4626a1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/InertialSense.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#include "ISBootloaderDFU.h"
#endif

#include <chrono>
#include <thread>

using namespace std;

static int staticSendData(CMHANDLE cmHandle, int pHandle, unsigned char* buf, int len)

Check warning on line 27 in src/InertialSense.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter

src/InertialSense.cpp:27:12 [modernize-use-trailing-return-type]

use a trailing return type for this function
Expand Down Expand Up @@ -501,6 +504,7 @@ bool InertialSense::UpdateClient()
{
CloseServerConnection();
m_clientStreamReconnector = std::async(std::launch::async, [this]() {
std::this_thread::sleep_for(std::chrono::milliseconds{IS_SOCKET_DEFAULT_TIMEOUT_MS});
return cISClient::OpenConnectionToServer(m_clientConnectionString, &m_forwardGpgga);
});
return false;
Expand Down

0 comments on commit d4626a1

Please # to comment.