mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-22 10:42:49 +00:00
minor cleanup proposal (#4169)
* MESHTASTIC_EXCLUDE_WIFI and HAS_WIFI cleanup... Our code was checking HAS_WIFI and the new MESHTASTIC_EXCLUDE_WIFI flags in various places (even though EXCLUDE_WIFI forces HAS_WIFI to 0). Instead just check HAS_WIFI, only use EXCLUDE_WIFI inside configuration.h * cleanup: use HAS_NETWORKING instead of HAS_WIFI || HAS_ETHERNET We already had HAS_NETWORKING as flag in MQTT to mean 'we have tcpip'. Generallize that and move it into configuration.h so that we can use it elsewhere. * Use #pragma once, because supported by gcc and all modern compilers instead of #ifdef DOTHFILE_H etc... --------- Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz>
This commit is contained in:
@@ -8,17 +8,15 @@
|
||||
#include "mqtt/JSON.h"
|
||||
#if HAS_WIFI
|
||||
#include <WiFiClient.h>
|
||||
#define HAS_NETWORKING 1
|
||||
#if !defined(ARCH_PORTDUINO)
|
||||
#include <WiFiClientSecure.h>
|
||||
#endif
|
||||
#endif
|
||||
#if HAS_ETHERNET
|
||||
#include <EthernetClient.h>
|
||||
#define HAS_NETWORKING 1
|
||||
#endif
|
||||
|
||||
#ifdef HAS_NETWORKING
|
||||
#if HAS_NETWORKING
|
||||
#include <PubSubClient.h>
|
||||
#endif
|
||||
|
||||
@@ -43,7 +41,7 @@ class MQTT : private concurrency::OSThread
|
||||
#endif
|
||||
|
||||
public:
|
||||
#ifdef HAS_NETWORKING
|
||||
#if HAS_NETWORKING
|
||||
PubSubClient pubSub;
|
||||
#endif
|
||||
MQTT();
|
||||
|
||||
Reference in New Issue
Block a user