Final fix Device Groups Exception

This commit is contained in:
Theo Arends 2021-01-24 16:03:42 +01:00
parent bc52c2fbfc
commit a6c51f1fb4
2 changed files with 0 additions and 5 deletions

View File

@ -659,7 +659,6 @@ bool ValidIpAddress(const char* str)
return ip_address.fromString(str);
}
bool ParseIPv4(uint32_t* addr, const char* str_p)
{
uint8_t *part = (uint8_t*)addr;

View File

@ -225,7 +225,6 @@ void SendReceiveDeviceGroupMessage(struct device_group * device_group, struct de
flags |= *message_ptr++ << 8;
// Initialize the log buffer.
// log_length = sprintf(log_buffer, PSTR("DGR: %s %s message %s %s: seq=%u, flags=%u"), (received ? PSTR("Received") : PSTR("Sending")), device_group->group_name, (received ? PSTR("from") : PSTR("to")), (device_group_member ? device_group_member->ip_address.toString().c_str() : received ? PSTR("local") : PSTR("network")), message_sequence, flags);
log_length = sprintf(log_buffer, PSTR("DGR: %s %s message %s %s: seq=%u, flags=%u"), (received ? PSTR("Received") : PSTR("Sending")), device_group->group_name, (received ? PSTR("from") : PSTR("to")), (device_group_member ? IPAddressToString(device_group_member->ip_address) : received ? PSTR("local") : PSTR("network")), message_sequence, flags);
log_ptr = log_buffer + log_length;
log_remaining = sizeof(log_buffer) - log_length;
@ -783,7 +782,6 @@ void ProcessDeviceGroupMessage(uint8_t * message, int message_length)
}
device_group_member->ip_address = remote_ip;
*flink = device_group_member;
// AddLog(LOG_LEVEL_DEBUG, PSTR("DGR: Member %s added"), remote_ip.toString().c_str());
AddLog(LOG_LEVEL_DEBUG, PSTR("DGR: Member %s added"), IPAddressToString(remote_ip));
break;
}
@ -804,7 +802,6 @@ void DeviceGroupStatus(uint8_t device_group_index)
struct device_group * device_group = &device_groups[device_group_index];
buffer[0] = buffer[1] = 0;
for (struct device_group_member * device_group_member = device_group->device_group_members; device_group_member; device_group_member = device_group_member->flink) {
// snprintf_P(buffer, sizeof(buffer), PSTR("%s,{\"IPAddress\":\"%s\",\"ResendCount\":%u,\"LastRcvdSeq\":%u,\"LastAckedSeq\":%u}"), buffer, device_group_member->ip_address.toString().c_str(), device_group_member->unicast_count, device_group_member->received_sequence, device_group_member->acked_sequence);
snprintf_P(buffer, sizeof(buffer), PSTR("%s,{\"IPAddress\":\"%s\",\"ResendCount\":%u,\"LastRcvdSeq\":%u,\"LastAckedSeq\":%u}"), buffer, IPAddressToString(device_group_member->ip_address), device_group_member->unicast_count, device_group_member->received_sequence, device_group_member->acked_sequence);
member_count++;
}
@ -882,7 +879,6 @@ AddLog(LOG_LEVEL_DEBUG, PSTR("DGR: Checking next_check_time=%u, now=%u"), next_c
if ((long)(now - device_group->member_timeout_time) >= 0) {
*flink = device_group_member->flink;
free(device_group_member);
// AddLog(LOG_LEVEL_DEBUG, PSTR("DGR: Member %s removed"), device_group_member->ip_address.toString().c_str());
AddLog(LOG_LEVEL_DEBUG, PSTR("DGR: Member %s removed"), IPAddressToString(device_group_member->ip_address));
continue;
}