/// <summary> /// Constructor for binary input argument for an action /// </summary> /// <remarks>Intended to be write only (its value is written on construction and not be later read)</remarks> /// <param name="aParameter">Defines the name for the argument. /// Must have been previously added to the action using Action.AddInputParameter</param> /// <param name="aData">Value for the argument</param> public ArgumentBinary(ParameterBinary aParameter, byte[] aData) { GCHandle h = GCHandle.Alloc(aData, GCHandleType.Pinned); iHandle = ActionArgumentCreateBinaryInput(aParameter.Handle(), h.AddrOfPinnedObject(), aData.Length); h.Free(); }
/// <summary> /// Constructor for binary input argument for an action /// </summary> /// <remarks>Intended to be write only (its value is written on construction and not be later read)</remarks> /// <param name="aParameter">Defines the name for the argument. /// Must have been previously added to the action using Action.AddInputParameter</param> /// <param name="aData">Value for the argument</param> public unsafe ArgumentBinary(ParameterBinary aParameter, byte[] aData) { fixed(byte *pData = aData) { iHandle = ActionArgumentCreateBinaryInput(aParameter.Handle(), new IntPtr(pData), aData.Length); } }
/// <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 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(); }
/// <summary> /// Constructor for binary output argument for an action /// </summary> /// <remarks>Intended to be created without any value. The value is later set after /// CpService.InvokeAction is called but before the invocation's callback is run)</remarks> /// <param name="aParameter">Defines the name plus any bounds to the value for the argument. /// Must have been previously added to the action using Action.AddOutputParameter</param> public ArgumentBinary(ParameterBinary aParameter) { iHandle = ActionArgumentCreateBinaryOutput(aParameter.Handle()); }
/// <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); }