예제 #1
0
파일: DvDevice.cs 프로젝트: fuzzy01/ohNet
        /// <summary>
        /// Constructor.  Creates a device capable of serving UI files and of operating on any of the
        /// protocols the device stack supports as standard but with no services or attributes as yet
        /// </summary>
        /// <param name="aUdn">Universally unique identifier.  The caller is responsible for calculating/assigning this</param>
        /// <param name="aResourceManager">Allows the owner of a device to serve UI files</param>
        public unsafe DvDeviceStandard(string aUdn, IResourceManager aResourceManager)
        {
            iResourceManager = aResourceManager;
            iGch             = GCHandle.Alloc(this);
            IntPtr ptr = GCHandle.ToIntPtr(iGch);
            IntPtr udn = InteropUtils.StringToHGlobalUtf8(aUdn);

            iCallbackResourceManager = new CallbackResourceManager(WriteResource);
            iHandle = DvDeviceStandardCreate(udn, iCallbackResourceManager, ptr);
            Marshal.FreeHGlobal(udn);
        }
예제 #2
0
파일: DvDevice.cs 프로젝트: Wodath/ohNet
 /// <summary>
 /// Constructor.  Creates a device capable of serving UI files and of operating on any of the
 /// protocols the device stack supports as standard but with no services or attributes as yet
 /// </summary>
 /// <param name="aUdn">Universally unique identifier.  The caller is responsible for calculating/assigning this</param>
 /// <param name="aResourceManager">Allows the owner of a device to serve UI files</param>
 public DvDeviceStandard(string aUdn, IResourceManager aResourceManager)
 {
     iResourceManager = aResourceManager;
     iGch = GCHandle.Alloc(this);
     IntPtr ptr = GCHandle.ToIntPtr(iGch);
     IntPtr udn = InteropUtils.StringToHGlobalUtf8(aUdn);
     iCallbackResourceManager = new CallbackResourceManager(WriteResource);
     iHandle = DvDeviceStandardCreate(udn, iCallbackResourceManager, ptr);
     Marshal.FreeHGlobal(udn);
 }
예제 #3
0
파일: DvDevice.cs 프로젝트: Wodath/ohNet
 static extern IntPtr DvDeviceStandardCreate(IntPtr aUdn, CallbackResourceManager aResourceManager, IntPtr aPtr);
예제 #4
0
파일: DvDevice.cs 프로젝트: fuzzy01/ohNet
 static extern IntPtr DvDeviceStandardCreate(IntPtr aUdn, CallbackResourceManager aResourceManager, IntPtr aPtr);
예제 #5
0
 static extern unsafe uint DvDeviceCreate(char *aUdn, CallbackResourceManager aResourceManager, IntPtr aPtr);
예제 #6
0
파일: DvDevice.cs 프로젝트: wifigeek/ohNet
 static unsafe extern IntPtr DvDeviceStandardCreate(char* aUdn, CallbackResourceManager aResourceManager, IntPtr aPtr);
예제 #7
0
파일: DvDevice.cs 프로젝트: wifigeek/ohNet
 /// <summary>
 /// Constructor.  Creates a device capable of serving UI files and of operating on any of the
 /// protocols the device stack supports as standard but with no services or attributes as yet
 /// </summary>
 /// <param name="aUdn">Universally unique identifier.  The caller is responsible for calculating/assigning this</param>
 /// <param name="aResourceManager">Allows the owner of a device to serve UI files</param>
 public unsafe DvDeviceStandard(string aUdn, IResourceManager aResourceManager)
 {
     iResourceManager = aResourceManager;
     iGch = GCHandle.Alloc(this);
     IntPtr ptr = GCHandle.ToIntPtr(iGch);
     char* udn = (char*)Marshal.StringToHGlobalAnsi(aUdn).ToPointer();
     iCallbackResourceManager = new CallbackResourceManager(WriteResource);
     iHandle = DvDeviceStandardCreate(udn, iCallbackResourceManager, ptr);
     Marshal.FreeHGlobal((IntPtr)udn);
 }