Skip to content

Commit cbd6066

Browse files
committed
MQTT now using NetworkClientSecure
1 parent bcf37d5 commit cbd6066

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

Firmware/RTK_Everywhere/Network.ino

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,20 @@ IPAddress networkGetIpAddress(uint8_t networkType)
476476
return IPAddress((uint32_t)0);
477477
}
478478

479+
//----------------------------------------
480+
// Get the network type
481+
//----------------------------------------
482+
uint8_t networkGetActiveType()
483+
{
484+
NETWORK_DATA *network;
485+
uint8_t type;
486+
487+
type = network->type;
488+
if (type == NETWORK_TYPE_USE_DEFAULT)
489+
type = NETWORK_TYPE_ETHERNET;
490+
return type;
491+
}
492+
479493
//----------------------------------------
480494
// Get the network type
481495
//----------------------------------------

Firmware/RTK_Everywhere/RTK_Everywhere.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
#define NTRIP_SERVER_MAX 4
7171

7272
#include <NetworkClient.h>
73+
#include <NetworkClientSecure.h>
7374
#include <NetworkUdp.h>
7475

7576
#ifdef COMPILE_ETHERNET

Firmware/RTK_Everywhere/menuPP.ino

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ ZtpResponse pointperfectTryZtpToken(JsonDocument &apiPost)
449449
JsonDocument *jsonZtp = nullptr;
450450
char *tempHolderPtr = nullptr;
451451

452-
WiFiClientSecure client;
452+
NetworkClientSecure client;
453453
client.setCACert(AWS_PUBLIC_CERT);
454454

455455
String json;
@@ -815,7 +815,7 @@ bool pointperfectUpdateKeys()
815815
#ifdef COMPILE_WIFI
816816
char *certificateContents = nullptr; // Holds the contents of the keys prior to MQTT connection
817817
char *keyContents = nullptr;
818-
WiFiClientSecure secureClient;
818+
NetworkClientSecure secureClient;
819819
bool gotKeys = false;
820820
menuppMqttClient = nullptr;
821821

@@ -1395,7 +1395,7 @@ void beginLBand()
13951395
LBandFreq = Regional_Information_Table[settings.geographicRegion].frequency;
13961396
if (settings.debugCorrections == true)
13971397
systemPrintf("No fix available for L-Band geographic region determination. Using %s (%dHz)\r\n", Regional_Information_Table[settings.geographicRegion].name, LBandFreq);
1398-
}
1398+
}
13991399

14001400
bool response = true;
14011401
response &= i2cLBand.newCfgValset();
@@ -1537,7 +1537,8 @@ void menuPointPerfect()
15371537
}
15381538
else if (incoming == 3 && pointPerfectIsEnabled())
15391539
{
1540-
if (wifiNetworkCount() == 0)
1540+
if ((networkGetActiveType() == NETWORK_TYPE_WIFI)
1541+
&& (wifiNetworkCount() == 0))
15411542
{
15421543
systemPrintln("Error: Please enter at least one SSID before getting keys");
15431544
}

0 commit comments

Comments
 (0)