Exemple #1
0
 private ICommProtocol GetProtocolDelegateForType(CommProtocolType protocol)
 {
     if (protocol == CommProtocolType.CommSconnProtocol)
     {
         return(new CommSconnProtocol(this));
     }
     return(null);
 }
Exemple #2
0
        public Boolean UpdateDevice()
        {
            CommProtocolType protType = GetDeviceQueryProtcol();
            ICommProtocol    protocol = GetProtocolDelegateForType(protType);

            if (protocol.ProtocolDeviceQueryAble())
            {
                return(protocol.LoadDeviceProperties(this));
            }
            return(false);
        }
Exemple #3
0
 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);
     }
 }