private ICommProtocol GetProtocolDelegateForType(CommProtocolType protocol) { if (protocol == CommProtocolType.CommSconnProtocol) { return(new CommSconnProtocol(this)); } return(null); }
public Boolean UpdateDevice() { CommProtocolType protType = GetDeviceQueryProtcol(); ICommProtocol protocol = GetProtocolDelegateForType(protType); if (protocol.ProtocolDeviceQueryAble()) { return(protocol.LoadDeviceProperties(this)); } return(false); }
public Boolean QueryDeviceActions() { try { CommProtocolType protType = GetDeviceQueryProtcol(); ICommProtocol protocol = GetProtocolDelegateForType(protType); if (protocol.ProtocolDeviceQueryAble()) { return(protocol.LoadDeviceActions(_Device)); } } catch (Exception e) { } return(false); }
public Task PerformActionAsync(DeviceAction action) { try { CommProtocolType protType = GetDeviceQueryProtcol(); ICommProtocol protocol = GetProtocolDelegateForType(protType); if (protocol.ProtocolDeviceQueryAble()) { return(protocol.PerformActionAsync(action)); } else { return(null); } } catch (Exception e) { return(null); } }