The C Ingestion SDK is a portable header-only library written in C99 for data collection on embedded devices. It’s designed to reliably store sampled data from sensors at a high frequency in very little memory. On top of this it allows cryptographic signing of the data when sampling is complete. Data can be stored on a POSIX file system, in memory, or on a raw block device.Documentation Index
Fetch the complete documentation index at: https://docs.edgeimpulse.com/llms.txt
Use this file to discover all available pages before exploring further.
Installation instructions
- Add Mbed TLS to your project (see signing contexts to use a different TLS library).
- Download the SDK.
- Copy the
incfolder to your project. This contains all headers and source files.
Usage
The following application:- Initializes the library.
- Sets up the Mbed TLS signing context with the key
my-hmac-sha256-key. - Creates a file with three axes (
accX,accY,accZ) and four readings. - It then prints out the CBOR buffer.
Signing contexts
If you are using a different TLS library you can implement a custom signing context. Here’s an example:Adding fields to the protected header
The signing context can also add new fields to the protected header, such as an expiration date for the token. We suggest to use the JWT Claim Names. You do this by registering aset_protected callback:
Usage on non-POSIX systems
The storage layer is pluggable. You’ll need to set theEI_SENSOR_AQ_STREAM macro to an object of your choice, and then implement fwrite() and fseek() methods to interact with the storage layer. If your system has a clock you can also implement the time() method. If not, the iat (issued at) field in the header will be omitted.
This is an example of using a memory-backed storage layer: