pass cmd string as reference

This commit is contained in:
proddy
2022-03-26 22:28:50 +01:00
parent d0efe8eb47
commit 175412774c
2 changed files with 2 additions and 2 deletions

View File

@@ -489,7 +489,7 @@ bool EMSdevice::is_readable(const void * value_p) const {
} }
// check if value/command is readonly // check if value/command is readonly
bool EMSdevice::is_readonly(const std::string cmd, const int8_t id) const { bool EMSdevice::is_readonly(const std::string & cmd, const int8_t id) const {
uint8_t tag = id > 0 ? DeviceValueTAG::TAG_HC1 + id - 1 : DeviceValueTAG::TAG_NONE; uint8_t tag = id > 0 ? DeviceValueTAG::TAG_HC1 + id - 1 : DeviceValueTAG::TAG_NONE;
for (const auto & dv : devicevalues_) { for (const auto & dv : devicevalues_) {
// check command name and tag, id -1 is default hc and only checks name // check command name and tag, id -1 is default hc and only checks name

View File

@@ -243,7 +243,7 @@ class EMSdevice {
void read_command(const uint16_t type_id, uint8_t offset = 0, uint8_t length = 0) const; void read_command(const uint16_t type_id, uint8_t offset = 0, uint8_t length = 0) const;
bool is_readable(const void * value_p) const; bool is_readable(const void * value_p) const;
bool is_readonly(const std::string cmd, const int8_t id) const; bool is_readonly(const std::string & cmd, const int8_t id) const;
bool has_command(const void * value_p) const; bool has_command(const void * value_p) const;
void publish_value(void * value_p) const; void publish_value(void * value_p) const;
void publish_all_values(); void publish_all_values();