The Cayenne MQTT mbed Library provides functions to easily connect to the Cayenne IoT project builder.

Fork of Cayenne-MQTT-mbed by myDevicesIoT

Revision:
16:085bcf2e9a18
Parent:
6:82e142a864ad
Child:
22:0dbabcc6e7b2
diff -r 1f4d5dbf1928 -r 085bcf2e9a18 src/CayenneUtils/CayenneUtils.c
--- a/src/CayenneUtils/CayenneUtils.c	Fri Nov 04 13:25:27 2016 -0600
+++ b/src/CayenneUtils/CayenneUtils.c	Fri Nov 04 13:26:29 2016 -0600
@@ -338,8 +338,8 @@
 			payloadLength += strlen(values[i].unit) + 1;
 		}
 		else if (type) {
-			// If type exists but unit does not, use UNDEFINED for the unit.
-			payloadLength += strlen(UNDEFINED) + 1;
+			// If type exists but unit does not, use UNIT_UNDEFINED for the unit.
+			payloadLength += strlen(UNIT_UNDEFINED) + 1;
 		}
 		payloadLength += values[i].value ? strlen(values[i].value) + 1 : 0;
 	}
@@ -359,7 +359,7 @@
 		if (values[i].unit)
 			strcat(payload, values[i].unit);
 		else if (type)
-			strcat(payload, UNDEFINED);
+			strcat(payload, UNIT_UNDEFINED);
 	}
 	if (payload[0] != '\0' && valueCount > 0 && values[0].value)
 		strcat(payload, "=");