Skip to content

Commit

Permalink
updated timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
dadecoza committed Dec 7, 2024
1 parent 89fb86e commit ef330e8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 1 addition & 2 deletions Makefile.mingw
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
include ./nanopb/extra/nanopb.mk

CC ?= gcc
C_FLAGS = -Wall -Werror -g -O2

C_FLAGS = -Wall -Werror -g -O2 -std=c99


# PIDGIN_TREE_TOP := ../pidgin-release-2.x.y
Expand Down
4 changes: 2 additions & 2 deletions meshtastic.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ 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 = MAXDWORD;
timeouts.ReadTotalTimeoutConstant = 0;
timeouts.ReadTotalTimeoutConstant = 100;
timeouts.ReadTotalTimeoutMultiplier = 0;
timeouts.WriteTotalTimeoutConstant = 10;
timeouts.WriteTotalTimeoutConstant = 100;
timeouts.WriteTotalTimeoutMultiplier = 0;

success = SetCommTimeouts(mta->handle, &timeouts);
Expand Down
4 changes: 4 additions & 0 deletions meshtastic.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
# define dngettext(Domain, Singular, Plural, Number) ((Number == 1) ? ((const char *)Singular) : ((const char *)Plural))
#endif

#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif

enum connection_type {
meshtastic_serial_connection,
meshtastic_socket_connection
Expand Down

0 comments on commit ef330e8

Please sign in to comment.