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
  • #1142
Closed
Open
Issue created Dec 12, 2019 by Administrator@rootContributor

serializeMsgPack for unsigned char (uint8_t)

Created by: Piruthivi

Hi, Am new to json format data and c++ too. I found it amusing, it is very easy to build a json when started to json generator example. And it is simple to use. Now lets see what my doubt is.

By using ArduinoJson library i can serializeJson to a character array and to a uart port like Serial1 or SerialUSB. Similarly same can be done with serializeMsgPack. Now the tricky part is i need to use unsigned char for serialize message pack. I did saw a "Custom Writer" could be a solution, but didnt have a clue to use it. Does it need to be added in the library files or in the program(.ino) files i have been using.

If i call serializeMsgPack(doc,(uint8_t) data) getting following error

_In member function 'size_t CustomWriter::write(uint8_t)':

abputilitypacket:22:9: error: request for member 'append' in '((CustomWriter*)this)->CustomWriter::str', which is of non-class type 'uint8_t {aka unsigned char}'

 str.append(1, static_cast<char>(c));

     ^_

If i could solve this i can move forward in my project. And thanks in advance.

Assignee
Assign to
Time tracking