3-phase PV router
|
A class for managing and sending telemetry information in a structured frame format. More...
#include <teleinfo.h>
Public Member Functions | |
void | endFrame () |
Finalizes the frame by adding the end character and sending the buffer over Serial. | |
void | send (const char *tag, int16_t value, uint8_t index=0) |
Sends a telemetry value as an integer. | |
void | startFrame () |
Initializes a new frame by resetting the buffer and adding the start character. | |
Private Member Functions | |
uint8_t | calculateChecksum (uint8_t startPos, uint8_t endPos) const |
Calculates the checksum for a portion of the buffer. | |
void | writeTag (const char *tag, uint8_t index) |
Writes a tag to the buffer. | |
Private Attributes | |
char | buffer [calcBufferSize()] {} |
uint8_t | bufferPos { 0 } |
Static Private Attributes | |
static const char | CR { 0x0D } |
static const char | ETX { 0x03 } |
static const char | LF { 0x0A } |
static const char | STX { 0x02 } |
static const char | TAB { 0x09 } |
A class for managing and sending telemetry information in a structured frame format.
The TeleInfo
class is responsible for creating and sending telemetry frames that include various data points such as power, voltage, temperature, and relay states. The frames are formatted with tags, values, and checksums to ensure data integrity.
Definition at line 142 of file teleinfo.h.
|
inlinenodiscardprivate |
Calculates the checksum for a portion of the buffer.
startPos | The starting position in the buffer. |
endPos | The ending position in the buffer. |
Definition at line 160 of file teleinfo.h.
|
inline |
Finalizes the frame by adding the end character and sending the buffer over Serial.
Definition at line 227 of file teleinfo.h.
|
inline |
Sends a telemetry value as an integer.
tag | The tag associated with the value. |
value | The integer value to send. |
Definition at line 207 of file teleinfo.h.
|
inline |
Initializes a new frame by resetting the buffer and adding the start character.
Definition at line 196 of file teleinfo.h.
|
inlineprivate |
Writes a tag to the buffer.
tag | The tag to write. |
Definition at line 178 of file teleinfo.h.
|
private |
Buffer to store the frame data. Adjust size as needed.
Definition at line 151 of file teleinfo.h.
|
private |
Current position in the buffer.
Definition at line 152 of file teleinfo.h.
|
staticprivate |
Carriage Return character.
Definition at line 148 of file teleinfo.h.
|
staticprivate |
End of Frame character.
Definition at line 146 of file teleinfo.h.
|
staticprivate |
Line Feed character.
Definition at line 147 of file teleinfo.h.
|
staticprivate |
Start of Frame character.
Definition at line 145 of file teleinfo.h.
|
staticprivate |
Tab character.
Definition at line 149 of file teleinfo.h.