-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Devel
- Loading branch information
Showing
128 changed files
with
9,380 additions
and
21,568 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
.pioenvs | ||
.piolibdeps | ||
CMakeListsPrivate.txt | ||
platformio*.log | ||
|
||
### C++ template | ||
# Prerequisites | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Brewer's Friend / Brewfather JSON | ||
|
||
``` | ||
{ | ||
"name": "Yellow", | ||
"temp": "100.1", | ||
"temp_unit": "F", | ||
"gravity": "1.0123", | ||
"gravity_unit": "G", | ||
"device_source": "TiltBridge" | ||
} | ||
``` | ||
|
||
## Serialize: | ||
|
||
``` | ||
StaticJsonDocument<192> doc; | ||
doc["name"] = "Yellow"; | ||
doc["temp"] = "100.1"; | ||
doc["temp_unit"] = "F"; | ||
doc["gravity"] = "1.0123"; | ||
doc["gravity_unit"] = "G"; | ||
doc["device_source"] = "TiltBridge"; | ||
serializeJson(doc, output); | ||
``` | ||
|
||
## Deserialize: | ||
|
||
``` | ||
// const char* input; | ||
// size_t inputLength; (optional) | ||
StaticJsonDocument<96> doc; | ||
deserializeJson(doc, input, inputLength); | ||
const char* name = doc["name"]; // "Yellow" | ||
const char* temp = doc["temp"]; // "100.1" | ||
const char* temp_unit = doc["temp_unit"]; // "F" | ||
const char* gravity = doc["gravity"]; // "1.0123" | ||
const char* gravity_unit = doc["gravity_unit"]; // "G" | ||
const char* device_source = doc["device_source"]; // "TiltBridge" | ||
``` |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
# GSheets JSON | ||
|
||
## Send | ||
|
||
``` | ||
{ | ||
"Beer":"xxxxxxxxxxxxxxxxxxxxxxxxx", | ||
"Temp":"xxxxx", | ||
"SG":"xxxxxxx", | ||
"Color":"xxxxxxx", | ||
"Comment":"", | ||
"Email":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", | ||
"tzOffset":-12 | ||
} | ||
``` | ||
|
||
### Serialize: | ||
|
||
``` | ||
StaticJsonDocument<512> doc; | ||
doc["Beer"] = "xxxxxxxxxxxxxxxxxxxxxxxxx"; | ||
doc["Temp"] = "xxxxx"; | ||
doc["SG"] = "xxxxxxx"; | ||
doc["Color"] = "xxxxxxx"; | ||
doc["Comment"] = ""; | ||
doc["Email"] = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; | ||
doc["tzOffset"] = -12; | ||
String output; | ||
serializeJson(doc, output); | ||
``` | ||
|
||
### Deserialize: | ||
|
||
``` | ||
// String input; | ||
StaticJsonDocument<512> doc; | ||
deserializeJson(doc, input); | ||
const char* Beer = doc["Beer"]; // "xxxxxxxxxxxxxxxxxxxxxxxxx" | ||
const char* Temp = doc["Temp"]; // "xxxxx" | ||
const char* SG = doc["SG"]; // "xxxxxxx" | ||
const char* Color = doc["Color"]; // "xxxxxxx" | ||
const char* Comment = doc["Comment"]; // "" | ||
const char* Email = doc["Email"]; | ||
int tzOffset = doc["tzOffset"]; // -12 | ||
``` | ||
|
||
## Respond | ||
|
||
``` | ||
{ | ||
"result":"</br>Xxxxxxxxxxxxxxxxxxxxxxxxx</br><strong>TILT | Xxxxxxx</strong></br>Success logging data to the cloud. (row: 64xxx)", | ||
"beername":"Xxxxxxxxxxxxxxxxxxxxxxxxx", | ||
"tiltcolor":"Xxxxxxx", | ||
"doclongurl":"https://docs.google.com/spreadsheets/d/1wK198LabkHZsK330lhKYYu9FNsDwRT8fiRFjLswodys/edit?ouid=111807419907392952307&urlBuilderDomain=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxx" | ||
} | ||
``` | ||
|
||
### Serialize: | ||
|
||
``` | ||
// Stream& output; | ||
StaticJsonDocument<512> doc; | ||
doc["result"] = "</br>Xxxxxxxxxxxxxxxxxxxxxxxxx</br><strong>TILT | Xxxxxxx</strong></br>Success logging data to the cloud. (row: 64xxx)"; | ||
doc["beername"] = "Xxxxxxxxxxxxxxxxxxxxxxxxx"; | ||
doc["tiltcolor"] = "Xxxxxxx"; | ||
doc["doclongurl"] = "https://docs.google.com/spreadsheets/d/1wK198LabkHZsK330lhKYYu9FNsDwRT8fiRFjLswodys/edit?ouid=111807419907392952307&urlBuilderDomain=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxx"; | ||
serializeJson(doc, output); | ||
``` | ||
|
||
### Deserialize: | ||
|
||
``` | ||
// Stream& input; | ||
StaticJsonDocument<512> doc; | ||
deserializeJson(doc, input); | ||
const char* result = doc["result"]; // "</br>Xxxxxxxxxxxxxxxxxxxxxxxxx</br><strong>TILT | ... | ||
const char* beername = doc["beername"]; // "Xxxxxxxxxxxxxxxxxxxxxxxxx" | ||
const char* tiltcolor = doc["tiltcolor"]; // "Xxxxxxx" | ||
const char* doclongurl = doc["doclongurl"]; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Heap JSON | ||
|
||
``` | ||
{ | ||
"free":999999, | ||
"max":999999, | ||
"frag":99 | ||
} | ||
``` | ||
|
||
## Serialize: | ||
|
||
``` | ||
DynamicJsonDocument doc(48); | ||
doc["free"] = 999999; | ||
doc["max"] = 999999; | ||
doc["frag"] = 99; | ||
serializeJson(doc, Serial); | ||
``` | ||
|
||
## Deserialize: | ||
|
||
``` | ||
const char* json = "{\"free\":999999,\"max\":999999,\"frag\":99}"; | ||
StaticJsonDocument<0> filter; | ||
filter.set(true); | ||
DynamicJsonDocument doc(96); | ||
deserializeJson(doc, json, DeserializationOption::Filter(filter)); | ||
long free = doc["free"]; // 999999 | ||
long max = doc["max"]; // 999999 | ||
int frag = doc["frag"]; // 99 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Reset Reason JSON | ||
|
||
``` | ||
{ | ||
"reason":"REASON_DEEP_SLEEP_AWAKE", | ||
"resetDescription":"Software restart, system_restart, GPIO status won’t change" | ||
} | ||
``` | ||
|
||
## Serialize: | ||
|
||
``` | ||
DynamicJsonDocument doc(128); | ||
doc["reason"] = "REASON_DEEP_SLEEP_AWAKE"; | ||
doc["resetDescription"] = "Software restart, system_restart, GPIO status won’t change"; | ||
serializeJson(doc, Serial); | ||
``` | ||
|
||
## Deserialize: | ||
|
||
``` | ||
const char* json = "{\"reason\":\"REASON_DEEP_SLEEP_AWAKE\",\"resetDescription\":\"Software restart, system_restart, GPIO status won’t change\"}"; | ||
DynamicJsonDocument doc(192); | ||
deserializeJson(doc, json); | ||
const char* reason = doc["reason"]; // "REASON_DEEP_SLEEP_AWAKE" | ||
const char* resetDescription = doc["resetDescription"]; // "Software restart, system_restart, GPIO status won’t change" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Tilt Hydrometer JSON | ||
|
||
This is the return from `tiltHydrometer::to_json_string()`. | ||
|
||
``` | ||
{ | ||
"color":"Yellow", | ||
"temp":"100.1", | ||
"tempUnit":"F", | ||
"gravity":"1.0123", | ||
"gsheets_name":"XXXXXXXXXXXXXXXXXXXXXXXXX", | ||
"weeks_on_battery":123, | ||
"sends_battery":false, | ||
"high_resolution":false, | ||
"fwVersion":1001, | ||
"rssi":-75 | ||
} | ||
``` | ||
|
||
## Serialize: | ||
|
||
``` | ||
DynamicJsonDocument doc(256); | ||
doc["color"] = "Yellow"; | ||
doc["temp"] = "100.1"; | ||
doc["tempUnit"] = "F"; | ||
doc["gravity"] = "1.0123"; | ||
doc["gsheets_name"] = "XXXXXXXXXXXXXXXXXXXXXXXXX"; | ||
doc["weeks_on_battery"] = 123; | ||
doc["sends_battery"] = false; | ||
doc["high_resolution"] = false; | ||
doc["fwVersion"] = 1001; | ||
doc["rssi"] = -75; | ||
serializeJson(doc, output); | ||
``` | ||
|
||
## Deserialize: | ||
|
||
``` | ||
DynamicJsonDocument doc(384); | ||
deserializeJson(doc, input); | ||
const char* color = doc["color"]; // "Yellow" | ||
const char* temp = doc["temp"]; // "100.1" | ||
const char* tempUnit = doc["tempUnit"]; // "F" | ||
const char* gravity = doc["gravity"]; // "1.0123" | ||
const char* gsheets_name = doc["gsheets_name"]; // "XXXXXXXXXXXXXXXXXXXXXXXXX" | ||
int weeks_on_battery = doc["weeks_on_battery"]; // 123 | ||
bool sends_battery = doc["sends_battery"]; // false | ||
bool high_resolution = doc["high_resolution"]; // false | ||
int fwVersion = doc["fwVersion"]; // 1001 | ||
int rssi = doc["rssi"]; // -75 | ||
``` |
Oops, something went wrong.