mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 16:29:51 +03:00
store ems plus type (FF, F7, F9)
This commit is contained in:
10
src/ems.cpp
10
src/ems.cpp
@@ -881,9 +881,10 @@ void ems_parseTelegram(uint8_t * telegram, uint8_t length) {
|
|||||||
// determing if its normal ems or ems plus, check for marker
|
// determing if its normal ems or ems plus, check for marker
|
||||||
if (telegram[2] >= 0xF0) {
|
if (telegram[2] >= 0xF0) {
|
||||||
// its EMS plus / EMS 2.0
|
// its EMS plus / EMS 2.0
|
||||||
EMS_RxTelegram.emsplus = true;
|
EMS_RxTelegram.emsplus = true;
|
||||||
|
EMS_RxTelegram.emsplus_type = telegram[2]; // 0xFF, 0xF7 or 0xF9
|
||||||
|
|
||||||
if (telegram[2] == 0xFF) {
|
if (EMS_RxTelegram.emsplus_type == 0xFF) {
|
||||||
EMS_RxTelegram.type = (telegram[4] << 8) + telegram[5]; // is a long in bytes 5 & 6
|
EMS_RxTelegram.type = (telegram[4] << 8) + telegram[5]; // is a long in bytes 5 & 6
|
||||||
EMS_RxTelegram.data = telegram + 6;
|
EMS_RxTelegram.data = telegram + 6;
|
||||||
|
|
||||||
@@ -1462,6 +1463,11 @@ void _process_JunkersStatusMessage(_EMS_RxTelegram * EMS_RxTelegram) {
|
|||||||
* type 0x01B9 EMS+ for reading the mode from RC300/RC310 thermostat
|
* type 0x01B9 EMS+ for reading the mode from RC300/RC310 thermostat
|
||||||
*/
|
*/
|
||||||
void _process_RCPLUSSetMessage(_EMS_RxTelegram * EMS_RxTelegram) {
|
void _process_RCPLUSSetMessage(_EMS_RxTelegram * EMS_RxTelegram) {
|
||||||
|
// ignore F7 and F9
|
||||||
|
if (EMS_RxTelegram->emsplus_type != 0xFF) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (EMS_RxTelegram->offset == 0) {
|
if (EMS_RxTelegram->offset == 0) {
|
||||||
EMS_Thermostat.mode = _toByte(EMS_OFFSET_RCPLUSSet_mode);
|
EMS_Thermostat.mode = _toByte(EMS_OFFSET_RCPLUSSet_mode);
|
||||||
EMS_Thermostat.daytemp = _toByte(EMS_OFFSET_RCPLUSSet_temp_comfort2); // is * 2
|
EMS_Thermostat.daytemp = _toByte(EMS_OFFSET_RCPLUSSet_temp_comfort2); // is * 2
|
||||||
|
|||||||
23
src/ems.h
23
src/ems.h
@@ -190,19 +190,20 @@ typedef struct {
|
|||||||
|
|
||||||
// The Rx receive package
|
// The Rx receive package
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint32_t timestamp; // timestamp from millis()
|
uint32_t timestamp; // timestamp from millis()
|
||||||
uint8_t * telegram; // the full data package
|
uint8_t * telegram; // the full data package
|
||||||
uint8_t data_length; // length in bytes of the data
|
uint8_t data_length; // length in bytes of the data
|
||||||
uint8_t length; // full length of the complete telegram
|
uint8_t length; // full length of the complete telegram
|
||||||
uint8_t src; // source ID
|
uint8_t src; // source ID
|
||||||
uint8_t dest; // destination ID
|
uint8_t dest; // destination ID
|
||||||
uint16_t type; // type ID as a double byte to support EMS+
|
uint16_t type; // type ID as a double byte to support EMS+
|
||||||
uint8_t offset; // offset
|
uint8_t offset; // offset
|
||||||
uint8_t * data; // pointer to where telegram data starts
|
uint8_t * data; // pointer to where telegram data starts
|
||||||
bool emsplus; // true if ems+/ems 2.0
|
bool emsplus; // true if ems+/ems 2.0
|
||||||
|
uint8_t emsplus_type; // FF, F7 or F9
|
||||||
} _EMS_RxTelegram;
|
} _EMS_RxTelegram;
|
||||||
|
|
||||||
// default empty Tx
|
// default empty Tx, must match struct
|
||||||
const _EMS_TxTelegram EMS_TX_TELEGRAM_NEW = {
|
const _EMS_TxTelegram EMS_TX_TELEGRAM_NEW = {
|
||||||
EMS_TX_TELEGRAM_INIT, // action
|
EMS_TX_TELEGRAM_INIT, // action
|
||||||
EMS_ID_NONE, // dest
|
EMS_ID_NONE, // dest
|
||||||
|
|||||||
Reference in New Issue
Block a user