/// <summary> /// Get the device status. /// </summary> public void OnGetStatus() { if (deviceCommunication == null) { return; } if (deviceState != DeviceState.Disposed && (DateTime.Now - lastGetStatus).TotalSeconds > 2) { deviceCommunication.GetStatus(); lastGetStatus = DateTime.Now; } }
/// <summary> /// Get the device status. /// </summary> public void OnGetStatus() { if (deviceCommunication == null) { return; } DoFirewallCheck(); if (GetDeviceState() != DeviceState.Disposed && (DateTime.Now - lastGetStatus).TotalSeconds > 5) { deviceCommunication.GetStatus(); GetDeviceInformation(); lastGetStatus = DateTime.Now; } }