private static unsafe int DoSetInt(IntPtr aPtr, uint aVersion, int aValueInt) { GCHandle gch = GCHandle.FromIntPtr(aPtr); DvServiceZappOrgTestBasic1 self = (DvServiceZappOrgTestBasic1)gch.Target; self.SetInt(aVersion, aValueInt); return(0); }
private static unsafe int DoSetBinary(IntPtr aPtr, uint aVersion, char *aValueBin, int aValueBinLen) { GCHandle gch = GCHandle.FromIntPtr(aPtr); DvServiceZappOrgTestBasic1 self = (DvServiceZappOrgTestBasic1)gch.Target; string valueBin = Marshal.PtrToStringAnsi((IntPtr)aValueBin, aValueBinLen); self.SetBinary(aVersion, valueBin); return(0); }
private static unsafe int DoSetMultiple(IntPtr aPtr, uint aVersion, uint aValueUint, int aValueInt, int aValueBool) { GCHandle gch = GCHandle.FromIntPtr(aPtr); DvServiceZappOrgTestBasic1 self = (DvServiceZappOrgTestBasic1)gch.Target; bool valueBool = (aValueBool != 0); self.SetMultiple(aVersion, aValueUint, aValueInt, valueBool); return(0); }
private static unsafe int DoGetString(IntPtr aPtr, uint aVersion, char **aValueStr) { GCHandle gch = GCHandle.FromIntPtr(aPtr); DvServiceZappOrgTestBasic1 self = (DvServiceZappOrgTestBasic1)gch.Target; string valueStr; self.GetString(aVersion, out valueStr); *aValueStr = (char *)Marshal.StringToHGlobalAnsi(valueStr).ToPointer(); return(0); }
private static unsafe int DoGetBool(IntPtr aPtr, uint aVersion, int *aValueBool) { GCHandle gch = GCHandle.FromIntPtr(aPtr); DvServiceZappOrgTestBasic1 self = (DvServiceZappOrgTestBasic1)gch.Target; bool valueBool; self.GetBool(aVersion, out valueBool); *aValueBool = (valueBool ? 1 : 0); return(0); }
private static unsafe int DoGetUint(IntPtr aPtr, uint aVersion, uint *aValueUint) { GCHandle gch = GCHandle.FromIntPtr(aPtr); DvServiceZappOrgTestBasic1 self = (DvServiceZappOrgTestBasic1)gch.Target; uint valueUint; self.GetUint(aVersion, out valueUint); *aValueUint = valueUint; return(0); }
private static unsafe int DoDecrement(IntPtr aPtr, uint aVersion, int aValue, int *aResult) { GCHandle gch = GCHandle.FromIntPtr(aPtr); DvServiceZappOrgTestBasic1 self = (DvServiceZappOrgTestBasic1)gch.Target; int result; self.Decrement(aVersion, aValue, out result); *aResult = result; return(0); }
private static unsafe int DoGetBinary(IntPtr aPtr, uint aVersion, char **aValueBin, int *aValueBinLen) { GCHandle gch = GCHandle.FromIntPtr(aPtr); DvServiceZappOrgTestBasic1 self = (DvServiceZappOrgTestBasic1)gch.Target; string valueBin; self.GetBinary(aVersion, out valueBin); *aValueBin = (char *)Marshal.StringToHGlobalAnsi(valueBin).ToPointer(); *aValueBinLen = valueBin.Length; return(0); }
private static unsafe int DoEchoString(IntPtr aPtr, uint aVersion, char *aValue, char **aResult) { GCHandle gch = GCHandle.FromIntPtr(aPtr); DvServiceZappOrgTestBasic1 self = (DvServiceZappOrgTestBasic1)gch.Target; string value = Marshal.PtrToStringAnsi((IntPtr)aValue); string result; self.EchoString(aVersion, value, out result); *aResult = (char *)Marshal.StringToHGlobalAnsi(result).ToPointer(); return(0); }
private static unsafe int DoToggle(IntPtr aPtr, uint aVersion, int aValue, int *aResult) { GCHandle gch = GCHandle.FromIntPtr(aPtr); DvServiceZappOrgTestBasic1 self = (DvServiceZappOrgTestBasic1)gch.Target; bool value = (aValue != 0); bool result; self.Toggle(aVersion, value, out result); *aResult = (result ? 1 : 0); return(0); }
public DeviceBasic() { RandomiseUdn(out gDeviceName); iDevice = new DvDevice(gDeviceName); iDevice.SetAttribute("Upnp.Domain", "zapp.org"); iDevice.SetAttribute("Upnp.Type", "Test"); iDevice.SetAttribute("Upnp.Version", "1"); iDevice.SetAttribute("Upnp.FriendlyName", "ZappTestDevice"); iDevice.SetAttribute("Upnp.Manufacturer", "None"); iDevice.SetAttribute("Upnp.ManufacturerUrl", "http://www.linn.co.uk"); iDevice.SetAttribute("Upnp.ModelDescription", "Test service"); iDevice.SetAttribute("Upnp.ModelName", "Zapp test device"); iDevice.SetAttribute("Upnp.ModelNumber", "1"); iDevice.SetAttribute("Upnp.ModelUrl", "http://www.linn.co.uk"); iDevice.SetAttribute("Upnp.SerialNumber", "123456"); iDevice.SetAttribute("Upnp.Upc", "123456654321"); iTestBasic = new ServiceTestBasic(iDevice); iDevice.SetEnabled(); }