Project Description
GET POST PATCH DELETE for submitting telemetry data to an Azure Mobile Service Table.
Parses JSON Response into array of name-value records.
C++ Compact 2013
Acknowledgement
Thanks to Thierry Joubert for the socket code (netTool).
Updates
  • Documentation (Embedded101.com blogs) now available. See DOCUMENTATION tab. Now several articles.
  • DELETE and PATCH(Update/PUT) now work
  • Fixed CheckArray(): This "removes" multiple values of a sensor. Leaves only most recent (larger id).
  • Supplementary HTML app (Web site project) added. See bottom of Downloads page.

Coming
  • DateTime data type: Available now in repository (Source Code Tab)
  • Filters on GET: In repository is documentation of the AzMS scripts: Read script shows how to make available a number of SQL style Selections.
  • Module (ie as a a lib/dll)


CEJSON is an API for posting telemetry data from an embedded device to an Azure Mobile Service (AzMS) table. The API also supports retrieving existing data records from an AzMS table and parsing the JSON string so returned into a (C++) array of name-value records.

The target for this project is Windows Embedded Compact 2013 devices. There is though a Windows desktop console project included that uses the same source code. There is also a Universal app that runs on a Windows 8.1 Desktop or RT Surface as well as on Win 8.1 Phones. This will display the telemetry AzMS table as well as post new values to the same table. Whilst the Universal app uses Managed Code, the desktop app and the embedded API use native code.

This project is the next in a series of Internet of Things (IoT) activities. The previous activity is Ardjson, a similar project for Arduino devices, upon which this project is based. Both projects use the same AzMS service and have similar functionality. The blogs on embedded101.com for Ardjson discuss various nuances for both of activities, particularly with respect to HTTP POST & GET.

Scenario
An embedded device is collecting data from one or more sensors and periodically uploading that raw data to the cloud (an AzMS table). Other devices can pull that data back but generally only want to display or act upon the most recent value for any sensor so all values are filtered except the most recent. The old data is to be retained for time based analysis. The filtering could/should be done in the cloud but is only done partially. Tagged records (like the complete field with the sample AzMS ToDo app) are not returned but tagging isn't done in the service. The Universal app does process the data it receives and tags the older data. The GET query from the embedded devices firstly displays all of the untagged records then does a check (*CheckArray( ) ) and then only displays the most recent values.


Blog: http://www.embedded101.com/Blogs/David-Jones

Last edited Apr 17, 2015 at 2:43 PM by DJonesEmbedded, version 26