203#define strncpy(x, y, z) strncpy_s(x, sizeof(x), y, sizeof(x)-1)
204#define strncat strncat_s
205
206#endif
207
208// Modifications for MiNGW32 compiler
209#ifdef MINGW
210
211// Replace "safe" versions of sprintf
212#define sprintf_s snprintf
213
214// seems some MINGW versions don't have a errno_t
215#ifndef errno_t
216#define errno_t int
217#endif
218
219#define fopen_s fopen
220
221#endif
222
223//#define MAX_TRIES 3 // Retry sends up to 3 times
224#define MAX_TRIES 1 // set this to one, as I believe now that a ACK failure is indication that the device is offline, hence additional attempts will not work.
225#define MAX_MAX_TRIES 7 // Don't exceed this retry limit
226#define ACK_TIMEOUT 1000 // How long to wait for an ACK