22 TEST_ASSERT_EQUAL(5 + 1 + 3,
lineSize(1, 3));
23 TEST_ASSERT_EQUAL(5 + 2 + 5,
lineSize(2, 5));
24 TEST_ASSERT_EQUAL(5 + 4 + 2,
lineSize(4, 2));
33 TEST_ASSERT_GREATER_THAN(10, bufferSize);
34 TEST_ASSERT_LESS_THAN(1000, bufferSize);
44 TEST_ASSERT_TRUE(
true);
53 teleinfo.startFrame();
54 teleinfo.
send(
"P", 1234);
55 teleinfo.
send(
"V", 230, 1);
56 teleinfo.
send(
"T", -15, 2);
60 TEST_ASSERT_TRUE(
true);
68 teleinfo.startFrame();
71 teleinfo.
send(
"ZERO", 0);
72 teleinfo.
send(
"MAX", 32767);
73 teleinfo.
send(
"MIN", -32768);
74 teleinfo.
send(
"POS", 1);
75 teleinfo.
send(
"NEG", -1);
80 TEST_ASSERT_TRUE(
true);
89 teleinfo.startFrame();
90 teleinfo.
send(
"F1", 100);
94 teleinfo.startFrame();
95 teleinfo.
send(
"F2", 200);
99 teleinfo.startFrame();
100 teleinfo.
send(
"F3", 300);
104 TEST_ASSERT_TRUE(
true);
112 teleinfo.startFrame();
115 for (
int i = 1;
i <= 10;
i++)
117 teleinfo.
send(
"V", 230 +
i,
i);
123 TEST_ASSERT_TRUE(
true);
131 Serial.println(
"Starting TeleInfo embedded tests...");
146 Serial.println(
"All TeleInfo tests completed!");
A class for managing and sending telemetry information in a structured frame format.
void send(const char *tag, int16_t value, uint8_t index=0)
Sends a telemetry value as an integer.
Basic configuration values to be set by the end-user.
void test_teleinfo_edge_values(void)
void test_lineSize_calculation(void)
void test_teleinfo_multiple_frames(void)
void test_teleinfo_instantiation(void)
void test_teleinfo_long_sequences(void)
void test_calcBufferSize_compile_time(void)
void test_teleinfo_basic_operations(void)
static constexpr size_t calcBufferSize()
Calculates the total buffer size required for the telemetry frame.
static constexpr size_t lineSize(size_t tagLen, size_t valueLen)
Calculates the size of a single telemetry line in the frame.
Manages telemetry data and frame formatting.