Skip to content

Commit 5721bee

Browse files
authored
Merge pull request #342 from LeeLeahy2/wifi
Switch RTKNetworkClient to use NetworkClient instead of Client
2 parents 4a16193 + a9af60c commit 5721bee

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Firmware/RTK_Everywhere/RTKNetworkClient.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33

44
extern uint8_t networkGetType(uint8_t user);
55

6-
class RTKNetworkClient : public Client
6+
class RTKNetworkClient : public NetworkClient
77
{
88
protected:
9-
Client *_client; // Ethernet or WiFi client
9+
NetworkClient *_client; // Ethernet or WiFi client
1010
bool _friendClass;
1111
uint8_t _networkType;
1212

1313
public:
1414
//------------------------------
1515
// Create the network client
1616
//------------------------------
17-
RTKNetworkClient(Client *client, uint8_t networkType)
17+
RTKNetworkClient(NetworkClient *client, uint8_t networkType)
1818
{
1919
_friendClass = true;
2020
_networkType = networkType;
@@ -31,7 +31,7 @@ class RTKNetworkClient : public Client
3131
else
3232
#endif // COMPILE_ETHERNET
3333
#if defined(COMPILE_WIFI)
34-
_client = new WiFiClient;
34+
_client = new NetworkClient;
3535
#else // COMPILE_WIFI
3636
_client = nullptr;
3737
#endif // COMPILE_WIFI
@@ -165,7 +165,7 @@ class RTKNetworkClient : public Client
165165
#endif // COMPILE_ETHERNET
166166
#if defined(COMPILE_WIFI)
167167
if (_networkType == NETWORK_TYPE_WIFI)
168-
return ((WiFiClient *)_client)->remoteIP();
168+
return ((NetworkClient *)_client)->remoteIP();
169169
#endif // COMPILE_WIFI
170170
return IPAddress((uint32_t)0);
171171
}
@@ -182,7 +182,7 @@ class RTKNetworkClient : public Client
182182
#endif // COMPILE_ETHERNET
183183
#if defined(COMPILE_WIFI)
184184
if (_networkType == NETWORK_TYPE_WIFI)
185-
return ((WiFiClient *)_client)->remotePort();
185+
return ((NetworkClient *)_client)->remotePort();
186186
#endif // COMPILE_WIFI
187187
return 0;
188188
}
@@ -266,7 +266,7 @@ class NetworkEthernetClient : public RTKNetworkClient
266266
class NetworkWiFiClient : public RTKNetworkClient
267267
{
268268
protected:
269-
WiFiClient _client;
269+
NetworkClient _client;
270270

271271
public:
272272
NetworkWiFiClient() : RTKNetworkClient(&_client, NETWORK_TYPE_WIFI)
@@ -286,7 +286,7 @@ class NetworkWiFiClient : public RTKNetworkClient
286286
class NetworkSecureWiFiClient : public RTKNetworkClient
287287
{
288288
protected:
289-
WiFiClientSecure _client;
289+
NetworkClientSecure _client;
290290

291291
public:
292292
NetworkSecureWiFiClient() : _client{WiFiClientSecure()}, RTKNetworkClient(&_client, NETWORK_TYPE_WIFI)
@@ -302,7 +302,7 @@ class NetworkSecureWiFiClient : public RTKNetworkClient
302302
this->~RTKNetworkClient();
303303
}
304304

305-
WiFiClientSecure *getClient()
305+
NetworkClientSecure *getClient()
306306
{
307307
return &_client;
308308
}

0 commit comments

Comments
 (0)