Skip to content

Commit

Permalink
windows/serialInterface: Added a call to read out the serial state no…
Browse files Browse the repository at this point in the history
…tification when we start comms
  • Loading branch information
dragonmux committed Oct 31, 2023
1 parent b2baeff commit 2e91c56
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/windows/serialInterface.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@ serialInterface_t::serialInterface_t(const usbDevice_t &usbDevice) : device
timeouts.WriteTotalTimeoutMultiplier = 10;
if (!SetCommTimeouts(device, &timeouts))
handleDeviceError("set communications timeouts for device"sv);

// Having adjusted the line state, try to do a read of the serial state notification which will be sat in the buffer
std::array<uint8_t, 10U> serialState{};
static_cast<void>(ReadFile(device, serialState.data(), serialState.size(), nullptr, nullptr));
}

serialInterface_t::~serialInterface_t() noexcept
Expand Down

0 comments on commit 2e91c56

Please sign in to comment.