#include "defaults.h"
#include "senml_enums.h"
#include <math.h>
Go to the source code of this file.
◆ SENML_MAX_DOUBLE_PRECISION
| #define SENML_MAX_DOUBLE_PRECISION 8 |
◆ BaseData
Internal helper struct that stores the base value to be used during rendering
◆ SenmlData
Internal helper struct that stores information needed during the rendering process
◆ SenmlMemoryData
Internal helper struct that stores information needed during the rendering process
◆ StreamContext
Internal helper struct that stores information needed during the rendering process
◆ canPrint()
| bool canPrint |
( |
int |
length | ) |
|
Helper function for the generation process Determines if the underlying stream has enough space to write length bytes (_streamCtx).
always returns true for non buffer backed streams
◆ charAvailable()
Helper function for the parsing process Checks if there is data available on the stream. Warning: THIS CAN BE PROBLEMATIC ON MBED SYSTEMS>
◆ flush()
Helper function for the parsing process flush and reset all input for the current data stream.
◆ peekChar()
Helper function for the parsing process peek a character from the current data stream. takes into account that the stream might contain hex values.
◆ printBinaryAsBase64()
| int printBinaryAsBase64 |
( |
const unsigned char * |
data, |
|
|
unsigned int |
length |
|
) |
| |
Helper function for the generation process convert the data array to base64 string and write to stream (_streamCtx)
- Parameters
-
| data | pointer to the binary data blob that needs to be rendered as base64 to the stream. |
| length | the length of the data blob |
◆ printByte()
| int printByte |
( |
uint8_t |
value | ) |
|
Helper function for the generation process write a uint8_t as byte to the stream (_streamCtx).
- Parameters
-
◆ printDouble()
| int printDouble |
( |
double |
f, |
|
|
unsigned int |
digits |
|
) |
| |
Helper function for the generation process write a double as string to the stream (_streamCtx).
- Parameters
-
| f | the value to print |
| digits | the nr of digits that should be printed after the comma. |
◆ printInt()
Helper function for the generation process write a int as string to the stream (_streamCtx).
- Parameters
-
◆ printText()
| int printText |
( |
const char * |
value, |
|
|
int |
length |
|
) |
| |
Helper function for the generation process Writes the specified text to the stream (_streamCtx).
- Parameters
-
| value | the value to write |
| len | the length of the value. |
◆ printUnit()
Helper function for the generation process convert the unit to string and write to stream (_streamCtx).
- Parameters
-
| unit | the value to write as text to the stream. |
◆ readChar()
Helper function for the parsing process read a character from the current data stream (_streamCtx) takes into account that the stream might contain hex values
◆ readChars()
| void readChars |
( |
unsigned char * |
buffer, |
|
|
int |
len |
|
) |
| |
|
inline |
Helper function for the parsing process Reads the specified nr of characters from the stream (_streamCtx) takes into account that the stream might contain hex values
- Parameters
-
| buffer | the buffer to store the values in. |
| len | the nr of characters to read from the stream into the buffer. If the input contains hex values, the actual nr of characters read from the stream is double this value. |
◆ _streamCtx
Internal data field used for the rendering process.