public AddOutputParameter ( |
||
aParameter | Output parameter. Ownership is passed to the action | |
return | void |
Action addAction = new Action("AddNumbers", new ActionDelegate(_AddNumbers)); addAction.AddOutputParameter(new ParameterUint("result")); iService.AddAction(addAction); private void _AddNumbers(Action aAction) { uint number1 = aAction.InputParameters["number1"].ValueUint; uint number2 = aAction.InputParameters["number2"].ValueUint; uint result = number1 + number2; aAction.OutputParameters["result"].Value = result; }
Action getDetailsAction = new Action("GetDeviceDetails", new ActionDelegate(_GetDeviceDetails)); getDetailsAction.AddOutputParameter(new ParameterString("name")); getDetailsAction.AddOutputParameter(new ParameterString("ipAddress")); getDetailsAction.AddOutputParameter(new ParameterString("firmwareVersion")); iService.AddAction(getDetailsAction); private void _GetDeviceDetails(Action aAction) { string name = "MyDevice"; string ipAddress = "192.168.1.10"; string firmwareVersion = "1.0.0"; aAction.OutputParameters["name"].Value = name; aAction.OutputParameters["ipAddress"].Value = ipAddress; aAction.OutputParameters["firmwareVersion"].Value = firmwareVersion; }The OpenHome.Net.Core package library contains the necessary classes and interfaces for building UPnP-compatible devices and control points.
public AddOutputParameter ( |
||
aParameter | Output parameter. Ownership is passed to the action | |
return | void |