override public uint CallMethod(IAdapterMethod Method, out IAdapterIoRequest RequestPtr) { RequestPtr = null; ((BridgeAdapterMethod <HoermannDevice>)Method).Device.CallMethod(Method); return(ERROR_SUCCESS); }
public uint CallMethod( IAdapterMethod Method, out IAdapterIoRequest RequestPtr) { RequestPtr = null; return(ERROR_SUCCESS); }
public uint CallMethod( IAdapterMethod Method, out IAdapterIoRequest RequestPtr) { RequestPtr = null; ((ModbusSensorMethod)Method).SetValue(); return(ERROR_SUCCESS); }
public uint CallMethod(IAdapterMethod Method, out IAdapterIoRequest RequestPtr) { RequestPtr = null; AllJoynMethod?.Invoke(this, new AllJoynMethodData(Method, devices[0])); return(ERROR_SUCCESS); }
public uint CallMethod( IAdapterMethod Method, out IAdapterIoRequest RequestPtr) { RequestPtr = null; if (Method is AdapterMethod) { ((AdapterMethod)Method).Invoke(); } return(ERROR_SUCCESS); }
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); } }
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; }
public uint CallMethod(IAdapterMethod Method, out IAdapterIoRequest RequestPtr) { return(_adapter.CallMethod(Method, out RequestPtr)); }
public uint CallMethod( IAdapterMethod Method, out IAdapterIoRequest RequestPtr) { RequestPtr = null; if(Method is AdapterMethod) { ((AdapterMethod)Method).Invoke(); } return ERROR_SUCCESS; }
virtual public void CallMethod(IAdapterMethod methodn) { }
public uint CallMethod( IAdapterMethod Method, out IAdapterIoRequest RequestPtr) { RequestPtr = null; return ERROR_SUCCESS; }
public AllJoynMethodData(IAdapterMethod method, IAdapterDevice adapterDevice) { this.Method = method; this.AdapterDevice = adapterDevice; }