Ejemplo n.º 1
0
        public uint EnumDevices(
            ENUM_DEVICES_OPTIONS Options,
            out IList <IAdapterDevice> DeviceListPtr,
            out IAdapterIoRequest RequestPtr)
        {
            RequestPtr = null;

            DeviceListPtr = new List <IAdapterDevice>();

            // Add all end points in all ZigBee devices to the list
            // if device list not locked
            // note that:
            // - an endpoint is a device for BridgeRT
            // - endpoints will be notified as ZigBee devices arrive
            if (Monitor.TryEnter(m_deviceMap))
            {
                try
                {
                    foreach (var zigBeeDeviceItem in m_deviceMap)
                    {
                        foreach (var endPointItem in zigBeeDeviceItem.Value.EndPointList)
                        {
                            DeviceListPtr.Add(endPointItem.Value);
                        }
                    }
                }
                finally
                {
                    // use try/finally to ensure m_deviceList is unlocked in every case
                    Monitor.Exit(m_deviceMap);
                }
            }

            return(ERROR_SUCCESS);
        }
Ejemplo n.º 2
0
        public uint EnumDevices(ENUM_DEVICES_OPTIONS Options, out IList <IAdapterDevice> DeviceListPtr, out IAdapterIoRequest RequestPtr)
        {
            RequestPtr    = null;
            DeviceListPtr = new List <IAdapterDevice>(this.devices);

            return(ERROR_SUCCESS);
        }
Ejemplo n.º 3
0
        public uint EnumDevices(ENUM_DEVICES_OPTIONS Options, out IList <IAdapterDevice> DeviceListPtr, out IAdapterIoRequest RequestPtr)
        {
            RequestPtr = null;
            this.PopulateDevicesAsync();

            try
            {
                DeviceListPtr = new List <IAdapterDevice>(this.devices);
            }
            catch (OutOfMemoryException ex)
            {
                throw;
            }
            return(ERROR_SUCCESS);
        }
Ejemplo n.º 4
0
        public uint EnumDevices(ENUM_DEVICES_OPTIONS Options, out IList <IAdapterDevice> DeviceListPtr, out IAdapterIoRequest RequestPtr)
        {
            RequestPtr = null;

            try
            {
                DeviceListPtr = new List <IAdapterDevice>(this.devices);
            }
            catch (OutOfMemoryException ex)
            {
                Debug.WriteLine("Out of memory while trying to allocate DeviceListPtr." + ex.Message);
                throw;
            }

            return(ERROR_SUCCESS);
        }
Ejemplo n.º 5
0
        public uint EnumDevices(
            ENUM_DEVICES_OPTIONS Options,
            out IList<IAdapterDevice> DeviceListPtr,
            out IAdapterIoRequest RequestPtr)
        {
            RequestPtr = null;

            try
            {
                DeviceListPtr = new List<IAdapterDevice>(this.devices);
            }
            catch (OutOfMemoryException ex)
            {
                throw;
            }

            return ERROR_SUCCESS;
        }
Ejemplo n.º 6
0
 public uint EnumDevices(ENUM_DEVICES_OPTIONS Options, out IList <IAdapterDevice> DeviceListPtr, out IAdapterIoRequest RequestPtr)
 {
     return(_adapter.EnumDevices(Options, out DeviceListPtr, out RequestPtr));
 }