test code for duplicate issue

This commit is contained in:
proddy
2019-03-24 16:26:45 +01:00
parent 578783382a
commit 303e3adc81
2 changed files with 40 additions and 27 deletions

View File

@@ -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

View File

@@ -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;