Merge pull request #14045 from pcdiem/dgr4

Add DevGroupSend full status item
This commit is contained in:
Theo Arends 2021-12-14 18:15:13 +01:00 committed by GitHub
commit 6a1090c876
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -591,8 +591,7 @@ bool _SendDeviceGroupMessage(int32_t device, DevGroupMessageType message_type, .
value_ptr = (uint8_t *)XdrvMailbox.data;
while ((item = strtoul((char *)value_ptr, (char **)&value_ptr, 0))) {
item_ptr->item = item;
if (*value_ptr != '=') return 1;
value_ptr++;
if (*value_ptr == '=') value_ptr++;
// If flags were specified for this item, save them.
item_ptr->flags = 0;
@ -613,6 +612,12 @@ bool _SendDeviceGroupMessage(int32_t device, DevGroupMessageType message_type, .
value = (oper == '+' ? old_value + value : oper == '-' ? old_value - value : oper == '^' ? old_value ^ value : oper == '|' ? old_value | value : old_value == '&' ? old_value & value : old_value);
}
item_ptr->value = value;
if (item == DGR_ITEM_STATUS) {
if (!(item_ptr->flags & DGR_ITEM_FLAG_NO_SHARE)) device_group->no_status_share = 0;
_SendDeviceGroupMessage(-device_group_index, DGR_MSGTYP_FULL_STATUS);
item_ptr--;
}
}
else {
item_ptr->value_ptr = out_ptr;