예제 #1
0
파일: CyUSBBOS.cs 프로젝트: arnofan/tesis
        protected byte[] _ContainerID; /* UUID */

        #endregion Fields

        #region Constructors

        internal unsafe CyBOS_CONTAINER_ID(IntPtr handle, USB_BOS_CONTAINER_ID* USB_ContainerID)
        {
            _bLength = USB_ContainerID->bLength;
            _bDescriptorType = USB_ContainerID->bDescriptorType;
            _bDevCapabilityType = USB_ContainerID->bDevCapabilityType;
            _ContainerID = new byte[CyConst.USB_BOS_CAPABILITY_TYPE_CONTAINER_ID_SIZE];
            for (int i = 0; i < CyConst.USB_BOS_CAPABILITY_TYPE_CONTAINER_ID_SIZE; i++)
                _ContainerID[i] = USB_ContainerID->ContainerID[i];
        }
예제 #2
0
        public unsafe bool GetBosContainedIDDescriptor(ref USB_BOS_CONTAINER_ID descr)
        {
            // USB3.0 device specific descriptor, for USB2.0 device this function will return false
            if (_alreadyDisposed) throw new ObjectDisposedException("");
            if ((_bcdUSB & CyConst.bcdUSBJJMask) != CyConst.USB30MajorVer)
                return false;
            if (USBBos.Container_ID != null)
            {
                descr.bLength = USBBos.Container_ID.Lenght;
                descr.bDescriptorType = USBBos.Container_ID.DescriptorType;
                descr.bDevCapabilityType = USBBos.Container_ID.DevCapabilityType;
                descr.bReserved = USBBos.Container_ID.Reserved;
                //for (int i = 0; i < CyConst.USB_BOS_CAPABILITY_TYPE_CONTAINER_ID_SIZE; i++)
                //  descr.ContainerID[i] = 0;
            }
            else
                return false;

            return true;
        }