Zigbee plugin mul/div extended to 16 bits

This commit is contained in:
Stephan Hadinger 2022-11-20 18:21:46 +01:00
parent 6e9394984d
commit 923ef8202e
3 changed files with 7 additions and 7 deletions

View File

@ -318,8 +318,8 @@ public:
} }
uint8_t type; // zigbee type, Zunk by default uint8_t type; // zigbee type, Zunk by default
int8_t multiplier; // multiply by x (ignore if 0 or 1) int16_t multiplier; // multiply by x (ignore if 0 or 1)
int8_t divider; // divide by x (ignore if 0 or 1) int16_t divider; // divide by x (ignore if 0 or 1)
int16_t base; // add x (ignore if 0) int16_t base; // add x (ignore if 0)
uint16_t cluster; // cluster number uint16_t cluster; // cluster number
uint16_t attribute; // attribute number uint16_t attribute; // attribute number
@ -354,8 +354,8 @@ public:
uint16_t attribute; // attribute to match uint16_t attribute; // attribute to match
uint16_t new_cluster; // replace with this cluster uint16_t new_cluster; // replace with this cluster
uint16_t new_attribute; // replace with this attribute uint16_t new_attribute; // replace with this attribute
int8_t multiplier; // multiply by x (ignore if 0 or 1) int16_t multiplier; // multiply by x (ignore if 0 or 1)
int8_t divider; // divide by x (ignore if 0 or 1) int16_t divider; // divide by x (ignore if 0 or 1)
int16_t base; // add x (ignore if 0) int16_t base; // add x (ignore if 0)
}; };

View File

@ -1000,8 +1000,8 @@ void ZCLFrame::parseReadConfigAttributes(uint16_t shortaddr, Z_attribute_list& a
} }
// find the multiplier // find the multiplier
int8_t multiplier = 1; int16_t multiplier = 1;
int8_t divider = 1; int16_t divider = 1;
int16_t base = 0; int16_t base = 0;
Z_attribute_match matched_attr = Z_findAttributeMatcherById(shortaddr, cluster, attrid, false); Z_attribute_match matched_attr = Z_findAttributeMatcherById(shortaddr, cluster, attrid, false);
if (matched_attr.found()) { if (matched_attr.found()) {

View File

@ -386,7 +386,7 @@ bool ZbUnload(const char *filename_raw) {
} }
// append modifiers like mul/div/manuf // append modifiers like mul/div/manuf
void Z_AppendModifiers(char * buf, size_t buf_len, int8_t multiplier, int8_t divider, int16_t base, uint16_t manuf) { void Z_AppendModifiers(char * buf, size_t buf_len, uint16_t multiplier, uint16_t divider, int16_t base, uint16_t manuf) {
if (multiplier != 0 && multiplier != 1) { if (multiplier != 0 && multiplier != 1) {
ext_snprintf_P(buf, buf_len, "%s,%s%i", buf, Z_MUL, multiplier); ext_snprintf_P(buf, buf_len, "%s,%s%i", buf, Z_MUL, multiplier);
} }