Skip to content

Commit 2906d68

Browse files
committed
Compile successfully when commenting out COMPILE_NETWORK
1 parent dfee191 commit 2906d68

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

Firmware/RTK_Everywhere/menuPP.ino

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "mbedtls/ssl.h" //Needed for certificate validation
2+
#include "mbedtls/ctr_drbg.h"
23

34
//----------------------------------------
45
// Locals - compiled out
@@ -806,11 +807,11 @@ void erasePointperfectCredentials()
806807
// Subscribe to MQTT channel, grab keys, then stop
807808
bool pointperfectUpdateKeys()
808809
{
809-
#ifdef COMPILE_WIFI
810+
bool gotKeys = false;
811+
#ifdef COMPILE_NETWORK
810812
char *certificateContents = nullptr; // Holds the contents of the keys prior to MQTT connection
811813
char *keyContents = nullptr;
812814
NetworkClientSecure secureClient;
813-
bool gotKeys = false;
814815
menuppMqttClient = nullptr;
815816

816817
do
@@ -940,16 +941,14 @@ bool pointperfectUpdateKeys()
940941
free(certificateContents);
941942

942943
// Return the key status
944+
#endif // COMPILE_NETWORK
943945
return (gotKeys);
944-
#else // COMPILE_WIFI
945-
return (false);
946-
#endif // COMPILE_WIFI
947946
}
948947

949948
// Called when a subscribed to message arrives
950949
void mqttCallback(int messageSize)
951950
{
952-
#ifdef COMPILE_WIFI
951+
#ifdef COMPILE_NETWORK
953952
static uint32_t messageLength = 0;
954953
static byte *message = nullptr;
955954

@@ -1040,7 +1039,7 @@ void mqttCallback(int messageSize)
10401039

10411040
mqttMessageReceived = true;
10421041
} while (0);
1043-
#endif // COMPILE_WIFI
1042+
#endif // COMPILE_NETWORK
10441043
}
10451044

10461045
// Get a date from a user
@@ -1494,6 +1493,7 @@ void menuPointPerfect()
14941493

14951494
if (pointPerfectIsEnabled())
14961495
{
1496+
#ifdef COMPILE_NETWORK
14971497
systemPrint("2) Toggle Auto Key Renewal: ");
14981498
if (settings.autoKeyRenewal == true)
14991499
systemPrintln("Enabled");
@@ -1504,6 +1504,7 @@ void menuPointPerfect()
15041504
systemPrintln("3) Provision Device");
15051505
else
15061506
systemPrintln("3) Update Keys");
1507+
#endif // COMPILE_NETWORK
15071508

15081509
systemPrintln("4) Show device ID");
15091510

@@ -1525,6 +1526,7 @@ void menuPointPerfect()
15251526
restartRover = true; // Require a rover restart to enable / disable RTCM for PPL
15261527
}
15271528

1529+
#ifdef COMPILE_NETWORK
15281530
else if (incoming == 2 && pointPerfectIsEnabled())
15291531
{
15301532
settings.autoKeyRenewal ^= 1;
@@ -1581,6 +1583,7 @@ void menuPointPerfect()
15811583

15821584
WIFI_STOP();
15831585
}
1586+
#endif // COMPILE_NETWORK
15841587
else if (incoming == 4 && pointPerfectIsEnabled())
15851588
{
15861589
char hardwareID[15];

Firmware/RTK_Everywhere/settings.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,8 @@ enum WiFiState
316316
};
317317
volatile byte wifiState = WIFI_STATE_OFF;
318318

319+
#ifdef COMPILE_NETWORK
320+
319321
#include "RTKNetworkClient.h" // Built-in - Supports both WiFiClient and EthernetClient
320322
#include "RTKNetworkUDP.h" //Built-in - Supports both WiFiUdp and EthernetUdp
321323

@@ -349,6 +351,8 @@ typedef struct _NTRIP_SERVER_DATA
349351
uint32_t previousMilliseconds;
350352
} NTRIP_SERVER_DATA;
351353

354+
#endif // COMPILE_NETWORK
355+
352356
typedef enum
353357
{
354358
ESPNOW_OFF,

0 commit comments

Comments
 (0)