public static DeviceConnectedStatus Deserialise(Stream stream)
 {
     DeviceConnectedStatus result = new DeviceConnectedStatus();
     result.Online = IPCHelper.ReadBoolean(stream);
     result.LastActivityTime = IPCHelper.ReadDateTime(stream);
     return result;
 }
        public static DeviceConnectedStatus Deserialise(Stream stream)
        {
            DeviceConnectedStatus result = new DeviceConnectedStatus();

            result.Online           = IPCHelper.ReadBoolean(stream);
            result.LastActivityTime = IPCHelper.ReadDateTime(stream);
            return(result);
        }
Beispiel #3
0
 public DeviceConnectedStatus GetDeviceConnectedStatus(Guid clientID)
 {
     DeviceConnectedStatus result = null;
     LWM2MClient client = BusinessLogicFactory.Clients.GetClient(clientID);
     if (client != null)
     {
         result = new DeviceConnectedStatus();
         result.Online = (client.Lifetime > DateTime.UtcNow);
         if (client.LastActivityTime > DateTime.MinValue)
             result.LastActivityTime = client.LastActivityTime;
     }
     return result;
 }