Example #1
0
        Task OnDeviceStateChanged(RemoteConnection_DeviceStateChangedMessage msg)
        {
            if (IsMessageFromCurrentDevice(msg))
            {
                DeviceStateChanged?.Invoke(this, msg.State.ToDeviceState());
            }

            return(Task.CompletedTask);
        }
Example #2
0
        bool IsMessageFromCurrentDevice(RemoteConnection_DeviceStateChangedMessage msg)
        {
            if (string.IsNullOrWhiteSpace(msg.DeviceId))
            {
                return(false);
            }

            if (RemoteDevice == null)
            {
                return(false);
            }

            return(msg.DeviceId == RemoteDevice.Id);
        }
Example #3
0
 public Task RemoteConnection_DeviceStateChanged(RemoteConnection_DeviceStateChangedMessage message)
 {
     //_log.WriteLine($"({deviceId}) Remote system state received");
     SendMessage(new Remote_DeviceStateChangedMessage(message.DeviceId, message.State.ToDeviceState()));
     return(Task.CompletedTask);
 }