MCPcopy Create free account
hub / github.com/ArduPilot/ArduRemoteID / json_format

Function json_format

RemoteIDModule/status.cpp:28–41  ·  view source on GitHub ↗

create a json string from a table */

Source from the content-addressed store, hash-verified

26 create a json string from a table
27 */
28static String json_format(const json_table_t *table, uint8_t n)
29{
30 String s = "{";
31 for (uint8_t i=0; i<n; i++) {
32 const auto &t = table[i];
33 s += "\"" + t.name + "\" : ";
34 s += "\"" + escape_string(t.value) + "\"";
35 if (i != n-1) {
36 s += ",";
37 }
38 }
39 s += "}";
40 return s;
41}
42
43typedef struct {
44 int v;

Callers 1

status_jsonFunction · 0.85

Calls 1

escape_stringFunction · 0.85

Tested by

no test coverage detected