Michael Ammann / M2XStreamClient

Fork of M2XStreamClient by AT&T M2X Team

Files at this revision

API Documentation at this revision

Comitter:
citrusbyte
Date:
Wed Aug 13 02:02:21 2014 +0000
Parent:
0:f479e4f4db0e
Commit message:
Timestamp is now a required field

Changed in this revision

M2XStreamClient.h Show annotated file Show diff for this revision Revisions of this file
M2XStreamClient_template.h Show annotated file Show diff for this revision Revisions of this file
--- a/M2XStreamClient.h	Wed Feb 12 19:43:34 2014 +0000
+++ b/M2XStreamClient.h	Wed Aug 13 02:02:21 2014 +0000
@@ -87,9 +87,8 @@
   // be the some of all values in +counts+, for the first +counts[0]+
   // items, the values belong to the first stream, for the following
   // +counts[1]+ number of items, the values belong to the second stream,
-  // etc. Note timestamps are optional, if a value does not havee timestamp,
-  // we can simply put NULL here, or we can put NULl for +ats+, meaning
-  // none of the values has a timestamp
+  // etc. Notice that timestamps are required here: you must provide
+  // a timestamp for each value posted.
   // +values+ - Values to post. This works the same way as +ats+, the
   // first +counts[0]+ number of items contain values to post to the first
   // stream, the succeeding +counts[1]+ number of items contain values
--- a/M2XStreamClient_template.h	Wed Feb 12 19:43:34 2014 +0000
+++ b/M2XStreamClient_template.h	Wed Aug 13 02:02:21 2014 +0000
@@ -34,13 +34,9 @@
     bytes += print->print(names[i]);
     bytes += print->print("\":[");
     for (int j = 0; j < counts[i]; j++) {
-      bytes += print->print("{");
-      if (ats && ats[value_index]) {
-        bytes += print->print("\"at\": \"");
-        bytes += print->print(ats[value_index]);
-        bytes += print->print("\",");
-      }
-      bytes += print->print("\"value\": \"");
+      bytes += print->print("{\"at\": \"");
+      bytes += print->print(ats[value_index]);
+      bytes += print->print("\", \"value\": \"");
       bytes += print->print(values[value_index]);
       bytes += print->print("\"}");
       if (j < counts[i] - 1) { bytes += print->print(","); }