|
brazos-trapezoidal
|
Strata Simulator Driver example. More...
#include <string.h>#include <stdint.h>#include "Strata.h"
Go to the source code of this file.
Functions | |
| char * | Get_Plataform_ID_Response (void) |
| char * | Get_Plataform_ID_ACK (void) |
| uint8_t | Check_Plataform_ID_Request (char *pparam, char *input, uint16_t len_input) |
| uint8_t | Check_Plataform_ID_Word (char *pparam, char *input) |
Strata Simulator Driver example.
THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. ON SEMICONDUCTOR SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
This utility provides the functions needed to serialize and deserialize JSON message protocols for use in applications like Strata. This utility does not require any knowledge of the means of communication such as serial, SPI, I2C or other magic, but simply generates a proper JSON string according to an external application driven structure and places it in an outgoing buffer for the application to transmit.
An application may also receive an incoming stream, place it in an incoming buffer and call upon this utility to deserialize and parse the command into an application defined structure.
The intent is to make serialization and deserialization of JSON strings less painful for developers.
Calls into this utility will return zero if successful and non-zero if unsuccessful. Non-zero values will indicate further details about the failure to indicate such items as invalid incoming Json structure, out of memory, etc.
Many strings prepared in C have different endings depending on the editor and IDE in use. JSON does not tolerate any non-printing characters such as tabs, backspaces or tabs, and this utility will strip those prior ro processing. JSON strings are always terminated with a LF (0x0A) and this will be appended to an outgoing buffer. Keep in mind the developer must be aware that sending a buffer out using STDIO methods such as printf MAY introduce errors for the far end of the comm channel. The recommended method is to handle the characters in the buffer individually without STDIO methods and check for terminationat the first LF detected. This also allows code that does not use Printf or associated libraries.
Definition in file Strata.c.
| uint8_t Check_Plataform_ID_Request | ( | char * | pparam, |
| char * | input, | ||
| uint16_t | len_input | ||
| ) |
| uint8_t Check_Plataform_ID_Word | ( | char * | pparam, |
| char * | input | ||
| ) |