mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-08 00:39:50 +03:00
test code for duplicate issue
This commit is contained in:
14
src/ems.cpp
14
src/ems.cpp
@@ -577,13 +577,25 @@ void _createValidate() {
|
||||
EMS_TxQueue.unshift(new_EMS_TxTelegram); // add back to queue making it first to be picked up next (FIFO)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Entry point TODO: tidy up
|
||||
*/
|
||||
void ems_parseTelegram(uint8_t * telegram, uint8_t length) {
|
||||
_ems_readTelegram(telegram, length);
|
||||
// now clear it just be safe
|
||||
for (uint8_t i = 0; i < EMS_MAXBUFFERSIZE; i++) {
|
||||
telegram[i] = 0x00;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* the main logic that parses the telegram message, triggered by an interrupt in emsuart.cpp
|
||||
* length is only data bytes, excluding the BRK
|
||||
* Read commands are asynchronous as they're handled by the interrupt
|
||||
* When we receive a Poll Request we need to send any Tx packages quickly within a 200ms window
|
||||
*/
|
||||
void ems_parseTelegram(uint8_t * telegram, uint8_t length) {
|
||||
void _ems_readTelegram(uint8_t * telegram, uint8_t length) {
|
||||
// check if we just received a single byte
|
||||
// it could well be a Poll request from the boiler for us, which will have a value of 0x8B (0x0B | 0x80)
|
||||
// or either a return code like 0x01 or 0x04 from the last Write command
|
||||
|
||||
@@ -315,6 +315,7 @@ int _ems_findBoilerModel(uint8_t model_id);
|
||||
bool _ems_setModel(uint8_t model_id);
|
||||
void _ems_setThermostatModel(uint8_t thermostat_modelid);
|
||||
void _removeTxQueue();
|
||||
void _ems_readTelegram(uint8_t * telegram, uint8_t length);
|
||||
|
||||
// global so can referenced in other classes
|
||||
extern _EMS_Sys_Status EMS_Sys_Status;
|
||||
|
||||
Reference in New Issue
Block a user