示例#1
0
        override public uint CallMethod(IAdapterMethod Method, out IAdapterIoRequest RequestPtr)
        {
            RequestPtr = null;

            ((BridgeAdapterMethod <HoermannDevice>)Method).Device.CallMethod(Method);

            return(ERROR_SUCCESS);
        }
示例#2
0
        public uint CallMethod(
            IAdapterMethod Method,
            out IAdapterIoRequest RequestPtr)
        {
            RequestPtr = null;

            return(ERROR_SUCCESS);
        }
示例#3
0
文件: Adapter.cs 项目: alljoyn/dsb
        public uint CallMethod(
            IAdapterMethod Method,
            out IAdapterIoRequest RequestPtr)
        {
            RequestPtr = null;
            ((ModbusSensorMethod)Method).SetValue();

            return(ERROR_SUCCESS);
        }
示例#4
0
        public uint CallMethod(IAdapterMethod Method, out IAdapterIoRequest RequestPtr)
        {
            RequestPtr = null;


            AllJoynMethod?.Invoke(this, new AllJoynMethodData(Method, devices[0]));

            return(ERROR_SUCCESS);
        }
示例#5
0
 public uint CallMethod(
     IAdapterMethod Method,
     out IAdapterIoRequest RequestPtr)
 {
     RequestPtr = null;
     if (Method is AdapterMethod)
     {
         ((AdapterMethod)Method).Invoke();
     }
     return(ERROR_SUCCESS);
 }
示例#6
0
 virtual public void CallMethod(IAdapterMethod method)
 {
     if (method.Name == "LearnCmd")
     {
         Task.Factory.StartNew(async() =>
         {
             var commandhex    = await _conn.LearnCommand();
             var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
             localSettings.Values["commandhex:" + Convert.ToString(method.InputParams[0].Data)] = commandhex;
         });
     }
     else if (method.Name == "SendCmd")
     {
         var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
         var commandhex    = (string)localSettings.Values["commandhex:" + Convert.ToString(method.InputParams[0].Data)];
         _conn.SendCommandHex(commandhex);
     }
 }
示例#7
0
        public uint CallMethod(
            IAdapterMethod Method,
            out IAdapterIoRequest RequestPtr)
        {
            RequestPtr = null;

            // sanity check
            if (Method == null)
            {
                return(ERROR_INVALID_PARAMETER);
            }

            // IAdapterMethod is either a ZclCommand or a ManagementLeave command,
            // cast back IAdapterMethod to ZclCommand first then to ManagementLeave if cast failed
            try
            {
                var command = (ZclCommand)Method;
                command.Send();
                return((uint)command.HResult);
            }
            catch (InvalidCastException e)
            {
                // send the leave command and remove devices (hence all end points of the ZigBee device)
                //
                // Note that ManagementLeave is THE unique ZdoCommand exposed to AllJoyn
                //
                var command = (ManagementLeave)Method;
                command.Send();

                if (command.ZigBeeStatus != ZdoHelper.ZDO_NOT_SUPPORTED)
                {
                    // async device removal
                    Task.Run(() => RemoveDevice(command.Device));
                }

                return((uint)command.HResult);
            }
        }
 public AllJoynMethodData(IAdapterMethod method, IAdapterDevice adapterDevice)
 {
     this.Method = method;
     this.AdapterDevice = adapterDevice;
 }
        public uint CallMethod(IAdapterMethod Method, out IAdapterIoRequest RequestPtr)
        {
            RequestPtr = null;

            AllJoynMethod?.Invoke(this, new AllJoynMethodData(Method, devices[0]));

            return ERROR_SUCCESS;
        }
示例#10
0
 public uint CallMethod(IAdapterMethod Method, out IAdapterIoRequest RequestPtr)
 {
     return(_adapter.CallMethod(Method, out RequestPtr));
 }
示例#11
0
 public uint CallMethod(
     IAdapterMethod Method,
     out IAdapterIoRequest RequestPtr)
 {
     RequestPtr = null;
     if(Method is AdapterMethod)
     {
         ((AdapterMethod)Method).Invoke();
     }
     return ERROR_SUCCESS;
 }
示例#12
0
 virtual public void CallMethod(IAdapterMethod methodn)
 {
 }
示例#13
0
        public uint CallMethod(
            IAdapterMethod Method,
            out IAdapterIoRequest RequestPtr)
        {
            RequestPtr = null;

            return ERROR_SUCCESS;
        }
示例#14
0
 public AllJoynMethodData(IAdapterMethod method, IAdapterDevice adapterDevice)
 {
     this.Method        = method;
     this.AdapterDevice = adapterDevice;
 }