Skip to content

Commit

Permalink
get current port state before update
Browse files Browse the repository at this point in the history
  • Loading branch information
dadecoza authored Dec 17, 2024
1 parent be7aa40 commit 9c9a76e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions meshtastic.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,13 @@ int mt_connect(MeshtasticAccount *mta, char *port, enum connection_type type)
return 1;
}
DCB state = {0};
success = GetCommState(mta->handle, &state);
if (!success)
{
purple_debug_error(PROTO_NAME, "Failed to get port state\n");
CloseHandle(mta->handle);
return 1;
}
state.DCBlength = sizeof(DCB);
state.BaudRate = 115200;
state.ByteSize = 8;
Expand Down

0 comments on commit 9c9a76e

Please sign in to comment.