/// <summary> /// Constructor /// </summary> /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks> /// <param name="aDevice">The device to use</param> public CpProxyAvOpenhomeOrgNetworkMonitor1(ICpDevice aDevice) : base("av-openhome-org", "NetworkMonitor", 1, aDevice) { OpenHome.Net.Core.Parameter param; List <String> allowedValues = new List <String>(); iActionName = new OpenHome.Net.Core.Action("Name"); param = new ParameterString("Name", allowedValues); iActionName.AddOutputParameter(param); iActionPorts = new OpenHome.Net.Core.Action("Ports"); param = new ParameterUint("Sender"); iActionPorts.AddOutputParameter(param); param = new ParameterUint("Receiver"); iActionPorts.AddOutputParameter(param); param = new ParameterUint("Results"); iActionPorts.AddOutputParameter(param); iName = new PropertyString("Name", NamePropertyChanged); AddProperty(iName); iSender = new PropertyUint("Sender", SenderPropertyChanged); AddProperty(iSender); iReceiver = new PropertyUint("Receiver", ReceiverPropertyChanged); AddProperty(iReceiver); iResults = new PropertyUint("Results", ResultsPropertyChanged); AddProperty(iResults); iPropertyLock = new Mutex(); }
/// <summary> /// Constructor /// </summary> /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks> /// <param name="aDevice">The device to use</param> public CpProxyLinnCoUkExaktInputs1(ICpDevice aDevice) : base("linn-co-uk", "ExaktInputs", 1, aDevice) { OpenHome.Net.Core.Parameter param; List <String> allowedValues = new List <String>(); iActionGetAssociation = new OpenHome.Net.Core.Action("GetAssociation"); param = new ParameterUint("InputIndex"); iActionGetAssociation.AddInputParameter(param); param = new ParameterString("DeviceId", allowedValues); iActionGetAssociation.AddOutputParameter(param); iActionSetAssociation = new OpenHome.Net.Core.Action("SetAssociation"); param = new ParameterUint("InputIndex"); iActionSetAssociation.AddInputParameter(param); param = new ParameterString("DeviceId", allowedValues); iActionSetAssociation.AddInputParameter(param); iActionClearAssociation = new OpenHome.Net.Core.Action("ClearAssociation"); param = new ParameterUint("InputIndex"); iActionClearAssociation.AddInputParameter(param); iActionInputCount = new OpenHome.Net.Core.Action("InputCount"); param = new ParameterUint("InputCount"); iActionInputCount.AddOutputParameter(param); iAssociations = new PropertyString("Associations", AssociationsPropertyChanged); AddProperty(iAssociations); iPropertyLock = new Mutex(); }
/// <summary> /// Constructor /// </summary> /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks> /// <param name="aDevice">The device to use</param> public CpProxyLinnCoUkConfiguration1(ICpDevice aDevice) : base("linn-co-uk", "Configuration", 1, aDevice) { OpenHome.Net.Core.Parameter param; List <String> allowedValues = new List <String>(); iActionConfigurationXml = new OpenHome.Net.Core.Action("ConfigurationXml"); param = new ParameterString("aConfigurationXml", allowedValues); iActionConfigurationXml.AddOutputParameter(param); iActionParameterXml = new OpenHome.Net.Core.Action("ParameterXml"); param = new ParameterString("aParameterXml", allowedValues); iActionParameterXml.AddOutputParameter(param); iActionSetParameter = new OpenHome.Net.Core.Action("SetParameter"); param = new ParameterString("aTarget", allowedValues); iActionSetParameter.AddInputParameter(param); param = new ParameterString("aName", allowedValues); iActionSetParameter.AddInputParameter(param); param = new ParameterString("aValue", allowedValues); iActionSetParameter.AddInputParameter(param); iConfigurationXml = new PropertyString("ConfigurationXml", ConfigurationXmlPropertyChanged); AddProperty(iConfigurationXml); iParameterXml = new PropertyString("ParameterXml", ParameterXmlPropertyChanged); AddProperty(iParameterXml); iPropertyLock = new Mutex(); }
/// <summary> /// Constructor /// </summary> /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks> /// <param name="aDevice">The device to use</param> public CpProxyLinnCoUkLipSync1(ICpDevice aDevice) : base("linn-co-uk", "LipSync", 1, aDevice) { OpenHome.Net.Core.Parameter param; iActionSetDelay = new OpenHome.Net.Core.Action("SetDelay"); param = new ParameterUint("Delay"); iActionSetDelay.AddInputParameter(param); iActionDelay = new OpenHome.Net.Core.Action("Delay"); param = new ParameterUint("Delay"); iActionDelay.AddOutputParameter(param); iActionDelayMinimum = new OpenHome.Net.Core.Action("DelayMinimum"); param = new ParameterUint("Min"); iActionDelayMinimum.AddOutputParameter(param); iActionDelayMaximum = new OpenHome.Net.Core.Action("DelayMaximum"); param = new ParameterUint("Max"); iActionDelayMaximum.AddOutputParameter(param); iDelay = new PropertyUint("Delay", DelayPropertyChanged); AddProperty(iDelay); iDelayMinimum = new PropertyUint("DelayMinimum", DelayMinimumPropertyChanged); AddProperty(iDelayMinimum); iDelayMaximum = new PropertyUint("DelayMaximum", DelayMaximumPropertyChanged); AddProperty(iDelayMaximum); iPropertyLock = new Mutex(); }
/// <summary> /// Constructor /// </summary> /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks> /// <param name="aDevice">The device to use</param> public CpProxyLinnCoUkPrivacy1(ICpDevice aDevice) : base("linn-co-uk", "Privacy", 1, aDevice) { OpenHome.Net.Core.Parameter param; List <String> allowedValues = new List <String>(); iActionGetPolicyVersion = new OpenHome.Net.Core.Action("GetPolicyVersion"); param = new ParameterUint("Version"); iActionGetPolicyVersion.AddOutputParameter(param); iActionGetPolicyAgreed = new OpenHome.Net.Core.Action("GetPolicyAgreed"); param = new ParameterUint("Version"); iActionGetPolicyAgreed.AddOutputParameter(param); iActionGetPolicyDetails = new OpenHome.Net.Core.Action("GetPolicyDetails"); param = new ParameterString("Details", allowedValues); iActionGetPolicyDetails.AddOutputParameter(param); iActionSetPolicyDetails = new OpenHome.Net.Core.Action("SetPolicyDetails"); param = new ParameterString("Details", allowedValues); iActionSetPolicyDetails.AddInputParameter(param); iPolicyVersion = new PropertyUint("PolicyVersion", PolicyVersionPropertyChanged); AddProperty(iPolicyVersion); iPolicyAgreed = new PropertyUint("PolicyAgreed", PolicyAgreedPropertyChanged); AddProperty(iPolicyAgreed); iPolicyDetails = new PropertyString("PolicyDetails", PolicyDetailsPropertyChanged); AddProperty(iPolicyDetails); iPropertyLock = new Mutex(); }
/// <summary> /// Constructor /// </summary> /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks> /// <param name="aDevice">The device to use</param> public CpProxyAvOpenhomeOrgExakt2(ICpDevice aDevice) : base("av-openhome-org", "Exakt", 2, aDevice) { OpenHome.Net.Core.Parameter param; List <String> allowedValues = new List <String>(); iActionDeviceList = new OpenHome.Net.Core.Action("DeviceList"); param = new ParameterString("List", allowedValues); iActionDeviceList.AddOutputParameter(param); iActionDeviceSettings = new OpenHome.Net.Core.Action("DeviceSettings"); param = new ParameterString("DeviceId", allowedValues); iActionDeviceSettings.AddInputParameter(param); param = new ParameterString("Settings", allowedValues); iActionDeviceSettings.AddOutputParameter(param); iActionConnectionStatus = new OpenHome.Net.Core.Action("ConnectionStatus"); param = new ParameterString("ConnectionStatus", allowedValues); iActionConnectionStatus.AddOutputParameter(param); iActionSet = new OpenHome.Net.Core.Action("Set"); param = new ParameterString("DeviceId", allowedValues); iActionSet.AddInputParameter(param); param = new ParameterUint("BankId"); iActionSet.AddInputParameter(param); param = new ParameterString("FileUri", allowedValues); iActionSet.AddInputParameter(param); param = new ParameterBool("Mute"); iActionSet.AddInputParameter(param); param = new ParameterBool("Persist"); iActionSet.AddInputParameter(param); iActionReprogram = new OpenHome.Net.Core.Action("Reprogram"); param = new ParameterString("DeviceId", allowedValues); iActionReprogram.AddInputParameter(param); param = new ParameterString("FileUri", allowedValues); iActionReprogram.AddInputParameter(param); iActionReprogramFallback = new OpenHome.Net.Core.Action("ReprogramFallback"); param = new ParameterString("DeviceId", allowedValues); iActionReprogramFallback.AddInputParameter(param); param = new ParameterString("FileUri", allowedValues); iActionReprogramFallback.AddInputParameter(param); iActionVersion = new OpenHome.Net.Core.Action("Version"); param = new ParameterString("Version", allowedValues); iActionVersion.AddOutputParameter(param); iDeviceList = new PropertyString("DeviceList", DeviceListPropertyChanged); AddProperty(iDeviceList); iConnectionStatus = new PropertyString("ConnectionStatus", ConnectionStatusPropertyChanged); AddProperty(iConnectionStatus); iVersion = new PropertyString("Version", VersionPropertyChanged); AddProperty(iVersion); iPropertyLock = new Mutex(); }
/// <summary> /// Constructor /// </summary> /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks> /// <param name="aDevice">The device to use</param> public CpProxyOpenhomeOrgTestLights1(ICpDevice aDevice) : base("openhome-org", "TestLights", 1, aDevice) { OpenHome.Net.Core.Parameter param; List <String> allowedValues = new List <String>(); iActionGetCount = new OpenHome.Net.Core.Action("GetCount"); param = new ParameterUint("Count"); iActionGetCount.AddOutputParameter(param); iActionGetRoom = new OpenHome.Net.Core.Action("GetRoom"); param = new ParameterUint("Index"); iActionGetRoom.AddInputParameter(param); param = new ParameterString("RoomName", allowedValues); iActionGetRoom.AddOutputParameter(param); iActionGetName = new OpenHome.Net.Core.Action("GetName"); param = new ParameterUint("Index"); iActionGetName.AddInputParameter(param); param = new ParameterString("FriendlyName", allowedValues); iActionGetName.AddOutputParameter(param); iActionGetPosition = new OpenHome.Net.Core.Action("GetPosition"); param = new ParameterUint("Index"); iActionGetPosition.AddInputParameter(param); param = new ParameterUint("X"); iActionGetPosition.AddOutputParameter(param); param = new ParameterUint("Y"); iActionGetPosition.AddOutputParameter(param); param = new ParameterUint("Z"); iActionGetPosition.AddOutputParameter(param); iActionSetColor = new OpenHome.Net.Core.Action("SetColor"); param = new ParameterUint("Index"); iActionSetColor.AddInputParameter(param); param = new ParameterUint("Color"); iActionSetColor.AddInputParameter(param); iActionGetColor = new OpenHome.Net.Core.Action("GetColor"); param = new ParameterUint("Index"); iActionGetColor.AddInputParameter(param); param = new ParameterUint("Color"); iActionGetColor.AddOutputParameter(param); iActionGetColorComponents = new OpenHome.Net.Core.Action("GetColorComponents"); param = new ParameterUint("Color"); iActionGetColorComponents.AddInputParameter(param); param = new ParameterUint("Brightness"); iActionGetColorComponents.AddOutputParameter(param); param = new ParameterUint("Red"); iActionGetColorComponents.AddOutputParameter(param); param = new ParameterUint("Green"); iActionGetColorComponents.AddOutputParameter(param); param = new ParameterUint("Blue"); iActionGetColorComponents.AddOutputParameter(param); }
private void DeviceAdded(CpDeviceList aList, ICpDevice aDevice) { lock (this) { if (iDeviceList.Count == 0 && aDevice.Udn() == DeviceBasic.gDeviceName) { aDevice.AddRef(); iDeviceList.Add(aDevice); } } }
protected CpProxy(String aDomain, String aName, uint aVersion, ICpDevice aDevice) { IntPtr domain = InteropUtils.StringToHGlobalUtf8(aDomain); IntPtr name = InteropUtils.StringToHGlobalUtf8(aName); iHandle = CpProxyCreate(domain, name, aVersion, aDevice.Handle()); Marshal.FreeHGlobal(domain); Marshal.FreeHGlobal(name); IntPtr serviceHandle = CpProxyService(iHandle); iService = new CpService(serviceHandle); iGchProxy = GCHandle.Alloc(this); iSubscriptionStatusLock = new Mutex(); }
/// <summary> /// Constructor /// </summary> /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks> /// <param name="aDevice">The device to use</param> public CpProxyAvOpenhomeOrgDebug1(ICpDevice aDevice) : base("av-openhome-org", "Debug", 1, aDevice) { OpenHome.Net.Core.Parameter param; List <String> allowedValues = new List <String>(); iActionGetLog = new OpenHome.Net.Core.Action("GetLog"); param = new ParameterString("Log", allowedValues); iActionGetLog.AddOutputParameter(param); iActionSendLog = new OpenHome.Net.Core.Action("SendLog"); param = new ParameterString("Data", allowedValues); iActionSendLog.AddInputParameter(param); }
/// <summary> /// Constructor /// </summary> /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks> /// <param name="aDevice">The device to use</param> public CpProxyLinnCoUkCloud1(ICpDevice aDevice) : base("linn-co-uk", "Cloud", 1, aDevice) { OpenHome.Net.Core.Parameter param; List <String> allowedValues = new List <String>(); iActionGetChallengeResponse = new OpenHome.Net.Core.Action("GetChallengeResponse"); param = new ParameterString("Challenge", allowedValues); iActionGetChallengeResponse.AddInputParameter(param); param = new ParameterString("Response", allowedValues); iActionGetChallengeResponse.AddOutputParameter(param); iActionSetAssociated = new OpenHome.Net.Core.Action("SetAssociated"); param = new ParameterBinary("AesKeyRsaEncrypted"); iActionSetAssociated.AddInputParameter(param); param = new ParameterBinary("InitVectorRsaEncrypted"); iActionSetAssociated.AddInputParameter(param); param = new ParameterBinary("TokenAesEncrypted"); iActionSetAssociated.AddInputParameter(param); param = new ParameterBool("Associated"); iActionSetAssociated.AddInputParameter(param); iActionSetControlEnabled = new OpenHome.Net.Core.Action("SetControlEnabled"); param = new ParameterBool("Enabled"); iActionSetControlEnabled.AddInputParameter(param); iActionGetControlEnabled = new OpenHome.Net.Core.Action("GetControlEnabled"); param = new ParameterBool("Enabled"); iActionGetControlEnabled.AddOutputParameter(param); iActionGetConnected = new OpenHome.Net.Core.Action("GetConnected"); param = new ParameterBool("Connected"); iActionGetConnected.AddOutputParameter(param); iActionGetPublicKey = new OpenHome.Net.Core.Action("GetPublicKey"); param = new ParameterString("PublicKey", allowedValues); iActionGetPublicKey.AddOutputParameter(param); iAssociationStatus = new PropertyString("AssociationStatus", AssociationStatusPropertyChanged); AddProperty(iAssociationStatus); iControlEnabled = new PropertyBool("ControlEnabled", ControlEnabledPropertyChanged); AddProperty(iControlEnabled); iConnected = new PropertyBool("Connected", ConnectedPropertyChanged); AddProperty(iConnected); iPublicKey = new PropertyString("PublicKey", PublicKeyPropertyChanged); AddProperty(iPublicKey); iPropertyLock = new Mutex(); }
/// <summary> /// Constructor /// </summary> /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks> /// <param name="aDevice">The device to use</param> public CpProxyLinnCoUkUpdate1(ICpDevice aDevice) : base("linn-co-uk", "Update", 1, aDevice) { OpenHome.Net.Core.Parameter param; List <String> allowedValues = new List <String>(); iActionPushManifest = new OpenHome.Net.Core.Action("PushManifest"); param = new ParameterString("Uri", allowedValues); iActionPushManifest.AddInputParameter(param); iActionSetUpdateFeedParams = new OpenHome.Net.Core.Action("SetUpdateFeedParams"); param = new ParameterString("Topic", allowedValues); iActionSetUpdateFeedParams.AddInputParameter(param); allowedValues.Add("release"); allowedValues.Add("beta"); allowedValues.Add("development"); allowedValues.Add("nightly"); param = new ParameterString("Channel", allowedValues); iActionSetUpdateFeedParams.AddInputParameter(param); allowedValues.Clear(); iActionGetUpdateFeedParams = new OpenHome.Net.Core.Action("GetUpdateFeedParams"); param = new ParameterString("Topic", allowedValues); iActionGetUpdateFeedParams.AddOutputParameter(param); allowedValues.Add("release"); allowedValues.Add("beta"); allowedValues.Add("development"); allowedValues.Add("nightly"); param = new ParameterString("Channel", allowedValues); iActionGetUpdateFeedParams.AddOutputParameter(param); allowedValues.Clear(); iActionGetUpdateStatus = new OpenHome.Net.Core.Action("GetUpdateStatus"); param = new ParameterString("UpdateStatus", allowedValues); iActionGetUpdateStatus.AddOutputParameter(param); iActionApply = new OpenHome.Net.Core.Action("Apply"); iActionRestore = new OpenHome.Net.Core.Action("Restore"); iUpdateStatus = new PropertyString("UpdateStatus", UpdateStatusPropertyChanged); AddProperty(iUpdateStatus); iUpdateTopic = new PropertyString("UpdateTopic", UpdateTopicPropertyChanged); AddProperty(iUpdateTopic); iUpdateChannel = new PropertyString("UpdateChannel", UpdateChannelPropertyChanged); AddProperty(iUpdateChannel); iPropertyLock = new Mutex(); }
/// <summary> /// Constructor /// </summary> /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks> /// <param name="aDevice">The device to use</param> public CpProxyAvOpenhomeOrgReceiver1(ICpDevice aDevice) : base("av-openhome-org", "Receiver", 1, aDevice) { OpenHome.Net.Core.Parameter param; List <String> allowedValues = new List <String>(); iActionPlay = new OpenHome.Net.Core.Action("Play"); iActionStop = new OpenHome.Net.Core.Action("Stop"); iActionSetSender = new OpenHome.Net.Core.Action("SetSender"); param = new ParameterString("Uri", allowedValues); iActionSetSender.AddInputParameter(param); param = new ParameterString("Metadata", allowedValues); iActionSetSender.AddInputParameter(param); iActionSender = new OpenHome.Net.Core.Action("Sender"); param = new ParameterString("Uri", allowedValues); iActionSender.AddOutputParameter(param); param = new ParameterString("Metadata", allowedValues); iActionSender.AddOutputParameter(param); iActionProtocolInfo = new OpenHome.Net.Core.Action("ProtocolInfo"); param = new ParameterString("Value", allowedValues); iActionProtocolInfo.AddOutputParameter(param); iActionTransportState = new OpenHome.Net.Core.Action("TransportState"); allowedValues.Add("Stopped"); allowedValues.Add("Playing"); allowedValues.Add("Waiting"); allowedValues.Add("Buffering"); param = new ParameterString("Value", allowedValues); iActionTransportState.AddOutputParameter(param); allowedValues.Clear(); iUri = new PropertyString("Uri", UriPropertyChanged); AddProperty(iUri); iMetadata = new PropertyString("Metadata", MetadataPropertyChanged); AddProperty(iMetadata); iTransportState = new PropertyString("TransportState", TransportStatePropertyChanged); AddProperty(iTransportState); iProtocolInfo = new PropertyString("ProtocolInfo", ProtocolInfoPropertyChanged); AddProperty(iProtocolInfo); iPropertyLock = new Mutex(); }
/// <summary> /// Constructor /// </summary> /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks> /// <param name="aDevice">The device to use</param> public CpProxyAvOpenhomeOrgSender1(ICpDevice aDevice) : base("av-openhome-org", "Sender", 1, aDevice) { OpenHome.Net.Core.Parameter param; List <String> allowedValues = new List <String>(); iActionPresentationUrl = new OpenHome.Net.Core.Action("PresentationUrl"); param = new ParameterString("Value", allowedValues); iActionPresentationUrl.AddOutputParameter(param); iActionMetadata = new OpenHome.Net.Core.Action("Metadata"); param = new ParameterString("Value", allowedValues); iActionMetadata.AddOutputParameter(param); iActionAudio = new OpenHome.Net.Core.Action("Audio"); param = new ParameterBool("Value"); iActionAudio.AddOutputParameter(param); iActionStatus = new OpenHome.Net.Core.Action("Status"); allowedValues.Add("Enabled"); allowedValues.Add("Disabled"); allowedValues.Add("Blocked"); param = new ParameterString("Value", allowedValues); iActionStatus.AddOutputParameter(param); allowedValues.Clear(); iActionAttributes = new OpenHome.Net.Core.Action("Attributes"); param = new ParameterString("Value", allowedValues); iActionAttributes.AddOutputParameter(param); iPresentationUrl = new PropertyString("PresentationUrl", PresentationUrlPropertyChanged); AddProperty(iPresentationUrl); iMetadata = new PropertyString("Metadata", MetadataPropertyChanged); AddProperty(iMetadata); iAudio = new PropertyBool("Audio", AudioPropertyChanged); AddProperty(iAudio); iStatus = new PropertyString("Status", StatusPropertyChanged); AddProperty(iStatus); iAttributes = new PropertyString("Attributes", AttributesPropertyChanged); AddProperty(iAttributes); iPropertyLock = new Mutex(); }
private void DeviceRemoved(CpDeviceList aList, ICpDevice aDevice) { /* The device stack sends byebyes then alives for each newly enabled device. * These can be interleaved with responses to a msearch and can cause tests to misbehave, * thinking a device has been removed. The simplest way to work around this is to say * our test guarantees that a device remains available as long as its needed then take * advantage of this by ignoring device removed callbacks. */ /*lock (this) * { * string udn = aDevice.Udn(); * int count = iDeviceList.Count; * for (int i = 0; i < count; i++) * { * if (iDeviceList[i].Udn() == udn) * { * iDeviceList.RemoveAt(i); * iDeviceList[i].RemoveRef(); * } * } * }*/ }
/// <summary> /// Constructor /// </summary> /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks> /// <param name="aDevice">The device to use</param> public CpProxyOpenhomeOrgSubscriptionLongPoll1(ICpDevice aDevice) : base("openhome-org", "SubscriptionLongPoll", 1, aDevice) { OpenHome.Net.Core.Parameter param; List<String> allowedValues = new List<String>(); iActionSubscribe = new OpenHome.Net.Core.Action("Subscribe"); param = new ParameterString("ClientId", allowedValues); iActionSubscribe.AddInputParameter(param); param = new ParameterString("Udn", allowedValues); iActionSubscribe.AddInputParameter(param); param = new ParameterString("Service", allowedValues); iActionSubscribe.AddInputParameter(param); param = new ParameterUint("RequestedDuration"); iActionSubscribe.AddInputParameter(param); param = new ParameterString("Sid", allowedValues); iActionSubscribe.AddOutputParameter(param); param = new ParameterUint("Duration"); iActionSubscribe.AddOutputParameter(param); iActionUnsubscribe = new OpenHome.Net.Core.Action("Unsubscribe"); param = new ParameterString("Sid", allowedValues); iActionUnsubscribe.AddInputParameter(param); iActionRenew = new OpenHome.Net.Core.Action("Renew"); param = new ParameterString("Sid", allowedValues); iActionRenew.AddInputParameter(param); param = new ParameterUint("RequestedDuration"); iActionRenew.AddInputParameter(param); param = new ParameterUint("Duration"); iActionRenew.AddOutputParameter(param); iActionGetPropertyUpdates = new OpenHome.Net.Core.Action("GetPropertyUpdates"); param = new ParameterString("ClientId", allowedValues); iActionGetPropertyUpdates.AddInputParameter(param); param = new ParameterString("Updates", allowedValues); iActionGetPropertyUpdates.AddOutputParameter(param); }
/// <summary> /// Constructor /// </summary> /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks> /// <param name="aDevice">The device to use</param> public CpProxyOpenhomeOrgSubscriptionLongPoll1(ICpDevice aDevice) : base("openhome-org", "SubscriptionLongPoll", 1, aDevice) { OpenHome.Net.Core.Parameter param; List <String> allowedValues = new List <String>(); iActionSubscribe = new OpenHome.Net.Core.Action("Subscribe"); param = new ParameterString("ClientId", allowedValues); iActionSubscribe.AddInputParameter(param); param = new ParameterString("Udn", allowedValues); iActionSubscribe.AddInputParameter(param); param = new ParameterString("Service", allowedValues); iActionSubscribe.AddInputParameter(param); param = new ParameterUint("RequestedDuration"); iActionSubscribe.AddInputParameter(param); param = new ParameterString("Sid", allowedValues); iActionSubscribe.AddOutputParameter(param); param = new ParameterUint("Duration"); iActionSubscribe.AddOutputParameter(param); iActionUnsubscribe = new OpenHome.Net.Core.Action("Unsubscribe"); param = new ParameterString("Sid", allowedValues); iActionUnsubscribe.AddInputParameter(param); iActionRenew = new OpenHome.Net.Core.Action("Renew"); param = new ParameterString("Sid", allowedValues); iActionRenew.AddInputParameter(param); param = new ParameterUint("RequestedDuration"); iActionRenew.AddInputParameter(param); param = new ParameterUint("Duration"); iActionRenew.AddOutputParameter(param); iActionGetPropertyUpdates = new OpenHome.Net.Core.Action("GetPropertyUpdates"); param = new ParameterString("ClientId", allowedValues); iActionGetPropertyUpdates.AddInputParameter(param); param = new ParameterString("Updates", allowedValues); iActionGetPropertyUpdates.AddOutputParameter(param); }
/// <summary> /// Constructor /// </summary> /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks> /// <param name="aDevice">The device to use</param> public CpProxyAvOpenhomeOrgTime1(ICpDevice aDevice) : base("av-openhome-org", "Time", 1, aDevice) { OpenHome.Net.Core.Parameter param; iActionTime = new OpenHome.Net.Core.Action("Time"); param = new ParameterUint("TrackCount"); iActionTime.AddOutputParameter(param); param = new ParameterUint("Duration"); iActionTime.AddOutputParameter(param); param = new ParameterUint("Seconds"); iActionTime.AddOutputParameter(param); iTrackCount = new PropertyUint("TrackCount", TrackCountPropertyChanged); AddProperty(iTrackCount); iDuration = new PropertyUint("Duration", DurationPropertyChanged); AddProperty(iDuration); iSeconds = new PropertyUint("Seconds", SecondsPropertyChanged); AddProperty(iSeconds); iPropertyLock = new Mutex(); }
/// <summary> /// Constructor /// </summary> /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks> /// <param name="aDevice">The device to use</param> public CpProxyUpnpOrgSwitchPower1(ICpDevice aDevice) : base("schemas-upnp-org", "SwitchPower", 1, aDevice) { OpenHome.Net.Core.Parameter param; iActionSetTarget = new OpenHome.Net.Core.Action("SetTarget"); param = new ParameterBool("newTargetValue"); iActionSetTarget.AddInputParameter(param); iActionGetTarget = new OpenHome.Net.Core.Action("GetTarget"); param = new ParameterBool("RetTargetValue"); iActionGetTarget.AddOutputParameter(param); iActionGetStatus = new OpenHome.Net.Core.Action("GetStatus"); param = new ParameterBool("ResultStatus"); iActionGetStatus.AddOutputParameter(param); iStatus = new PropertyBool("Status", StatusPropertyChanged); AddProperty(iStatus); iPropertyLock = new Mutex(); }
public ThreadArgs(ICpDevice aDevice, double aDurationMs) { Device = aDevice; iStopTime = DateTime.Now.AddMilliseconds(aDurationMs); }
private void DeviceRemoved(CpDeviceList aList, ICpDevice aDevice) { /* The device stack sends byebyes then alives for each newly enabled device. These can be interleaved with responses to a msearch and can cause tests to misbehave, thinking a device has been removed. The simplest way to work around this is to say our test guarantees that a device remains available as long as its needed then take advantage of this by ignoring device removed callbacks. */ /*lock (this) { string udn = aDevice.Udn(); int count = iDeviceList.Count; for (int i = 0; i < count; i++) { if (iDeviceList[i].Udn() == udn) { iDeviceList.RemoveAt(i); iDeviceList[i].RemoveRef(); } } }*/ }
/// <summary> /// Constructor /// </summary> /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks> /// <param name="aDevice">The device to use</param> public CpProxyOpenhomeOrgTestBasic1(ICpDevice aDevice) : base("openhome-org", "TestBasic", 1, aDevice) { OpenHome.Net.Core.Parameter param; List<String> allowedValues = new List<String>(); iActionIncrement = new OpenHome.Net.Core.Action("Increment"); param = new ParameterUint("Value"); iActionIncrement.AddInputParameter(param); param = new ParameterUint("Result"); iActionIncrement.AddOutputParameter(param); iActionEchoAllowedRangeUint = new OpenHome.Net.Core.Action("EchoAllowedRangeUint"); param = new ParameterUint("Value", 10, 20); iActionEchoAllowedRangeUint.AddInputParameter(param); param = new ParameterUint("Result"); iActionEchoAllowedRangeUint.AddOutputParameter(param); iActionDecrement = new OpenHome.Net.Core.Action("Decrement"); param = new ParameterInt("Value"); iActionDecrement.AddInputParameter(param); param = new ParameterInt("Result"); iActionDecrement.AddOutputParameter(param); iActionToggle = new OpenHome.Net.Core.Action("Toggle"); param = new ParameterBool("Value"); iActionToggle.AddInputParameter(param); param = new ParameterBool("Result"); iActionToggle.AddOutputParameter(param); iActionEchoString = new OpenHome.Net.Core.Action("EchoString"); param = new ParameterString("Value", allowedValues); iActionEchoString.AddInputParameter(param); param = new ParameterString("Result", allowedValues); iActionEchoString.AddOutputParameter(param); iActionEchoAllowedValueString = new OpenHome.Net.Core.Action("EchoAllowedValueString"); allowedValues.Add("One"); allowedValues.Add("Two"); allowedValues.Add("Three"); allowedValues.Add("Four"); param = new ParameterString("Value", allowedValues); iActionEchoAllowedValueString.AddInputParameter(param); allowedValues.Clear(); param = new ParameterString("Result", allowedValues); iActionEchoAllowedValueString.AddOutputParameter(param); iActionEchoBinary = new OpenHome.Net.Core.Action("EchoBinary"); param = new ParameterBinary("Value"); iActionEchoBinary.AddInputParameter(param); param = new ParameterBinary("Result"); iActionEchoBinary.AddOutputParameter(param); iActionSetUint = new OpenHome.Net.Core.Action("SetUint"); param = new ParameterUint("ValueUint"); iActionSetUint.AddInputParameter(param); iActionGetUint = new OpenHome.Net.Core.Action("GetUint"); param = new ParameterUint("ValueUint"); iActionGetUint.AddOutputParameter(param); iActionSetInt = new OpenHome.Net.Core.Action("SetInt"); param = new ParameterInt("ValueInt"); iActionSetInt.AddInputParameter(param); iActionGetInt = new OpenHome.Net.Core.Action("GetInt"); param = new ParameterInt("ValueInt"); iActionGetInt.AddOutputParameter(param); iActionSetBool = new OpenHome.Net.Core.Action("SetBool"); param = new ParameterBool("ValueBool"); iActionSetBool.AddInputParameter(param); iActionGetBool = new OpenHome.Net.Core.Action("GetBool"); param = new ParameterBool("ValueBool"); iActionGetBool.AddOutputParameter(param); iActionSetMultiple = new OpenHome.Net.Core.Action("SetMultiple"); param = new ParameterUint("ValueUint"); iActionSetMultiple.AddInputParameter(param); param = new ParameterInt("ValueInt"); iActionSetMultiple.AddInputParameter(param); param = new ParameterBool("ValueBool"); iActionSetMultiple.AddInputParameter(param); iActionGetMultiple = new OpenHome.Net.Core.Action("GetMultiple"); param = new ParameterUint("ValueUint"); iActionGetMultiple.AddOutputParameter(param); param = new ParameterInt("ValueInt"); iActionGetMultiple.AddOutputParameter(param); param = new ParameterBool("ValueBool"); iActionGetMultiple.AddOutputParameter(param); iActionSetString = new OpenHome.Net.Core.Action("SetString"); param = new ParameterString("ValueStr", allowedValues); iActionSetString.AddInputParameter(param); iActionGetString = new OpenHome.Net.Core.Action("GetString"); param = new ParameterString("ValueStr", allowedValues); iActionGetString.AddOutputParameter(param); iActionSetBinary = new OpenHome.Net.Core.Action("SetBinary"); param = new ParameterBinary("ValueBin"); iActionSetBinary.AddInputParameter(param); iActionGetBinary = new OpenHome.Net.Core.Action("GetBinary"); param = new ParameterBinary("ValueBin"); iActionGetBinary.AddOutputParameter(param); iActionToggleBool = new OpenHome.Net.Core.Action("ToggleBool"); iActionWriteFile = new OpenHome.Net.Core.Action("WriteFile"); param = new ParameterString("Data", allowedValues); iActionWriteFile.AddInputParameter(param); param = new ParameterString("FileFullName", allowedValues); iActionWriteFile.AddInputParameter(param); iActionShutdown = new OpenHome.Net.Core.Action("Shutdown"); iVarUint = new PropertyUint("VarUint", VarUintPropertyChanged); AddProperty(iVarUint); iVarInt = new PropertyInt("VarInt", VarIntPropertyChanged); AddProperty(iVarInt); iVarBool = new PropertyBool("VarBool", VarBoolPropertyChanged); AddProperty(iVarBool); iVarStr = new PropertyString("VarStr", VarStrPropertyChanged); AddProperty(iVarStr); iVarBin = new PropertyBinary("VarBin", VarBinPropertyChanged); AddProperty(iVarBin); iPropertyLock = new Mutex(); }
/// <summary> /// Constructor /// </summary> /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks> /// <param name="aDevice">The device to use</param> public CpProxyAvOpenhomeOrgCredentials1(ICpDevice aDevice) : base("av-openhome-org", "Credentials", 1, aDevice) { OpenHome.Net.Core.Parameter param; List <String> allowedValues = new List <String>(); iActionSet = new OpenHome.Net.Core.Action("Set"); param = new ParameterString("Id", allowedValues); iActionSet.AddInputParameter(param); param = new ParameterString("UserName", allowedValues); iActionSet.AddInputParameter(param); param = new ParameterBinary("Password"); iActionSet.AddInputParameter(param); iActionClear = new OpenHome.Net.Core.Action("Clear"); param = new ParameterString("Id", allowedValues); iActionClear.AddInputParameter(param); iActionSetEnabled = new OpenHome.Net.Core.Action("SetEnabled"); param = new ParameterString("Id", allowedValues); iActionSetEnabled.AddInputParameter(param); param = new ParameterBool("Enabled"); iActionSetEnabled.AddInputParameter(param); iActionGet = new OpenHome.Net.Core.Action("Get"); param = new ParameterString("Id", allowedValues); iActionGet.AddInputParameter(param); param = new ParameterString("UserName", allowedValues); iActionGet.AddOutputParameter(param); param = new ParameterBinary("Password"); iActionGet.AddOutputParameter(param); param = new ParameterBool("Enabled"); iActionGet.AddOutputParameter(param); param = new ParameterString("Status", allowedValues); iActionGet.AddOutputParameter(param); param = new ParameterString("Data", allowedValues); iActionGet.AddOutputParameter(param); iActionLogin = new OpenHome.Net.Core.Action("Login"); param = new ParameterString("Id", allowedValues); iActionLogin.AddInputParameter(param); param = new ParameterString("Token", allowedValues); iActionLogin.AddOutputParameter(param); iActionReLogin = new OpenHome.Net.Core.Action("ReLogin"); param = new ParameterString("Id", allowedValues); iActionReLogin.AddInputParameter(param); param = new ParameterString("CurrentToken", allowedValues); iActionReLogin.AddInputParameter(param); param = new ParameterString("NewToken", allowedValues); iActionReLogin.AddOutputParameter(param); iActionGetIds = new OpenHome.Net.Core.Action("GetIds"); param = new ParameterString("Ids", allowedValues); iActionGetIds.AddOutputParameter(param); iActionGetPublicKey = new OpenHome.Net.Core.Action("GetPublicKey"); param = new ParameterString("PublicKey", allowedValues); iActionGetPublicKey.AddOutputParameter(param); iActionGetSequenceNumber = new OpenHome.Net.Core.Action("GetSequenceNumber"); param = new ParameterUint("SequenceNumber"); iActionGetSequenceNumber.AddOutputParameter(param); iIds = new PropertyString("Ids", IdsPropertyChanged); AddProperty(iIds); iPublicKey = new PropertyString("PublicKey", PublicKeyPropertyChanged); AddProperty(iPublicKey); iSequenceNumber = new PropertyUint("SequenceNumber", SequenceNumberPropertyChanged); AddProperty(iSequenceNumber); iPropertyLock = new Mutex(); }
public TestBasicCp(ICpDevice aDevice) { iDevice = aDevice; iUpdatesComplete = new Semaphore(0, Int32.MaxValue); }
/// <summary> /// Constructor /// </summary> /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks> /// <param name="aDevice">The device to use</param> public CpProxyUpnpOrgConnectionManager2(ICpDevice aDevice) : base("schemas-upnp-org", "ConnectionManager", 2, aDevice) { OpenHome.Net.Core.Parameter param; List <String> allowedValues = new List <String>(); iActionGetProtocolInfo = new OpenHome.Net.Core.Action("GetProtocolInfo"); param = new ParameterString("Source", allowedValues); iActionGetProtocolInfo.AddOutputParameter(param); param = new ParameterString("Sink", allowedValues); iActionGetProtocolInfo.AddOutputParameter(param); iActionPrepareForConnection = new OpenHome.Net.Core.Action("PrepareForConnection"); param = new ParameterString("RemoteProtocolInfo", allowedValues); iActionPrepareForConnection.AddInputParameter(param); param = new ParameterString("PeerConnectionManager", allowedValues); iActionPrepareForConnection.AddInputParameter(param); param = new ParameterInt("PeerConnectionID"); iActionPrepareForConnection.AddInputParameter(param); allowedValues.Add("Input"); allowedValues.Add("Output"); param = new ParameterString("Direction", allowedValues); iActionPrepareForConnection.AddInputParameter(param); allowedValues.Clear(); param = new ParameterInt("ConnectionID"); iActionPrepareForConnection.AddOutputParameter(param); param = new ParameterInt("AVTransportID"); iActionPrepareForConnection.AddOutputParameter(param); param = new ParameterInt("RcsID"); iActionPrepareForConnection.AddOutputParameter(param); iActionConnectionComplete = new OpenHome.Net.Core.Action("ConnectionComplete"); param = new ParameterInt("ConnectionID"); iActionConnectionComplete.AddInputParameter(param); iActionGetCurrentConnectionIDs = new OpenHome.Net.Core.Action("GetCurrentConnectionIDs"); param = new ParameterString("ConnectionIDs", allowedValues); iActionGetCurrentConnectionIDs.AddOutputParameter(param); iActionGetCurrentConnectionInfo = new OpenHome.Net.Core.Action("GetCurrentConnectionInfo"); param = new ParameterInt("ConnectionID"); iActionGetCurrentConnectionInfo.AddInputParameter(param); param = new ParameterInt("RcsID"); iActionGetCurrentConnectionInfo.AddOutputParameter(param); param = new ParameterInt("AVTransportID"); iActionGetCurrentConnectionInfo.AddOutputParameter(param); param = new ParameterString("ProtocolInfo", allowedValues); iActionGetCurrentConnectionInfo.AddOutputParameter(param); param = new ParameterString("PeerConnectionManager", allowedValues); iActionGetCurrentConnectionInfo.AddOutputParameter(param); param = new ParameterInt("PeerConnectionID"); iActionGetCurrentConnectionInfo.AddOutputParameter(param); allowedValues.Add("Input"); allowedValues.Add("Output"); param = new ParameterString("Direction", allowedValues); iActionGetCurrentConnectionInfo.AddOutputParameter(param); allowedValues.Clear(); allowedValues.Add("OK"); allowedValues.Add("ContentFormatMismatch"); allowedValues.Add("InsufficientBandwidth"); allowedValues.Add("UnreliableChannel"); allowedValues.Add("Unknown"); param = new ParameterString("Status", allowedValues); iActionGetCurrentConnectionInfo.AddOutputParameter(param); allowedValues.Clear(); iSourceProtocolInfo = new PropertyString("SourceProtocolInfo", SourceProtocolInfoPropertyChanged); AddProperty(iSourceProtocolInfo); iSinkProtocolInfo = new PropertyString("SinkProtocolInfo", SinkProtocolInfoPropertyChanged); AddProperty(iSinkProtocolInfo); iCurrentConnectionIDs = new PropertyString("CurrentConnectionIDs", CurrentConnectionIDsPropertyChanged); AddProperty(iCurrentConnectionIDs); iPropertyLock = new Mutex(); }
/// <summary> /// Constructor /// </summary> /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks> /// <param name="aDevice">The device to use</param> public CpProxyAvOpenhomeOrgPins1(ICpDevice aDevice) : base("av-openhome-org", "Pins", 1, aDevice) { OpenHome.Net.Core.Parameter param; List <String> allowedValues = new List <String>(); iActionGetDeviceAccountMax = new OpenHome.Net.Core.Action("GetDeviceAccountMax"); param = new ParameterUint("DeviceMax"); iActionGetDeviceAccountMax.AddOutputParameter(param); param = new ParameterUint("AccountMax"); iActionGetDeviceAccountMax.AddOutputParameter(param); iActionGetModes = new OpenHome.Net.Core.Action("GetModes"); param = new ParameterString("Modes", allowedValues); iActionGetModes.AddOutputParameter(param); iActionGetIdArray = new OpenHome.Net.Core.Action("GetIdArray"); param = new ParameterString("IdArray", allowedValues); iActionGetIdArray.AddOutputParameter(param); iActionReadList = new OpenHome.Net.Core.Action("ReadList"); param = new ParameterString("Ids", allowedValues); iActionReadList.AddInputParameter(param); param = new ParameterString("List", allowedValues); iActionReadList.AddOutputParameter(param); iActionInvokeId = new OpenHome.Net.Core.Action("InvokeId"); param = new ParameterUint("Id"); iActionInvokeId.AddInputParameter(param); iActionInvokeIndex = new OpenHome.Net.Core.Action("InvokeIndex"); param = new ParameterUint("Index"); iActionInvokeIndex.AddInputParameter(param); iActionSetDevice = new OpenHome.Net.Core.Action("SetDevice"); param = new ParameterUint("Index"); iActionSetDevice.AddInputParameter(param); param = new ParameterString("Mode", allowedValues); iActionSetDevice.AddInputParameter(param); param = new ParameterString("Type", allowedValues); iActionSetDevice.AddInputParameter(param); param = new ParameterString("Uri", allowedValues); iActionSetDevice.AddInputParameter(param); param = new ParameterString("Title", allowedValues); iActionSetDevice.AddInputParameter(param); param = new ParameterString("Description", allowedValues); iActionSetDevice.AddInputParameter(param); param = new ParameterString("ArtworkUri", allowedValues); iActionSetDevice.AddInputParameter(param); param = new ParameterBool("Shuffle"); iActionSetDevice.AddInputParameter(param); iActionSetAccount = new OpenHome.Net.Core.Action("SetAccount"); param = new ParameterUint("Index"); iActionSetAccount.AddInputParameter(param); param = new ParameterString("Mode", allowedValues); iActionSetAccount.AddInputParameter(param); param = new ParameterString("Type", allowedValues); iActionSetAccount.AddInputParameter(param); param = new ParameterString("Uri", allowedValues); iActionSetAccount.AddInputParameter(param); param = new ParameterString("Title", allowedValues); iActionSetAccount.AddInputParameter(param); param = new ParameterString("Description", allowedValues); iActionSetAccount.AddInputParameter(param); param = new ParameterString("ArtworkUri", allowedValues); iActionSetAccount.AddInputParameter(param); param = new ParameterBool("Shuffle"); iActionSetAccount.AddInputParameter(param); iActionClear = new OpenHome.Net.Core.Action("Clear"); param = new ParameterUint("Id"); iActionClear.AddInputParameter(param); iActionSwap = new OpenHome.Net.Core.Action("Swap"); param = new ParameterUint("Index1"); iActionSwap.AddInputParameter(param); param = new ParameterUint("Index2"); iActionSwap.AddInputParameter(param); iDeviceMax = new PropertyUint("DeviceMax", DeviceMaxPropertyChanged); AddProperty(iDeviceMax); iAccountMax = new PropertyUint("AccountMax", AccountMaxPropertyChanged); AddProperty(iAccountMax); iModes = new PropertyString("Modes", ModesPropertyChanged); AddProperty(iModes); iIdArray = new PropertyString("IdArray", IdArrayPropertyChanged); AddProperty(iIdArray); iPropertyLock = new Mutex(); }
/// <summary> /// Constructor /// </summary> /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks> /// <param name="aDevice">The device to use</param> public CpProxyLinnCoUkFlash1(ICpDevice aDevice) : base("linn-co-uk", "Flash", 1, aDevice) { OpenHome.Net.Core.Parameter param; iActionRead = new OpenHome.Net.Core.Action("Read"); param = new ParameterUint("aId"); iActionRead.AddInputParameter(param); param = new ParameterUint("aAddress"); iActionRead.AddInputParameter(param); param = new ParameterUint("aLength"); iActionRead.AddInputParameter(param); param = new ParameterBinary("aBuffer"); iActionRead.AddOutputParameter(param); iActionWrite = new OpenHome.Net.Core.Action("Write"); param = new ParameterUint("aId"); iActionWrite.AddInputParameter(param); param = new ParameterUint("aAddress"); iActionWrite.AddInputParameter(param); param = new ParameterBinary("aSource"); iActionWrite.AddInputParameter(param); iActionErase = new OpenHome.Net.Core.Action("Erase"); param = new ParameterUint("aId"); iActionErase.AddInputParameter(param); param = new ParameterUint("aAddress"); iActionErase.AddInputParameter(param); iActionEraseSector = new OpenHome.Net.Core.Action("EraseSector"); param = new ParameterUint("aId"); iActionEraseSector.AddInputParameter(param); param = new ParameterUint("aSector"); iActionEraseSector.AddInputParameter(param); iActionEraseSectors = new OpenHome.Net.Core.Action("EraseSectors"); param = new ParameterUint("aId"); iActionEraseSectors.AddInputParameter(param); param = new ParameterUint("aFirstSector"); iActionEraseSectors.AddInputParameter(param); param = new ParameterUint("aLastSector"); iActionEraseSectors.AddInputParameter(param); iActionEraseChip = new OpenHome.Net.Core.Action("EraseChip"); param = new ParameterUint("aId"); iActionEraseChip.AddInputParameter(param); iActionSectors = new OpenHome.Net.Core.Action("Sectors"); param = new ParameterUint("aId"); iActionSectors.AddInputParameter(param); param = new ParameterUint("aSectors"); iActionSectors.AddOutputParameter(param); iActionSectorBytes = new OpenHome.Net.Core.Action("SectorBytes"); param = new ParameterUint("aId"); iActionSectorBytes.AddInputParameter(param); param = new ParameterUint("aBytes"); iActionSectorBytes.AddOutputParameter(param); iActionRomDirInfo = new OpenHome.Net.Core.Action("RomDirInfo"); param = new ParameterUint("aFlashIdMain"); iActionRomDirInfo.AddOutputParameter(param); param = new ParameterUint("aOffsetMain"); iActionRomDirInfo.AddOutputParameter(param); param = new ParameterUint("aBytesMain"); iActionRomDirInfo.AddOutputParameter(param); param = new ParameterUint("aFlashIdFallback"); iActionRomDirInfo.AddOutputParameter(param); param = new ParameterUint("aOffsetFallback"); iActionRomDirInfo.AddOutputParameter(param); param = new ParameterUint("aBytesFallback"); iActionRomDirInfo.AddOutputParameter(param); }
/// <summary> /// Constructor /// </summary> /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks> /// <param name="aDevice">The device to use</param> public CpProxyAvOpenhomeOrgInfo1(ICpDevice aDevice) : base("av-openhome-org", "Info", 1, aDevice) { OpenHome.Net.Core.Parameter param; List <String> allowedValues = new List <String>(); iActionCounters = new OpenHome.Net.Core.Action("Counters"); param = new ParameterUint("TrackCount"); iActionCounters.AddOutputParameter(param); param = new ParameterUint("DetailsCount"); iActionCounters.AddOutputParameter(param); param = new ParameterUint("MetatextCount"); iActionCounters.AddOutputParameter(param); iActionTrack = new OpenHome.Net.Core.Action("Track"); param = new ParameterString("Uri", allowedValues); iActionTrack.AddOutputParameter(param); param = new ParameterString("Metadata", allowedValues); iActionTrack.AddOutputParameter(param); iActionDetails = new OpenHome.Net.Core.Action("Details"); param = new ParameterUint("Duration"); iActionDetails.AddOutputParameter(param); param = new ParameterUint("BitRate"); iActionDetails.AddOutputParameter(param); param = new ParameterUint("BitDepth"); iActionDetails.AddOutputParameter(param); param = new ParameterUint("SampleRate"); iActionDetails.AddOutputParameter(param); param = new ParameterBool("Lossless"); iActionDetails.AddOutputParameter(param); param = new ParameterString("CodecName", allowedValues); iActionDetails.AddOutputParameter(param); iActionMetatext = new OpenHome.Net.Core.Action("Metatext"); param = new ParameterString("Value", allowedValues); iActionMetatext.AddOutputParameter(param); iTrackCount = new PropertyUint("TrackCount", TrackCountPropertyChanged); AddProperty(iTrackCount); iDetailsCount = new PropertyUint("DetailsCount", DetailsCountPropertyChanged); AddProperty(iDetailsCount); iMetatextCount = new PropertyUint("MetatextCount", MetatextCountPropertyChanged); AddProperty(iMetatextCount); iUri = new PropertyString("Uri", UriPropertyChanged); AddProperty(iUri); iMetadata = new PropertyString("Metadata", MetadataPropertyChanged); AddProperty(iMetadata); iDuration = new PropertyUint("Duration", DurationPropertyChanged); AddProperty(iDuration); iBitRate = new PropertyUint("BitRate", BitRatePropertyChanged); AddProperty(iBitRate); iBitDepth = new PropertyUint("BitDepth", BitDepthPropertyChanged); AddProperty(iBitDepth); iSampleRate = new PropertyUint("SampleRate", SampleRatePropertyChanged); AddProperty(iSampleRate); iLossless = new PropertyBool("Lossless", LosslessPropertyChanged); AddProperty(iLossless); iCodecName = new PropertyString("CodecName", CodecNamePropertyChanged); AddProperty(iCodecName); iMetatext = new PropertyString("Metatext", MetatextPropertyChanged); AddProperty(iMetatext); iPropertyLock = new Mutex(); }
/// <summary> /// Constructor /// </summary> /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks> /// <param name="aDevice">The device to use</param> public CpProxyLinnCoUkVolkano1(ICpDevice aDevice) : base("linn-co-uk", "Volkano", 1, aDevice) { OpenHome.Net.Core.Parameter param; List <String> allowedValues = new List <String>(); iActionReboot = new OpenHome.Net.Core.Action("Reboot"); iActionBootMode = new OpenHome.Net.Core.Action("BootMode"); allowedValues.Add("Main"); allowedValues.Add("Fallback"); allowedValues.Add("Ram"); param = new ParameterString("aMode", allowedValues); iActionBootMode.AddOutputParameter(param); allowedValues.Clear(); iActionSetBootMode = new OpenHome.Net.Core.Action("SetBootMode"); allowedValues.Add("Main"); allowedValues.Add("Fallback"); param = new ParameterString("aMode", allowedValues); iActionSetBootMode.AddInputParameter(param); allowedValues.Clear(); iActionBspType = new OpenHome.Net.Core.Action("BspType"); param = new ParameterString("aBspType", allowedValues); iActionBspType.AddOutputParameter(param); iActionUglyName = new OpenHome.Net.Core.Action("UglyName"); param = new ParameterString("aUglyName", allowedValues); iActionUglyName.AddOutputParameter(param); iActionMacAddress = new OpenHome.Net.Core.Action("MacAddress"); param = new ParameterString("aMacAddress", allowedValues); iActionMacAddress.AddOutputParameter(param); iActionProductId = new OpenHome.Net.Core.Action("ProductId"); param = new ParameterString("aProductNumber", allowedValues); iActionProductId.AddOutputParameter(param); iActionBoardId = new OpenHome.Net.Core.Action("BoardId"); param = new ParameterUint("aIndex"); iActionBoardId.AddInputParameter(param); param = new ParameterString("aBoardNumber", allowedValues); iActionBoardId.AddOutputParameter(param); iActionBoardType = new OpenHome.Net.Core.Action("BoardType"); param = new ParameterUint("aIndex"); iActionBoardType.AddInputParameter(param); param = new ParameterString("aBoardNumber", allowedValues); iActionBoardType.AddOutputParameter(param); iActionMaxBoards = new OpenHome.Net.Core.Action("MaxBoards"); param = new ParameterUint("aMaxBoards"); iActionMaxBoards.AddOutputParameter(param); iActionSoftwareVersion = new OpenHome.Net.Core.Action("SoftwareVersion"); param = new ParameterString("aSoftwareVersion", allowedValues); iActionSoftwareVersion.AddOutputParameter(param); iActionSoftwareUpdate = new OpenHome.Net.Core.Action("SoftwareUpdate"); param = new ParameterBool("aAvailable"); iActionSoftwareUpdate.AddOutputParameter(param); param = new ParameterString("aSoftwareVersion", allowedValues); iActionSoftwareUpdate.AddOutputParameter(param); iActionDeviceInfo = new OpenHome.Net.Core.Action("DeviceInfo"); param = new ParameterString("aDeviceInfoXml", allowedValues); iActionDeviceInfo.AddOutputParameter(param); }
public static void Main(string[] aArgs) { Console.WriteLine("TestPerformanceCpCs - starting"); InitParams initParams = new InitParams(); using (Library lib = Library.Create(initParams)) { SubnetList subnetList = new SubnetList(); NetworkAdapter nif = subnetList.SubnetAt(0); uint subnet = nif.Subnet(); subnetList.Dispose(); var deviceListFactory = new CpUpnpDeviceListFactory(lib.StartCp(subnet)); ICpDevice device = null; Semaphore sem = new Semaphore(0, 1); var deviceList = deviceListFactory.CreateListServiceType("openhome.org", "TestBasic", 1, (aDeviceList, aDevice) => { if (device != null) { throw new Exception("Found more than one device. Giving up as test results will probably be invalid."); } device = aDevice; device.AddRef(); sem.Release(); }, (aDeviceList, aDevice) => { throw new Exception("ERROR: Device removed while test is running."); }); sem.WaitOne(); // actions Console.WriteLine(""); int[] threadCounts = { 1, 2, 4 }; foreach (int threadCount in threadCounts) { List <Thread> threads = new List <Thread>(); for (int i = 0; i < threadCount; i++) { threads.Add(new Thread(ActionThread)); } ThreadArgs threadArgs = new ThreadArgs(device, kTestDurationMs); for (int i = 0; i < threadCount; i++) { threads[i].Start(threadArgs); } for (int i = 0; i < threadCount; i++) { threads[i].Join(); } Console.WriteLine("Invoked {0} actions in {1}ms using {2} threads", threadArgs.Count, kTestDurationMs, threadCount); } // subscriptions Thread thread = new Thread(SubscriptionThread); ThreadArgs args = new ThreadArgs(device, kTestDurationMs); thread.Start(args); thread.Join(); Console.WriteLine("\nCompleted {0} subscriptions in {1}ms\n", args.Count, kTestDurationMs); device.RemoveRef(); deviceList.Dispose(); Console.WriteLine("\nTests complete. Press 'q' to exit."); while (Console.ReadKey(true).KeyChar != 'q') { ; } } }
/// <summary> /// Constructor /// </summary> /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks> /// <param name="aDevice">The device to use</param> public CpProxyAvOpenhomeOrgSender1(ICpDevice aDevice) : base("av-openhome-org", "Sender", 1, aDevice) { OpenHome.Net.Core.Parameter param; List<String> allowedValues = new List<String>(); iActionPresentationUrl = new OpenHome.Net.Core.Action("PresentationUrl"); param = new ParameterString("Value", allowedValues); iActionPresentationUrl.AddOutputParameter(param); iActionMetadata = new OpenHome.Net.Core.Action("Metadata"); param = new ParameterString("Value", allowedValues); iActionMetadata.AddOutputParameter(param); iActionAudio = new OpenHome.Net.Core.Action("Audio"); param = new ParameterBool("Value"); iActionAudio.AddOutputParameter(param); iActionStatus = new OpenHome.Net.Core.Action("Status"); allowedValues.Add("Enabled"); allowedValues.Add("Disabled"); allowedValues.Add("Blocked"); param = new ParameterString("Value", allowedValues); iActionStatus.AddOutputParameter(param); allowedValues.Clear(); iActionAttributes = new OpenHome.Net.Core.Action("Attributes"); param = new ParameterString("Value", allowedValues); iActionAttributes.AddOutputParameter(param); iPresentationUrl = new PropertyString("PresentationUrl", PresentationUrlPropertyChanged); AddProperty(iPresentationUrl); iMetadata = new PropertyString("Metadata", MetadataPropertyChanged); AddProperty(iMetadata); iAudio = new PropertyBool("Audio", AudioPropertyChanged); AddProperty(iAudio); iStatus = new PropertyString("Status", StatusPropertyChanged); AddProperty(iStatus); iAttributes = new PropertyString("Attributes", AttributesPropertyChanged); AddProperty(iAttributes); iPropertyLock = new Mutex(); }
/// <summary> /// Constructor /// </summary> /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks> /// <param name="aDevice">The device to use</param> public CpProxyAvOpenhomeOrgProduct1(ICpDevice aDevice) : base("av-openhome-org", "Product", 1, aDevice) { OpenHome.Net.Core.Parameter param; List<String> allowedValues = new List<String>(); iActionManufacturer = new OpenHome.Net.Core.Action("Manufacturer"); param = new ParameterString("Name", allowedValues); iActionManufacturer.AddOutputParameter(param); param = new ParameterString("Info", allowedValues); iActionManufacturer.AddOutputParameter(param); param = new ParameterString("Url", allowedValues); iActionManufacturer.AddOutputParameter(param); param = new ParameterString("ImageUri", allowedValues); iActionManufacturer.AddOutputParameter(param); iActionModel = new OpenHome.Net.Core.Action("Model"); param = new ParameterString("Name", allowedValues); iActionModel.AddOutputParameter(param); param = new ParameterString("Info", allowedValues); iActionModel.AddOutputParameter(param); param = new ParameterString("Url", allowedValues); iActionModel.AddOutputParameter(param); param = new ParameterString("ImageUri", allowedValues); iActionModel.AddOutputParameter(param); iActionProduct = new OpenHome.Net.Core.Action("Product"); param = new ParameterString("Room", allowedValues); iActionProduct.AddOutputParameter(param); param = new ParameterString("Name", allowedValues); iActionProduct.AddOutputParameter(param); param = new ParameterString("Info", allowedValues); iActionProduct.AddOutputParameter(param); param = new ParameterString("Url", allowedValues); iActionProduct.AddOutputParameter(param); param = new ParameterString("ImageUri", allowedValues); iActionProduct.AddOutputParameter(param); iActionStandby = new OpenHome.Net.Core.Action("Standby"); param = new ParameterBool("Value"); iActionStandby.AddOutputParameter(param); iActionSetStandby = new OpenHome.Net.Core.Action("SetStandby"); param = new ParameterBool("Value"); iActionSetStandby.AddInputParameter(param); iActionSourceCount = new OpenHome.Net.Core.Action("SourceCount"); param = new ParameterUint("Value"); iActionSourceCount.AddOutputParameter(param); iActionSourceXml = new OpenHome.Net.Core.Action("SourceXml"); param = new ParameterString("Value", allowedValues); iActionSourceXml.AddOutputParameter(param); iActionSourceIndex = new OpenHome.Net.Core.Action("SourceIndex"); param = new ParameterUint("Value"); iActionSourceIndex.AddOutputParameter(param); iActionSetSourceIndex = new OpenHome.Net.Core.Action("SetSourceIndex"); param = new ParameterUint("Value"); iActionSetSourceIndex.AddInputParameter(param); iActionSetSourceIndexByName = new OpenHome.Net.Core.Action("SetSourceIndexByName"); param = new ParameterString("Value", allowedValues); iActionSetSourceIndexByName.AddInputParameter(param); iActionSource = new OpenHome.Net.Core.Action("Source"); param = new ParameterUint("Index"); iActionSource.AddInputParameter(param); param = new ParameterString("SystemName", allowedValues); iActionSource.AddOutputParameter(param); param = new ParameterString("Type", allowedValues); iActionSource.AddOutputParameter(param); param = new ParameterString("Name", allowedValues); iActionSource.AddOutputParameter(param); param = new ParameterBool("Visible"); iActionSource.AddOutputParameter(param); iActionAttributes = new OpenHome.Net.Core.Action("Attributes"); param = new ParameterString("Value", allowedValues); iActionAttributes.AddOutputParameter(param); iActionSourceXmlChangeCount = new OpenHome.Net.Core.Action("SourceXmlChangeCount"); param = new ParameterUint("Value"); iActionSourceXmlChangeCount.AddOutputParameter(param); iManufacturerName = new PropertyString("ManufacturerName", ManufacturerNamePropertyChanged); AddProperty(iManufacturerName); iManufacturerInfo = new PropertyString("ManufacturerInfo", ManufacturerInfoPropertyChanged); AddProperty(iManufacturerInfo); iManufacturerUrl = new PropertyString("ManufacturerUrl", ManufacturerUrlPropertyChanged); AddProperty(iManufacturerUrl); iManufacturerImageUri = new PropertyString("ManufacturerImageUri", ManufacturerImageUriPropertyChanged); AddProperty(iManufacturerImageUri); iModelName = new PropertyString("ModelName", ModelNamePropertyChanged); AddProperty(iModelName); iModelInfo = new PropertyString("ModelInfo", ModelInfoPropertyChanged); AddProperty(iModelInfo); iModelUrl = new PropertyString("ModelUrl", ModelUrlPropertyChanged); AddProperty(iModelUrl); iModelImageUri = new PropertyString("ModelImageUri", ModelImageUriPropertyChanged); AddProperty(iModelImageUri); iProductRoom = new PropertyString("ProductRoom", ProductRoomPropertyChanged); AddProperty(iProductRoom); iProductName = new PropertyString("ProductName", ProductNamePropertyChanged); AddProperty(iProductName); iProductInfo = new PropertyString("ProductInfo", ProductInfoPropertyChanged); AddProperty(iProductInfo); iProductUrl = new PropertyString("ProductUrl", ProductUrlPropertyChanged); AddProperty(iProductUrl); iProductImageUri = new PropertyString("ProductImageUri", ProductImageUriPropertyChanged); AddProperty(iProductImageUri); iStandby = new PropertyBool("Standby", StandbyPropertyChanged); AddProperty(iStandby); iSourceIndex = new PropertyUint("SourceIndex", SourceIndexPropertyChanged); AddProperty(iSourceIndex); iSourceCount = new PropertyUint("SourceCount", SourceCountPropertyChanged); AddProperty(iSourceCount); iSourceXml = new PropertyString("SourceXml", SourceXmlPropertyChanged); AddProperty(iSourceXml); iAttributes = new PropertyString("Attributes", AttributesPropertyChanged); AddProperty(iAttributes); iPropertyLock = new Mutex(); }
/// <summary> /// Constructor /// </summary> /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks> /// <param name="aDevice">The device to use</param> public CpProxyUpnpOrgConnectionManager1(ICpDevice aDevice) : base("schemas-upnp-org", "ConnectionManager", 1, aDevice) { OpenHome.Net.Core.Parameter param; List<String> allowedValues = new List<String>(); iActionGetProtocolInfo = new OpenHome.Net.Core.Action("GetProtocolInfo"); param = new ParameterString("Source", allowedValues); iActionGetProtocolInfo.AddOutputParameter(param); param = new ParameterString("Sink", allowedValues); iActionGetProtocolInfo.AddOutputParameter(param); iActionPrepareForConnection = new OpenHome.Net.Core.Action("PrepareForConnection"); param = new ParameterString("RemoteProtocolInfo", allowedValues); iActionPrepareForConnection.AddInputParameter(param); param = new ParameterString("PeerConnectionManager", allowedValues); iActionPrepareForConnection.AddInputParameter(param); param = new ParameterInt("PeerConnectionID"); iActionPrepareForConnection.AddInputParameter(param); allowedValues.Add("Input"); allowedValues.Add("Output"); param = new ParameterString("Direction", allowedValues); iActionPrepareForConnection.AddInputParameter(param); allowedValues.Clear(); param = new ParameterInt("ConnectionID"); iActionPrepareForConnection.AddOutputParameter(param); param = new ParameterInt("AVTransportID"); iActionPrepareForConnection.AddOutputParameter(param); param = new ParameterInt("RcsID"); iActionPrepareForConnection.AddOutputParameter(param); iActionConnectionComplete = new OpenHome.Net.Core.Action("ConnectionComplete"); param = new ParameterInt("ConnectionID"); iActionConnectionComplete.AddInputParameter(param); iActionGetCurrentConnectionIDs = new OpenHome.Net.Core.Action("GetCurrentConnectionIDs"); param = new ParameterString("ConnectionIDs", allowedValues); iActionGetCurrentConnectionIDs.AddOutputParameter(param); iActionGetCurrentConnectionInfo = new OpenHome.Net.Core.Action("GetCurrentConnectionInfo"); param = new ParameterInt("ConnectionID"); iActionGetCurrentConnectionInfo.AddInputParameter(param); param = new ParameterInt("RcsID"); iActionGetCurrentConnectionInfo.AddOutputParameter(param); param = new ParameterInt("AVTransportID"); iActionGetCurrentConnectionInfo.AddOutputParameter(param); param = new ParameterString("ProtocolInfo", allowedValues); iActionGetCurrentConnectionInfo.AddOutputParameter(param); param = new ParameterString("PeerConnectionManager", allowedValues); iActionGetCurrentConnectionInfo.AddOutputParameter(param); param = new ParameterInt("PeerConnectionID"); iActionGetCurrentConnectionInfo.AddOutputParameter(param); allowedValues.Add("Input"); allowedValues.Add("Output"); param = new ParameterString("Direction", allowedValues); iActionGetCurrentConnectionInfo.AddOutputParameter(param); allowedValues.Clear(); allowedValues.Add("OK"); allowedValues.Add("ContentFormatMismatch"); allowedValues.Add("InsufficientBandwidth"); allowedValues.Add("UnreliableChannel"); allowedValues.Add("Unknown"); param = new ParameterString("Status", allowedValues); iActionGetCurrentConnectionInfo.AddOutputParameter(param); allowedValues.Clear(); iSourceProtocolInfo = new PropertyString("SourceProtocolInfo", SourceProtocolInfoPropertyChanged); AddProperty(iSourceProtocolInfo); iSinkProtocolInfo = new PropertyString("SinkProtocolInfo", SinkProtocolInfoPropertyChanged); AddProperty(iSinkProtocolInfo); iCurrentConnectionIDs = new PropertyString("CurrentConnectionIDs", CurrentConnectionIDsPropertyChanged); AddProperty(iCurrentConnectionIDs); iPropertyLock = new Mutex(); }