Ejemplo n.º 1
0
        static UsbSerialDeviceList()
        {
            Default = new UsbSerialDeviceList();

            Default.AddAvailableDeviceInfo(VendorArduino, ArduinoUno, typeof(CdcAcmSerialPort), 1);
            Default.AddAvailableDeviceInfo(VendorArduino, ArduinoUnoR3, typeof(CdcAcmSerialPort), 1);
            Default.AddAvailableDeviceInfo(VendorArduino, ArduinoMega2560, typeof(CdcAcmSerialPort), 1);
            Default.AddAvailableDeviceInfo(VendorArduino, ArduinoMega2560R3, typeof(CdcAcmSerialPort), 1);
            Default.AddAvailableDeviceInfo(VendorArduino, ArduinoSerialAdapter, typeof(CdcAcmSerialPort), 1);
            Default.AddAvailableDeviceInfo(VendorArduino, ArduinoSerialAdapterR3, typeof(CdcAcmSerialPort), 1);
            Default.AddAvailableDeviceInfo(VendorArduino, ArduinoMegaAdk, typeof(CdcAcmSerialPort), 1);
            Default.AddAvailableDeviceInfo(VendorArduino, ArduinoMegaAdkR3, typeof(CdcAcmSerialPort), 1);
            Default.AddAvailableDeviceInfo(VendorArduino, ArduinoLeonard, typeof(CdcAcmSerialPort), 1);
            Default.AddAvailableDeviceInfo(VendorVanOoijenTech, VanOoijenTechTeensyduinoSerial, typeof(CdcAcmSerialPort), 1);
            Default.AddAvailableDeviceInfo(VendorAtmel, AtmelLufaCdcDemoApp, typeof(CdcAcmSerialPort), 1);
            Default.AddAvailableDeviceInfo(VendorLeaflabs, LeaflabsMaple, typeof(CdcAcmSerialPort), 1);

            Default.AddAvailableDeviceInfo(VendorSilabs, SilabsCP2102, typeof(Cp21xxSerialPort), 1);
            Default.AddAvailableDeviceInfo(VendorSilabs, SilabsCP2105, typeof(Cp21xxSerialPort), 1);
            Default.AddAvailableDeviceInfo(VendorSilabs, SilabsCP2108, typeof(Cp21xxSerialPort), 1);
            Default.AddAvailableDeviceInfo(VendorSilabs, SilabsCP2110, typeof(Cp21xxSerialPort), 1);

            Default.AddAvailableDeviceInfo(VendorFtdi, FtdiFT232_245, typeof(FtdiSerialPort), 1);
            Default.AddAvailableDeviceInfo(VendorFtdi, FtdiFT2232, typeof(FtdiSerialPort), 2);
            Default.AddAvailableDeviceInfo(VendorFtdi, FtdiFT4232, typeof(FtdiSerialPort), 4);
            Default.AddAvailableDeviceInfo(VendorFtdi, FtdiFT232HL, typeof(FtdiSerialPort), 1);

            Default.AddAvailableDeviceInfo(VendorRatoc, RexUsb60F, typeof(FtdiSerialPort), 1);
            Default.AddAvailableDeviceInfo(VendorRatoc, RexUsb60MI, typeof(FtdiSerialPort), 1);

            Default.AddAvailableDeviceInfo(VendorProlific, ProlificPL2303, typeof(ProlificSerialPort), 1);
        }
        static UsbSerialDeviceList()
        {
            Default = new UsbSerialDeviceList();

            Default.AddAvailableDeviceInfo(VendorArduino, ArduinoUno, typeof(CdcAcmSerialPort), 1);
            Default.AddAvailableDeviceInfo(VendorArduino, ArduinoUnoR3, typeof(CdcAcmSerialPort), 1);
            Default.AddAvailableDeviceInfo(VendorArduino, ArduinoMega2560, typeof(CdcAcmSerialPort), 1);
            Default.AddAvailableDeviceInfo(VendorArduino, ArduinoMega2560R3, typeof(CdcAcmSerialPort), 1);
            Default.AddAvailableDeviceInfo(VendorArduino, ArduinoSerialAdapter, typeof(CdcAcmSerialPort), 1);
            Default.AddAvailableDeviceInfo(VendorArduino, ArduinoSerialAdapterR3, typeof(CdcAcmSerialPort), 1);
            Default.AddAvailableDeviceInfo(VendorArduino, ArduinoMegaAdk, typeof(CdcAcmSerialPort), 1);
            Default.AddAvailableDeviceInfo(VendorArduino, ArduinoMegaAdkR3, typeof(CdcAcmSerialPort), 1);
            Default.AddAvailableDeviceInfo(VendorArduino, ArduinoLeonard, typeof(CdcAcmSerialPort), 1);
            Default.AddAvailableDeviceInfo(VendorVanOoijenTech, VanOoijenTechTeensyduinoSerial, typeof(CdcAcmSerialPort), 1);
            Default.AddAvailableDeviceInfo(VendorAtmel, AtmelLufaCdcDemoApp, typeof(CdcAcmSerialPort), 1);
            Default.AddAvailableDeviceInfo(VendorLeaflabs, LeaflabsMaple, typeof(CdcAcmSerialPort), 1);

            Default.AddAvailableDeviceInfo(VendorSilabs, SilabsCP2102, typeof(Cp21xxSerialPort), 1);
            Default.AddAvailableDeviceInfo(VendorSilabs, SilabsCP2105, typeof(Cp21xxSerialPort), 1);
            Default.AddAvailableDeviceInfo(VendorSilabs, SilabsCP2108, typeof(Cp21xxSerialPort), 1);
            Default.AddAvailableDeviceInfo(VendorSilabs, SilabsCP2110, typeof(Cp21xxSerialPort), 1);

            Default.AddAvailableDeviceInfo(VendorFtdi, FtdiFT232_245, typeof(FtdiSerialPort), 1);
            Default.AddAvailableDeviceInfo(VendorFtdi, FtdiFT2232, typeof(FtdiSerialPort), 2);
            Default.AddAvailableDeviceInfo(VendorFtdi, FtdiFT4232, typeof(FtdiSerialPort), 4);
            Default.AddAvailableDeviceInfo(VendorFtdi, FtdiFT232HL, typeof(FtdiSerialPort), 1);

            Default.AddAvailableDeviceInfo(VendorRatoc, RexUsb60F, typeof(FtdiSerialPort), 1);
            Default.AddAvailableDeviceInfo(VendorRatoc, RexUsb60MI, typeof(FtdiSerialPort), 1);

            Default.AddAvailableDeviceInfo(VendorProlific, ProlificPL2303, typeof(ProlificSerialPort), 1);
        }
        public UsbSerialDeviceManager(Context context, string actionUsbPermission, bool allowAnonymousCdcAmcDevices, UsbSerialDeviceList availableDeviceList)
        {
            if (context == null)
                throw new ArgumentNullException();
            if (string.IsNullOrEmpty(actionUsbPermission))
                throw new ArgumentException();
            if (availableDeviceList == null)
                throw new ArgumentNullException();

            Context = context;
            ActionUsbPermission = actionUsbPermission;
            UsbManager = (UsbManager)context.GetSystemService(Context.UsbService);
            Receiver = new UsbSerialDeviceBroadcastReceiver(this, UsbManager, actionUsbPermission);
            AllowAnonymousCdcAcmDevices = allowAnonymousCdcAmcDevices;

            AvailableDeviceInfo = availableDeviceList.AvailableDeviceInfo;
            AttachedDevices = new List<UsbSerialDevice>();
        }
Ejemplo n.º 4
0
        public UsbSerialDeviceManager(Context context, string actionUsbPermission, bool allowAnonymousCdcAmcDevices, UsbSerialDeviceList availableDeviceList)
#endif
        {
            if (context == null)
            {
                throw new ArgumentNullException();
            }
            if (string.IsNullOrEmpty(actionUsbPermission))
            {
                throw new ArgumentException();
            }
            if (availableDeviceList == null)
            {
                throw new ArgumentNullException();
            }

            Context                     = context;
            ActionUsbPermission         = actionUsbPermission;
            UsbManager                  = (UsbManager)context.GetSystemService(Context.UsbService);
            Receiver                    = new UsbSerialDeviceBroadcastReceiver(this, UsbManager, actionUsbPermission);
            AllowAnonymousCdcAcmDevices = allowAnonymousCdcAmcDevices;

            AvailableDeviceInfo = availableDeviceList.AvailableDeviceInfo;
            AttachedDevices     = new List <UsbSerialDevice>();

#if UseSmartThreadPool
            ThreadPool = threadPool;
#endif
        }
Ejemplo n.º 5
0
 public UsbSerialDeviceManager(Context context, string actionUsbPermission, bool allowAnonymousCdcAmcDevices, UsbSerialDeviceList availableDeviceList, SmartThreadPool threadPool)