fix: fixed ComHub error of using string deviceId instead of DeviceDisconnectMessage object
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
This commit is contained in:
parent
79b66b2d17
commit
abca043229
@ -338,6 +338,9 @@ namespace RR.Common.Controls
|
||||
return;
|
||||
}
|
||||
|
||||
string role = client.ControllerRole;
|
||||
string mac = client.MacAddress;
|
||||
|
||||
UnsubscribeDevice(client);
|
||||
_devices.Remove(deviceId);
|
||||
|
||||
@ -352,12 +355,21 @@ namespace RR.Common.Controls
|
||||
_defaultDeviceId = _devices.Keys.FirstOrDefault() ?? string.Empty;
|
||||
}
|
||||
|
||||
_disconnectedQueue.Enqueue(deviceId);
|
||||
_disconnectedQueue.Enqueue(new DeviceDisconnectMessage(deviceId, role, mac));
|
||||
}
|
||||
|
||||
private void OnDeviceConnectionLost(string deviceId)
|
||||
{
|
||||
_disconnectedQueue.Enqueue(deviceId);
|
||||
string role = string.Empty;
|
||||
string mac = string.Empty;
|
||||
|
||||
if (_devices.TryGetValue(deviceId, out ComDeviceClient client))
|
||||
{
|
||||
role = client.ControllerRole;
|
||||
mac = client.MacAddress;
|
||||
}
|
||||
|
||||
_disconnectedQueue.Enqueue(new DeviceDisconnectMessage(deviceId, role, mac));
|
||||
}
|
||||
|
||||
private IComControllerHandler CreateHandlerForDevice(string deviceId)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user