Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static const inline void Get_JSON(){
- const size_t capacity = 15000;
- File JSONFILE = SPIFFS.open("/UserProg.json", "r");
- if(!JSONFILE){
- Error_iras("Can't open UserProg.json for read.");
- }else{
- do{
- DynamicJsonDocument doc(capacity);
- DeserializationError error = deserializeJson(doc, JSONFILE);
- if (error) {
- String Error = String(error.c_str());
- Error_iras(Error);
- }else {
- JsonArray content = doc["content"];
- JsonArray content_0_content = content[0]["content"];
- for(int x = 0; x < 16;x++){
- JsonObject content_0_content_0_attributes = content_0_content[x]["attributes"];
- const char* Addr = content_0_content_0_attributes["outexp"];
- const char* pinke = content_0_content_0_attributes["outpin"];
- if(pinke[0] != 0){
- int AddressIndex = String(Addr).indexOf(":");
- int Address = (String(Addr).substring(AddressIndex+1)).toInt();
- int PIN = (String(pinke).substring(7)).toInt();
- Timers[PIN].Address = Address;
- }
- }
- }
- }while(JSONFILE.read() == '?');
- }
- JSONFILE.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement