Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A ArduinoJson
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 24
    • Issues 24
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Benoît Blanchon
  • ArduinoJson
  • Issues
  • #337
Closed
Open
Issue created Aug 23, 2016 by Administrator@rootContributor

Why JsonVariant cannot be converted to char?

Created by: interimlife

I use ARDUINO IDE 1.6.11 from arduino.cc I met errors in my program. I can show these errors by JsonParserExample (included in library)

char json[] = "{"sensor":"gps","time":1351824120,"data":[48.756080,2.302038]}"; -->>original. signed char json[] = "{"sensor":"gps","time":1351824120,"data":[48.756080,2.302038]}"; -->>error. unsigned char json[] = "{"sensor":"gps","time":1351824120,"data":[48.756080,2.302038]}"; -->>error. uint8_t json[] = "{"sensor":"gps","time":1351824120,"data":[48.756080,2.302038]}"; -->>error. int8_t json[] = "{"sensor":"gps","time":1351824120,"data":[48.756080,2.302038]}"; -->>error.

change time key value. char json[] = "{"sensor":"gps","time":135,"data":[48.756080,2.302038]}";

and change time variable. long to char.

unsigned char time = root["time"]; -> OK. signed char time = root["time"]; -> OK. uint8_t time = root["time"]; -> OK. int8_t time = root["time"]; -> OK. but.. char time = root["time"]; -> error.

I'm poor English. I beginning programming. I don't know why I met these errors.

Assignee
Assign to
Time tracking