{"action":"created","issue":{"url":"https://api.github.com/repos/bblanchon/ArduinoJson/issues/154","labels_url":"https://api.github.com/repos/bblanchon/ArduinoJson/issues/154/labels{/name}","comments_url":"https://api.github.com/repos/bblanchon/ArduinoJson/issues/154/comments","events_url":"https://api.github.com/repos/bblanchon/ArduinoJson/issues/154/events","html_url":"https://github.com/bblanchon/ArduinoJson/issues/154","id":115768983,"number":154,"title":"trouble with \"parseObject() failed\", convert const char to char","user":{"login":"NitrofMtl","id":9940431,"avatar_url":"https://avatars.githubusercontent.com/u/9940431?v=3","gravatar_id":"","url":"https://api.github.com/users/NitrofMtl","html_url":"https://github.com/NitrofMtl","followers_url":"https://api.github.com/users/NitrofMtl/followers","following_url":"https://api.github.com/users/NitrofMtl/following{/other_user}","gists_url":"https://api.github.com/users/NitrofMtl/gists{/gist_id}","starred_url":"https://api.github.com/users/NitrofMtl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NitrofMtl/subscriptions","organizations_url":"https://api.github.com/users/NitrofMtl/orgs","repos_url":"https://api.github.com/users/NitrofMtl/repos","events_url":"https://api.github.com/users/NitrofMtl/events{/privacy}","received_events_url":"https://api.github.com/users/NitrofMtl/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bblanchon/ArduinoJson/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-11-08T23:20:33Z","updated_at":"2015-11-09T15:28:08Z","closed_at":null,"body":"Hi.\r\n\r\nJust star to implant arduinoJson to my sketch. But with the parser return \"parseObject() failed\".\r\n\r\nI read on the wiki that It could be cause by a read-only or pointer object. My char came from uHTTP library and is a pointer but I can't find the way to convert it to an non const var . here the code:\r\n\r\n\r\n    void parseJSONInputs(const char json[])  {\r\n      StaticJsonBuffer<5000> jsonBuffer;\r\n    Serial.print(json);\r\n    Serial.println();\r\n      JsonObject& root = jsonBuffer.parseObject(json);\r\n\r\n      if (!root.success()) {\r\n        Serial.println(\"parseObject() failed\");\r\n        return;\r\n      }\r\n\r\n      for (int i = 0; i < 10 ; i++) {\r\n\r\n        inChannelID[root[\"channels\"][i][\"canal\"]].channelName = root[\"channels\"][i][\"name\"];\r\n        outChannelID[root[\"channels\"][i][\"canal\"]].channelSwitch = stringToBool(root[\"channels\"][i][\"status\"]);\r\n        outChannelID[root[\"channels\"][i][\"canal\"]].sp = root[\"channels\"][i][\"setPoint\"];\r\n\r\n      }\r\n    }"},"comment":{"url":"https://api.github.com/repos/bblanchon/ArduinoJson/issues/comments/155095822","html_url":"https://github.com/bblanchon/ArduinoJson/issues/154#issuecomment-155095822","issue_url":"https://api.github.com/repos/bblanchon/ArduinoJson/issues/154","id":155095822,"user":{"login":"domonetic","id":4523833,"avatar_url":"https://avatars.githubusercontent.com/u/4523833?v=3","gravatar_id":"","url":"https://api.github.com/users/domonetic","html_url":"https://github.com/domonetic","followers_url":"https://api.github.com/users/domonetic/followers","following_url":"https://api.github.com/users/domonetic/following{/other_user}","gists_url":"https://api.github.com/users/domonetic/gists{/gist_id}","starred_url":"https://api.github.com/users/domonetic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domonetic/subscriptions","organizations_url":"https://api.github.com/users/domonetic/orgs","repos_url":"https://api.github.com/users/domonetic/repos","events_url":"https://api.github.com/users/domonetic/events{/privacy}","received_events_url":"https://api.github.com/users/domonetic/received_events","type":"User","site_admin":false},"created_at":"2015-11-09T15:28:08Z","updated_at":"2015-11-09T15:28:08Z","body":"why noto sent as nestedarray the 10 channels\n\n¿y porque no enviar los datos de los 10 canales como un array?\nName\nTempChannels[0,1,2,3,4,5,6,7,8,9]\nstatus\nsetPoint\npermission\npercentOut\n\n2015-11-09 12:05 GMT-03:00 NitrofMtl <notifications@github.com>:\n\n> original uHTTP <https://github.com/nomadnt/uHTTP/>\n>\n> I nerver heard of const_cast... will take a look for it.\n>\n> for the the nested array, sorry i'm sometime (always) a bit slow... it is\n> maybe cause of my data structure that I'm confuse.\n>\n> here a part of my json:\n>\n> {\"channels\":\"[{\\\"name\\\":\\\"name0\\\",\\\"canal\\\":\\\"0\\\",\\\"status\\\":true,\\\"temperature\\\":21.4,\\\"setPoint\\\":5,\\\"permission\\\":false,\\\"percentOut\\\":0,\n>\n> so I've got 10 channels.. I just have to do:\n> int setpoint = root[channels][0][setpoint];\n>\n> I'm right ?\n>\n> thank.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/bblanchon/ArduinoJson/issues/154#issuecomment-155089847>\n> .\n>\n\n\n\n-- \nEl que pregunta aprende, y el que contesta aprende a responder.\n\nNo a la obsolecencia programada:\nhttp://www.rtve.es/noticias/20110104/productos-consumo-duran-cada-vez-menos/392498.shtml\n\nLinux User #495070\nhttp://domonetic.com/blog\n"}}