Tabs replacment
Aesthetic
This commit is contained in:
+2
-2
@@ -11,7 +11,7 @@
|
||||
#include "BridgeProps.h"
|
||||
|
||||
BridgeProps::BridgeProps(const char* client_id, const char* in_box, const char* out_box, const char* broker, const int port)
|
||||
: Props(client_id, in_box, out_box, broker, port)
|
||||
: Props(client_id, in_box, out_box, broker, port)
|
||||
{
|
||||
_client.setClient(_bridgeClient);
|
||||
}
|
||||
@@ -23,7 +23,7 @@ void BridgeProps::begin(void(*on_message)(String))
|
||||
|
||||
void BridgeProps::setBrokerIpAddress(IPAddress ip, uint16_t port)
|
||||
{
|
||||
_brokerIpAddress = ip;
|
||||
_brokerIpAddress = ip;
|
||||
_client.setServer(_brokerIpAddress, port);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ class BridgeProps : public Props
|
||||
public:
|
||||
BridgeProps(const char*, const char*, const char*, const char*, const int);
|
||||
void begin(void(*)(String) = NULL);
|
||||
void setBrokerIpAddress(IPAddress, uint16_t port = 1883);
|
||||
void setBrokerIpAddress(IPAddress, uint16_t port = 1883);
|
||||
|
||||
private:
|
||||
BridgeClient _bridgeClient;
|
||||
|
||||
@@ -11,12 +11,12 @@
|
||||
#include "EthernetProps.h"
|
||||
|
||||
EthernetProps::EthernetProps(const char* client_id, const char* in_box, const char* out_box, const char* broker, const int port)
|
||||
: Props(client_id, in_box, out_box, broker, port)
|
||||
: Props(client_id, in_box, out_box, broker, port)
|
||||
{
|
||||
_client.setClient(_ethernetClient);
|
||||
_client.setClient(_ethernetClient);
|
||||
}
|
||||
|
||||
void EthernetProps::begin(void(*on_message)(String))
|
||||
{
|
||||
if (on_message) onInboxMessageReceived = on_message;
|
||||
if (on_message) onInboxMessageReceived = on_message;
|
||||
}
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ class EthernetProps : public Props
|
||||
void begin(void(*)(String) = NULL);
|
||||
|
||||
private:
|
||||
EthernetClient _ethernetClient;
|
||||
EthernetClient _ethernetClient;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+11
-11
@@ -101,10 +101,10 @@ void Props::checkDataChanges()
|
||||
void Props::resetMcu()
|
||||
{
|
||||
#if defined(ARDUINO_ARCH_SAMD)
|
||||
NVIC_SystemReset();
|
||||
NVIC_SystemReset();
|
||||
#elif defined(ARDUINO_ARCH_AVR) || defined(__AVR__)
|
||||
wdt_enable(WDTO_15MS);
|
||||
while (true);
|
||||
wdt_enable(WDTO_15MS);
|
||||
while (true);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -112,8 +112,8 @@ void Props::sendAllData()
|
||||
{
|
||||
String data("DATA "), str;
|
||||
for (int i = 0; i < _dataTable.Count(); i++) {
|
||||
str = _dataTable[i]->fetch();
|
||||
send(&data, &str);
|
||||
str = _dataTable[i]->fetch();
|
||||
send(&data, &str);
|
||||
}
|
||||
|
||||
if (data.length() > 5) {
|
||||
@@ -125,8 +125,8 @@ void Props::sendDataChanges()
|
||||
{
|
||||
String data("DATA "), str;
|
||||
for (int i = 0; i < _dataTable.Count(); i++) {
|
||||
str = _dataTable[i]->fetchChange();
|
||||
send(&data, &str);
|
||||
str = _dataTable[i]->fetchChange();
|
||||
send(&data, &str);
|
||||
}
|
||||
|
||||
if (data.length() > 5) {
|
||||
@@ -190,10 +190,10 @@ void Props::sendRequ(String action, char* topic) {
|
||||
|
||||
void Props::resetIntervals(const int changes, const int silent)
|
||||
{
|
||||
_nextReconAttempt = 0;
|
||||
_dataSentCount = 0;
|
||||
_maximumSilentPeriod = silent; // seconds
|
||||
_sendDataAction.reset(changes); // milliseconds
|
||||
_nextReconAttempt = 0;
|
||||
_dataSentCount = 0;
|
||||
_maximumSilentPeriod = silent; // seconds
|
||||
_sendDataAction.reset(changes); // milliseconds
|
||||
}
|
||||
|
||||
|
||||
|
||||
+7
-7
@@ -52,12 +52,12 @@ class Props
|
||||
{
|
||||
public:
|
||||
Props(const char*, const char*, const char*, const char*, const int=1883);
|
||||
virtual void begin(void(*)(String) = NULL) = 0;
|
||||
virtual void begin(void(*)(String) = NULL) = 0;
|
||||
void addData(PropsData*);
|
||||
void loop();
|
||||
void resetIntervals(const int changes, const int silent);
|
||||
void resetMcu();
|
||||
void sendAllData();
|
||||
void loop();
|
||||
void resetIntervals(const int changes, const int silent);
|
||||
void resetMcu();
|
||||
void sendAllData();
|
||||
void sendDataChanges();
|
||||
void sendData(String); // only in outbox
|
||||
void sendDone(String);
|
||||
@@ -67,7 +67,7 @@ class Props
|
||||
void sendOver(String);
|
||||
void sendProg(String);
|
||||
void sendRequ(String);
|
||||
void sendRequ(String, char*);
|
||||
void sendRequ(String, char*);
|
||||
|
||||
static void (*onInboxMessageReceived)(String);
|
||||
|
||||
@@ -87,7 +87,7 @@ class Props
|
||||
unsigned long _nextReconAttempt;
|
||||
uint8_t _payloadMax;
|
||||
PropsAction _sendDataAction;
|
||||
List<PropsData*> _dataTable;
|
||||
List<PropsData*> _dataTable;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+2
-2
@@ -17,12 +17,12 @@
|
||||
WifiProps::WifiProps(const char* client_id, const char* in_box, const char* out_box, const char* broker, const int port)
|
||||
: Props(client_id, in_box, out_box, broker, port)
|
||||
{
|
||||
_client.setClient(_wifiClient);
|
||||
_client.setClient(_wifiClient);
|
||||
}
|
||||
|
||||
void WifiProps::begin(void(*on_message)(String))
|
||||
{
|
||||
if (on_message) onInboxMessageReceived = on_message;
|
||||
if (on_message) onInboxMessageReceived = on_message;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ class WifiProps : public Props
|
||||
void begin(void(*)(String) = NULL);
|
||||
|
||||
private:
|
||||
WiFiClient _wifiClient;
|
||||
WiFiClient _wifiClient;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user