mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-06-17 13:26:31 +03:00
Merge branch 'dev' into core3
This commit is contained in:
@@ -26,11 +26,11 @@
|
||||
#endif
|
||||
|
||||
#ifndef EMSESP_DEFAULT_TX_MODE
|
||||
#define EMSESP_DEFAULT_TX_MODE 1 // EMS1.0
|
||||
#define EMSESP_DEFAULT_TX_MODE 5 // Auto
|
||||
#endif
|
||||
|
||||
#ifndef EMSESP_DEFAULT_EMS_BUS_ID
|
||||
#define EMSESP_DEFAULT_EMS_BUS_ID 0x0B // service key
|
||||
#define EMSESP_DEFAULT_EMS_BUS_ID 0x49 // gateway 2
|
||||
#endif
|
||||
|
||||
#ifndef EMSESP_DEFAULT_SYSLOG_ENABLED
|
||||
|
||||
@@ -448,6 +448,14 @@ class EMSdevice {
|
||||
static constexpr uint8_t EMS_DEVICE_ID_DHW2 = 0x29; // MM100 module as water station
|
||||
static constexpr uint8_t EMS_DEVICE_ID_DHW8 = 0x2F; // last DHW module id?
|
||||
static constexpr uint8_t EMS_DEVICE_ID_IPM_DHW = 0x41; // IPM module as water station
|
||||
static constexpr uint8_t EMS_DEVICE_ID_GATEWAY1 = 0x48; // KM200, MX300, MX400
|
||||
static constexpr uint8_t EMS_DEVICE_ID_GATEWAY2 = 0x49;
|
||||
static constexpr uint8_t EMS_DEVICE_ID_GATEWAY3 = 0x4A;
|
||||
static constexpr uint8_t EMS_DEVICE_ID_GATEWAY4 = 0x4B;
|
||||
static constexpr uint8_t EMS_DEVICE_ID_GATEWAY5 = 0x4C;
|
||||
static constexpr uint8_t EMS_DEVICE_ID_GATEWAY6 = 0x4D;
|
||||
static constexpr uint8_t EMS_DEVICE_ID_GATEWAY7 = 0x4E;
|
||||
static constexpr uint8_t EMS_DEVICE_ID_GATEWAY8 = 0x4F;
|
||||
|
||||
// generic type IDs
|
||||
static constexpr uint16_t EMS_TYPE_NAME = 0x01; // device config for ems devices, name ascii on offset 27ff for ems+
|
||||
|
||||
@@ -43,6 +43,7 @@ uint8_t EMSbus::ems_mask_ = EMS_MASK_UNSET; // unset so its triggered
|
||||
uint8_t EMSbus::ems_bus_id_ = EMSESP_DEFAULT_EMS_BUS_ID;
|
||||
uint8_t EMSbus::tx_mode_ = EMSESP_DEFAULT_TX_MODE;
|
||||
uint8_t EMSbus::tx_state_ = Telegram::Operation::NONE;
|
||||
bool EMSbus::isEMS2_ = false;
|
||||
|
||||
uuid::log::Logger EMSbus::logger_{F_(telegram), uuid::log::Facility::CONSOLE};
|
||||
|
||||
@@ -206,7 +207,9 @@ void RxService::add(uint8_t * data, uint8_t length) {
|
||||
message_data = data + 6;
|
||||
message_length = length - 7;
|
||||
}
|
||||
|
||||
if (type_id > 0x0FF && message_length > 1) { // used for auto tx_mode
|
||||
set_ems2();
|
||||
}
|
||||
// if we're watching and "raw" print out actual telegram as bytes to the console
|
||||
// including the CRC at the end
|
||||
if (EMSESP::watch() == EMSESP::Watch::WATCH_RAW) {
|
||||
|
||||
@@ -169,6 +169,14 @@ class EMSbus {
|
||||
return (ems_mask_ == EMS_MASK_HT3);
|
||||
}
|
||||
|
||||
static bool is_ems2() {
|
||||
return isEMS2_;
|
||||
}
|
||||
|
||||
static void set_ems2() {
|
||||
isEMS2_ = true;;
|
||||
}
|
||||
|
||||
static uint8_t ems_mask() {
|
||||
return ems_mask_;
|
||||
}
|
||||
@@ -242,6 +250,7 @@ class EMSbus {
|
||||
static uint8_t ems_bus_id_; // the bus id, which configurable and stored in settings
|
||||
static uint8_t tx_mode_; // local copy of the tx mode
|
||||
static uint8_t tx_state_; // state of the Tx line (NONE or waiting on a TX_READ or TX_WRITE)
|
||||
static bool isEMS2_;
|
||||
};
|
||||
|
||||
class RxService : public EMSbus {
|
||||
|
||||
Reference in New Issue
Block a user