Skip to content

Commit

Permalink
increased read timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
dadecoza committed Dec 7, 2024
1 parent a3b02af commit 7bb398e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion meshtastic.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ int mt_connect(MeshtasticAccount *mta, char *port, enum connection_type type)

// Configure read and write operations to time out after 100 ms.
COMMTIMEOUTS timeouts = {0};
timeouts.ReadIntervalTimeout = 10;
timeouts.ReadIntervalTimeout = MAXDWORD;
timeouts.ReadTotalTimeoutConstant = 0;
timeouts.ReadTotalTimeoutMultiplier = 0;
timeouts.WriteTotalTimeoutConstant = 10;
Expand All @@ -143,6 +143,13 @@ int mt_connect(MeshtasticAccount *mta, char *port, enum connection_type type)
CloseHandle(mta->handle);
return 1;
}
success = FlushFileBuffers(mta->handle);
if (!success)
{
purple_debug_error(PROTO_NAME, "Failed to flush handle buffers\n");
CloseHandle(mta->handle);
return 1;
}
mta->mt_handle_timeout = purple_timeout_add(100, (GSourceFunc)mt_read_handle, mta);
return 0;
#endif
Expand Down

0 comments on commit 7bb398e

Please sign in to comment.