Skip to content

Commit 5a04353

Browse files
authored
Merge pull request #17 from myDevicesIoT/feature/connection-info
Feature/connection info
2 parents 5d7d0f4 + 6091e52 commit 5a04353

13 files changed

+27
-2
lines changed

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=CayenneMQTT
2-
version=1.0.2
2+
version=1.1.0
33
author=myDevices
44
maintainer=myDevices
55
sentence=Connect a device to the Cayenne dashboard using MQTT.

src/CayenneArduinoMQTTClient.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@ class CayenneArduinoMQTTClient
131131
publishData(SYS_CPU_MODEL_TOPIC, CAYENNE_NO_CHANNEL, F(INFO_CPU));
132132
#endif
133133
publishData(SYS_CPU_SPEED_TOPIC, CAYENNE_NO_CHANNEL, F_CPU);
134-
publishData(SYS_VERSION_TOPIC, CAYENNE_NO_CHANNEL, F(CAYENNE_VERSION));
134+
publishData(SYS_VERSION_TOPIC, CAYENNE_NO_CHANNEL, F(CAYENNE_LIBRARY_VERSION));
135+
#ifdef INFO_CONNECTION
136+
publishData(SYS_CONNECTION_TOPIC, CAYENNE_NO_CHANNEL, F(INFO_CONNECTION));
137+
#endif
135138
}
136139

137140
/**

src/CayenneMQTTESP8266Shield.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ Code adapted from Blynk library BlynkSimpleShieldEsp8266.h. Copyright info below
2525
#ifndef _CAYENNEMQTTESP8266SHIELD_h
2626
#define _CAYENNEMQTTESP8266SHIELD_h
2727

28+
#define INFO_CONNECTION "ESP8266"
29+
2830
#include "Client.h"
2931
#include "ESP8266SerialLibrary.h"
3032
#include "CayenneUtils/CayenneDefines.h"

src/CayenneMQTTEthernet.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEAL
1818
#ifndef _CAYENNEMQTTETHERNET_h
1919
#define _CAYENNEMQTTETHERNET_h
2020

21+
#define INFO_CONNECTION "W5100"
22+
2123
#include "CayenneUtils/CayenneDefines.h"
2224
#include <Ethernet.h>
2325
#include "CayenneMQTTEthernetClient.h"

src/CayenneMQTTEthernetW5200.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEAL
1818
#ifndef _CAYENNEMQTTETHERNETW5200_h
1919
#define _CAYENNEMQTTETHERNETW5200_h
2020

21+
#define INFO_CONNECTION "W5200"
22+
2123
#include "CayenneUtils/CayenneDefines.h"
2224
#include <EthernetV2_0.h>
2325
#include "CayenneMQTTEthernetClient.h"

src/CayenneMQTTEthernetW5500.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEAL
1818
#ifndef _CAYENNEMQTTETHERNETW5500_h
1919
#define _CAYENNEMQTTETHERNETW5500_h
2020

21+
#define INFO_CONNECTION "W5500"
22+
2123
#include "CayenneUtils/CayenneDefines.h"
2224
#include <Ethernet2.h>
2325
#include "CayenneMQTTEthernetClient.h"

src/CayenneMQTTMKR1000.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEAL
1818
#ifndef _CAYENNEMQTTMKR1000_h
1919
#define _CAYENNEMQTTMKR1000_h
2020

21+
#define INFO_CONNECTION "MKR1000"
22+
2123
#include "CayenneMQTTWiFi101.h"
2224

2325
#endif

src/CayenneMQTTSerial.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEAL
1818
#ifndef _CAYENNEMQTTSERIAL_h
1919
#define _CAYENNEMQTTSERIAL_h
2020

21+
#define INFO_CONNECTION "Serial"
22+
2123
#include "Client.h"
2224
#include "CayenneUtils/CayenneDefines.h"
2325
#include "CayenneMQTTSerialClient.h"

src/CayenneMQTTWiFi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEAL
1919
#define _CAYENNEMQTTWIFI_h
2020

2121
#define WRITE_CHUNK_SIZE 80 // The chunk size to use when sending data to prevent sending too much data at once which is an issue with WiFi Shield R3.
22+
#define INFO_CONNECTION "WiFi"
2223

2324
#include <WiFi.h>
2425
#include "CayenneUtils/CayenneDefines.h"

src/CayenneMQTTWiFi101.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEAL
1818
#ifndef _CAYENNEMQTTWIFI101_h
1919
#define _CAYENNEMQTTWIFI101_h
2020

21+
#ifndef INFO_CONNECTION
22+
#define INFO_CONNECTION "WiFi101"
23+
#endif
24+
2125
#include <SPI.h>
2226
#include <WiFi101.h>
2327
#include "CayenneUtils/CayenneDefines.h"

0 commit comments

Comments
 (0)