diff --git a/src/third-party/arduino-json-5.1.1/examples/IndentedPrintExample/IndentedPrintExample.ino b/src/third-party/arduino-json-5.1.1/examples/IndentedPrintExample/IndentedPrintExample.ino deleted file mode 100644 index 9e86f0f5..00000000 --- a/src/third-party/arduino-json-5.1.1/examples/IndentedPrintExample/IndentedPrintExample.ino +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright Benoit Blanchon 2014-2016 -// MIT License -// -// Arduino JSON library -// https://github.com/bblanchon/ArduinoJson -// If you like this project, please add a star! - -#include - -using namespace ArduinoJson::Internals; - -void setup() { - Serial.begin(9600); - while (!Serial) { - // wait serial port initialization - } - - IndentedPrint serial(Serial); - serial.setTabSize(4); - - serial.println("This is at indentation 0"); - serial.indent(); - serial.println("This is at indentation 1"); - serial.println("This is also at indentation 1"); - serial.indent(); - serial.println("This is at indentation 2"); - - serial.unindent(); - serial.unindent(); - serial.println("This is back at indentation 0"); -} - -void loop() { - // not used in this example -} diff --git a/src/third-party/arduino-json-5.1.1/examples/JsonGeneratorExample/JsonGeneratorExample.ino b/src/third-party/arduino-json-5.1.1/examples/JsonGeneratorExample/JsonGeneratorExample.ino deleted file mode 100644 index 717a2276..00000000 --- a/src/third-party/arduino-json-5.1.1/examples/JsonGeneratorExample/JsonGeneratorExample.ino +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright Benoit Blanchon 2014-2016 -// MIT License -// -// Arduino JSON library -// https://github.com/bblanchon/ArduinoJson -// If you like this project, please add a star! - -#include - -void setup() { - Serial.begin(9600); - while (!Serial) { - // wait serial port initialization - } - - // Memory pool for JSON object tree. - // - // Inside the brackets, 200 is the size of the pool in bytes. - // If the JSON object is more complex, you need to increase that value. - StaticJsonBuffer<200> jsonBuffer; - - // StaticJsonBuffer allocates memory on the stack, it can be - // replaced by DynamicJsonBuffer which allocates in the heap. - // It's simpler but less efficient. - // - // DynamicJsonBuffer jsonBuffer; - - // Create the root of the object tree. - // - // It's a reference to the JsonObject, the actual bytes are inside the - // JsonBuffer with all the other nodes of the object tree. - // Memory is freed when jsonBuffer goes out of scope. - JsonObject& root = jsonBuffer.createObject(); - - // Add values in the object - // - // Most of the time, you can rely on the implicit casts. - // In other case, you can do root.set("time", 1351824120); - root["sensor"] = "gps"; - root["time"] = 1351824120; - - // Add a nested array. - // - // It's also possible to create the array separately and add it to the - // JsonObject but it's less efficient. - JsonArray& data = root.createNestedArray("data"); - data.add(double_with_n_digits(48.756080, 6)); - data.add(double_with_n_digits(2.302038, 6)); - - root.printTo(Serial); - // This prints: - // {"sensor":"gps","time":1351824120,"data":[48.756080,2.302038]} - - Serial.println(); - - root.prettyPrintTo(Serial); - // This prints: - // { - // "sensor": "gps", - // "time": 1351824120, - // "data": [ - // 48.756080, - // 2.302038 - // ] - // } -} - -void loop() { - // not used in this example -} diff --git a/src/third-party/arduino-json-5.1.1/examples/JsonParserExample/JsonParserExample.ino b/src/third-party/arduino-json-5.1.1/examples/JsonParserExample/JsonParserExample.ino deleted file mode 100644 index 13536019..00000000 --- a/src/third-party/arduino-json-5.1.1/examples/JsonParserExample/JsonParserExample.ino +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright Benoit Blanchon 2014-2016 -// MIT License -// -// Arduino JSON library -// https://github.com/bblanchon/ArduinoJson -// If you like this project, please add a star! - -#include - -void setup() { - Serial.begin(9600); - while (!Serial) { - // wait serial port initialization - } - - // Memory pool for JSON object tree. - // - // Inside the brackets, 200 is the size of the pool in bytes, - // If the JSON object is more complex, you need to increase that value. - StaticJsonBuffer<200> jsonBuffer; - - // StaticJsonBuffer allocates memory on the stack, it can be - // replaced by DynamicJsonBuffer which allocates in the heap. - // It's simpler but less efficient. - // - // DynamicJsonBuffer jsonBuffer; - - // JSON input string. - // - // It's better to use a char[] as shown here. - // If you use a const char* or a String, ArduinoJson will - // have to make a copy of the input in the JsonBuffer. - char json[] = - "{\"sensor\":\"gps\",\"time\":1351824120,\"data\":[48.756080,2.302038]}"; - - // Root of the object tree. - // - // It's a reference to the JsonObject, the actual bytes are inside the - // JsonBuffer with all the other nodes of the object tree. - // Memory is freed when jsonBuffer goes out of scope. - JsonObject& root = jsonBuffer.parseObject(json); - - // Test if parsing succeeds. - if (!root.success()) { - Serial.println("parseObject() failed"); - return; - } - - // Fetch values. - // - // Most of the time, you can rely on the implicit casts. - // In other case, you can do root["time"].as(); - const char* sensor = root["sensor"]; - long time = root["time"]; - double latitude = root["data"][0]; - double longitude = root["data"][1]; - - // Print values. - Serial.println(sensor); - Serial.println(time); - Serial.println(latitude, 6); - Serial.println(longitude, 6); -} - -void loop() { - // not used in this example -} diff --git a/src/third-party/arduino-json-5.1.1/examples/JsonServer/JsonServer.ino b/src/third-party/arduino-json-5.1.1/examples/JsonServer/JsonServer.ino deleted file mode 100644 index 895b6729..00000000 --- a/src/third-party/arduino-json-5.1.1/examples/JsonServer/JsonServer.ino +++ /dev/null @@ -1,74 +0,0 @@ -// Sample Arduino Json Web Server -// Created by Benoit Blanchon. -// Heavily inspired by "Web Server" from David A. Mellis and Tom Igoe - -#include -#include -#include - -byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED}; -IPAddress ip(192, 168, 0, 177); -EthernetServer server(80); - -bool readRequest(EthernetClient& client) { - bool currentLineIsBlank = true; - while (client.connected()) { - if (client.available()) { - char c = client.read(); - if (c == '\n' && currentLineIsBlank) { - return true; - } else if (c == '\n') { - currentLineIsBlank = true; - } else if (c != '\r') { - currentLineIsBlank = false; - } - } - } - return false; -} - -JsonObject& prepareResponse(JsonBuffer& jsonBuffer) { - JsonObject& root = jsonBuffer.createObject(); - - JsonArray& analogValues = root.createNestedArray("analog"); - for (int pin = 0; pin < 6; pin++) { - int value = analogRead(pin); - analogValues.add(value); - } - - JsonArray& digitalValues = root.createNestedArray("digital"); - for (int pin = 0; pin < 14; pin++) { - int value = digitalRead(pin); - digitalValues.add(value); - } - - return root; -} - -void writeResponse(EthernetClient& client, JsonObject& json) { - client.println("HTTP/1.1 200 OK"); - client.println("Content-Type: application/json"); - client.println("Connection: close"); - client.println(); - - json.prettyPrintTo(client); -} - -void setup() { - Ethernet.begin(mac, ip); - server.begin(); -} - -void loop() { - EthernetClient client = server.available(); - if (client) { - bool success = readRequest(client); - if (success) { - StaticJsonBuffer<500> jsonBuffer; - JsonObject& json = prepareResponse(jsonBuffer); - writeResponse(client, json); - } - delay(1); - client.stop(); - } -} diff --git a/src/third-party/arduino-json-5.1.1/examples/JsonUdpBeacon/JsonUdpBeacon.ino b/src/third-party/arduino-json-5.1.1/examples/JsonUdpBeacon/JsonUdpBeacon.ino deleted file mode 100644 index 7d0fa38a..00000000 --- a/src/third-party/arduino-json-5.1.1/examples/JsonUdpBeacon/JsonUdpBeacon.ino +++ /dev/null @@ -1,55 +0,0 @@ -// Send a JSON object on UDP at regular interval -// -// You can easily test this program with netcat: -// $ nc -ulp 8888 -// -// by Benoit Blanchon, MIT License 2015-2016 - -#include -#include -#include - -byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED}; -IPAddress localIp(192, 168, 0, 177); -IPAddress remoteIp(192, 168, 0, 109); -unsigned int remotePort = 8888; -unsigned localPort = 8888; -EthernetUDP udp; - -JsonObject& buildJson(JsonBuffer& jsonBuffer) { - JsonObject& root = jsonBuffer.createObject(); - - JsonArray& analogValues = root.createNestedArray("analog"); - for (int pin = 0; pin < 6; pin++) { - int value = analogRead(pin); - analogValues.add(value); - } - - JsonArray& digitalValues = root.createNestedArray("digital"); - for (int pin = 0; pin < 14; pin++) { - int value = digitalRead(pin); - digitalValues.add(value); - } - - return root; -} - -void sendJson(JsonObject& json) { - udp.beginPacket(remoteIp, remotePort); - json.printTo(udp); - udp.println(); - udp.endPacket(); -} - -void setup() { - Ethernet.begin(mac, localIp); - udp.begin(localPort); -} - -void loop() { - delay(1000); - - StaticJsonBuffer<300> jsonBuffer; - JsonObject& json = buildJson(jsonBuffer); - sendJson(json); -}