Esempio n. 1
0
        private static int WriteResource(IntPtr aUserData, IntPtr aUriTail, uint aInterface, IntPtr aLanguageList, IntPtr aWriterData,
                                         CallbackWriteResourceBegin aWriteBegin,
                                         CallbackWriteResource aWriteResource,
                                         CallbackWriteResourceEnd aWriteEnd)
        {
            GCHandle         gch          = GCHandle.FromIntPtr(aUserData);
            DvDeviceStandard self         = (DvDeviceStandard)gch.Target;
            string           uriTail      = InteropUtils.PtrToStringUtf8(aUriTail);
            List <string>    languageList = new List <string>();
            uint             count        = DvResourceWriterLanguageCount(aLanguageList);

            for (uint i = 0; i < count; i++)
            {
                languageList.Add(InteropUtils.PtrToStringUtf8(DvResourceWriterLanguage(aLanguageList, i)));
            }
            ResourceWriter writer = new ResourceWriter(aWriterData, aWriteBegin, aWriteResource, aWriteEnd);

            try
            {
                writer.Write(self.iResourceManager, uriTail, aInterface, languageList);
            }
            catch
            {
                return(-1);
            }
            return(0);
        }
Esempio n. 2
0
 public ResourceWriter(IntPtr aWriterData,
                       DvDeviceStandard.CallbackWriteResourceBegin aWriteBegin,
                       DvDeviceStandard.CallbackWriteResource aWriteResource,
                       DvDeviceStandard.CallbackWriteResourceEnd aWriteEnd)
 {
     iWriterData = aWriterData;
     iWriteBegin = aWriteBegin;
     iWriteResource = aWriteResource;
     iWriteEnd = aWriteEnd;
 }
Esempio n. 3
0
 public DeviceBasic()
 {
     RandomiseUdn(out gDeviceName);
     iDevice = new DvDeviceStandard(gDeviceName);
     iDevice.SetAttribute("Upnp.Domain", "openhome.org");
     iDevice.SetAttribute("Upnp.Type", "Test");
     iDevice.SetAttribute("Upnp.Version", "1");
     iDevice.SetAttribute("Upnp.FriendlyName", "ohNetTestDevice");
     iDevice.SetAttribute("Upnp.Manufacturer", "None");
     iDevice.SetAttribute("Upnp.ModelName", "ohNet test device");
     iTestBasic = new ProviderTestBasic(iDevice);
     iDevice.SetEnabled();
 }
Esempio n. 4
0
 public DeviceLights(int aMode, string aConfigDir)
 {
     iConfigDir = aConfigDir;
     RandomiseUdn(out iDeviceName);
     iDevice = new Device.DvDeviceStandard(iDeviceName, this);
     iDevice.SetAttribute("Upnp.Domain", "openhome.org");
     iDevice.SetAttribute("Upnp.Type", "TestLights");
     iDevice.SetAttribute("Upnp.Version", "1");
     iDevice.SetAttribute("Upnp.FriendlyName", "ohNet Lights");
     iDevice.SetAttribute("Upnp.Manufacturer", "None");
     iDevice.SetAttribute("Upnp.ModelName", "ohNet Lights v1");
     iLights = new ProviderLights(iDevice, aMode);
     iDevice.SetEnabled();
 }
Esempio n. 5
0
 public DeviceLights(int aMode, string aConfigDir)
 {
     iConfigDir = aConfigDir;
     RandomiseUdn(out iDeviceName);
     iDevice = new Device.DvDeviceStandard(iDeviceName, this);
     iDevice.SetAttribute("Upnp.Domain", "openhome.org");
     iDevice.SetAttribute("Upnp.Type", "TestLights");
     iDevice.SetAttribute("Upnp.Version", "1");
     iDevice.SetAttribute("Upnp.FriendlyName", "ohNet Lights");
     iDevice.SetAttribute("Upnp.Manufacturer", "None");
     iDevice.SetAttribute("Upnp.ModelName", "ohNet Lights v1");
     iLights = new ProviderLights(iDevice, aMode);
     iDevice.SetEnabled();
 }