# OS functions available for user code?

**URL:** <https://community.particle.io/t/os-functions-available-for-user-code/47334>\
**Category:** Troubleshooting\
**Created:** [January 28, 2019, 5:19pm UTC](https://community.particle.io/t/os-functions-available-for-user-code/47334 "2019-01-28T17:19:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![makerken](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/makerken/32/13243_2.png) [@makerken](https://community.particle.io/u/makerken)\
**Post date:** [January 28, 2019, 5:19pm UTC](https://community.particle.io/t/os-functions-available-for-user-code/47334/1 "2019-01-28T17:19:13Z")

</div>

Looking at encoding/decoding JSON on a Particle device.  
Currently best practice as I understand it is using a `char[]` and encoding with `snprintf()` or use a library.

I looked to see what the firmware was using, and seems like there is already a very nice function do to that.  
So any way to access system os firmware functions? Excluding the possibility of building and flashing your own firmware. Security and reliability, would be two good encompassing reasons that you can’t.

If no, exposing the JSON decoding/encoding seems useful, but beyond my ability to contribute.

> <https://github.com/particle-iot/device-os/blob/27f6c3884e2b6786ff5bfcc4546cd731d555a7d3/hal/src/photon/softap.cpp#L168>

> <https://github.com/particle-iot/device-os/blob/27f6c3884e2b6786ff5bfcc4546cd731d555a7d3/services/src/jsmn.c#L328>

---

<div class="post-metadata">

**Author:** ![rickkas7](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/rickkas7/32/8681_2.png) [@rickkas7](https://community.particle.io/u/rickkas7)\
**Post date:** [January 28, 2019, 5:22pm UTC](https://community.particle.io/t/os-functions-available-for-user-code/47334/2 "2019-01-28T17:22:13Z")

</div>

jsmn is not available to user applications.

You might be interested in this library, which is a wrapper around jsmn which makes it much easier to use and is much more memory-efficient than SparkJson/ArduinoJson.

> **[rickkas7/JsonParserGeneratorRK](https://github.com/rickkas7/JsonParserGeneratorRK)**
>
> JSON parser and generator for Particle devices. Contribute to rickkas7/JsonParserGeneratorRK development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![makerken](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/makerken/32/13243_2.png) [@makerken](https://community.particle.io/u/makerken)\
**Post date:** [January 28, 2019, 5:29pm UTC](https://community.particle.io/t/os-functions-available-for-user-code/47334/3 "2019-01-28T17:29:16Z")

</div>

Thanks

As everything gets better and faster, I don’t have to optimize every byte out so having a function/class twice is not going to affect actual use. I am still adjusting.
