Skip to content

Commit edbb779

Browse files
committed
Add lots of ifdef/ifndef statements
Signed-off-by: Sara Damiano <sdamiano@stroudcenter.org>
1 parent 40ae099 commit edbb779

36 files changed

+472
-15
lines changed

src/TinyGsmBattery.tpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111

1212
#include "TinyGsmCommon.h"
1313

14+
#ifndef TINY_GSM_MODEM_HAS_BATTERY
1415
#define TINY_GSM_MODEM_HAS_BATTERY
16+
#endif
1517

1618
template <class modemType>
1719
class TinyGsmBattery {

src/TinyGsmBluetooth.tpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111

1212
#include "TinyGsmCommon.h"
1313

14+
#ifndef TINY_GSM_MODEM_HAS_BLUETOOTH
1415
#define TINY_GSM_MODEM_HAS_BLUETOOTH
16+
#endif
1517

1618
template <class modemType>
1719
class TinyGsmBluetooth {

src/TinyGsmCalling.tpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111

1212
#include "TinyGsmCommon.h"
1313

14+
#ifndef TINY_GSM_MODEM_HAS_CALLING
1415
#define TINY_GSM_MODEM_HAS_CALLING
16+
#endif
1517

1618
template <class modemType>
1719
class TinyGsmCalling {

src/TinyGsmClient.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,28 +103,24 @@ typedef TinyGsmMC60 TinyGsm;
103103
typedef TinyGsmMC60::GsmClientMC60 TinyGsmClient;
104104

105105
#elif defined(TINY_GSM_MODEM_ESP32)
106-
#define TINY_GSM_MODEM_HAS_WIFI
107106
#include "TinyGsmClientESP32.h"
108107
typedef TinyGsmESP32 TinyGsm;
109108
typedef TinyGsmESP32::GsmClientESP32 TinyGsmClient;
110109
typedef TinyGsmESP32::GsmClientSecureESP32 TinyGsmClientSecure;
111110

112111
#elif defined(TINY_GSM_MODEM_ESP8266)
113-
#define TINY_GSM_MODEM_HAS_WIFI
114112
#include "TinyGsmClientESP8266.h"
115113
typedef TinyGsmESP8266 TinyGsm;
116114
typedef TinyGsmESP8266::GsmClientESP8266 TinyGsmClient;
117115
typedef TinyGsmESP8266::GsmClientSecureESP8266 TinyGsmClientSecure;
118116

119117
#elif defined(TINY_GSM_MODEM_ESP8266_NONOS)
120-
#define TINY_GSM_MODEM_HAS_WIFI
121118
#include "TinyGsmClientESP8266NonOS.h"
122119
typedef TinyGsmESP8266NonOS TinyGsm;
123120
typedef TinyGsmESP8266NonOS::GsmClientESP8266NonOS TinyGsmClient;
124121
typedef TinyGsmESP8266NonOS::GsmClientSecureESP8266NonOS TinyGsmClientSecure;
125122

126123
#elif defined(TINY_GSM_MODEM_XBEE)
127-
#define TINY_GSM_MODEM_HAS_WIFI
128124
#include "TinyGsmClientXBee.h"
129125
typedef TinyGsmXBee TinyGsm;
130126
typedef TinyGsmXBee::GsmClientXBee TinyGsmClient;

src/TinyGsmClientA6.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,30 @@
1212

1313
// #define TINY_GSM_DEBUG Serial
1414

15+
#ifdef TINY_GSM_MUX_COUNT
16+
#undef TINY_GSM_MUX_COUNT
17+
#endif
1518
#define TINY_GSM_MUX_COUNT 8
19+
#ifdef TINY_GSM_SEND_MAX_SIZE
20+
#undef TINY_GSM_SEND_MAX_SIZE
21+
#endif
1622
#define TINY_GSM_SEND_MAX_SIZE 1024
1723
// CIPSEND accepts up to 1024 bytes of input
24+
#ifdef TINY_GSM_BUFFER_READ_AND_CHECK_SIZE
25+
#undef TINY_GSM_BUFFER_READ_AND_CHECK_SIZE
26+
#endif
27+
#ifdef TINY_GSM_BUFFER_READ_NO_CHECK
28+
#undef TINY_GSM_BUFFER_READ_NO_CHECK
29+
#endif
30+
#ifndef TINY_GSM_NO_MODEM_BUFFER
1831
#define TINY_GSM_NO_MODEM_BUFFER
32+
#endif
33+
#ifdef TINY_GSM_MUX_STATIC
34+
#undef TINY_GSM_MUX_STATIC
35+
#endif
36+
#ifndef TINY_GSM_MUX_DYNAMIC
1937
#define TINY_GSM_MUX_DYNAMIC
38+
#endif
2039
#ifdef AT_NL
2140
#undef AT_NL
2241
#endif

src/TinyGsmClientA7672x.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@
1212
// #define TINY_GSM_DEBUG Serial
1313
// #define TINY_GSM_USE_HEX
1414

15+
#ifdef TINY_GSM_MUX_COUNT
16+
#undef TINY_GSM_MUX_COUNT
17+
#endif
1518
#define TINY_GSM_MUX_COUNT 10
19+
#ifdef TINY_GSM_SECURE_MUX_COUNT
20+
#undef TINY_GSM_SECURE_MUX_COUNT
21+
#endif
1622
#define TINY_GSM_SECURE_MUX_COUNT 2
1723
// supports 10 TCP sockets or 2 SSL
1824
// SRGD Note: I think these two numbers are independent of each other and
@@ -21,6 +27,9 @@
2127
// application on the module.
2228
// TODO(?) Could someone who has this module test this?
2329

30+
#ifdef TINY_GSM_SEND_MAX_SIZE
31+
#undef TINY_GSM_SEND_MAX_SIZE
32+
#endif
2433
#define TINY_GSM_SEND_MAX_SIZE 1500
2534
// CCHSEND can handle up to 2048 bytes of input, but CIPSEND will only accept
2635
// 1500, so we'll take the smaller number
@@ -30,8 +39,21 @@
3039
// The SSL context is collection of SSL settings, not the connection identifier.
3140
// This library always uses SSL context 0.
3241

42+
#ifdef TINY_GSM_NO_MODEM_BUFFER
43+
#undef TINY_GSM_NO_MODEM_BUFFER
44+
#endif
45+
#ifdef TINY_GSM_BUFFER_READ_NO_CHECK
46+
#undef TINY_GSM_BUFFER_READ_NO_CHECK
47+
#endif
48+
#ifndef TINY_GSM_BUFFER_READ_AND_CHECK_SIZE
3349
#define TINY_GSM_BUFFER_READ_AND_CHECK_SIZE
50+
#endif
51+
#ifdef TINY_GSM_MUX_DYNAMIC
52+
#undef TINY_GSM_MUX_DYNAMIC
53+
#endif
54+
#ifndef TINY_GSM_MUX_STATIC
3455
#define TINY_GSM_MUX_STATIC
56+
#endif
3557
#ifdef AT_NL
3658
#undef AT_NL
3759
#endif

src/TinyGsmClientBG96.h

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,50 @@
1212

1313
// #define TINY_GSM_DEBUG Serial
1414

15+
#ifdef TINY_GSM_MUX_COUNT
16+
#undef TINY_GSM_MUX_COUNT
17+
#endif
18+
// supports 12 sockets (0-11); any of them can be SSL
1519
#define TINY_GSM_MUX_COUNT 12
16-
#define TINY_GSM_SECURE_MUX_COUNT 12
20+
21+
#ifdef TINY_GSM_SECURE_MUX_COUNT
22+
#undef TINY_GSM_SECURE_MUX_COUNT
23+
#endif
1724
// supports 12 sockets (0-11); any of them can be SSL
25+
#define TINY_GSM_SECURE_MUX_COUNT 12
1826

19-
#define TINY_GSM_SEND_MAX_SIZE 1460
27+
#ifdef TINY_GSM_SEND_MAX_SIZE
28+
#undef TINY_GSM_SEND_MAX_SIZE
29+
#endif
2030
// QISEND and QSSLSEND both accept up to 1460 bytes of input
31+
#define TINY_GSM_SEND_MAX_SIZE 1460
2132

22-
#if !defined(TINY_GSM_CONNECT_TIMEOUT)
23-
#define TINY_GSM_CONNECT_TIMEOUT 150
33+
34+
#ifdef TINY_GSM_CONNECT_TIMEOUT
35+
#undef TINY_GSM_CONNECT_TIMEOUT
2436
#endif
37+
#define TINY_GSM_CONNECT_TIMEOUT 150
2538

2639
// Also supports 6 SSL contexts (0-5)
2740
// The SSL context is collection of SSL settings, not the connection identifier.
2841
// This library always uses SSL context 0.
2942
// #define TINY_GSM_DEFAULT_SSL_CTX 0
3043

44+
#ifdef TINY_GSM_NO_MODEM_BUFFER
45+
#undef TINY_GSM_NO_MODEM_BUFFER
46+
#endif
47+
#ifdef TINY_GSM_BUFFER_READ_NO_CHECK
48+
#undef TINY_GSM_BUFFER_READ_NO_CHECK
49+
#endif
50+
#ifndef TINY_GSM_BUFFER_READ_AND_CHECK_SIZE
3151
#define TINY_GSM_BUFFER_READ_AND_CHECK_SIZE
52+
#endif
53+
#ifdef TINY_GSM_MUX_DYNAMIC
54+
#undef TINY_GSM_MUX_DYNAMIC
55+
#endif
56+
#ifndef TINY_GSM_MUX_STATIC
3257
#define TINY_GSM_MUX_STATIC
58+
#endif
3359
#ifdef AT_NL
3460
#undef AT_NL
3561
#endif

src/TinyGsmClientESP32.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,21 @@
1212

1313
// #define TINY_GSM_DEBUG Serial
1414

15+
#ifdef TINY_GSM_NO_MODEM_BUFFER
16+
#undef TINY_GSM_NO_MODEM_BUFFER
17+
#endif
18+
#ifdef TINY_GSM_BUFFER_READ_NO_CHECK
19+
#undef TINY_GSM_BUFFER_READ_NO_CHECK
20+
#endif
21+
#ifndef TINY_GSM_BUFFER_READ_AND_CHECK_SIZE
1522
#define TINY_GSM_BUFFER_READ_AND_CHECK_SIZE
23+
#endif
24+
#ifdef TINY_GSM_MUX_STATIC
25+
#undef TINY_GSM_MUX_STATIC
26+
#endif
27+
#ifndef TINY_GSM_MUX_DYNAMIC
1628
#define TINY_GSM_MUX_DYNAMIC
29+
#endif
1730

1831
#include "TinyGsmClientEspressif.h"
1932
#include "TinyGsmTCP.tpp"

src/TinyGsmClientESP8266.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,21 @@
1212

1313
// #define TINY_GSM_DEBUG Serial
1414

15+
#ifdef TINY_GSM_BUFFER_READ_AND_CHECK_SIZE
16+
#undef TINY_GSM_BUFFER_READ_AND_CHECK_SIZE
17+
#endif
18+
#ifdef TINY_GSM_BUFFER_READ_NO_CHECK
19+
#undef TINY_GSM_BUFFER_READ_NO_CHECK
20+
#endif
21+
#ifndef TINY_GSM_NO_MODEM_BUFFER
1522
#define TINY_GSM_NO_MODEM_BUFFER
23+
#endif
24+
#ifdef TINY_GSM_MUX_DYNAMIC
25+
#undef TINY_GSM_MUX_DYNAMIC
26+
#endif
27+
#ifndef TINY_GSM_MUX_STATIC
1628
#define TINY_GSM_MUX_STATIC
29+
#endif
1730

1831
#include "TinyGsmClientEspressif.h"
1932
#include "TinyGsmTCP.tpp"

src/TinyGsmClientESP8266NonOS.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,21 @@
1212

1313
// #define TINY_GSM_DEBUG Serial
1414

15+
#ifdef TINY_GSM_BUFFER_READ_AND_CHECK_SIZE
16+
#undef TINY_GSM_BUFFER_READ_AND_CHECK_SIZE
17+
#endif
18+
#ifdef TINY_GSM_BUFFER_READ_NO_CHECK
19+
#undef TINY_GSM_BUFFER_READ_NO_CHECK
20+
#endif
21+
#ifndef TINY_GSM_NO_MODEM_BUFFER
1522
#define TINY_GSM_NO_MODEM_BUFFER
23+
#endif
24+
#ifdef TINY_GSM_MUX_DYNAMIC
25+
#undef TINY_GSM_MUX_DYNAMIC
26+
#endif
27+
#ifndef TINY_GSM_MUX_STATIC
1628
#define TINY_GSM_MUX_STATIC
29+
#endif
1730

1831
#include "TinyGsmClientEspressif.h"
1932
#include "TinyGsmTCP.tpp"
@@ -22,7 +35,9 @@
2235
// management for the non-OS version of the ESP8266 firmware, so we define
2336
// TINY_GSM_MODEM_HAS_SSL here and do no include the SSL module so as not to
2437
// waste space.
38+
#ifndef TINY_GSM_MODEM_HAS_SSL
2539
#define TINY_GSM_MODEM_HAS_SSL
40+
#endif
2641

2742
static uint8_t TINY_GSM_TCP_KEEP_ALIVE = 120;
2843

0 commit comments

Comments
 (0)