Simplifying Concepts.
Accelerating Innovation.

Jacob's Blog

Jacob Beningo
|

Getting Started with JSON for Embedded Developers

For decades embedded software developers worked on products that were stand-alone and did not require any internet access. Over the past decade or so, the number of products that are connected to the internet has grown exponentially and with it, embedded developers have been forced to learn the underlying technologies required to communicate in a connected world such as various internet protocols and messaging technologies. While developers have traditionally transmitted encoded binary communication streams, the internet often uses human readable JSON messages. In this post, we will examine what JSON is and how developers can use it in their embedded systems.

Defining JSON

JSON stands for JavaScript Object Notation and is an open-standard file format that was first standardized in 2013 in the ECMA-404 specification and uses human-readable text to transmit data objects across a network. When examining a JSON message, you’ll notice that they are broken up into a collection of attributes and value pairs. For example, a very simple JSON message to notify that the system is still working might look like the following:

{

“isAlive” : true

}

The “isAlive” portion of the message is the attribute and the “true” portion is the value that is paired with the attribute. JSON messages can include more than a single attribute/value pair. For example:

{

“isAlive” : true,

“DeviceID” = 1234,

“DeviceName” = “MyProduct”

}

You’ll notice that reading the JSON message is actually quite simple for a human and beats having to look-up which bits or bytes are associated with a variable.

JSON’s Impact on Embedded System Development

As you might suspect, the use of string messages to transfer information between devices puts an additional strain on embedded systems developers. We always used to use encoded and binary data because it is more efficient to transfer and requires less processing power to parse. Now, we need to parse string messages! I suspect most developers aren’t as familiar with the C string library which adds yet another wrinkle to using JSON.

There are several different ways to parse JSON messages in C which we will be discussing over the next few blogs. One way is to use an online library such as one of the following:

Conclusions

Any developer working on an IoT device will need to understand JSON and more importantly how to parse these messages. In the next post, we will take a look at how developers can use the built-in C library function strstr to parse JSON messages.

* * *

Struggling to keep your development skills up to date or facing outdated processes that slow down your team, raise costs, and impact product quality?

Here are 4 ways I can help you:

  • Embedded Software Academy: Enhance your skills, streamline your processes, and elevate your architecture. Join my academy for on-demand, hands-on workshops and cutting-edge development resources designed to transform your career and keep you ahead of the curve.
  • Consulting Services: Get personalized, expert guidance to streamline your development processes, boost efficiency, and achieve your project goals faster. Partner with us to unlock your team's full potential and drive innovation, ensuring your projects success.
  • Team Training and Development: Empower your team with the latest best practices in embedded software. Our expert-led training sessions will equip your team with the skills and knowledge to excel, innovate, and drive your projects to success.
  • Customized Design Solutions: Get design and development assistance to enhance efficiency, ensure robust testing, and streamline your development pipeline, driving your projects success.

Take action today to upgrade your skills, optimize your team, and achieve success.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.