mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-05-01 11:45:13 +00:00
read fragmented telegram 0x484, #3017
This commit is contained in:
@@ -368,7 +368,7 @@ void EMSdevice::fetch_values() {
|
|||||||
|
|
||||||
for (const auto & tf : telegram_functions_) {
|
for (const auto & tf : telegram_functions_) {
|
||||||
if (tf.fetch_) {
|
if (tf.fetch_) {
|
||||||
read_command(tf.telegram_type_id_);
|
read_command(tf.telegram_type_id_, 0, tf.length_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -547,8 +547,8 @@ void EMSdevice::show_mqtt_handlers(uuid::console::Shell & shell) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// register a callback function for a specific telegram type
|
// register a callback function for a specific telegram type
|
||||||
void EMSdevice::register_telegram_type(const uint16_t telegram_type_id, const char * telegram_type_name, bool fetch, const process_function_p f) {
|
void EMSdevice::register_telegram_type(const uint16_t telegram_type_id, const char * telegram_type_name, bool fetch, const process_function_p f, uint8_t length) {
|
||||||
telegram_functions_.emplace_back(telegram_type_id, telegram_type_name, fetch, false, f);
|
telegram_functions_.emplace_back(telegram_type_id, telegram_type_name, fetch, false, length, f);
|
||||||
}
|
}
|
||||||
|
|
||||||
// add to device value library, also know now as a "device entity"
|
// add to device value library, also know now as a "device entity"
|
||||||
|
|||||||
@@ -259,7 +259,7 @@ class EMSdevice {
|
|||||||
void setCustomizationEntity(const std::string & entity_id);
|
void setCustomizationEntity(const std::string & entity_id);
|
||||||
void getCustomizationEntities(std::vector<std::string> & entity_ids);
|
void getCustomizationEntities(std::vector<std::string> & entity_ids);
|
||||||
|
|
||||||
void register_telegram_type(const uint16_t telegram_type_id, const char * telegram_type_name, bool fetch, const process_function_p cb);
|
void register_telegram_type(const uint16_t telegram_type_id, const char * telegram_type_name, bool fetch, const process_function_p cb, uint8_t length = 0);
|
||||||
bool handle_telegram(std::shared_ptr<const Telegram> telegram);
|
bool handle_telegram(std::shared_ptr<const Telegram> telegram);
|
||||||
|
|
||||||
std::string get_value_uom(const std::string & shortname) const;
|
std::string get_value_uom(const std::string & shortname) const;
|
||||||
@@ -555,13 +555,15 @@ class EMSdevice {
|
|||||||
const char * telegram_type_name_; // e.g. RC20Message
|
const char * telegram_type_name_; // e.g. RC20Message
|
||||||
bool fetch_; // if this type_id be queried automatically
|
bool fetch_; // if this type_id be queried automatically
|
||||||
bool received_;
|
bool received_;
|
||||||
|
uint8_t length_;
|
||||||
const process_function_p process_function_;
|
const process_function_p process_function_;
|
||||||
|
|
||||||
TelegramFunction(uint16_t telegram_type_id, const char * telegram_type_name, bool fetch, bool received, const process_function_p process_function)
|
TelegramFunction(uint16_t telegram_type_id, const char * telegram_type_name, bool fetch, bool received, uint8_t length, const process_function_p process_function)
|
||||||
: telegram_type_id_(telegram_type_id)
|
: telegram_type_id_(telegram_type_id)
|
||||||
, telegram_type_name_(telegram_type_name)
|
, telegram_type_name_(telegram_type_name)
|
||||||
, fetch_(fetch)
|
, fetch_(fetch)
|
||||||
, received_(received)
|
, received_(received)
|
||||||
|
, length_(length)
|
||||||
, process_function_(process_function) {
|
, process_function_(process_function) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
|
|||||||
|
|
||||||
register_telegram_type(0x492, "HpHeaterConfig", true, MAKE_PF_CB(process_HpHeaterConfig));
|
register_telegram_type(0x492, "HpHeaterConfig", true, MAKE_PF_CB(process_HpHeaterConfig));
|
||||||
register_telegram_type(0x488, "HPValve", true, MAKE_PF_CB(process_HpValve));
|
register_telegram_type(0x488, "HPValve", true, MAKE_PF_CB(process_HpValve));
|
||||||
register_telegram_type(0x484, "HPSilentMode", true, MAKE_PF_CB(process_HpSilentMode));
|
register_telegram_type(0x484, "HPSilentMode", true, MAKE_PF_CB(process_HpSilentMode), 65);
|
||||||
register_telegram_type(0x48B, "HPPumps", true, MAKE_PF_CB(process_HpPumps));
|
register_telegram_type(0x48B, "HPPumps", true, MAKE_PF_CB(process_HpPumps));
|
||||||
register_telegram_type(0x491, "HPAdditionalHeater", true, MAKE_PF_CB(process_HpAdditionalHeater));
|
register_telegram_type(0x491, "HPAdditionalHeater", true, MAKE_PF_CB(process_HpAdditionalHeater));
|
||||||
register_telegram_type(0x499, "HPDhwSettings", true, MAKE_PF_CB(process_HpDhwSettings));
|
register_telegram_type(0x499, "HPDhwSettings", true, MAKE_PF_CB(process_HpDhwSettings));
|
||||||
|
|||||||
Reference in New Issue
Block a user