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
  • #70
Closed
Open
Issue created Apr 28, 2015 by Administrator@rootContributor

jsonobject prints string as true

Created by: MornyDK

Hi

I'm planing on using the 1sheeld (1sheeld.com) to send and receive SMS with the Arduino. The SMS is to be generated and handled in a .net application. I'm planing on using json in the communication between the .net application and the Arduino. I have a problem in the following code, when making the println in the beginning the number and the text is printet as expected in the 1sheeld terminal shield for debugging purposes. When making the println og the buffer in the end, I'd expect something like this {"PhoneNo":"555890123","Message":"The text in the SMS"} as I'm adding 2 strings to the jsonobject.

Insted I'm getting this: {"PhoneNo":true,"Message":true} - Why??

/MornyDK

void receiveSms(String number ,String text) { Terminal.println(number); Terminal.println(text);

StaticJsonBuffer<200> jsonBuffer;
JsonObject& root = jsonBuffer.createObject();
root["PhoneNo"] = number;
root["Message"] = text;
char buffer[256];
root.printTo(buffer, sizeof(buffer));
Terminal.println(buffer);
Terminal.println("");

}

Assignee
Assign to
Time tracking