[riot-notifications] [RIOT-OS/RIOT] sys/phydat: added phydat to JSON converter (#7271)

Martine Lenders notifications at github.com
Wed May 20 15:34:51 CEST 2020


@miri64 commented on this pull request.



> +            }
+            else {
+                pos += (data->val[i]) ? 4 : 5;  /* true: 4, false: 5 */
+            }
+        }
+        pos += strlen(phydat_unit_to_str_verbose(data->unit));
+    }
+    else {
+        memcpy(buf, "{\"d\":", 5);
+        pos += 5;
+        /* write data */
+        if (dim > 1) {
+            buf[pos++] = '[';
+        }
+        for (size_t i = 0; i < dim; i++) {
+            if (data->unit != UNIT_BOOL) {

I think all our toolchains are smart enough by now to reorder it as we want... But fine... not dying on that hill ;-).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/7271#discussion_r428014488
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20200520/b0865fc0/attachment.htm>


More information about the notifications mailing list