├── .gitattributes ├── Examples ├── FMX │ ├── Bulk Transfer │ │ ├── Win32 │ │ │ └── Debug │ │ │ │ └── libusb-1.0.dll │ │ ├── Win64 │ │ │ └── Debug │ │ │ │ └── libusb-1.0.dll │ │ ├── bulktransfer.dpr │ │ ├── bulktransfer.dproj │ │ ├── bulktransfer.dproj.local │ │ ├── bulktransfer.identcache │ │ ├── bulktransfer.res │ │ ├── bulktransfer.stat │ │ ├── main.fmx │ │ └── main.pas │ ├── Dll Version │ │ ├── Libusb1Version.dpr │ │ ├── Libusb1Version.dproj │ │ ├── Libusb1Version.dproj.local │ │ ├── Libusb1Version.identcache │ │ ├── Libusb1Version.res │ │ ├── Libusb1Version.stat │ │ ├── Win32 │ │ │ └── Debug │ │ │ │ └── libusb-1.0.dll │ │ ├── Win64 │ │ │ └── Debug │ │ │ │ └── libusb-1.0.dll │ │ ├── main.fmx │ │ └── main.pas │ ├── Listdevs │ │ ├── LibusbListDevs.dpr │ │ ├── LibusbListDevs.dproj │ │ ├── LibusbListDevs.dproj.local │ │ ├── LibusbListDevs.identcache │ │ ├── LibusbListDevs.res │ │ ├── LibusbListDevs.stat │ │ ├── Win32 │ │ │ └── Debug │ │ │ │ └── libusb-1.0.dll │ │ ├── Win64 │ │ │ ├── Debug │ │ │ │ └── libusb-1.0.dll │ │ │ └── Release │ │ │ │ └── libusb-1.0.dll │ │ ├── main.fmx │ │ └── main.pas │ └── Test LibUsb │ │ ├── LibusbTestusb.dpr │ │ ├── LibusbTestusb.dproj │ │ ├── LibusbTestusb.dproj.local │ │ ├── LibusbTestusb.identcache │ │ ├── LibusbTestusb.res │ │ ├── LibusbTestusb.stat │ │ ├── Libusbdev1.stat │ │ ├── Win32 │ │ ├── Debug │ │ │ └── libusb-1.0.dll │ │ └── Release │ │ │ └── libusb-1.0.dll │ │ ├── Win64 │ │ ├── Debug │ │ │ └── libusb-1.0.dll │ │ └── Release │ │ │ └── libusb-1.0.dll │ │ ├── main.fmx │ │ ├── main.pas │ │ └── testlibusb.pas └── VCL │ ├── Bulk Transfer │ ├── Bulk_Transfer.dpr │ ├── Bulk_Transfer.dproj │ ├── Bulk_Transfer.dproj.local │ ├── Bulk_Transfer.identcache │ ├── Bulk_Transfer.res │ ├── Win32 │ │ └── Debug │ │ │ └── libusb-1.0.dll │ ├── Win64 │ │ └── Debug │ │ │ └── libusb-1.0.dll │ ├── main.dfm │ └── main.pas │ ├── Dll Version │ ├── VCLVersion.dpr │ ├── VCLVersion.dproj │ ├── VCLVersion.dproj.local │ ├── VCLVersion.identcache │ ├── VCLVersion.res │ ├── VCLVersion.stat │ ├── Win32 │ │ └── Debug │ │ │ └── libusb-1.0.dll │ ├── Win64 │ │ └── Debug │ │ │ └── libusb-1.0.dll │ ├── vclmain.dfm │ └── vclmain.pas │ ├── ListDevs │ ├── LibusbListDevs.dpr │ ├── LibusbListDevs.dproj │ ├── LibusbListDevs.dproj.local │ ├── LibusbListDevs.identcache │ ├── LibusbListDevs.res │ ├── LibusbListDevs.stat │ ├── Win32 │ │ └── Debug │ │ │ └── libusb-1.0.dll │ ├── Win64 │ │ └── Debug │ │ │ └── libusb-1.0.dll │ ├── main.dfm │ └── main.pas │ └── Test LibUsb │ ├── LibusbListDevs.dpr │ ├── LibusbListDevs.dproj │ ├── LibusbListDevs.dproj.local │ ├── LibusbListDevs.identcache │ ├── Win32 │ └── Debug │ │ └── libusb-1.0.dll │ ├── Win64 │ └── Debug │ │ └── libusb-1.0.dll │ ├── main.dfm │ ├── main.pas │ └── testlibusb.pas ├── LICENSE ├── README.MD ├── Src ├── __history │ ├── libusb1.pas.~26~ │ ├── libusb1.pas.~27~ │ ├── libusb1.pas.~28~ │ ├── libusb1.pas.~29~ │ ├── libusb1.pas.~30~ │ ├── libusb1.pas.~31~ │ ├── libusb1.pas.~32~ │ ├── libusb1.pas.~33~ │ ├── libusb1.pas.~34~ │ ├── libusb1.pas.~35~ │ ├── libusb1helper.pas.~1~ │ ├── libusb1helper.pas.~2~ │ ├── libusb1helper.pas.~3~ │ ├── libusb1helper.pas.~4~ │ ├── libusb1helper.pas.~5~ │ ├── libusb1helper.pas.~6~ │ └── libusb1helper.pas.~7~ ├── libusb1.pas └── libusb1helper.pas ├── Windows Dll's V1.0.22.11297 ├── Win32 │ └── libusb-1.0.dll └── Win64 │ └── libusb-1.0.dll └── media ├── 3316d2a33f3684da8b72c9b55c16419b.gif ├── 5e7e326f1cac06cde584741d41543d22.gif ├── c073bd0e0ba1bc6330590f0f04173b5f.png ├── c3c7bec784993da828c9302fc8b567f3.gif └── de3d28c2bba393cb3b591ed27c01b0d5.gif /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /Examples/FMX/Bulk Transfer/Win32/Debug/libusb-1.0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYHPRO/Delphi-libusb/79d74d5466e6d588f0defa8fff75c67cf98429c0/Examples/FMX/Bulk Transfer/Win32/Debug/libusb-1.0.dll -------------------------------------------------------------------------------- /Examples/FMX/Bulk Transfer/Win64/Debug/libusb-1.0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYHPRO/Delphi-libusb/79d74d5466e6d588f0defa8fff75c67cf98429c0/Examples/FMX/Bulk Transfer/Win64/Debug/libusb-1.0.dll -------------------------------------------------------------------------------- /Examples/FMX/Bulk Transfer/bulktransfer.dpr: -------------------------------------------------------------------------------- 1 | program bulktransfer; 2 | 3 | uses 4 | System.StartUpCopy, 5 | FMX.Forms, 6 | main in 'main.pas' {fmmain}, 7 | libusb1 in '..\..\..\Src\libusb1.pas', 8 | libusb1helper in '..\..\..\Src\libusb1helper.pas'; 9 | 10 | {$R *.res} 11 | 12 | begin 13 | Application.Initialize; 14 | Application.CreateForm(Tfmmain, fmmain); 15 | Application.Run; 16 | end. 17 | -------------------------------------------------------------------------------- /Examples/FMX/Bulk Transfer/bulktransfer.dproj.local: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 2017/11/14 20:14:26.000.891,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 5 | 2017/11/20 08:57:28.000.814,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 6 | 2017/11/20 10:28:55.000.930,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 7 | 2017/11/20 11:30:19.000.680,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 8 | 2017/11/20 11:36:21.000.183,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 9 | 2017/11/22 11:55:09.000.432,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 10 | 2017/11/22 11:55:55.000.796,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 11 | 2017/12/06 16:41:19.000.757,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 12 | 2017/12/08 15:54:02.000.199,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 13 | 2018/01/02 17:09:59.000.518,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 14 | 2018/01/05 10:42:39.000.068,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 15 | 2018/03/01 09:21:58.000.213,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 16 | 2018/03/01 15:19:54.000.205,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 17 | 2018/03/01 16:34:45.000.931,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 18 | 2018/03/02 17:18:56.000.551,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 19 | 2018/04/19 19:59:21.000.201,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 20 | 2018/04/20 07:33:48.000.235,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 21 | 2018/04/20 07:52:12.000.986,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 22 | 2018/04/23 16:11:39.000.947,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 23 | 2018/04/23 16:12:40.000.909,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\main.pas=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 24 | 2018/04/23 16:12:40.000.909,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\main.fmx=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.fmx 25 | 2018/04/23 16:12:48.000.992,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Project2.dproj 26 | 2018/04/23 16:14:27.000.122,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj 27 | 2018/04/23 16:15:00.000.238,=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransferctopascal.pas 28 | 2018/04/23 16:15:00.000.244,=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransferoption2.pas 29 | 2018/04/23 16:15:13.000.359,=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\Unit1.pas 30 | 2018/04/23 16:15:43.000.819,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.pas=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\Unit1.pas 31 | 2018/04/23 16:15:49.000.572,=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\Unit1.pas 32 | 2018/04/23 16:16:35.000.758,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer2.pas=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\Unit1.pas 33 | 2018/04/23 16:16:51.000.954,=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\Unit1.pas 34 | 2018/04/23 16:17:22.000.732,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulkread.pas=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\Unit1.pas 35 | 2018/04/23 16:17:33.000.771,=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\Unit1.pas 36 | 2018/04/23 16:18:03.000.215,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bultransferArduino.pas=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\Unit1.pas 37 | 2018/04/23 16:30:07.000.119,=E:\AppEarlyDev\FMXLIBUSB1\Src\libusb1.pas 38 | 2018/04/23 16:43:20.000.143,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulkread.pas=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulkread..pas 39 | 2018/04/23 16:45:03.000.741,=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulkread_c.pas 40 | 2018/04/23 16:46:13.000.994,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulkread_c.pas=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulkread.pas 41 | 2018/04/23 17:04:54.000.816,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.pas=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer1.pas 42 | 2018/04/23 17:05:01.000.045,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj 43 | 2018/04/23 17:17:02.000.094,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj 44 | 2018/04/23 17:57:25.000.970,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj 45 | 2018/04/24 20:25:25.000.200,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj 46 | 2018/04/24 20:27:14.000.361,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\WriteBulkTransfer.pas=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer1.pas 47 | 2018/04/24 20:27:30.000.149,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulkread1.pas=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulkread.pas 48 | 2018/04/24 20:27:46.000.458,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulkread2.pas=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer2.pas 49 | 2018/04/24 20:28:17.000.115,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\ReadBulkTransfer1.pas=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulkread1.pas 50 | 2018/04/24 20:28:40.000.670,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\ReadBulkTransfer2.pas=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulkread2.pas 51 | 2018/04/24 20:29:06.000.935,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\BulkTransferArduino.pas=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bultransferArduino.pas 52 | 2018/04/24 20:30:07.000.307,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\ReadBulkTransfer3.pas=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransferoption2.pas 53 | 2018/04/24 20:32:48.000.432,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\ReadBulkTransfer4.pas=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\WriteBulkTransfer.pas 54 | 2018/04/24 20:37:53.000.886,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj 55 | 2018/04/24 20:41:29.000.073,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\WriteBulkTransfer.pas= 56 | 2018/04/24 20:41:35.000.992,=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\WriteBulkTransfer.pas 57 | 2018/04/24 20:42:05.000.776,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj 58 | 2018/04/24 20:44:10.000.378,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj 59 | 2018/04/24 20:52:20.000.395,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj 60 | 2018/04/24 21:01:16.000.175,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj 61 | 2018/04/24 21:02:32.000.242,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj 62 | 2018/04/24 21:36:42.000.617,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransferctopascal.pas= 63 | 2018/04/24 21:46:16.000.360,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\ReadBulkTransfer4.pas= 64 | 2018/04/24 21:47:00.000.859,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj 65 | 2018/04/24 21:48:53.000.077,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\ReadBulkTransfer3.pas=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\ReadBulkTransfer2.pas 66 | 2018/04/24 21:49:22.000.615,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj 67 | 2018/04/24 22:44:49.000.874,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj 68 | 2018/04/24 22:45:39.000.667,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj 69 | 2018/04/25 09:34:28.000.389,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj 70 | 2018/04/25 10:15:53.000.849,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj 71 | 2018/04/25 19:10:41.000.540,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj 72 | 2018/04/25 19:26:00.000.230,=E:\AppEarlyDev\FMXLIBUSB1\Src\libusb1helper.pas 73 | 2018/05/04 15:38:44.000.123,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj 74 | 2018/05/04 16:10:33.000.615,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj 75 | 2018/05/04 22:13:42.000.680,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\ReadBulkTransfer2.pas= 76 | 2018/05/04 22:13:46.000.919,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\ReadBulkTransfer1.pas= 77 | 2018/05/04 22:13:50.000.771,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\BulkTransferArduino.pas= 78 | 2018/05/04 22:13:54.000.099,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\WriteBulkTransfer.pas= 79 | 2018/05/04 22:40:19.000.725,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj 80 | 2018/05/06 15:30:30.000.804,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj 81 | 2018/05/20 19:47:20.770,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj 82 | 2018/05/20 19:48:16.899,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dproj 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | -------------------------------------------------------------------------------- /Examples/FMX/Bulk Transfer/bulktransfer.identcache: -------------------------------------------------------------------------------- 1 | )E:\AppEarlyDev\FMXLIBUSB1\Src\libusb1.pasEE:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\bulktransfer.dpr=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Bulk Transfer\main.pas/E:\AppEarlyDev\FMXLIBUSB1\Src\libusb1helper.pas -------------------------------------------------------------------------------- /Examples/FMX/Bulk Transfer/bulktransfer.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYHPRO/Delphi-libusb/79d74d5466e6d588f0defa8fff75c67cf98429c0/Examples/FMX/Bulk Transfer/bulktransfer.res -------------------------------------------------------------------------------- /Examples/FMX/Bulk Transfer/bulktransfer.stat: -------------------------------------------------------------------------------- 1 | [Stats] 2 | EditorSecs=18031 3 | DesignerSecs=1336 4 | InspectorSecs=519 5 | CompileSecs=290424 6 | OtherSecs=1338 7 | StartTime=2018/04/23 4:29:21 PM 8 | RealKeys=0 9 | EffectiveKeys=0 10 | DebugSecs=546 11 | -------------------------------------------------------------------------------- /Examples/FMX/Bulk Transfer/main.fmx: -------------------------------------------------------------------------------- 1 | object fmmain: Tfmmain 2 | Left = 0 3 | Top = 0 4 | Caption = 'main' 5 | ClientHeight = 489 6 | ClientWidth = 674 7 | FormFactor.Width = 320 8 | FormFactor.Height = 480 9 | FormFactor.Devices = [Desktop] 10 | OnCreate = FormCreate 11 | DesignerMasterStyle = 0 12 | object ToolBar1: TToolBar 13 | Size.Width = 674.000000000000000000 14 | Size.Height = 40.000000000000000000 15 | Size.PlatformDefault = False 16 | TabOrder = 1 17 | object Label1: TLabel 18 | Align = Client 19 | StyledSettings = [Family, Style, FontColor] 20 | Size.Width = 674.000000000000000000 21 | Size.Height = 40.000000000000000000 22 | Size.PlatformDefault = False 23 | TextSettings.Font.Size = 18.000000000000000000 24 | TextSettings.HorzAlign = Center 25 | Text = 'Libusb 1.0 Bulk Transfer' 26 | TabOrder = 1 27 | end 28 | end 29 | object btnRead: TButton 30 | Position.X = 400.000000000000000000 31 | Position.Y = 218.000000000000000000 32 | Size.Width = 249.000000000000000000 33 | Size.Height = 30.000000000000000000 34 | Size.PlatformDefault = False 35 | TabOrder = 2 36 | Text = 'Bulk Transfer In' 37 | OnClick = btnReadClick 38 | end 39 | object btnWrite: TButton 40 | Position.X = 40.000000000000000000 41 | Position.Y = 218.000000000000000000 42 | Size.Width = 249.000000000000000000 43 | Size.Height = 30.000000000000000000 44 | Size.PlatformDefault = False 45 | TabOrder = 3 46 | Text = 'Bulk Transfer Out' 47 | OnClick = btnWriteClick 48 | end 49 | object Edit10: TEdit 50 | Touch.InteractiveGestures = [LongTap, DoubleTap] 51 | TabOrder = 4 52 | Position.X = 176.000000000000000000 53 | Position.Y = 146.000000000000000000 54 | Size.Width = 30.000000000000000000 55 | Size.Height = 22.000000000000000000 56 | Size.PlatformDefault = False 57 | end 58 | object Edit11: TEdit 59 | Touch.InteractiveGestures = [LongTap, DoubleTap] 60 | TabOrder = 5 61 | Position.X = 216.000000000000000000 62 | Position.Y = 146.000000000000000000 63 | Size.Width = 30.000000000000000000 64 | Size.Height = 22.000000000000000000 65 | Size.PlatformDefault = False 66 | end 67 | object Edit12: TEdit 68 | Touch.InteractiveGestures = [LongTap, DoubleTap] 69 | TabOrder = 6 70 | Position.X = 256.000000000000000000 71 | Position.Y = 146.000000000000000000 72 | Size.Width = 30.000000000000000000 73 | Size.Height = 22.000000000000000000 74 | Size.PlatformDefault = False 75 | end 76 | object Edit9: TEdit 77 | Touch.InteractiveGestures = [LongTap, DoubleTap] 78 | TabOrder = 7 79 | Position.X = 136.000000000000000000 80 | Position.Y = 146.000000000000000000 81 | Size.Width = 30.000000000000000000 82 | Size.Height = 22.000000000000000000 83 | Size.PlatformDefault = False 84 | end 85 | object Label10: TLabel 86 | Position.X = 24.000000000000000000 87 | Position.Y = 111.000000000000000000 88 | Size.Width = 265.000000000000000000 89 | Size.Height = 25.000000000000000000 90 | Size.PlatformDefault = False 91 | Text = 'Pid' 92 | TabOrder = 8 93 | object Edit2: TEdit 94 | Touch.InteractiveGestures = [LongTap, DoubleTap] 95 | TabOrder = 0 96 | Position.X = 112.000000000000000000 97 | Size.Width = 153.000000000000000000 98 | Size.Height = 25.000000000000000000 99 | Size.PlatformDefault = False 100 | end 101 | end 102 | object Label12: TLabel 103 | Position.X = 16.000000000000000000 104 | Position.Y = 183.000000000000000000 105 | Size.Width = 265.000000000000000000 106 | Size.Height = 25.000000000000000000 107 | Size.PlatformDefault = False 108 | Text = 'EP Out' 109 | TabOrder = 9 110 | object Edit3: TEdit 111 | Touch.InteractiveGestures = [LongTap, DoubleTap] 112 | TabOrder = 0 113 | Position.X = 120.000000000000000000 114 | Size.Width = 153.000000000000000000 115 | Size.Height = 25.000000000000000000 116 | Size.PlatformDefault = False 117 | end 118 | end 119 | object Label2: TLabel 120 | Position.X = 416.000000000000000000 121 | Position.Y = 183.000000000000000000 122 | Size.Width = 265.000000000000000000 123 | Size.Height = 25.000000000000000000 124 | Size.PlatformDefault = False 125 | Text = 'EP In' 126 | TabOrder = 10 127 | object Edit5: TEdit 128 | Touch.InteractiveGestures = [LongTap, DoubleTap] 129 | TabOrder = 0 130 | Position.X = 80.000000000000000000 131 | Size.Width = 145.000000000000000000 132 | Size.Height = 25.000000000000000000 133 | Size.PlatformDefault = False 134 | end 135 | end 136 | object Label3: TLabel 137 | Position.X = 16.000000000000000000 138 | Position.Y = 151.000000000000000000 139 | Text = 'Data' 140 | TabOrder = 11 141 | end 142 | object Label8: TLabel 143 | Position.X = 16.000000000000000000 144 | Position.Y = 37.000000000000000000 145 | Size.Width = 649.000000000000000000 146 | Size.Height = 35.000000000000000000 147 | Size.PlatformDefault = False 148 | Text = 149 | 'Note! This is an example of how to set up bulk transfer. All dei' + 150 | 'ces are different and the setup can very from device to device.' 151 | TabOrder = 12 152 | end 153 | object Label9: TLabel 154 | Position.X = 24.000000000000000000 155 | Position.Y = 71.000000000000000000 156 | Size.Width = 265.000000000000000000 157 | Size.Height = 25.000000000000000000 158 | Size.PlatformDefault = False 159 | Text = 'Vid' 160 | TabOrder = 13 161 | object Edit1: TEdit 162 | Touch.InteractiveGestures = [LongTap, DoubleTap] 163 | TabOrder = 0 164 | Position.X = 112.000000000000000000 165 | Size.Width = 153.000000000000000000 166 | Size.Height = 25.000000000000000000 167 | Size.PlatformDefault = False 168 | end 169 | end 170 | object Memo1: TMemo 171 | Touch.InteractiveGestures = [Pan, LongTap, DoubleTap] 172 | DataDetectorTypes = [] 173 | Align = Bottom 174 | Position.Y = 264.000000000000000000 175 | Size.Width = 674.000000000000000000 176 | Size.Height = 225.000000000000000000 177 | Size.PlatformDefault = False 178 | TabOrder = 14 179 | Viewport.Width = 670.000000000000000000 180 | Viewport.Height = 221.000000000000000000 181 | end 182 | end 183 | -------------------------------------------------------------------------------- /Examples/FMX/Bulk Transfer/main.pas: -------------------------------------------------------------------------------- 1 | unit main; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, 7 | FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.StdCtrls, 8 | FMX.Controls.Presentation, FMX.ScrollBox, FMX.Memo,libusb1,libusb1helper, 9 | FMX.Edit, FMX.TabControl; 10 | 11 | type 12 | dataArr = array of byte; 13 | 14 | type 15 | Tfmmain = class(TForm) 16 | ToolBar1: TToolBar; 17 | Label1: TLabel; 18 | Label8: TLabel; 19 | Label9: TLabel; 20 | Edit1: TEdit; 21 | Label10: TLabel; 22 | Edit2: TEdit; 23 | Label12: TLabel; 24 | Edit3: TEdit; 25 | Label3: TLabel; 26 | Edit9: TEdit; 27 | Edit10: TEdit; 28 | Edit11: TEdit; 29 | Edit12: TEdit; 30 | btnWrite: TButton; 31 | Label2: TLabel; 32 | Edit5: TEdit; 33 | btnRead: TButton; 34 | Memo1: TMemo; 35 | procedure btnWriteClick(Sender: TObject); 36 | procedure FormCreate(Sender: TObject); 37 | procedure btnReadClick(Sender: TObject); 38 | private 39 | { Private declarations } 40 | public 41 | { Public declarations } 42 | end; 43 | 44 | var 45 | fmmain: Tfmmain; 46 | 47 | implementation 48 | 49 | {$R *.fmx} 50 | 51 | 52 | procedure Tfmmain.btnReadClick(Sender: TObject); 53 | var 54 | r,rc,i,num,fsize,flength:integer; 55 | newcontext: plibusb_context; 56 | devh: plibusb_device_handle; 57 | vendor_id,product_id,ep_in_Addr:uint16_t; 58 | actual_length:pinteger; 59 | 60 | OutputData:DataArr ; 61 | begin 62 | memo1.Lines.Clear; 63 | 64 | if (edit1.text = '' ) or (edit2.text = '') then 65 | begin 66 | memo1.Lines.Add('Insufficient data to process - re-enter'); 67 | edit1.Text:= ''; 68 | edit2.Text:= ''; 69 | exit; 70 | end 71 | else 72 | begin 73 | vendor_id := strtoint(edit1.Text); 74 | product_id:= strtoint(edit2.Text); 75 | num:= strtoint(edit3.Text); 76 | setlength(Outputdata,4); 77 | fsize := 512; //max 512 bytes 78 | flength:=sizeof(outputdata); 79 | actual_length:=@flength; //set the length of the byte array to a pointer 80 | 81 | // need endpoint addresses which are hard coded in the device 82 | 83 | ep_in_addr := strtoint(edit5.Text);// change this endpoint information as required 84 | 85 | newcontext:= nil; //declare the pointer to null 86 | devh:= nil; //create a NULL device handle 87 | 88 | r:= libusb_init(newcontext); //initialize Libusb 89 | libusb_set_debug(newcontext,3); // add the debugger on max 90 | 91 | if r <> 0 then 92 | begin 93 | memo1.Lines.add('Cannot initialize the DLL Device Value '+ inttostr(r)+ 'is less than 0'); 94 | exit; 95 | end 96 | else 97 | begin 98 | memo1.Lines.add('DLL Initialized and new context Registered ' ); 99 | memo1.Lines.Add(''); 100 | memo1.Lines.add('Opened Device Handle with Vid '+edit1.text+' / Pid '+edit2.text ); 101 | //open the device with the vid pid 102 | devh:= libusb_open_device_with_vid_pid(newcontext,vendor_id,product_id); 103 | if not (devh = nil) then 104 | begin 105 | memo1.Lines.add('Device Handle created '); 106 | memo1.Lines.Add('---------------------------------------------------------------------'); 107 | end 108 | else 109 | begin 110 | memo1.Lines.Add('Nil Device Handle found'); 111 | exit; 112 | end; 113 | end; 114 | 115 | //need to detach the drivers from all the USB interfaces. 116 | for i := 0 to 1 do 117 | begin 118 | if libusb_kernel_driver_active(devh,i) = 0 then 119 | begin 120 | libusb_detach_kernel_driver(devh,i); 121 | end; 122 | rc := libusb_claim_interface(devh,i); 123 | if rc < 0 then 124 | begin 125 | memo1.lines.add('Error claiming interface'); 126 | end; 127 | end; 128 | 129 | { To receive bytes from the device initiate a bulk_transfer to the 130 | * Endpoint with address ep_in_addr. } 131 | rc:= libusb_bulk_transfer(devh, ep_in_addr, @outputdata, fsize, @actual_length,1000); 132 | 133 | if outputdata <> nil then 134 | memo1.Lines.Add('Data read : '+ strpas(pchar(@outputdata))) 135 | else 136 | memo1.Lines.Add('No data read !'); 137 | 138 | if rc = 7 then //LIBUSB_ERROR_TIMEOUT 139 | begin 140 | Memo1.lines.add('Libusb timeout error'); 141 | exit; 142 | end 143 | else 144 | if (rc <> 0)then 145 | begin 146 | memo1.lines.add('Error while waiting for data - error_value = '+rc.tostring); 147 | exit; 148 | end; 149 | exit; 150 | 151 | libusb_release_interface(devh, 0); 152 | libusb_close(devh); 153 | libusb_exit(newcontext); 154 | Exit; 155 | end; 156 | end; 157 | 158 | procedure Tfmmain.btnWriteClick(Sender: TObject); 159 | var 160 | //sendbytes:pbyte; 161 | flength,fsize,r,rc,rd,i,q,num:integer; 162 | newcontext: plibusb_context; 163 | devh: plibusb_device_handle; 164 | vendor_id,product_id,ep_out_Addr:uint16_t; 165 | Newdata:dataArr; 166 | actual_length:pinteger; 167 | begin 168 | memo1.Lines.Clear; 169 | if (edit1.text = '' ) or (edit2.text = '') then 170 | begin 171 | memo1.Lines.Add('Insufficient data to process - re-enter'); 172 | edit1.Text:= ''; 173 | edit2.Text:= ''; 174 | exit; 175 | end 176 | else 177 | begin 178 | setlength(NewData,4); 179 | NewData[0] := strtoint(edit9.Text); 180 | NewData[1] := strtoint(edit10.Text); 181 | NewData[2] := strtoint(edit11.Text); 182 | NewData[3] := strtoint(edit12.Text); 183 | fsize:= 512; //max bytes 184 | // sendbytes:=@NewData; 185 | vendor_id := strtoint(edit1.Text); 186 | product_id:= strtoint(edit2.Text); 187 | num:= strtoint(edit3.Text); 188 | flength:=sizeof(NewData); 189 | actual_length:=@flength; //set the length of the byte array to a pointer 190 | 191 | // need endpoint addresses which are hard coded in the device 192 | ep_out_Addr := 0;// endpoint 193 | 194 | newcontext:= nil; //declare the pointer to null 195 | devh:= nil; //create a NULL device handle 196 | 197 | r:= libusb_init(newcontext); //initialize Libusb 198 | libusb_set_debug(newcontext,3); // add the debugger on 199 | 200 | if r < 0 then 201 | begin 202 | memo1.Lines.add('Cannot initialize the DLL Device Value '+ r.ToString+ 'is less than 0'); 203 | exit; 204 | end 205 | else 206 | begin 207 | memo1.Lines.add('DLL Initialized and new context Registered ' ); 208 | memo1.Lines.Add(''); 209 | memo1.Lines.add('Opened Device Handle with Vid '+edit1.text+' / Pid '+edit2.text ); 210 | //open the device with the vid pid 211 | devh:= libusb_open_device_with_vid_pid(newcontext,vendor_id,product_id); 212 | if not (devh = nil) then 213 | begin 214 | memo1.Lines.add('Device Handle created '); 215 | memo1.Lines.Add('---------------------------------------------------------------------'); 216 | end 217 | else 218 | begin 219 | memo1.Lines.Add('Nil Device Handle found'); 220 | exit; 221 | end; 222 | end; 223 | 224 | for i:= 0 to num do 225 | begin 226 | if libusb_kernel_driver_active(devh,num) = 0 then 227 | begin 228 | libusb_detach_kernel_driver(devh,num); 229 | rc:= libusb_claim_interface(devh,num); 230 | if rc <> 0 then 231 | begin 232 | memo1.Lines.add('Cannot Claim an Interface '); 233 | libusb_error_name(rc); 234 | end; 235 | end; 236 | 237 | (*Optional change to: var NewData [0..255] array of byte - could be 512 depending on 238 | the usb device then use the Tencoding -> Tencoding.ansi.getstring(); *) 239 | rc:= libusb_bulk_transfer(devh,ep_out_addr,@NewData,fsize,actual_length,1000); 240 | 241 | if rc <> 0 then 242 | begin 243 | memo1.lines.add('Error during control transfer'); 244 | end; 245 | 246 | end; 247 | { We can now start sending or receiving data to the device} 248 | if (libusb_bulk_transfer(devh,ep_out_addr,@NewData,fsize,actual_length,1000) < 0) then 249 | memo1.lines.add( 'Error while sending data ') 250 | else 251 | (*Optional change to: var NewData [0..255] array of byte - could be 512 depending on 252 | the usb device then use the Tencoding -> Tencoding.ansi.getstring(); *) 253 | memo1.lines.add( 'Data sent : '+ strpas(pchar(@NewData))); 254 | 255 | end; 256 | libusb_release_interface(devh, 0); 257 | libusb_close(devh); 258 | libusb_exit(newcontext); 259 | Exit; 260 | end; 261 | 262 | procedure Tfmmain.FormCreate(Sender: TObject); 263 | begin 264 | memo1.Lines.Clear; 265 | //Please use own addreses and values 266 | memo1.lines.add('This presents an example using an array of bytes to send and receive.'+#13#10+' This can be adapted to match the USB device input and output methods.' ); 267 | 268 | edit1.Text:= '3468'; // enter id vid 269 | edit2.Text:= '261'; // enter id pid 270 | edit3.text:= '0'; // enter ep out 271 | edit5.Text:= '139'; // enter ep in 272 | 273 | edit9.Text:= '30'; 274 | edit10.Text:= '15'; 275 | edit11.Text:= '10'; 276 | edit12.Text:= '5'; 277 | end; 278 | 279 | 280 | 281 | end. 282 | -------------------------------------------------------------------------------- /Examples/FMX/Dll Version/Libusb1Version.dpr: -------------------------------------------------------------------------------- 1 | program Libusb1Version; 2 | 3 | uses 4 | System.StartUpCopy, 5 | FMX.Forms, 6 | main in 'main.pas' {fmmain}, 7 | libusb1 in '..\..\..\Src\libusb1.pas'; 8 | 9 | {$R *.res} 10 | 11 | begin 12 | Application.Initialize; 13 | Application.CreateForm(Tfmmain, fmmain); 14 | Application.Run; 15 | end. 16 | -------------------------------------------------------------------------------- /Examples/FMX/Dll Version/Libusb1Version.dproj.local: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 2017/11/14 20:14:26.000.891,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 5 | 2017/11/20 08:57:28.000.814,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 6 | 2017/11/20 10:28:55.000.930,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 7 | 2017/11/20 11:30:19.000.680,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 8 | 2017/11/20 11:36:21.000.183,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 9 | 2017/11/22 11:55:09.000.432,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 10 | 2017/11/22 11:55:55.000.796,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 11 | 2017/12/06 16:41:19.000.757,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 12 | 2017/12/08 15:54:02.000.199,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 13 | 2018/01/02 17:09:59.000.518,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 14 | 2018/01/05 10:42:39.000.068,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 15 | 2018/02/03 13:54:45.000.088,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 16 | 2018/02/03 13:57:08.000.050,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\main.fmx=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.fmx 17 | 2018/02/03 13:57:08.000.049,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\main.pas=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 18 | 2018/02/03 13:57:18.000.202,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Project2.dproj 19 | 2018/02/03 13:58:44.000.480,=E:\AppEarlyDev\FMXLIBUSB1\Libusb Master 27.1.2018\Delphi final conversion libusb\final27012018LibUsb_h.pas 20 | 2018/02/03 15:05:24.000.014,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj 21 | 2018/02/05 17:04:10.000.568,=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Unit1.pas 22 | 2018/02/05 17:08:02.000.280,=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\listdevs_c.pas 23 | 2018/02/05 17:10:46.000.077,E:\AppEarlyDev\FMXLIBUSB1\Libusb Master 27.1.2018\Delphi final conversion libusb\final27012018LibUsb_h.pas=E:\AppEarlyDev\FMXLIBUSB1\Libusb Master 27.1.2018\Delphi final conversion libusb\libusb1.pas 24 | 2018/02/05 17:41:01.000.302,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\listdevs_c.pas=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\listdevs.pas 25 | 2018/02/05 17:41:23.000.509,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\listdevs.pas=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\listdevices.pas 26 | 2018/02/05 18:12:26.000.467,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj 27 | 2018/02/05 18:14:16.000.073,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj 28 | 2018/02/07 16:40:38.000.302,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj 29 | 2018/02/07 17:20:05.000.983,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj 30 | 2018/02/08 16:53:21.000.451,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj 31 | 2018/02/14 18:50:55.000.151,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj 32 | 2018/02/15 17:41:03.000.500,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj 33 | 2018/02/15 18:00:47.000.650,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj 34 | 2018/02/15 18:46:17.000.874,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj 35 | 2018/02/16 16:58:27.000.931,=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Unit1.pas 36 | 2018/02/21 11:35:50.000.190,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev1.dproj 37 | 2018/02/22 12:02:41.000.004,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev1.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev1.dproj 38 | 2018/02/22 15:15:12.000.474,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev1.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev1.dproj 39 | 2018/02/28 19:48:56.000.441,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Examples\Dll Version\Libusb1Version.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Examples\Dll Version\Libusbdev1.dproj 40 | 2018/02/28 20:08:34.000.290,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Examples\FMX\Dll Version\Libusb1Version.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Examples\FMX\Dll Version\Libusb1Version.dproj 41 | 2018/02/28 20:10:34.000.067,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Examples\FMX\Dll Version\Libusb1Version.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Examples\FMX\Dll Version\Libusb1Version.dproj 42 | 2018/02/28 20:11:51.000.479,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Examples\FMX\Dll Version\Libusb1Version.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Examples\FMX\Dll Version\Libusb1Version.dproj 43 | 2018/02/28 20:18:24.000.773,=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Library\libusb1.pas 44 | 2018/02/28 20:22:45.000.803,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Examples\FMX\Dll Version\Libusb1Version.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Examples\FMX\Dll Version\Libusb1Version.dproj 45 | 2018/03/01 09:10:02.000.364,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Dll Version\main.pas= 46 | 2018/03/01 09:10:53.000.231,=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Dll Version\main.pas 47 | 2018/03/01 09:11:09.000.345,=E:\AppEarlyDev\FMXLIBUSB1\Src\libusb1.pas 48 | 2018/03/01 09:11:52.000.534,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Dll Version\Libusb1Version.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Dll Version\Libusb1Version.dproj 49 | 2018/03/01 09:33:45.000.733,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Dll Version\Libusb1Version.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Dll Version\Libusb1Version.dproj 50 | 2018/05/06 16:21:14.000.418,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Dll Version\Libusb1Version.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Dll Version\Libusb1Version.dproj 51 | 2018/05/23 10:35:04.635,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Dll Version\Libusb1Version.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Dll Version\Libusb1Version.dproj 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /Examples/FMX/Dll Version/Libusb1Version.identcache: -------------------------------------------------------------------------------- 1 | )E:\AppEarlyDev\FMXLIBUSB1\Src\libusb1.pasEE:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Dll Version\Libusb1Version.dpr;E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Dll Version\main.pas -------------------------------------------------------------------------------- /Examples/FMX/Dll Version/Libusb1Version.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYHPRO/Delphi-libusb/79d74d5466e6d588f0defa8fff75c67cf98429c0/Examples/FMX/Dll Version/Libusb1Version.res -------------------------------------------------------------------------------- /Examples/FMX/Dll Version/Libusb1Version.stat: -------------------------------------------------------------------------------- 1 | [Stats] 2 | EditorSecs=474 3 | DesignerSecs=158 4 | InspectorSecs=48 5 | CompileSecs=55232 6 | OtherSecs=392 7 | StartTime=2018/02/28 8:04:20 PM 8 | RealKeys=0 9 | EffectiveKeys=0 10 | DebugSecs=397 11 | -------------------------------------------------------------------------------- /Examples/FMX/Dll Version/Win32/Debug/libusb-1.0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYHPRO/Delphi-libusb/79d74d5466e6d588f0defa8fff75c67cf98429c0/Examples/FMX/Dll Version/Win32/Debug/libusb-1.0.dll -------------------------------------------------------------------------------- /Examples/FMX/Dll Version/Win64/Debug/libusb-1.0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYHPRO/Delphi-libusb/79d74d5466e6d588f0defa8fff75c67cf98429c0/Examples/FMX/Dll Version/Win64/Debug/libusb-1.0.dll -------------------------------------------------------------------------------- /Examples/FMX/Dll Version/main.fmx: -------------------------------------------------------------------------------- 1 | object fmmain: Tfmmain 2 | Left = 380 3 | Top = 160 4 | Caption = 'Libusb1 Version ' 5 | ClientHeight = 277 6 | ClientWidth = 538 7 | Position = Designed 8 | FormFactor.Width = 320 9 | FormFactor.Height = 480 10 | FormFactor.Devices = [Desktop] 11 | OnCreate = FormCreate 12 | Left = 380 13 | Top = 160 14 | DesignerMasterStyle = 0 15 | object ToolBar1: TToolBar 16 | Size.Width = 538.000000000000000000 17 | Size.Height = 40.000000000000000000 18 | Size.PlatformDefault = False 19 | TabOrder = 0 20 | object Label5: TLabel 21 | Align = Client 22 | StyledSettings = [Family, Style, FontColor] 23 | Size.Width = 538.000000000000000000 24 | Size.Height = 40.000000000000000000 25 | Size.PlatformDefault = False 26 | TextSettings.Font.Size = 16.000000000000000000 27 | TextSettings.HorzAlign = Center 28 | Text = 'Libusb 1.0 USB Connect' 29 | end 30 | end 31 | object Layout1: TLayout 32 | Align = Center 33 | Size.Width = 377.000000000000000000 34 | Size.Height = 163.000000000000000000 35 | Size.PlatformDefault = False 36 | TabOrder = 2 37 | object Label1: TLabel 38 | StyledSettings = [Family, Style, FontColor] 39 | Position.X = 16.000000000000000000 40 | Position.Y = 14.000000000000000000 41 | Size.Width = 561.000000000000000000 42 | Size.Height = 27.000000000000000000 43 | Size.PlatformDefault = False 44 | TextSettings.Font.Size = 14.000000000000000000 45 | Text = 'Version Dll' 46 | TabOrder = 0 47 | object Label2: TLabel 48 | Align = Right 49 | StyledSettings = [Family, Style, FontColor] 50 | Position.X = 176.000000000000000000 51 | Size.Width = 385.000000000000000000 52 | Size.Height = 27.000000000000000000 53 | Size.PlatformDefault = False 54 | TextSettings.Font.Size = 14.000000000000000000 55 | Text = 'Label2' 56 | end 57 | end 58 | object Label6: TLabel 59 | StyledSettings = [Family, Style, FontColor] 60 | Position.X = 16.000000000000000000 61 | Position.Y = 112.000000000000000000 62 | Size.Width = 561.000000000000000000 63 | Size.Height = 27.000000000000000000 64 | Size.PlatformDefault = False 65 | TextSettings.Font.Size = 14.000000000000000000 66 | Text = 'ABI Compatibility' 67 | TabOrder = 1 68 | object Label7: TLabel 69 | Align = Right 70 | StyledSettings = [Family, Style, FontColor] 71 | Position.X = 176.000000000000000000 72 | Size.Width = 385.000000000000000000 73 | Size.Height = 27.000000000000000000 74 | Size.PlatformDefault = False 75 | TextSettings.Font.Size = 14.000000000000000000 76 | Text = 'Label7' 77 | end 78 | end 79 | object Label3: TLabel 80 | StyledSettings = [Family, Style, FontColor] 81 | Position.X = 16.000000000000000000 82 | Position.Y = 62.000000000000000000 83 | Size.Width = 561.000000000000000000 84 | Size.Height = 27.000000000000000000 85 | Size.PlatformDefault = False 86 | TextSettings.Font.Size = 14.000000000000000000 87 | Text = 'Decribed Value' 88 | TabOrder = 2 89 | object Label4: TLabel 90 | Align = Right 91 | StyledSettings = [Family, Style, FontColor] 92 | Position.X = 176.000000000000000000 93 | Size.Width = 385.000000000000000000 94 | Size.Height = 27.000000000000000000 95 | Size.PlatformDefault = False 96 | TextSettings.Font.Size = 14.000000000000000000 97 | Text = 'Label4' 98 | end 99 | end 100 | end 101 | end 102 | -------------------------------------------------------------------------------- /Examples/FMX/Dll Version/main.pas: -------------------------------------------------------------------------------- 1 | unit main; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, System.Types, System.UITypes, System.Classes, 7 | System.Variants, 8 | FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, 9 | FMX.Controls.Presentation, FMX.StdCtrls, libusb1, 10 | FMX.Edit, FMX.Layouts; 11 | 12 | type 13 | Tfmmain = class(TForm) 14 | ToolBar1: TToolBar; 15 | Label5: TLabel; 16 | Label1: TLabel; 17 | Label2: TLabel; 18 | Label3: TLabel; 19 | Label4: TLabel; 20 | Label6: TLabel; 21 | Label7: TLabel; 22 | Layout1: TLayout; 23 | procedure FormCreate(Sender: TObject); 24 | private 25 | { Private declarations } 26 | public 27 | { Public declarations } 28 | end; 29 | 30 | var 31 | fmmain: Tfmmain; 32 | 33 | implementation 34 | 35 | {$R *.fmx} 36 | 37 | procedure Tfmmain.FormCreate(Sender: TObject); 38 | var 39 | libusbversion: Plibusb_version; 40 | dllv: string; 41 | Driverv: string; 42 | begin 43 | libusbversion := libusb_get_version(); 44 | // get Dll version information 45 | {$IFDEF WIN64} 46 | dllv := ' 64 bit Dll version '; 47 | Driverv := '64 bit Driver version'; 48 | {$ENDIF} 49 | {$IFDEF WIN32} 50 | dllv := ' 32 bit Dll version '; 51 | Driverv := '32 bit Driver version'; 52 | {$ENDIF} 53 | // show Dll info 54 | Label2.Text := dllv + inttostr(libusbversion.major) + '.' + 55 | inttostr(libusbversion.minor) + '.' + inttostr(libusbversion.micro) + '.' + 56 | inttostr(libusbversion.nano); 57 | Label4.Text := inttostr(ord(libusbversion.describe)); 58 | Label7.Text := inttostr(ord(libusbversion.rc)); 59 | end; 60 | 61 | end. 62 | -------------------------------------------------------------------------------- /Examples/FMX/Listdevs/LibusbListDevs.dpr: -------------------------------------------------------------------------------- 1 | program LibusbListDevs; 2 | 3 | uses 4 | System.StartUpCopy, 5 | FMX.Forms, 6 | main in 'main.pas' {fmMain}, 7 | libusb1 in '..\..\..\Src\libusb1.pas'; 8 | 9 | {$R *.res} 10 | 11 | begin 12 | Application.Initialize; 13 | Application.CreateForm(TfmMain, fmMain); 14 | Application.Run; 15 | end. 16 | -------------------------------------------------------------------------------- /Examples/FMX/Listdevs/LibusbListDevs.dproj.local: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 2017/11/14 20:14:26.000.891,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 5 | 2017/11/20 08:57:28.000.814,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 6 | 2017/11/20 10:28:55.000.930,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 7 | 2017/11/20 11:30:19.000.680,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 8 | 2017/11/20 11:36:21.000.183,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 9 | 2017/11/22 11:55:09.000.432,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 10 | 2017/11/22 11:55:55.000.796,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 11 | 2017/12/06 16:41:19.000.757,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 12 | 2017/12/08 15:54:02.000.199,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 13 | 2018/01/02 17:09:59.000.518,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 14 | 2018/01/05 10:42:39.000.068,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 15 | 2018/02/03 13:54:45.000.088,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 16 | 2018/02/03 13:57:08.000.049,C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\main.pas 17 | 2018/02/03 13:57:08.000.050,C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.fmx=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\main.fmx 18 | 2018/02/03 13:57:18.000.202,C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Project2.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj 19 | 2018/02/03 13:58:44.000.480,=E:\AppEarlyDev\FMXLIBUSB1\Libusb Master 27.1.2018\Delphi final conversion libusb\final27012018LibUsb_h.pas 20 | 2018/02/03 15:05:24.000.014,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj 21 | 2018/02/05 17:04:10.000.568,=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Unit1.pas 22 | 2018/02/05 17:08:02.000.280,=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\listdevs_c.pas 23 | 2018/02/05 17:10:46.000.077,E:\AppEarlyDev\FMXLIBUSB1\Libusb Master 27.1.2018\Delphi final conversion libusb\libusb1.pas=E:\AppEarlyDev\FMXLIBUSB1\Libusb Master 27.1.2018\Delphi final conversion libusb\final27012018LibUsb_h.pas 24 | 2018/02/05 17:41:01.000.302,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\listdevs.pas=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\listdevs_c.pas 25 | 2018/02/05 17:41:23.000.509,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\listdevices.pas=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\listdevs.pas 26 | 2018/02/05 18:12:26.000.467,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj 27 | 2018/02/05 18:14:16.000.073,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj 28 | 2018/02/07 16:40:38.000.302,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj 29 | 2018/02/07 17:20:05.000.983,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj 30 | 2018/02/08 16:53:21.000.451,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj 31 | 2018/02/14 18:50:55.000.151,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj 32 | 2018/02/15 17:41:03.000.500,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj 33 | 2018/02/15 18:00:47.000.650,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj 34 | 2018/02/15 18:46:17.000.874,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj 35 | 2018/02/16 16:58:27.000.931,=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Unit1.pas 36 | 2018/02/21 11:35:50.000.190,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev1.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj 37 | 2018/02/22 12:02:41.000.004,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev1.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev1.dproj 38 | 2018/02/22 15:15:12.000.474,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev1.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev1.dproj 39 | 2018/02/28 20:01:44.000.237,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Examples\FMX\List Devices\LibusbListDevices.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Examples\FMX\List Devices\Libusbdev1.dproj 40 | 2018/02/28 20:02:22.000.973,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Examples\FMX\List Devices\LibusbListDevices.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Examples\FMX\List Devices\LibusbListDevices.dproj 41 | 2018/02/28 20:24:49.000.325,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Examples\FMX\List Devices\Unit1.pas= 42 | 2018/02/28 20:25:51.000.891,=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Library\libusb1.pas 43 | 2018/02/28 20:27:47.000.087,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Examples\FMX\List Devices\LibusbListDevices.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Examples\FMX\List Devices\LibusbListDevices.dproj 44 | 2018/02/28 20:33:07.000.203,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Examples\FMX\List Devices\LibusbListDevices.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Examples\FMX\List Devices\LibusbListDevices.dproj 45 | 2018/03/01 09:13:41.000.397,=E:\AppEarlyDev\FMXLIBUSB1\Src\libusb1.pas 46 | 2018/03/01 09:14:36.000.894,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\List Devices\LibusbListDevices.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\List Devices\LibusbListDevices.dproj 47 | 2018/05/04 23:06:52.000.910,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\List Devices\listdevices.pas= 48 | 2018/05/17 19:36:47.000.324,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\List Devices\LibusbListDevices.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\List Devices\LibusbListDevices.dproj 49 | 2018/05/18 13:13:41.000.397,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\List Devices\LibusbListDevices.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\List Devices\LibusbListDevices.dproj 50 | 2018/05/18 15:07:30.000.417,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Listdevs\LibusbListDevices.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Listdevs\LibusbListDevs.dproj 51 | 2018/05/22 16:28:22.000.089,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Listdevs\LibusbListDevs.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Listdevs\LibusbListDevs.dproj 52 | 2018/05/22 18:59:45.000.095,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Listdevs\LibusbListDevs.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Listdevs\LibusbListDevs.dproj 53 | 2018/05/23 10:43:49.000.938,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Listdevs\LibusbListDevs.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Listdevs\LibusbListDevs.dproj 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /Examples/FMX/Listdevs/LibusbListDevs.identcache: -------------------------------------------------------------------------------- 1 | BE:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Listdevs\LibusbListDevs.dpr8E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Listdevs\main.pas)E:\AppEarlyDev\FMXLIBUSB1\Src\libusb1.pas -------------------------------------------------------------------------------- /Examples/FMX/Listdevs/LibusbListDevs.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYHPRO/Delphi-libusb/79d74d5466e6d588f0defa8fff75c67cf98429c0/Examples/FMX/Listdevs/LibusbListDevs.res -------------------------------------------------------------------------------- /Examples/FMX/Listdevs/LibusbListDevs.stat: -------------------------------------------------------------------------------- 1 | [Stats] 2 | EditorSecs=2033 3 | DesignerSecs=109 4 | InspectorSecs=15 5 | CompileSecs=93391 6 | OtherSecs=203 7 | StartTime=2018/05/18 3:50:41 PM 8 | RealKeys=0 9 | EffectiveKeys=0 10 | DebugSecs=1078 11 | -------------------------------------------------------------------------------- /Examples/FMX/Listdevs/Win32/Debug/libusb-1.0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYHPRO/Delphi-libusb/79d74d5466e6d588f0defa8fff75c67cf98429c0/Examples/FMX/Listdevs/Win32/Debug/libusb-1.0.dll -------------------------------------------------------------------------------- /Examples/FMX/Listdevs/Win64/Debug/libusb-1.0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYHPRO/Delphi-libusb/79d74d5466e6d588f0defa8fff75c67cf98429c0/Examples/FMX/Listdevs/Win64/Debug/libusb-1.0.dll -------------------------------------------------------------------------------- /Examples/FMX/Listdevs/Win64/Release/libusb-1.0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYHPRO/Delphi-libusb/79d74d5466e6d588f0defa8fff75c67cf98429c0/Examples/FMX/Listdevs/Win64/Release/libusb-1.0.dll -------------------------------------------------------------------------------- /Examples/FMX/Listdevs/main.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYHPRO/Delphi-libusb/79d74d5466e6d588f0defa8fff75c67cf98429c0/Examples/FMX/Listdevs/main.pas -------------------------------------------------------------------------------- /Examples/FMX/Test LibUsb/LibusbTestusb.dpr: -------------------------------------------------------------------------------- 1 | program LibusbTestusb; 2 | 3 | uses 4 | System.StartUpCopy, 5 | FMX.Forms, 6 | main in 'main.pas' {fmmain}, 7 | testlibusb in 'testlibusb.pas', 8 | libusb1 in '..\..\..\Src\libusb1.pas'; 9 | 10 | {$R *.res} 11 | 12 | begin 13 | Application.Initialize; 14 | Application.CreateForm(Tfmmain, fmmain); 15 | Application.Run; 16 | end. 17 | -------------------------------------------------------------------------------- /Examples/FMX/Test LibUsb/LibusbTestusb.dproj.local: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 2017/11/14 20:14:26.000.891,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 5 | 2017/11/20 08:57:28.000.814,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 6 | 2017/11/20 10:28:55.000.930,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 7 | 2017/11/20 11:30:19.000.680,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 8 | 2017/11/20 11:36:21.000.183,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 9 | 2017/11/22 11:55:09.000.432,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 10 | 2017/11/22 11:55:55.000.796,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 11 | 2017/12/06 16:41:19.000.757,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 12 | 2017/12/08 15:54:02.000.199,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 13 | 2018/01/02 17:09:59.000.518,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 14 | 2018/01/05 10:42:39.000.068,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 15 | 2018/02/03 13:54:45.000.088,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 16 | 2018/02/03 13:57:08.000.050,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\main.fmx=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.fmx 17 | 2018/02/03 13:57:08.000.049,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\main.pas=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 18 | 2018/02/03 13:57:18.000.202,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Project2.dproj 19 | 2018/02/03 13:58:44.000.480,=E:\AppEarlyDev\FMXLIBUSB1\Libusb Master 27.1.2018\Delphi final conversion libusb\final27012018LibUsb_h.pas 20 | 2018/02/03 15:05:24.000.014,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj 21 | 2018/02/05 17:04:10.000.568,=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Unit1.pas 22 | 2018/02/05 17:08:02.000.280,=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\listdevs_c.pas 23 | 2018/02/05 17:10:46.000.077,E:\AppEarlyDev\FMXLIBUSB1\Libusb Master 27.1.2018\Delphi final conversion libusb\final27012018LibUsb_h.pas=E:\AppEarlyDev\FMXLIBUSB1\Libusb Master 27.1.2018\Delphi final conversion libusb\libusb1.pas 24 | 2018/02/05 17:41:01.000.302,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\listdevs_c.pas=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\listdevs.pas 25 | 2018/02/05 17:41:23.000.509,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\listdevs.pas=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\listdevices.pas 26 | 2018/02/05 18:12:26.000.467,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj 27 | 2018/02/05 18:14:16.000.073,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj 28 | 2018/02/07 16:40:38.000.302,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj 29 | 2018/02/07 17:20:05.000.983,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj 30 | 2018/02/08 16:53:21.000.451,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj 31 | 2018/02/14 18:50:55.000.151,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj 32 | 2018/02/15 17:41:03.000.500,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj 33 | 2018/02/15 18:00:47.000.650,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj 34 | 2018/02/15 18:46:17.000.874,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj 35 | 2018/02/16 16:58:27.000.931,=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Unit1.pas 36 | 2018/02/21 11:35:50.000.190,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev1.dproj 37 | 2018/02/22 12:02:41.000.004,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev1.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev1.dproj 38 | 2018/02/22 15:15:12.000.474,E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev1.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examplelibusb1\Libusbdev1.dproj 39 | 2018/03/11 16:14:01.000.034,=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\testlibusb.pas 40 | 2018/03/11 16:21:17.000.065,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\Libusbdev1.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\Libusbdev1.dproj 41 | 2018/03/11 16:21:33.000.414,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\Unit1.pas= 42 | 2018/03/11 16:23:08.000.202,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\Libusbdev1.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj 43 | 2018/03/11 16:23:59.000.732,=E:\AppEarlyDev\FMXLIBUSB1\Src\libusb1.pas 44 | 2018/03/11 16:53:09.000.334,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj 45 | 2018/04/26 13:55:03.000.024,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj 46 | 2018/04/26 13:55:11.000.683,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj 47 | 2018/04/26 14:16:52.000.226,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj 48 | 2018/04/26 14:18:54.000.588,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj 49 | 2018/04/26 14:51:30.000.267,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj 50 | 2018/05/18 19:03:07.000.875,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj 51 | 2018/05/19 12:38:16.000.010,=E:\AppEarlyDev\FMXLIBUSB1\Src\libusb1helper.pas 52 | 2018/05/20 14:35:37.000.520,E:\AppEarlyDev\FMXLIBUSB1\Src\libusb1helper.pas= 53 | 2018/05/20 16:33:12.000.391,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj 54 | 2018/05/20 19:21:09.000.332,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj 55 | 2018/05/20 19:24:01.000.984,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj 56 | 2018/05/21 12:34:31.000.273,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj 57 | 2018/05/21 13:27:31.000.250,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj 58 | 2018/05/22 12:15:08.000.293,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj 59 | 2018/05/22 12:16:22.000.947,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj 60 | 2018/05/22 12:44:44.000.150,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj 61 | 2018/05/22 12:51:55.000.845,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj 62 | 2018/05/22 13:06:41.000.166,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj 63 | 2018/05/22 13:16:33.000.244,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj 64 | 2018/05/22 16:05:46.000.139,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj 65 | 2018/05/22 19:18:19.000.197,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj 66 | 2018/05/23 09:36:06.000.364,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj 67 | 2018/05/23 10:11:46.000.723,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj 68 | 2018/05/23 10:13:07.000.508,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj 69 | 2018/05/25 15:44:49.049,E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dproj 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /Examples/FMX/Test LibUsb/LibusbTestusb.identcache: -------------------------------------------------------------------------------- 1 | AE:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\testlibusb.pas)E:\AppEarlyDev\FMXLIBUSB1\Src\libusb1.pas;E:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\main.pasDE:\AppEarlyDev\FMXLIBUSB1\Examples\FMX\Test LibUsb\LibusbTestusb.dpr -------------------------------------------------------------------------------- /Examples/FMX/Test LibUsb/LibusbTestusb.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYHPRO/Delphi-libusb/79d74d5466e6d588f0defa8fff75c67cf98429c0/Examples/FMX/Test LibUsb/LibusbTestusb.res -------------------------------------------------------------------------------- /Examples/FMX/Test LibUsb/LibusbTestusb.stat: -------------------------------------------------------------------------------- 1 | [Stats] 2 | EditorSecs=59895 3 | DesignerSecs=1191 4 | InspectorSecs=449 5 | CompileSecs=1313714 6 | OtherSecs=3130 7 | StartTime=2018/03/11 4:54:46 PM 8 | RealKeys=0 9 | EffectiveKeys=0 10 | DebugSecs=24473 11 | -------------------------------------------------------------------------------- /Examples/FMX/Test LibUsb/Libusbdev1.stat: -------------------------------------------------------------------------------- 1 | [Stats] 2 | EditorSecs=8634 3 | DesignerSecs=1599 4 | InspectorSecs=257 5 | CompileSecs=83451 6 | OtherSecs=224 7 | StartTime=2018/02/22 8:35:39 AM 8 | RealKeys=0 9 | EffectiveKeys=0 10 | DebugSecs=1306 11 | -------------------------------------------------------------------------------- /Examples/FMX/Test LibUsb/Win32/Debug/libusb-1.0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYHPRO/Delphi-libusb/79d74d5466e6d588f0defa8fff75c67cf98429c0/Examples/FMX/Test LibUsb/Win32/Debug/libusb-1.0.dll -------------------------------------------------------------------------------- /Examples/FMX/Test LibUsb/Win32/Release/libusb-1.0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYHPRO/Delphi-libusb/79d74d5466e6d588f0defa8fff75c67cf98429c0/Examples/FMX/Test LibUsb/Win32/Release/libusb-1.0.dll -------------------------------------------------------------------------------- /Examples/FMX/Test LibUsb/Win64/Debug/libusb-1.0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYHPRO/Delphi-libusb/79d74d5466e6d588f0defa8fff75c67cf98429c0/Examples/FMX/Test LibUsb/Win64/Debug/libusb-1.0.dll -------------------------------------------------------------------------------- /Examples/FMX/Test LibUsb/Win64/Release/libusb-1.0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYHPRO/Delphi-libusb/79d74d5466e6d588f0defa8fff75c67cf98429c0/Examples/FMX/Test LibUsb/Win64/Release/libusb-1.0.dll -------------------------------------------------------------------------------- /Examples/FMX/Test LibUsb/main.pas: -------------------------------------------------------------------------------- 1 | unit main; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, System.Types, System.UITypes, System.Classes, 7 | System.Variants, 8 | FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.TabControl, 9 | FMX.Controls.Presentation, FMX.StdCtrls, FMX.ScrollBox, FMX.Memo, libusb1, 10 | FMX.Edit; 11 | 12 | type 13 | Tfmmain = class(TForm) 14 | ToolBar1: TToolBar; 15 | Label5: TLabel; 16 | Memo1: TMemo; 17 | ToolBar2: TToolBar; 18 | Btn_device: TButton; 19 | Edit1: TEdit; 20 | Label1: TLabel; 21 | procedure Btn_deviceClick(Sender: TObject); 22 | procedure FormShow(Sender: TObject); 23 | private 24 | var 25 | { Private declarations } 26 | public 27 | { Public declarations } 28 | end; 29 | 30 | var 31 | fmmain: Tfmmain; 32 | Memo1: TMemo; 33 | 34 | implementation 35 | 36 | uses testlibusb; 37 | 38 | {$R *.fmx} 39 | 40 | procedure Tfmmain.Btn_deviceClick(Sender: TObject); 41 | begin 42 | if Edit1.Text= '0' then 43 | begin 44 | showmessage('Please enter a Valid Ref ID before processing...'); 45 | exit; 46 | end 47 | else 48 | begin 49 | Memo1.lines.clear; 50 | device(Edit1.Text.ToInteger, Memo1); 51 | end; 52 | end; 53 | 54 | 55 | 56 | procedure Tfmmain.FormShow(Sender: TObject); 57 | begin 58 | Edit1.Text := '0'; 59 | getdevicelist(Memo1,Self); 60 | 61 | end; 62 | 63 | end. 64 | -------------------------------------------------------------------------------- /Examples/FMX/Test LibUsb/testlibusb.pas: -------------------------------------------------------------------------------- 1 | 2 | (* Translated to Delphi pascal By Greg Bayes 12/02/2018 3 | ------------------------------------------------------------ 4 | Original C/C++ Test suite program based of libusb-0.1-compat testlibusb 5 | * Copyright (c) 2013 Nathan Hjelm *) 6 | 7 | unit testlibusb; 8 | 9 | interface 10 | 11 | uses System.SysUtils, System.Types, System.UITypes, System.Classes, 12 | System.Variants, FMX.Types, Libusb1, FMX.Memo, FMX.Dialogs; 13 | 14 | const 15 | verbose: integer = 0; 16 | 17 | procedure getdevicelist(var Memo: Tmemo;sender:Tobject); 18 | procedure endpoint_comp(ep_comp: plibusb_ss_endpoint_companion_descriptor; 19 | var Memo: Tmemo); 20 | procedure endpoint(endpoint: plibusb_endpoint_descriptor; var Memo: Tmemo); 21 | procedure usb2_0_ext_cap(usb_2_0_ext_cap: plibusb_usb_2_0_extension_descriptor; 22 | var Memo: Tmemo); 23 | procedure ss_usb_cap(s_usb_cap: plibusb_ss_usb_device_capability_descriptor; 24 | var Memo: Tmemo); 25 | procedure bos(handle: plibusb_device_handle; var Memo: Tmemo); 26 | procedure interface_process(inter: plibusb_interface; var Memo: Tmemo); 27 | procedure configuration(config: plibusb_config_descriptor; var Memo: Tmemo); 28 | function device(deviceno: integer; var Memo: Tmemo): integer; 29 | procedure extrainfo(dev: plibusb_device; Memo: Tmemo); 30 | function textload:string; 31 | 32 | implementation 33 | 34 | 35 | procedure getdevicelist(var Memo: Tmemo;sender:Tobject); 36 | var 37 | count: ssize_t; 38 | s, p, i,rs, r, op: integer; 39 | context: plibusb_context; 40 | devhandle: plibusb_device_handle; 41 | arrdev: array of plibusb_device; 42 | devs: pplibusb_device; 43 | begin 44 | // List devices 45 | Memo.lines.clear; 46 | Memo.lines.add(textload); 47 | Memo.lines.add 48 | ('---------------------------------------------------------------------------------------------------------------'); 49 | context := nil; // declare the pointer to null 50 | 51 | r := libusb_init(context); 52 | 53 | if r <> 0 then 54 | begin 55 | Memo.lines.add('Cannot initialize the DLL Device Value ' + r.ToString + 56 | 'is less than 0'); 57 | exit; 58 | end 59 | else 60 | begin 61 | Memo.lines.add('DLL Initialized - Device connected'); 62 | count := libusb_get_device_list(context,@devs); 63 | setlength(arrdev,count); 64 | libusb_free_device_list(devs,1); 65 | 66 | if count < 1 then 67 | begin 68 | Memo.lines.add('No devices found '); 69 | exit; 70 | end 71 | else 72 | begin 73 | Memo.lines.add('***USB Activate Devices found : ' + inttostr(count) 74 | + ' ***'); 75 | Memo.lines.add(' Device VID / PID Device extended Information'); 76 | Memo.lines.add('-------------------------------------------------------'); 77 | op := -1; 78 | 79 | rs:= libusb_get_device_list(context,@arrdev); 80 | if rs > 0 then 81 | begin 82 | for i := 0 to count - 1 do 83 | begin 84 | Memo.lines.add('USB Device on system - no ' + inttostr(i + 1)); 85 | extrainfo(arrdev[i],Memo); 86 | 87 | op := libusb_open(arrdev[i], @devhandle); 88 | if op <> 0 then 89 | begin 90 | Memo.lines.add(''); 91 | Memo.lines.add('***Device is not Available to open***'); 92 | end 93 | else 94 | begin 95 | Memo.lines.add(''); 96 | Memo.lines.add('***Device ref ID ' + inttostr(i) + 97 | ' is Open and available to use***'); 98 | end; 99 | Memo.lines.add('-----------------------------------------------------'); 100 | end; 101 | 102 | end 103 | else 104 | begin 105 | memo.lines.Add('Failed to get device list'); 106 | end; 107 | end; 108 | end; 109 | (*Cannot use the function free_ device_list with an array of Plibusb_devices 110 | so have to de_ref each Plibdevice one by one from last to first *) 111 | // libusb_free_device_list(devs,1); 112 | for s := high(arrdev) to low(arrdev) do 113 | libusb_unref_device(arrdev[s]); 114 | 115 | libusb_exit(context); 116 | end; 117 | 118 | procedure extrainfo(dev: plibusb_device; Memo: Tmemo); 119 | var 120 | s, i, r: integer; 121 | desc: Libusb_device_descriptor; 122 | config: plibusb_config_descriptor; 123 | op:integer; 124 | begin 125 | r := libusb_get_device_descriptor(dev, @desc); 126 | 127 | if r <> 0 then 128 | begin 129 | Memo.lines.add('failed to get device descriptor'); 130 | exit; 131 | end 132 | else 133 | begin 134 | // format 135 | Memo.lines.add(' VID : ' + inttostr(desc.idVendor) + ' PID : ' + 136 | inttostr(desc.idProduct) + ' Bus ' + 137 | inttostr(libusb_get_bus_number(dev)) + ' Device ' + 138 | inttostr(libusb_get_device_address(dev))); 139 | end; 140 | end; 141 | //////////////////////////////////////////////////////////////////////////// 142 | procedure endpoint_comp(ep_comp: plibusb_ss_endpoint_companion_descriptor; 143 | var Memo: Tmemo); 144 | begin 145 | Memo.lines.add(' USB 3.0 Endpoint Companion'); 146 | Memo.lines.add('---------------------------------------'); 147 | Memo.lines.add(''); 148 | Memo.lines.add(' bMaxBurst : ' + inttostr(ep_comp.bMaxBurst)); 149 | Memo.lines.add(' bmAttributes : ' + inttostr(ep_comp.bmAttributes)); 150 | Memo.lines.add(' wBytesPerInterval : ' + inttostr(ep_comp.wBytesPerInterval)); 151 | end; 152 | 153 | procedure endpoint(endpoint: plibusb_endpoint_descriptor; var Memo: Tmemo); 154 | var 155 | i, extra, ret: integer; 156 | ep_comp: plibusb_ss_endpoint_companion_descriptor; 157 | context: plibusb_context; 158 | begin 159 | if endpoint <> nil then 160 | begin 161 | if endpoint.bEndpointAddress > 0 then 162 | begin 163 | 164 | Memo.lines.add(' Endpoint information'); 165 | Memo.lines.add('---------------------------------------'); 166 | Memo.lines.add(' bEndpointAddress: ' + inttostr(endpoint.bEndpointAddress)); 167 | Memo.lines.add(' bmAttributes: ' + inttostr(endpoint.bmAttributes)); 168 | Memo.lines.add(' wMaxPacketSize: ' + inttostr(endpoint.wMaxPacketSize)); 169 | Memo.lines.add(' bInterval: ' + inttostr(endpoint.bInterval)); 170 | Memo.lines.add(' bRefresh: ' + inttostr(endpoint.bRefresh)); 171 | Memo.lines.add(' bSynchAddress: ' + inttostr(endpoint.bSynchAddress)); 172 | Memo.lines.add(' bextra_length: ' + endpoint.extra_length.ToString); 173 | Memo.lines.add(' extra: ' + inttostr(endpoint.extra)); 174 | 175 | if endpoint.extra_length > 0 then 176 | begin 177 | for i := 0 to endpoint.extra_length - 1 do 178 | begin 179 | if LIBUSB_DT_SS_ENDPOINT_COMPANION = endpoint.extra then 180 | begin 181 | ret := libusb_get_ss_endpoint_companion_descriptor(context, endpoint, 182 | @ep_comp); 183 | if ret <> 0 then 184 | begin 185 | Memo.lines.add('-----------------------------'); 186 | endpoint_comp(ep_comp, Memo); 187 | libusb_free_ss_endpoint_companion_descriptor(ep_comp); 188 | end; 189 | end 190 | else 191 | begin 192 | Memo.lines.add(' Not a USB 3.0 Endpoint Companion'); 193 | end; 194 | end; 195 | end 196 | else 197 | begin 198 | Memo.lines.add('-----------------------------'); 199 | Memo.lines.add(' Endpoint - ExtraPoint is not available'); 200 | Memo.lines.add('-----------------------------'); 201 | end 202 | end 203 | else 204 | Memo.lines.add(' No Endpoint Descriptions found for the Interface'); 205 | end 206 | else 207 | begin 208 | Memo.lines.add(' No Endpoint found for the Interface'); 209 | end; 210 | 211 | 212 | 213 | end; 214 | 215 | procedure altsetting(inter: plibusb_interface_descriptor; var Memo: Tmemo); 216 | var 217 | i: integer; 218 | begin 219 | if inter <> nil then 220 | begin 221 | Memo.lines.add(' Interface:'); 222 | Memo.lines.add(' bInterfaceNumber: ' + inttostr(inter.bInterfaceNumber)); 223 | Memo.lines.add(' bAlternateSetting: ' + 224 | inttostr(inter.bAlternateSetting)); 225 | Memo.lines.add(' bNumEndpoints: ' + inttostr(inter.bNumEndpoints)); 226 | Memo.lines.add(' bInterfaceClass: ' + 227 | inttostr(inter.bInterfaceClass)); 228 | Memo.lines.add(' bInterfaceSubClass: ' + 229 | inttostr(inter.bInterfaceSubClass)); 230 | Memo.lines.add(' bInterfaceProtocol: ' + 231 | inttostr(inter.bInterfaceProtocol)); 232 | Memo.lines.add(' iInterface: ' + 233 | inttostr(inter.iInterface)); 234 | memo.lines.add(''); 235 | memo.lines.add('Interface.Bnumpoints : '+inttostr(inter.bNumEndpoints)); 236 | 237 | if ((inter.bNumEndpoints > 0 ) and (inter.bNumEndpoints < 10)) then 238 | begin 239 | 240 | for i := 1 to inter.bNumEndpoints do 241 | endpoint(@inter.endpoint[i], Memo) 242 | 243 | end; 244 | end 245 | else 246 | begin 247 | Memo.lines.add(' No Endpoint Interface available'); 248 | end; 249 | end; 250 | 251 | procedure usb2_0_ext_cap(usb_2_0_ext_cap: plibusb_usb_2_0_extension_descriptor; 252 | var Memo: Tmemo); 253 | begin 254 | Memo.lines.add(' USB 2.0 Extension Capabilities:'); 255 | Memo.lines.add('------------------------------------------------'); 256 | Memo.lines.add(''); 257 | Memo.lines.add(' bDevCapabilityType: ' + 258 | inttostr(usb_2_0_ext_cap.bDevCapabilityType)); 259 | Memo.lines.add(' bmAttributes: ' + 260 | inttostr(usb_2_0_ext_cap.bmAttributes)); 261 | end; 262 | 263 | procedure ss_usb_cap(s_usb_cap: plibusb_ss_usb_device_capability_descriptor; 264 | var Memo: Tmemo); 265 | begin 266 | Memo.lines.add(' USB 3.0 Capabilities:'); 267 | Memo.lines.add('------------------------------------------------'); 268 | Memo.lines.add(''); 269 | Memo.lines.add(' bDevCapabilityType: ' + 270 | inttostr(s_usb_cap.bDevCapabilityType)); 271 | Memo.lines.add(' bmAttributes: ' + 272 | inttostr(s_usb_cap.bmAttributes)); 273 | Memo.lines.add(' wSpeedSupported: ' + 274 | inttostr(s_usb_cap.wSpeedSupported)); 275 | Memo.lines.add(' bFunctionalitySupport: ' + 276 | inttostr(s_usb_cap.bFunctionalitySupport)); 277 | Memo.lines.add(' bU1devExitLat: ' + 278 | inttostr(s_usb_cap.bU1DevExitLat)); 279 | Memo.lines.add(' bU2devExitLat: ' + 280 | inttostr(s_usb_cap.bU2DevExitLat)); 281 | end; 282 | 283 | procedure bos(handle: plibusb_device_handle; var Memo: Tmemo); 284 | var 285 | ret, ret2: integer; 286 | fbos: plibusb_bos_descriptor; 287 | usb_2_0_extension: plibusb_usb_2_0_extension_descriptor; 288 | dev_cap: plibusb_ss_usb_device_capability_descriptor; 289 | begin 290 | ret := libusb_get_bos_descriptor(handle, @fbos); 291 | 292 | if ret < 0 then 293 | begin 294 | exit; 295 | end 296 | else 297 | begin 298 | Memo.lines.add(' Binary Object Store (BOS):'); 299 | Memo.lines.add(' wTotalLength: ' + inttostr(fbos.wTotalLength)); 300 | Memo.lines.add(' bNumDeviceCaps: ' + inttostr(fbos.bNumDeviceCaps)); 301 | end; 302 | 303 | if fbos.dev_capability[0].bDevCapabilityType = LIBUSB_BT_USB_2_0_EXTENSION 304 | then 305 | begin 306 | ret := libusb_get_usb_2_0_extension_descriptor(0, fbos.dev_capability[0], 307 | @usb_2_0_extension); 308 | if 0 > ret then 309 | begin 310 | exit; 311 | end 312 | else 313 | begin 314 | usb2_0_ext_cap(usb_2_0_extension, Memo); 315 | libusb_free_usb_2_0_extension_descriptor(usb_2_0_extension); 316 | end; 317 | end; 318 | 319 | if fbos.dev_capability[0].bDevCapabilityType = LIBUSB_BT_SS_USB_DEVICE_CAPABILITY 320 | then 321 | begin 322 | ret := libusb_get_ss_usb_device_capability_descriptor(0, 323 | fbos.dev_capability[0], @dev_cap); 324 | if 0 > ret then 325 | begin 326 | exit; 327 | end 328 | else 329 | begin 330 | ss_usb_cap(dev_cap, Memo); 331 | libusb_free_ss_usb_device_capability_descriptor(dev_cap); 332 | end; 333 | end; 334 | libusb_free_bos_descriptor(fbos); 335 | end; 336 | 337 | procedure interface_process(inter: plibusb_interface; var Memo: Tmemo); 338 | var 339 | i: integer; 340 | begin 341 | if inter.num_altsetting > -1 then 342 | begin 343 | Memo.lines.add(''); 344 | if inter.num_altsetting < 50 then 345 | Memo.lines.add(' Alt Setting number: ' + inter.num_altsetting.ToString) 346 | else 347 | Memo.lines.add(' Alt Setting number: ' + inter.num_altsetting.ToString + 348 | ' is out of bounds and not a valid to process'); 349 | Memo.lines.add('-----------------------------'); 350 | 351 | if inter.num_altsetting < 20 then 352 | // if the item is an abnormal large number ?? 353 | begin 354 | for i := 0 to inter.num_altsetting - 1 do 355 | begin 356 | Memo.lines.add(' Interface Alt Setting no : ' + i.ToString); 357 | Memo.lines.add('-------------------------------'); 358 | altsetting(@inter.altsetting[i], Memo); 359 | Memo.lines.add('--------------------------------'); 360 | end; 361 | end; 362 | end 363 | else 364 | begin 365 | Memo.lines.add(' No alternate interface found'); 366 | Memo.lines.add('--------------------------------'); 367 | end; 368 | end; 369 | 370 | procedure configuration(config: plibusb_config_descriptor; var Memo: Tmemo); 371 | var 372 | i: integer; 373 | inter: plibusb_interface; 374 | begin 375 | Memo.lines.add(' Configuration '); 376 | Memo.lines.add('------------------------------------------------'); 377 | Memo.lines.add(' wTotalLength: ' + 378 | inttostr(config.wTotalLength)); 379 | Memo.lines.add(' bNumInterfaces: ' + 380 | inttostr(config.bNumInterfaces)); 381 | Memo.lines.add(' bConfigurationValue: ' + 382 | inttostr(config.bConfigurationValue)); 383 | Memo.lines.add(' iConfiguration: ' + 384 | inttostr(config.iConfiguration)); 385 | Memo.lines.add(' bmAttributes: ' + 386 | inttostr(config.bmAttributes)); 387 | Memo.lines.add(' MaxPower: ' + 388 | inttostr(config.MaxPower)); 389 | 390 | if config.bNumInterfaces > 0 then 391 | begin 392 | for i := 0 to config.bNumInterfaces - 1 do 393 | begin 394 | interface_process(@config.&interface[i], Memo); 395 | end; 396 | end 397 | else 398 | begin 399 | Memo.lines.add(' No Alternate Settings Found'); 400 | end; 401 | end; 402 | 403 | procedure Descripinfo(dev: plibusb_device; Memo: Tmemo); 404 | var 405 | r: integer; 406 | desc: Libusb_device_descriptor; 407 | begin 408 | r := libusb_get_device_descriptor(dev, @desc); 409 | 410 | if r < 0 then 411 | begin 412 | Memo.lines.add(' failed to get device descriptor'); 413 | exit; 414 | end 415 | else 416 | begin 417 | Memo.lines.add(' device descriptor connected'); 418 | end; 419 | end; 420 | 421 | function device(deviceno: integer; var Memo: Tmemo): integer; 422 | var 423 | s, i, r,rs, op, ret, ret1, ret2: integer; 424 | devs: pplibusb_device; 425 | dev:plibusb_device; 426 | desc: Libusb_device_descriptor; 427 | config: plibusb_config_descriptor; 428 | devhandle: plibusb_device_handle; 429 | arrdev1: array of plibusb_device; 430 | description: array [0 .. 254] of byte; 431 | str: array [0 .. 254] of byte; 432 | count: ssize_t; 433 | context: plibusb_context; 434 | extract:string; 435 | begin 436 | // List devices 437 | Memo.lines.clear; 438 | Memo.lines.add(textload); 439 | Memo.lines.add('---------------------------------------------------------------------------------------------------------------'); 440 | context := nil; // declare the pointer to null 441 | 442 | r := libusb_init(context); 443 | if r <> 0 then 444 | begin 445 | Memo.lines.add('Cannot initialize the DLL Device Value ' + r.ToString + 446 | 'is less than 0'); 447 | exit; 448 | end 449 | else 450 | begin 451 | Memo.lines.add('DLL Initialized - Device connected'); 452 | end; 453 | count := libusb_get_device_list(context, @devs); 454 | 455 | // uses the referenced pointer 456 | setlength(arrdev1, count); 457 | libusb_free_device_list(devs, 1); // we now know how many devices there are 458 | 459 | if count < 1 then 460 | begin 461 | Memo.lines.add('No devices found '); 462 | exit; 463 | end 464 | else 465 | begin 466 | libusb_get_device_list(context, @arrdev1); // set new devicelist with dev 467 | 468 | rs := libusb_get_device_descriptor(arrdev1[deviceno], @desc); 469 | 470 | op := -1; 471 | if rs = 0 then 472 | begin 473 | op := libusb_open(arrdev1[deviceno], @devhandle); 474 | if op <> 0 then 475 | begin 476 | Memo.lines.add(''); 477 | Memo.lines.add('***Device is not Available to open***'); 478 | end 479 | else 480 | begin 481 | Memo.lines.add('***Device ref ID ' + inttostr(deviceno) + 482 | ' is Open and available to use***'); 483 | Memo.lines.add('------------------------------------------------------'); 484 | Memo.lines.add(''); 485 | 486 | if op = 0 then 487 | begin 488 | if desc.iManufacturer > 0 then 489 | begin 490 | ret := libusb_get_string_descriptor_ascii(devhandle, desc.iManufacturer, 491 | @str, sizeof(str)); 492 | if ret > 0 then 493 | Memo.lines.add(' Description -> ' + TEncoding.ANSI.GetString(str)) 494 | else 495 | Memo.lines.add(' Description -> Max Bytes[' + sizeof(description) 496 | .ToString + ']+ ' + inttostr(desc.idVendor) + 497 | ' No Descriptive info'); 498 | 499 | Memo.lines.add(' Id Vendor -> Max Bytes[' + sizeof(description) 500 | .ToString + '] ID: ' + inttostr(desc.idVendor)); 501 | Memo.lines.add(' Id PID -> Max Bytes[' + sizeof(description) 502 | .ToString + '] ID: ' + inttostr(desc.idProduct)); 503 | end; 504 | 505 | if desc.iProduct > 0 then 506 | begin 507 | ret := libusb_get_string_descriptor_ascii(devhandle, desc.iProduct, @str, 508 | sizeof(str)); 509 | if ret > 0 then 510 | Memo.lines.add(' Description -> Max Bytes[' + sizeof(description) 511 | .ToString + ']+ ' + TEncoding.ANSI.GetString(str)) 512 | else 513 | Memo.lines.add(' Description -> Max Bytes[' + 514 | sizeof(description).ToString + '] ID: ' + 515 | inttostr(desc.idProduct) + ' No Descriptive info'); 516 | end; 517 | 518 | Memo.lines.add(' Bus No -> ' + 519 | inttostr(libusb_get_bus_number(arrdev1[deviceno]))); 520 | Memo.lines.add(' Device -> ' + 521 | inttostr(libusb_get_device_address(arrdev1[deviceno]))); 522 | if ((devhandle <> nil) and (verbose = 0)) then 523 | begin 524 | if desc.iSerialNumber = 0 then 525 | begin 526 | ret1 := libusb_get_string_descriptor_ascii(devhandle, 527 | desc.iSerialNumber, @str, sizeof(str)); 528 | if (ret1 <> 0) then 529 | Memo.lines.add(' iSerialnumber level * 2 :' + 530 | inttostr(desc.iSerialNumber) + ' ' + 531 | TEncoding.ANSI.GetString(str)); 532 | end; 533 | end; 534 | if verbose = 0 then 535 | begin 536 | memo.lines.add(' Desc.BnumConfigurations -> '+ inttostr(desc.bNumConfigurations)); 537 | for i := 0 to desc.bNumConfigurations - 1 do 538 | begin 539 | ret2 := libusb_get_config_descriptor(arrdev1[deviceno], i, @config); 540 | if ret2 <> 0 then 541 | begin 542 | Memo.lines.add(' Could not retrieve descriptors'); 543 | end 544 | else 545 | begin 546 | Memo.lines.add(''); 547 | configuration(config, Memo); 548 | libusb_free_config_descriptor(config); 549 | end; 550 | 551 | // gives details on the usb 3.0 device 552 | if ((devhandle <> nil) and (desc.bcdUSB >= 513)) then 553 | begin 554 | Memo.lines.add('-------------------------------------'); 555 | bos(devhandle, Memo); 556 | end 557 | else 558 | begin 559 | Memo.lines.add('-------------------------------------'); 560 | Memo.lines.add 561 | (' The Binary Device Object Store (BOS) descriptor information of the USB 2.0 or USB 3.0 not available for this device'); 562 | Memo.lines.add('-------------------------------------'); 563 | end; 564 | end; 565 | end; 566 | end; 567 | end; 568 | end; 569 | (*Cannot use the function free_ device_list with an array of Plibusb_devices 570 | so have to de_ref each Plibdevice one by one from last to first *) 571 | for s := high(arrdev1) to low(arrdev1) do 572 | libusb_unref_device(arrdev1[i]); 573 | 574 | libusb_exit(context); 575 | end; 576 | end; 577 | 578 | function textload:string; 579 | begin 580 | result:= 581 | ('The device must show open and available to use before trying to ' + 582 | 'enter the device id number else the device' + #13#10 + 583 | ' will fail to open. ' + 584 | 'Just because you have a reference to a device does not mean it is ' + 585 | 'necessarily usable.' + #13#10 + 586 | ' The device may have been unplugged,you may not have ' + 587 | 'permission to operate such device,or another' + #13#10 + 588 | ' program or driver may be ' + 'using the device. ' + 589 | 'When you have found a device that you would like to operate,' + #13#10 + 590 | ' you must ask ' + 591 | 'libusb to open the device using the libusb_open() function. Assuming ' + 592 | 'success,libusb then ' + #13#10 + 'returns you a device handle ' + 593 | '(a \ref libusb_device_handle pointer). All "real" I/O operations then ' + 594 | 'operate' + #13#10 + 595 | ' on the handle rather than the original device pointer.)' + #13#10 + ''); 596 | end; 597 | 598 | 599 | end. 600 | -------------------------------------------------------------------------------- /Examples/VCL/Bulk Transfer/Bulk_Transfer.dpr: -------------------------------------------------------------------------------- 1 | program Bulk_Transfer; 2 | 3 | uses 4 | Vcl.Forms, 5 | main in 'main.pas' {fmmain}, 6 | libusb1 in '..\..\..\Src\libusb1.pas'; 7 | 8 | {$R *.res} 9 | 10 | begin 11 | Application.Initialize; 12 | Application.MainFormOnTaskbar := True; 13 | Application.CreateForm(Tfmmain, fmmain); 14 | Application.Run; 15 | end. 16 | -------------------------------------------------------------------------------- /Examples/VCL/Bulk Transfer/Bulk_Transfer.dproj.local: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 2017/11/14 20:14:26.000.891,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 5 | 2017/11/20 08:57:28.000.814,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 6 | 2017/11/20 10:28:55.000.930,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 7 | 2017/11/20 11:30:19.000.680,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 8 | 2017/11/20 11:36:21.000.183,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 9 | 2017/11/22 11:55:09.000.432,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 10 | 2017/11/22 11:55:55.000.796,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 11 | 2017/12/06 16:41:19.000.757,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 12 | 2017/12/08 15:54:02.000.199,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 13 | 2018/01/02 17:09:59.000.518,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 14 | 2018/01/05 10:42:39.000.068,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 15 | 2018/03/01 09:21:58.000.213,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 16 | 2018/03/01 15:19:54.000.205,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 17 | 2018/03/01 16:34:45.000.931,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 18 | 2018/03/02 17:18:56.000.551,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 19 | 2018/04/19 19:59:21.000.201,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 20 | 2018/04/20 07:33:48.000.235,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 21 | 2018/04/20 07:52:12.000.986,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 22 | 2018/04/24 13:00:33.000.488,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 23 | 2018/04/24 13:09:19.000.979,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 24 | 2018/04/24 13:09:52.000.801,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 25 | 2018/04/24 13:10:46.000.331,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 26 | 2018/04/24 13:26:37.000.959,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 27 | 2018/04/24 13:27:46.000.367,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 28 | 2018/04/24 13:28:06.000.524,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 29 | 2018/04/24 14:00:50.000.052,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 30 | 2018/05/06 15:19:35.257,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 31 | 2018/05/06 15:20:05.752,=E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\Bulk Transfer\main.pas 32 | 2018/05/06 15:20:20.214,=E:\AppEarlyDev\FMXLIBUSB1\Src\libusb1.pas 33 | 2018/05/06 15:24:54.296,E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\Bulk Transfer\Bulk_Transfer.dproj=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Project2.dproj 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Examples/VCL/Bulk Transfer/Bulk_Transfer.identcache: -------------------------------------------------------------------------------- 1 | =E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\Bulk Transfer\main.pasFE:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\Bulk Transfer\Bulk_Transfer.dpr)E:\AppEarlyDev\FMXLIBUSB1\Src\libusb1.pas -------------------------------------------------------------------------------- /Examples/VCL/Bulk Transfer/Bulk_Transfer.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYHPRO/Delphi-libusb/79d74d5466e6d588f0defa8fff75c67cf98429c0/Examples/VCL/Bulk Transfer/Bulk_Transfer.res -------------------------------------------------------------------------------- /Examples/VCL/Bulk Transfer/Win32/Debug/libusb-1.0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYHPRO/Delphi-libusb/79d74d5466e6d588f0defa8fff75c67cf98429c0/Examples/VCL/Bulk Transfer/Win32/Debug/libusb-1.0.dll -------------------------------------------------------------------------------- /Examples/VCL/Bulk Transfer/Win64/Debug/libusb-1.0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYHPRO/Delphi-libusb/79d74d5466e6d588f0defa8fff75c67cf98429c0/Examples/VCL/Bulk Transfer/Win64/Debug/libusb-1.0.dll -------------------------------------------------------------------------------- /Examples/VCL/Bulk Transfer/main.dfm: -------------------------------------------------------------------------------- 1 | object fmmain: Tfmmain 2 | Left = 0 3 | Top = 0 4 | Caption = 'fmmain' 5 | ClientHeight = 405 6 | ClientWidth = 522 7 | Color = clBtnFace 8 | Font.Charset = DEFAULT_CHARSET 9 | Font.Color = clWindowText 10 | Font.Height = -11 11 | Font.Name = 'Tahoma' 12 | Font.Style = [] 13 | OldCreateOrder = False 14 | OnCreate = FormCreate 15 | PixelsPerInch = 96 16 | TextHeight = 13 17 | object Label1: TLabel 18 | Left = 16 19 | Top = 58 20 | Width = 17 21 | Height = 13 22 | Caption = 'VID' 23 | end 24 | object Label2: TLabel 25 | Left = 16 26 | Top = 85 27 | Width = 17 28 | Height = 13 29 | Caption = 'PID' 30 | end 31 | object Label3: TLabel 32 | Left = 16 33 | Top = 144 34 | Width = 36 35 | Height = 13 36 | Caption = 'EP OUT' 37 | end 38 | object Label4: TLabel 39 | Left = 288 40 | Top = 139 41 | Width = 26 42 | Height = 13 43 | Caption = 'EP IN' 44 | end 45 | object Panel1: TPanel 46 | Left = 0 47 | Top = 0 48 | Width = 522 49 | Height = 41 50 | Align = alTop 51 | Caption = 'Libusb 1.0Bulk Transfer' 52 | Font.Charset = DEFAULT_CHARSET 53 | Font.Color = clWindowText 54 | Font.Height = -21 55 | Font.Name = 'Tahoma' 56 | Font.Style = [] 57 | ParentFont = False 58 | TabOrder = 0 59 | end 60 | object Memo1: TMemo 61 | Left = 0 62 | Top = 194 63 | Width = 522 64 | Height = 211 65 | Align = alBottom 66 | ParentShowHint = False 67 | ScrollBars = ssVertical 68 | ShowHint = False 69 | TabOrder = 1 70 | end 71 | object Edit1: TEdit 72 | Left = 104 73 | Top = 55 74 | Width = 145 75 | Height = 21 76 | TabOrder = 2 77 | Text = 'Edit1' 78 | end 79 | object Edit2: TEdit 80 | Left = 104 81 | Top = 82 82 | Width = 145 83 | Height = 21 84 | TabOrder = 3 85 | Text = 'Edit2' 86 | end 87 | object Edit3: TEdit 88 | Left = 104 89 | Top = 136 90 | Width = 145 91 | Height = 21 92 | TabOrder = 4 93 | Text = 'Edit3' 94 | end 95 | object Edit4: TEdit 96 | Left = 344 97 | Top = 136 98 | Width = 155 99 | Height = 21 100 | TabOrder = 5 101 | Text = 'Edit4' 102 | end 103 | object Edit5: TEdit 104 | Left = 104 105 | Top = 109 106 | Width = 30 107 | Height = 21 108 | TabOrder = 6 109 | Text = 'Edit5' 110 | end 111 | object Edit6: TEdit 112 | Left = 140 113 | Top = 109 114 | Width = 30 115 | Height = 21 116 | TabOrder = 7 117 | Text = 'Edit6' 118 | end 119 | object Edit7: TEdit 120 | Left = 176 121 | Top = 109 122 | Width = 30 123 | Height = 21 124 | TabOrder = 8 125 | Text = 'Edit7' 126 | end 127 | object Edit8: TEdit 128 | Left = 219 129 | Top = 109 130 | Width = 30 131 | Height = 21 132 | TabOrder = 9 133 | Text = 'Edit8' 134 | end 135 | object btnwrite: TButton 136 | Left = 38 137 | Top = 163 138 | Width = 211 139 | Height = 25 140 | Caption = 'Bulk Transfer Out' 141 | TabOrder = 10 142 | OnClick = btnwriteClick 143 | end 144 | object btnread: TButton 145 | Left = 288 146 | Top = 163 147 | Width = 211 148 | Height = 25 149 | Caption = 'Bulk Transfer In' 150 | TabOrder = 11 151 | OnClick = btnreadClick 152 | end 153 | end 154 | -------------------------------------------------------------------------------- /Examples/VCL/Bulk Transfer/main.pas: -------------------------------------------------------------------------------- 1 | unit main; 2 | 3 | interface 4 | 5 | uses 6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, 7 | System.Classes, Vcl.Graphics,Vcl.Controls, Vcl.Forms, 8 | Vcl.Dialogs,libusb1, Vcl.StdCtrls, Vcl.ExtCtrls; 9 | 10 | type 11 | dataArr = array of byte; 12 | 13 | type 14 | Tfmmain = class(TForm) 15 | Panel1: TPanel; 16 | Memo1: TMemo; 17 | Label1: TLabel; 18 | Label2: TLabel; 19 | Label3: TLabel; 20 | Label4: TLabel; 21 | Edit1: TEdit; 22 | Edit2: TEdit; 23 | Edit3: TEdit; 24 | Edit4: TEdit; 25 | Edit5: TEdit; 26 | Edit6: TEdit; 27 | Edit7: TEdit; 28 | Edit8: TEdit; 29 | btnwrite: TButton; 30 | btnread: TButton; 31 | procedure btnwriteClick(Sender: TObject); 32 | procedure btnreadClick(Sender: TObject); 33 | procedure FormCreate(Sender: TObject); 34 | private 35 | { Private declarations } 36 | public 37 | { Public declarations } 38 | end; 39 | 40 | var 41 | fmmain: Tfmmain; 42 | 43 | implementation 44 | 45 | {$R *.dfm} 46 | 47 | 48 | procedure Tfmmain.btnReadClick(Sender: TObject); 49 | var 50 | r,rc,i,num,fsize,flength:integer; 51 | newcontext: plibusb_context; 52 | devh: plibusb_device_handle; 53 | vendor_id,product_id,ep_in_Addr:uint16_t; 54 | actual_length:pinteger; 55 | 56 | OutputData:DataArr ; 57 | begin 58 | memo1.Lines.Clear; 59 | 60 | if (edit1.text = '' ) or (edit2.text = '') then 61 | begin 62 | memo1.Lines.Add('Insufficient data to process - re-enter'); 63 | edit1.Text:= ''; 64 | edit2.Text:= ''; 65 | exit; 66 | end 67 | else 68 | begin 69 | vendor_id := strtoint(edit1.Text); 70 | product_id:= strtoint(edit2.Text); 71 | num:= strtoint(edit3.Text); 72 | setlength(Outputdata,4); 73 | fsize := 512; //max 512 bytes 74 | flength:=sizeof(outputdata); 75 | actual_length:=@flength; //set the length of the byte array to a pointer 76 | 77 | // need endpoint addresses which are hard coded in the device 78 | 79 | ep_in_addr := strtoint(edit4.Text);// change this endpoint information as required 80 | 81 | newcontext:= nil; //declare the pointer to null 82 | devh:= nil; //create a NULL device handle 83 | 84 | r:= libusb_init(newcontext); //initialize Libusb 85 | libusb_set_debug(newcontext,3); // add the debugger on max 86 | 87 | if r <> 0 then 88 | begin 89 | memo1.Lines.add('Cannot initialize the DLL Device Value '+ inttostr(r)+ 'is less than 0'); 90 | exit; 91 | end 92 | else 93 | begin 94 | memo1.Lines.add('DLL Initialized and new context Registered ' ); 95 | memo1.Lines.Add(''); 96 | memo1.Lines.add('Opened Device Handle with Vid '+edit1.text+' / Pid '+edit2.text ); 97 | //open the device with the vid pid 98 | devh:= libusb_open_device_with_vid_pid(newcontext,vendor_id,product_id); 99 | if not (devh = nil) then 100 | begin 101 | memo1.Lines.add('Device Handle created '); 102 | memo1.Lines.Add('---------------------------------------------------------------------'); 103 | end 104 | else 105 | begin 106 | memo1.Lines.Add('Nil Device Handle found'); 107 | exit; 108 | end; 109 | end; 110 | 111 | //need to detach the drivers from all the USB interfaces. 112 | for i := 0 to 1 do 113 | begin 114 | if libusb_kernel_driver_active(devh,i) = 0 then 115 | begin 116 | libusb_detach_kernel_driver(devh,i); 117 | end; 118 | rc := libusb_claim_interface(devh,i); 119 | if rc < 0 then 120 | begin 121 | memo1.lines.add('Error claiming interface'); 122 | end; 123 | end; 124 | 125 | { To receive bytes from the device initiate a bulk_transfer to the 126 | * Endpoint with address ep_in_addr. } 127 | rc:= libusb_bulk_transfer(devh, ep_in_addr, @outputdata, fsize, @actual_length,1000); 128 | 129 | if outputdata <> nil then 130 | memo1.Lines.Add('Data read : '+strpas(pchar(@outputdata))) 131 | else 132 | memo1.Lines.Add('No data read !'); 133 | 134 | if rc = 7 then //LIBUSB_ERROR_TIMEOUT 135 | begin 136 | Memo1.lines.add('Libusb timeout error'); 137 | exit; 138 | end 139 | else 140 | if (rc <> 0)then 141 | begin 142 | memo1.lines.add('Error while waiting for data'); 143 | exit; 144 | end; 145 | exit; 146 | 147 | libusb_release_interface(devh, 0); 148 | libusb_close(devh); 149 | libusb_exit(newcontext); 150 | Exit; 151 | end; 152 | end; 153 | 154 | procedure Tfmmain.btnWriteClick(Sender: TObject); 155 | var 156 | //sendbytes:pbyte; 157 | flength,fsize,r,rc,rd,i,q,num:integer; 158 | newcontext: plibusb_context; 159 | devh: plibusb_device_handle; 160 | vendor_id,product_id,ep_out_Addr:uint16_t; 161 | Newdata:dataArr; 162 | actual_length:pinteger; 163 | begin 164 | memo1.Lines.Clear; 165 | if (edit1.text = '' ) or (edit2.text = '') then 166 | begin 167 | memo1.Lines.Add('Insufficient data to process - re-enter'); 168 | edit1.Text:= ''; 169 | edit2.Text:= ''; 170 | exit; 171 | end 172 | else 173 | begin 174 | setlength(NewData,4); 175 | NewData[0] := strtoint(edit5.Text); 176 | NewData[1] := strtoint(edit6.Text); 177 | NewData[2] := strtoint(edit7.Text); 178 | NewData[3] := strtoint(edit8.Text); 179 | fsize:= 512; //max bytes 180 | // sendbytes:=@NewData; 181 | vendor_id := strtoint(edit1.Text); 182 | product_id:= strtoint(edit2.Text); 183 | num:= strtoint(edit3.Text); 184 | flength:=sizeof(NewData); 185 | actual_length:=@flength; //set the length of the byte array to a pointer 186 | 187 | // need endpoint addresses which are hard coded in the device 188 | ep_out_Addr := 0;// endpoint 189 | 190 | newcontext:= nil; //declare the pointer to null 191 | devh:= nil; //create a NULL device handle 192 | 193 | r:= libusb_init(newcontext); //initialize Libusb 194 | libusb_set_debug(newcontext,3); // add the debugger on 195 | 196 | if r < 0 then 197 | begin 198 | memo1.Lines.add('Cannot initialize the DLL Device Value '+ r.ToString+ 'is less than 0'); 199 | exit; 200 | end 201 | else 202 | begin 203 | memo1.Lines.add('DLL Initialized and new context Registered ' ); 204 | memo1.Lines.Add(''); 205 | memo1.Lines.add('Opened Device Handle with Vid '+edit1.text+' / Pid '+edit2.text ); 206 | //open the device with the vid pid 207 | devh:= libusb_open_device_with_vid_pid(newcontext,vendor_id,product_id); 208 | if not (devh = nil) then 209 | begin 210 | memo1.Lines.add('Device Handle created '); 211 | memo1.Lines.Add('---------------------------------------------------------------------'); 212 | end 213 | else 214 | begin 215 | memo1.Lines.Add('Nil Device Handle found'); 216 | exit; 217 | end; 218 | end; 219 | 220 | for i:= 0 to num do 221 | begin 222 | if libusb_kernel_driver_active(devh,num) = 0 then 223 | begin 224 | libusb_detach_kernel_driver(devh,num); 225 | rc:= libusb_claim_interface(devh,num); 226 | if rc <> 0 then 227 | begin 228 | memo1.Lines.add('Cannot Claim an Interface '); 229 | libusb_error_name(rc); 230 | end; 231 | end; 232 | 233 | rc:= libusb_bulk_transfer(devh,ep_out_addr,@NewData,fsize,actual_length,1000); 234 | 235 | if rc <> 0 then 236 | begin 237 | memo1.lines.add('Error during control transfer'); 238 | end; 239 | 240 | end; 241 | { We can now start sending or receiving data to the device} 242 | if (libusb_bulk_transfer(devh,ep_out_addr,@NewData,fsize,actual_length,1000) < 0) then 243 | memo1.lines.add( 'Error while sending data ') 244 | else 245 | memo1.lines.add( 'Data sent : '+ strpas(pchar(@NewData))); 246 | 247 | end; 248 | libusb_release_interface(devh, 0); 249 | libusb_close(devh); 250 | libusb_exit(newcontext); 251 | Exit; 252 | end; 253 | 254 | procedure Tfmmain.FormCreate(Sender: TObject); 255 | begin 256 | memo1.Lines.Clear; 257 | edit1.Text:= '3468'; 258 | edit2.Text:= '261'; 259 | edit3.text:= '0'; 260 | edit4.Text:= '139'; 261 | 262 | edit5.Text:= '30'; 263 | edit6.Text:= '15'; 264 | edit7.Text:= '10'; 265 | edit8.Text:= '5'; 266 | end; 267 | 268 | 269 | 270 | end. 271 | -------------------------------------------------------------------------------- /Examples/VCL/Dll Version/VCLVersion.dpr: -------------------------------------------------------------------------------- 1 | program VCLVersion; 2 | 3 | uses 4 | Vcl.Forms, 5 | vclmain in 'vclmain.pas' {fmvclmain}, 6 | libusb1 in '..\..\..\Src\libusb1.pas'; 7 | 8 | {$R *.res} 9 | 10 | begin 11 | Application.Initialize; 12 | Application.MainFormOnTaskbar := True; 13 | Application.CreateForm(Tfmvclmain, fmvclmain); 14 | Application.Run; 15 | end. 16 | -------------------------------------------------------------------------------- /Examples/VCL/Dll Version/VCLVersion.dproj.local: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 2017/11/14 20:14:26.000.891,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 5 | 2017/11/20 08:57:28.000.814,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 6 | 2017/11/20 10:28:55.000.930,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 7 | 2017/11/20 11:30:19.000.680,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 8 | 2017/11/20 11:36:21.000.183,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 9 | 2017/11/22 11:55:09.000.432,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 10 | 2017/11/22 11:55:55.000.796,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 11 | 2017/12/06 16:41:19.000.757,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 12 | 2017/12/08 15:54:02.000.199,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 13 | 2018/01/02 17:09:59.000.518,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 14 | 2018/01/05 10:42:39.000.068,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 15 | 2018/03/01 09:21:58.000.213,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 16 | 2018/03/01 09:22:42.000.678,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 17 | 2018/03/01 09:25:46.000.568,E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\Dll Version\vclmain.pas=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 18 | 2018/03/01 09:25:46.000.568,E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\Dll Version\vclmain.dfm=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.dfm 19 | 2018/03/01 09:26:04.000.292,E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\Dll Version\VCLVersion.dproj=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Project2.dproj 20 | 2018/03/01 09:26:11.000.742,=E:\AppEarlyDev\FMXLIBUSB1\Src\libusb1.pas 21 | 2018/03/01 09:29:00.000.458,E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\Dll Version\VCLVersion.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\Dll Version\VCLVersion.dproj 22 | 2018/03/01 09:32:46.000.879,E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\Dll Version\VCLVersion.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\Dll Version\VCLVersion.dproj 23 | 2018/03/01 09:34:46.000.506,E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\Dll Version\VCLVersion.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\Dll Version\VCLVersion.dproj 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Examples/VCL/Dll Version/VCLVersion.identcache: -------------------------------------------------------------------------------- 1 | )E:\AppEarlyDev\FMXLIBUSB1\Src\libusb1.pasAE:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\Dll Version\VCLVersion.dpr>E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\Dll Version\vclmain.pas -------------------------------------------------------------------------------- /Examples/VCL/Dll Version/VCLVersion.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYHPRO/Delphi-libusb/79d74d5466e6d588f0defa8fff75c67cf98429c0/Examples/VCL/Dll Version/VCLVersion.res -------------------------------------------------------------------------------- /Examples/VCL/Dll Version/VCLVersion.stat: -------------------------------------------------------------------------------- 1 | [Stats] 2 | EditorSecs=1 3 | DesignerSecs=12 4 | InspectorSecs=1 5 | CompileSecs=3338 6 | OtherSecs=12 7 | StartTime=2018/05/06 1:57:48 PM 8 | RealKeys=0 9 | EffectiveKeys=0 10 | DebugSecs=12 11 | -------------------------------------------------------------------------------- /Examples/VCL/Dll Version/Win32/Debug/libusb-1.0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYHPRO/Delphi-libusb/79d74d5466e6d588f0defa8fff75c67cf98429c0/Examples/VCL/Dll Version/Win32/Debug/libusb-1.0.dll -------------------------------------------------------------------------------- /Examples/VCL/Dll Version/Win64/Debug/libusb-1.0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYHPRO/Delphi-libusb/79d74d5466e6d588f0defa8fff75c67cf98429c0/Examples/VCL/Dll Version/Win64/Debug/libusb-1.0.dll -------------------------------------------------------------------------------- /Examples/VCL/Dll Version/vclmain.dfm: -------------------------------------------------------------------------------- 1 | object fmvclmain: Tfmvclmain 2 | Left = 0 3 | Top = 0 4 | Caption = 'VCL Libusb 1.0 Dll Version' 5 | ClientHeight = 196 6 | ClientWidth = 389 7 | Color = clBtnFace 8 | Font.Charset = DEFAULT_CHARSET 9 | Font.Color = clWindowText 10 | Font.Height = -11 11 | Font.Name = 'Tahoma' 12 | Font.Style = [] 13 | OldCreateOrder = False 14 | OnCreate = FormCreate 15 | PixelsPerInch = 96 16 | TextHeight = 13 17 | object Label1: TLabel 18 | Left = 24 19 | Top = 72 20 | Width = 75 21 | Height = 21 22 | Caption = 'Version Dll' 23 | Font.Charset = ANSI_CHARSET 24 | Font.Color = clWindowText 25 | Font.Height = -16 26 | Font.Name = 'Segoe UI' 27 | Font.Style = [] 28 | ParentFont = False 29 | end 30 | object Label2: TLabel 31 | Left = 24 32 | Top = 107 33 | Width = 111 34 | Height = 21 35 | Caption = 'Described Value' 36 | Font.Charset = ANSI_CHARSET 37 | Font.Color = clWindowText 38 | Font.Height = -16 39 | Font.Name = 'Segoe UI' 40 | Font.Style = [] 41 | ParentFont = False 42 | end 43 | object Label3: TLabel 44 | Left = 24 45 | Top = 142 46 | Width = 120 47 | Height = 21 48 | Caption = 'ABI Compatibility' 49 | Font.Charset = ANSI_CHARSET 50 | Font.Color = clWindowText 51 | Font.Height = -16 52 | Font.Name = 'Segoe UI' 53 | Font.Style = [] 54 | ParentFont = False 55 | end 56 | object Label4: TLabel 57 | Left = 160 58 | Top = 72 59 | Width = 200 60 | Height = 21 61 | Caption = 'Label1' 62 | Font.Charset = ANSI_CHARSET 63 | Font.Color = clWindowText 64 | Font.Height = -16 65 | Font.Name = 'Segoe UI' 66 | Font.Style = [] 67 | ParentFont = False 68 | end 69 | object Label5: TLabel 70 | Left = 160 71 | Top = 107 72 | Width = 200 73 | Height = 21 74 | Caption = 'Label1' 75 | Font.Charset = ANSI_CHARSET 76 | Font.Color = clWindowText 77 | Font.Height = -16 78 | Font.Name = 'Segoe UI' 79 | Font.Style = [] 80 | ParentFont = False 81 | end 82 | object Label6: TLabel 83 | Left = 160 84 | Top = 142 85 | Width = 200 86 | Height = 21 87 | Caption = 'Label1' 88 | Font.Charset = ANSI_CHARSET 89 | Font.Color = clWindowText 90 | Font.Height = -16 91 | Font.Name = 'Segoe UI' 92 | Font.Style = [] 93 | ParentFont = False 94 | end 95 | object Panel1: TPanel 96 | Left = 0 97 | Top = 0 98 | Width = 389 99 | Height = 41 100 | Align = alTop 101 | Caption = 'Libusb 1.0 Dll Version' 102 | Font.Charset = ANSI_CHARSET 103 | Font.Color = clWindowText 104 | Font.Height = -19 105 | Font.Name = 'Segoe UI' 106 | Font.Style = [] 107 | ParentFont = False 108 | TabOrder = 0 109 | ExplicitLeft = 232 110 | ExplicitTop = 8 111 | ExplicitWidth = 185 112 | end 113 | end 114 | -------------------------------------------------------------------------------- /Examples/VCL/Dll Version/vclmain.pas: -------------------------------------------------------------------------------- 1 | unit vclmain; 2 | 3 | interface 4 | 5 | uses 6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, 7 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, Vcl.StdCtrls,libusb1; 8 | 9 | type 10 | Tfmvclmain = class(TForm) 11 | Label1: TLabel; 12 | Label2: TLabel; 13 | Label3: TLabel; 14 | Panel1: TPanel; 15 | Label4: TLabel; 16 | Label5: TLabel; 17 | Label6: TLabel; 18 | procedure FormCreate(Sender: TObject); 19 | private 20 | { Private declarations } 21 | public 22 | { Public declarations } 23 | end; 24 | 25 | var 26 | fmvclmain: Tfmvclmain; 27 | 28 | implementation 29 | 30 | {$R *.dfm} 31 | 32 | procedure Tfmvclmain.FormCreate(Sender: TObject); 33 | var 34 | libusbversion: Plibusb_version; 35 | dllv:string; 36 | Driverv:string; 37 | begin 38 | libusbversion:= libusb_get_version(); 39 | //get Dll version information 40 | {$IFDEF WIN64} 41 | dllv:= ' 64 bit Dll version '; 42 | Driverv:= '64 bit Driver version' ; 43 | {$ENDIF} 44 | {$IFDEF WIN32} 45 | dllv:= ' 32 bit Dll version '; 46 | DriverV:= '32 bit Driver version'; 47 | {$ENDIF} 48 | //show Dll info 49 | label4.caption:= dllv + 50 | inttostr(libusbversion.major)+ '.'+ 51 | inttostr(libusbversion.minor) +'.'+ 52 | inttostr(libusbversion.micro) +'.'+ 53 | inttostr(libusbversion.nano) ; 54 | label5.caption:= inttostr(ord(libusbversion.describe)); 55 | label6.caption:= inttostr(ord(libusbversion.rc)); 56 | end; 57 | 58 | end. 59 | -------------------------------------------------------------------------------- /Examples/VCL/ListDevs/LibusbListDevs.dpr: -------------------------------------------------------------------------------- 1 | program LibusbListDevs; 2 | 3 | uses 4 | Vcl.Forms, 5 | main in 'main.pas' {fmmain}, 6 | libusb1 in '..\..\..\Src\libusb1.pas', 7 | libusb1helper in '..\..\..\Src\libusb1helper.pas'; 8 | 9 | {$R *.res} 10 | 11 | begin 12 | Application.Initialize; 13 | Application.MainFormOnTaskbar := True; 14 | Application.CreateForm(Tfmmain, fmmain); 15 | Application.Run; 16 | end. 17 | -------------------------------------------------------------------------------- /Examples/VCL/ListDevs/LibusbListDevs.dproj.local: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 2017/11/14 20:14:26.000.891,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 5 | 2017/11/20 08:57:28.000.814,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 6 | 2017/11/20 10:28:55.000.930,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 7 | 2017/11/20 11:30:19.000.680,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 8 | 2017/11/20 11:36:21.000.183,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 9 | 2017/11/22 11:55:09.000.432,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 10 | 2017/11/22 11:55:55.000.796,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 11 | 2017/12/06 16:41:19.000.757,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 12 | 2017/12/08 15:54:02.000.199,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 13 | 2018/01/02 17:09:59.000.518,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 14 | 2018/01/05 10:42:39.000.068,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 15 | 2018/03/01 09:21:58.000.213,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 16 | 2018/03/01 15:19:54.000.205,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 17 | 2018/03/01 16:34:45.000.931,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 18 | 2018/03/02 17:18:56.000.551,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 19 | 2018/04/19 19:59:21.000.201,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 20 | 2018/04/20 07:33:48.000.235,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 21 | 2018/04/20 07:52:12.000.986,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 22 | 2018/04/24 13:00:33.000.488,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 23 | 2018/04/24 13:09:19.000.979,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 24 | 2018/04/24 13:09:52.000.801,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 25 | 2018/04/24 13:10:46.000.331,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 26 | 2018/04/24 13:26:37.000.959,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 27 | 2018/04/24 13:27:46.000.367,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 28 | 2018/04/24 13:28:06.000.524,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 29 | 2018/04/24 14:00:50.000.052,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 30 | 2018/05/06 13:26:11.000.743,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 31 | 2018/05/06 13:26:55.000.746,C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.dfm=E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\List Devices\main.dfm 32 | 2018/05/06 13:26:55.000.746,C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas=E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\List Devices\main.pas 33 | 2018/05/06 13:27:04.000.680,C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Project2.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\List Devices\Listdevices.dproj 34 | 2018/05/06 13:28:31.000.129,=E:\AppEarlyDev\FMXLIBUSB1\Src\libusb1.pas 35 | 2018/05/06 13:28:46.000.972,=E:\AppEarlyDev\FMXLIBUSB1\Src\libusb1helper.pas 36 | 2018/05/06 13:56:54.000.852,E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\List Devices\Listdevices.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\List Devices\Listdevices.dproj 37 | 2018/05/06 19:16:20.000.312,E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\List Devices\Listdevices.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\List Devices\Listdevices.dproj 38 | 2018/05/06 19:17:02.000.710,E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\List Devices\Listdevices.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\List Devices\Listdevices.dproj 39 | 2018/05/25 15:37:24.000.093,E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\Test LibUsb\TestLibusbDev.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\Test LibUsb\Listdevices.dproj 40 | 2018/05/25 15:38:02.000.078,=E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\Test LibUsb\testlibusb.pas 41 | 2018/05/25 15:44:32.000.647,E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\Test LibUsb\TestLibusbDev.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\Test LibUsb\TestLibusbDev.dproj 42 | 2018/05/25 15:46:45.000.264,E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\Test LibUsb\LibusbListDevs.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\Test LibUsb\TestLibusbDev.dproj 43 | 2018/05/25 15:55:42.796,E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\ListDevs\testlibusb.pas= 44 | 2018/05/25 15:58:02.694,E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\ListDevs\LibusbListDevs.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\ListDevs\LibusbListDevs.dproj 45 | 2018/05/25 15:58:58.274,E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\ListDevs\LibusbListDevs.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\ListDevs\LibusbListDevs.dproj 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /Examples/VCL/ListDevs/LibusbListDevs.identcache: -------------------------------------------------------------------------------- 1 | )E:\AppEarlyDev\FMXLIBUSB1\Src\libusb1.pas8E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\ListDevs\main.pas/E:\AppEarlyDev\FMXLIBUSB1\Src\libusb1helper.pasBE:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\ListDevs\LibusbListDevs.dpr -------------------------------------------------------------------------------- /Examples/VCL/ListDevs/LibusbListDevs.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYHPRO/Delphi-libusb/79d74d5466e6d588f0defa8fff75c67cf98429c0/Examples/VCL/ListDevs/LibusbListDevs.res -------------------------------------------------------------------------------- /Examples/VCL/ListDevs/LibusbListDevs.stat: -------------------------------------------------------------------------------- 1 | [Stats] 2 | EditorSecs=64 3 | DesignerSecs=40 4 | InspectorSecs=53 5 | CompileSecs=6948 6 | OtherSecs=44 7 | StartTime=2018/05/25 3:52:22 PM 8 | RealKeys=0 9 | EffectiveKeys=0 10 | DebugSecs=27 11 | -------------------------------------------------------------------------------- /Examples/VCL/ListDevs/Win32/Debug/libusb-1.0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYHPRO/Delphi-libusb/79d74d5466e6d588f0defa8fff75c67cf98429c0/Examples/VCL/ListDevs/Win32/Debug/libusb-1.0.dll -------------------------------------------------------------------------------- /Examples/VCL/ListDevs/Win64/Debug/libusb-1.0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYHPRO/Delphi-libusb/79d74d5466e6d588f0defa8fff75c67cf98429c0/Examples/VCL/ListDevs/Win64/Debug/libusb-1.0.dll -------------------------------------------------------------------------------- /Examples/VCL/ListDevs/main.dfm: -------------------------------------------------------------------------------- 1 | object fmmain: Tfmmain 2 | Left = 0 3 | Top = 0 4 | Width = 684 5 | Height = 472 6 | AutoScroll = True 7 | Caption = 'LibusbList Devices Example' 8 | Color = clBtnFace 9 | Font.Charset = DEFAULT_CHARSET 10 | Font.Color = clWindowText 11 | Font.Height = -11 12 | Font.Name = 'Tahoma' 13 | Font.Style = [] 14 | OldCreateOrder = False 15 | OnCreate = FormCreate 16 | PixelsPerInch = 96 17 | TextHeight = 13 18 | object Panel1: TPanel 19 | Left = 0 20 | Top = 0 21 | Width = 668 22 | Height = 43 23 | Align = alTop 24 | BevelOuter = bvNone 25 | Caption = 26 | 'LibUSB 1.0 List Devs - libusb example program to list devices o' + 27 | 'n the bus' 28 | Font.Charset = DEFAULT_CHARSET 29 | Font.Color = clWindowText 30 | Font.Height = -16 31 | Font.Name = 'Tahoma' 32 | Font.Style = [] 33 | ParentFont = False 34 | TabOrder = 0 35 | end 36 | object Memo1: TMemo 37 | Left = 0 38 | Top = 43 39 | Width = 668 40 | Height = 390 41 | Align = alClient 42 | Lines.Strings = ( 43 | '') 44 | ScrollBars = ssVertical 45 | TabOrder = 1 46 | ExplicitTop = 81 47 | ExplicitHeight = 352 48 | end 49 | end 50 | -------------------------------------------------------------------------------- /Examples/VCL/ListDevs/main.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYHPRO/Delphi-libusb/79d74d5466e6d588f0defa8fff75c67cf98429c0/Examples/VCL/ListDevs/main.pas -------------------------------------------------------------------------------- /Examples/VCL/Test LibUsb/LibusbListDevs.dpr: -------------------------------------------------------------------------------- 1 | program LibusbListDevs; 2 | 3 | uses 4 | Vcl.Forms, 5 | main in 'main.pas' {fmmain}, 6 | libusb1 in '..\..\..\Src\libusb1.pas', 7 | libusb1helper in '..\..\..\Src\libusb1helper.pas', 8 | testlibusb in 'testlibusb.pas'; 9 | 10 | {$R *.res} 11 | 12 | begin 13 | Application.Initialize; 14 | Application.MainFormOnTaskbar := True; 15 | Application.CreateForm(Tfmmain, fmmain); 16 | Application.Run; 17 | end. 18 | -------------------------------------------------------------------------------- /Examples/VCL/Test LibUsb/LibusbListDevs.dproj.local: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 2017/11/14 20:14:26.000.891,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 5 | 2017/11/20 08:57:28.000.814,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 6 | 2017/11/20 10:28:55.000.930,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 7 | 2017/11/20 11:30:19.000.680,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 8 | 2017/11/20 11:36:21.000.183,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 9 | 2017/11/22 11:55:09.000.432,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 10 | 2017/11/22 11:55:55.000.796,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 11 | 2017/12/06 16:41:19.000.757,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 12 | 2017/12/08 15:54:02.000.199,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 13 | 2018/01/02 17:09:59.000.518,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 14 | 2018/01/05 10:42:39.000.068,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 15 | 2018/03/01 09:21:58.000.213,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 16 | 2018/03/01 15:19:54.000.205,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 17 | 2018/03/01 16:34:45.000.931,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 18 | 2018/03/02 17:18:56.000.551,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 19 | 2018/04/19 19:59:21.000.201,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 20 | 2018/04/20 07:33:48.000.235,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 21 | 2018/04/20 07:52:12.000.986,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 22 | 2018/04/24 13:00:33.000.488,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 23 | 2018/04/24 13:09:19.000.979,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 24 | 2018/04/24 13:09:52.000.801,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 25 | 2018/04/24 13:10:46.000.331,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 26 | 2018/04/24 13:26:37.000.959,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 27 | 2018/04/24 13:27:46.000.367,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 28 | 2018/04/24 13:28:06.000.524,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 29 | 2018/04/24 14:00:50.000.052,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 30 | 2018/05/06 13:26:11.000.743,=C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas 31 | 2018/05/06 13:26:55.000.746,C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.pas=E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\List Devices\main.pas 32 | 2018/05/06 13:26:55.000.746,C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Unit4.dfm=E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\List Devices\main.dfm 33 | 2018/05/06 13:27:04.000.680,C:\Users\GregB\Documents\Embarcadero\Studio\Projects\Project2.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\List Devices\Listdevices.dproj 34 | 2018/05/06 13:28:31.000.129,=E:\AppEarlyDev\FMXLIBUSB1\Src\libusb1.pas 35 | 2018/05/06 13:28:46.000.972,=E:\AppEarlyDev\FMXLIBUSB1\Src\libusb1helper.pas 36 | 2018/05/06 13:56:54.000.852,E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\List Devices\Listdevices.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\List Devices\Listdevices.dproj 37 | 2018/05/06 19:16:20.000.312,E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\List Devices\Listdevices.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\List Devices\Listdevices.dproj 38 | 2018/05/06 19:17:02.000.710,E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\List Devices\Listdevices.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\List Devices\Listdevices.dproj 39 | 2018/05/25 15:37:24.093,E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\Test LibUsb\TestLibusbDev.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\Test LibUsb\Listdevices.dproj 40 | 2018/05/25 15:38:02.078,=E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\Test LibUsb\testlibusb.pas 41 | 2018/05/25 15:44:32.647,E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\Test LibUsb\TestLibusbDev.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\Test LibUsb\TestLibusbDev.dproj 42 | 2018/05/25 15:46:45.264,E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\Test LibUsb\LibusbListDevs.dproj=E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\Test LibUsb\TestLibusbDev.dproj 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Examples/VCL/Test LibUsb/LibusbListDevs.identcache: -------------------------------------------------------------------------------- 1 | ;E:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\Test LibUsb\main.pas)E:\AppEarlyDev\FMXLIBUSB1\Src\libusb1.pasAE:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\Test LibUsb\testlibusb.pasEE:\AppEarlyDev\FMXLIBUSB1\Examples\VCL\Test LibUsb\LibusbListDevs.dpr/E:\AppEarlyDev\FMXLIBUSB1\Src\libusb1helper.pas -------------------------------------------------------------------------------- /Examples/VCL/Test LibUsb/Win32/Debug/libusb-1.0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYHPRO/Delphi-libusb/79d74d5466e6d588f0defa8fff75c67cf98429c0/Examples/VCL/Test LibUsb/Win32/Debug/libusb-1.0.dll -------------------------------------------------------------------------------- /Examples/VCL/Test LibUsb/Win64/Debug/libusb-1.0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYHPRO/Delphi-libusb/79d74d5466e6d588f0defa8fff75c67cf98429c0/Examples/VCL/Test LibUsb/Win64/Debug/libusb-1.0.dll -------------------------------------------------------------------------------- /Examples/VCL/Test LibUsb/main.dfm: -------------------------------------------------------------------------------- 1 | object fmmain: Tfmmain 2 | Left = 0 3 | Top = 0 4 | Width = 684 5 | Height = 472 6 | AutoScroll = True 7 | Caption = 'LibusbTestusb Example' 8 | Color = clBtnFace 9 | Font.Charset = DEFAULT_CHARSET 10 | Font.Color = clWindowText 11 | Font.Height = -11 12 | Font.Name = 'Tahoma' 13 | Font.Style = [] 14 | OldCreateOrder = False 15 | OnShow = FormShow 16 | PixelsPerInch = 96 17 | TextHeight = 13 18 | object Panel1: TPanel 19 | Left = 0 20 | Top = 0 21 | Width = 668 22 | Height = 43 23 | Align = alTop 24 | BevelOuter = bvNone 25 | Caption = 'LibUSB 1.0 TestLibUSB' 26 | Font.Charset = DEFAULT_CHARSET 27 | Font.Color = clWindowText 28 | Font.Height = -21 29 | Font.Name = 'Tahoma' 30 | Font.Style = [] 31 | ParentFont = False 32 | TabOrder = 0 33 | end 34 | object Memo1: TMemo 35 | Left = 0 36 | Top = 81 37 | Width = 668 38 | Height = 352 39 | Align = alClient 40 | Lines.Strings = ( 41 | '') 42 | ScrollBars = ssVertical 43 | TabOrder = 1 44 | ExplicitLeft = -8 45 | ExplicitTop = 80 46 | end 47 | object Panel2: TPanel 48 | Left = 0 49 | Top = 43 50 | Width = 668 51 | Height = 38 52 | Align = alTop 53 | BevelOuter = bvNone 54 | TabOrder = 2 55 | object Label1: TLabel 56 | Left = 13 57 | Top = 10 58 | Width = 85 59 | Height = 13 60 | Caption = 'Set Device Ref ID' 61 | end 62 | object Edit1: TEdit 63 | Left = 104 64 | Top = 6 65 | Width = 49 66 | Height = 25 67 | TabOrder = 0 68 | Text = 'Edit1' 69 | end 70 | object btn_device: TButton 71 | Left = 184 72 | Top = 6 73 | Width = 273 74 | Height = 25 75 | Caption = 'Process Device' 76 | TabOrder = 1 77 | OnClick = btn_deviceClick 78 | end 79 | end 80 | end 81 | -------------------------------------------------------------------------------- /Examples/VCL/Test LibUsb/main.pas: -------------------------------------------------------------------------------- 1 | unit main; 2 | 3 | interface 4 | 5 | uses 6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, 7 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls,libusb1,testlibusb; 8 | 9 | type 10 | Tfmmain = class(TForm) 11 | Panel1: TPanel; 12 | Memo1: TMemo; 13 | Panel2: TPanel; 14 | Edit1: TEdit; 15 | Label1: TLabel; 16 | btn_device: TButton; 17 | procedure btn_deviceClick(Sender: TObject); 18 | procedure FormShow(Sender: TObject); 19 | private 20 | { Private declarations } 21 | public 22 | { Public declarations } 23 | end; 24 | 25 | var 26 | fmmain: Tfmmain; 27 | Memo1: TMemo; 28 | 29 | implementation 30 | 31 | {$R *.dfm} 32 | 33 | procedure Tfmmain.btn_deviceClick(Sender: TObject); 34 | begin 35 | if Edit1.Text= '0' then 36 | begin 37 | showmessage('Please enter a Valid Ref ID before processing...'); 38 | exit; 39 | end 40 | else 41 | begin 42 | Memo1.lines.clear; 43 | device(strtoint(Edit1.Text), Memo1); 44 | end; 45 | end; 46 | 47 | procedure Tfmmain.FormShow(Sender: TObject); 48 | begin 49 | Edit1.Text := '0'; 50 | getdevicelist(Memo1,Self); 51 | end; 52 | 53 | end. 54 | 55 | 56 | -------------------------------------------------------------------------------- /Examples/VCL/Test LibUsb/testlibusb.pas: -------------------------------------------------------------------------------- 1 | 2 | (* Translated to Delphi pascal By Greg Bayes 12/02/2018 3 | ------------------------------------------------------------ 4 | Original C/C++ Test suite program based of libusb-0.1-compat testlibusb 5 | * Copyright (c) 2013 Nathan Hjelm *) 6 | 7 | unit testlibusb; 8 | 9 | interface 10 | 11 | uses System.SysUtils, System.Types,System.Variants, System.Classes, Vcl.Graphics, 12 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls,libusb1; 13 | 14 | const 15 | verbose: integer = 0; 16 | 17 | procedure getdevicelist(var Memo: Tmemo;sender:Tobject); 18 | procedure endpoint_comp(ep_comp: plibusb_ss_endpoint_companion_descriptor; 19 | var Memo: Tmemo); 20 | procedure endpoint(endpoint: plibusb_endpoint_descriptor; var Memo: Tmemo); 21 | procedure usb2_0_ext_cap(usb_2_0_ext_cap: plibusb_usb_2_0_extension_descriptor; 22 | var Memo: Tmemo); 23 | procedure ss_usb_cap(s_usb_cap: plibusb_ss_usb_device_capability_descriptor; 24 | var Memo: Tmemo); 25 | procedure bos(handle: plibusb_device_handle; var Memo: Tmemo); 26 | procedure interface_process(inter: plibusb_interface; var Memo: Tmemo); 27 | procedure configuration(config: plibusb_config_descriptor; var Memo: Tmemo); 28 | function device(deviceno: integer; var Memo: Tmemo): integer; 29 | procedure extrainfo(dev: plibusb_device; Memo: Tmemo); 30 | function textload:string; 31 | 32 | implementation 33 | 34 | 35 | procedure getdevicelist(var Memo: Tmemo;sender:Tobject); 36 | var 37 | count: ssize_t; 38 | s, p, i,rs, r, op: integer; 39 | context: plibusb_context; 40 | devhandle: plibusb_device_handle; 41 | arrdev: array of plibusb_device; 42 | devs: pplibusb_device; 43 | begin 44 | // List devices 45 | Memo.lines.clear; 46 | Memo.lines.add(textload); 47 | Memo.lines.add 48 | ('---------------------------------------------------------------------------------------------------------------'); 49 | context := nil; // declare the pointer to null 50 | 51 | r := libusb_init(context); 52 | 53 | if r <> 0 then 54 | begin 55 | Memo.lines.add('Cannot initialize the DLL Device Value ' + r.ToString + 56 | 'is less than 0'); 57 | exit; 58 | end 59 | else 60 | begin 61 | Memo.lines.add('DLL Initialized - Device connected'); 62 | count := libusb_get_device_list(context,@devs); 63 | setlength(arrdev,count); 64 | libusb_free_device_list(devs,1); 65 | 66 | if count < 1 then 67 | begin 68 | Memo.lines.add('No devices found '); 69 | exit; 70 | end 71 | else 72 | begin 73 | Memo.lines.add('***USB Activate Devices found : ' + inttostr(count) 74 | + ' ***'); 75 | Memo.lines.add(' Device VID / PID Device extended Information'); 76 | Memo.lines.add('-------------------------------------------------------'); 77 | op := -1; 78 | 79 | rs:= libusb_get_device_list(context,@arrdev); 80 | if rs > 0 then 81 | begin 82 | for i := 0 to count - 1 do 83 | begin 84 | Memo.lines.add('USB Device on system - no ' + inttostr(i + 1)); 85 | extrainfo(arrdev[i],Memo); 86 | 87 | op := libusb_open(arrdev[i], @devhandle); 88 | if op <> 0 then 89 | begin 90 | Memo.lines.add(''); 91 | Memo.lines.add('***Device is not Available to open***'); 92 | end 93 | else 94 | begin 95 | Memo.lines.add(''); 96 | Memo.lines.add('***Device ref ID ' + inttostr(i) + 97 | ' is Open and available to use***'); 98 | end; 99 | Memo.lines.add('-----------------------------------------------------'); 100 | end; 101 | 102 | end 103 | else 104 | begin 105 | memo.lines.Add('Failed to get device list'); 106 | end; 107 | end; 108 | end; 109 | (*Cannot use the function free_ device_list with an array of Plibusb_devices 110 | so have to de_ref each Plibdevice one by one from last to first *) 111 | // libusb_free_device_list(devs,1); 112 | for s := high(arrdev) to low(arrdev) do 113 | libusb_unref_device(arrdev[s]); 114 | 115 | libusb_exit(context); 116 | end; 117 | 118 | procedure extrainfo(dev: plibusb_device; Memo: Tmemo); 119 | var 120 | s, i, r: integer; 121 | desc: Libusb_device_descriptor; 122 | config: plibusb_config_descriptor; 123 | op:integer; 124 | begin 125 | r := libusb_get_device_descriptor(dev, @desc); 126 | 127 | if r <> 0 then 128 | begin 129 | Memo.lines.add('failed to get device descriptor'); 130 | exit; 131 | end 132 | else 133 | begin 134 | // format 135 | Memo.lines.add(' VID : ' + inttostr(desc.idVendor) + ' PID : ' + 136 | inttostr(desc.idProduct) + ' Bus ' + 137 | inttostr(libusb_get_bus_number(dev)) + ' Device ' + 138 | inttostr(libusb_get_device_address(dev))); 139 | end; 140 | end; 141 | //////////////////////////////////////////////////////////////////////////// 142 | procedure endpoint_comp(ep_comp: plibusb_ss_endpoint_companion_descriptor; 143 | var Memo: Tmemo); 144 | begin 145 | Memo.lines.add(' USB 3.0 Endpoint Companion'); 146 | Memo.lines.add('---------------------------------------'); 147 | Memo.lines.add(''); 148 | Memo.lines.add(' bMaxBurst : ' + inttostr(ep_comp.bMaxBurst)); 149 | Memo.lines.add(' bmAttributes : ' + inttostr(ep_comp.bmAttributes)); 150 | Memo.lines.add(' wBytesPerInterval : ' + inttostr(ep_comp.wBytesPerInterval)); 151 | end; 152 | 153 | procedure endpoint(endpoint: plibusb_endpoint_descriptor; var Memo: Tmemo); 154 | var 155 | i, extra, ret: integer; 156 | ep_comp: plibusb_ss_endpoint_companion_descriptor; 157 | context: plibusb_context; 158 | begin 159 | if endpoint <> nil then 160 | begin 161 | if endpoint.bEndpointAddress > 0 then 162 | begin 163 | 164 | Memo.lines.add(' Endpoint information'); 165 | Memo.lines.add('---------------------------------------'); 166 | Memo.lines.add(' bEndpointAddress: ' + inttostr(endpoint.bEndpointAddress)); 167 | Memo.lines.add(' bmAttributes: ' + inttostr(endpoint.bmAttributes)); 168 | Memo.lines.add(' wMaxPacketSize: ' + inttostr(endpoint.wMaxPacketSize)); 169 | Memo.lines.add(' bInterval: ' + inttostr(endpoint.bInterval)); 170 | Memo.lines.add(' bRefresh: ' + inttostr(endpoint.bRefresh)); 171 | Memo.lines.add(' bSynchAddress: ' + inttostr(endpoint.bSynchAddress)); 172 | Memo.lines.add(' bextra_length: ' + endpoint.extra_length.ToString); 173 | Memo.lines.add(' extra: ' + inttostr(endpoint.extra)); 174 | 175 | if endpoint.extra_length > 0 then 176 | begin 177 | for i := 0 to endpoint.extra_length - 1 do 178 | begin 179 | if LIBUSB_DT_SS_ENDPOINT_COMPANION = endpoint.extra then 180 | begin 181 | ret := libusb_get_ss_endpoint_companion_descriptor(context, endpoint, 182 | @ep_comp); 183 | if ret <> 0 then 184 | begin 185 | Memo.lines.add('-----------------------------'); 186 | endpoint_comp(ep_comp, Memo); 187 | libusb_free_ss_endpoint_companion_descriptor(ep_comp); 188 | end; 189 | end 190 | else 191 | begin 192 | Memo.lines.add(' Not a USB 3.0 Endpoint Companion'); 193 | end; 194 | end; 195 | end 196 | else 197 | begin 198 | Memo.lines.add('-----------------------------'); 199 | Memo.lines.add(' Endpoint - ExtraPoint is not available'); 200 | Memo.lines.add('-----------------------------'); 201 | end 202 | end 203 | else 204 | Memo.lines.add(' No Endpoint Descriptions found for the Interface'); 205 | end 206 | else 207 | begin 208 | Memo.lines.add(' No Endpoint found for the Interface'); 209 | end; 210 | 211 | 212 | 213 | end; 214 | 215 | procedure altsetting(inter: plibusb_interface_descriptor; var Memo: Tmemo); 216 | var 217 | i: integer; 218 | begin 219 | if inter <> nil then 220 | begin 221 | Memo.lines.add(' Interface:'); 222 | Memo.lines.add(' bInterfaceNumber: ' + inttostr(inter.bInterfaceNumber)); 223 | Memo.lines.add(' bAlternateSetting: ' + 224 | inttostr(inter.bAlternateSetting)); 225 | Memo.lines.add(' bNumEndpoints: ' + inttostr(inter.bNumEndpoints)); 226 | Memo.lines.add(' bInterfaceClass: ' + 227 | inttostr(inter.bInterfaceClass)); 228 | Memo.lines.add(' bInterfaceSubClass: ' + 229 | inttostr(inter.bInterfaceSubClass)); 230 | Memo.lines.add(' bInterfaceProtocol: ' + 231 | inttostr(inter.bInterfaceProtocol)); 232 | Memo.lines.add(' iInterface: ' + 233 | inttostr(inter.iInterface)); 234 | memo.lines.add(''); 235 | memo.lines.add('Interface.Bnumpoints : '+inttostr(inter.bNumEndpoints)); 236 | 237 | if ((inter.bNumEndpoints > 0 ) and (inter.bNumEndpoints < 10)) then 238 | begin 239 | 240 | for i := 1 to inter.bNumEndpoints do 241 | endpoint(@inter.endpoint[i], Memo) 242 | 243 | end; 244 | end 245 | else 246 | begin 247 | Memo.lines.add(' No Endpoint Interface available'); 248 | end; 249 | end; 250 | 251 | procedure usb2_0_ext_cap(usb_2_0_ext_cap: plibusb_usb_2_0_extension_descriptor; 252 | var Memo: Tmemo); 253 | begin 254 | Memo.lines.add(' USB 2.0 Extension Capabilities:'); 255 | Memo.lines.add('------------------------------------------------'); 256 | Memo.lines.add(''); 257 | Memo.lines.add(' bDevCapabilityType: ' + 258 | inttostr(usb_2_0_ext_cap.bDevCapabilityType)); 259 | Memo.lines.add(' bmAttributes: ' + 260 | inttostr(usb_2_0_ext_cap.bmAttributes)); 261 | end; 262 | 263 | procedure ss_usb_cap(s_usb_cap: plibusb_ss_usb_device_capability_descriptor; 264 | var Memo: Tmemo); 265 | begin 266 | Memo.lines.add(' USB 3.0 Capabilities:'); 267 | Memo.lines.add('------------------------------------------------'); 268 | Memo.lines.add(''); 269 | Memo.lines.add(' bDevCapabilityType: ' + 270 | inttostr(s_usb_cap.bDevCapabilityType)); 271 | Memo.lines.add(' bmAttributes: ' + 272 | inttostr(s_usb_cap.bmAttributes)); 273 | Memo.lines.add(' wSpeedSupported: ' + 274 | inttostr(s_usb_cap.wSpeedSupported)); 275 | Memo.lines.add(' bFunctionalitySupport: ' + 276 | inttostr(s_usb_cap.bFunctionalitySupport)); 277 | Memo.lines.add(' bU1devExitLat: ' + 278 | inttostr(s_usb_cap.bU1DevExitLat)); 279 | Memo.lines.add(' bU2devExitLat: ' + 280 | inttostr(s_usb_cap.bU2DevExitLat)); 281 | end; 282 | 283 | procedure bos(handle: plibusb_device_handle; var Memo: Tmemo); 284 | var 285 | ret, ret2: integer; 286 | fbos: plibusb_bos_descriptor; 287 | usb_2_0_extension: plibusb_usb_2_0_extension_descriptor; 288 | dev_cap: plibusb_ss_usb_device_capability_descriptor; 289 | begin 290 | ret := libusb_get_bos_descriptor(handle, @fbos); 291 | 292 | if ret < 0 then 293 | begin 294 | exit; 295 | end 296 | else 297 | begin 298 | Memo.lines.add(' Binary Object Store (BOS):'); 299 | Memo.lines.add(' wTotalLength: ' + inttostr(fbos.wTotalLength)); 300 | Memo.lines.add(' bNumDeviceCaps: ' + inttostr(fbos.bNumDeviceCaps)); 301 | end; 302 | 303 | if fbos.dev_capability[0].bDevCapabilityType = LIBUSB_BT_USB_2_0_EXTENSION 304 | then 305 | begin 306 | ret := libusb_get_usb_2_0_extension_descriptor(0, fbos.dev_capability[0], 307 | @usb_2_0_extension); 308 | if 0 > ret then 309 | begin 310 | exit; 311 | end 312 | else 313 | begin 314 | usb2_0_ext_cap(usb_2_0_extension, Memo); 315 | libusb_free_usb_2_0_extension_descriptor(usb_2_0_extension); 316 | end; 317 | end; 318 | 319 | if fbos.dev_capability[0].bDevCapabilityType = LIBUSB_BT_SS_USB_DEVICE_CAPABILITY 320 | then 321 | begin 322 | ret := libusb_get_ss_usb_device_capability_descriptor(0, 323 | fbos.dev_capability[0], @dev_cap); 324 | if 0 > ret then 325 | begin 326 | exit; 327 | end 328 | else 329 | begin 330 | ss_usb_cap(dev_cap, Memo); 331 | libusb_free_ss_usb_device_capability_descriptor(dev_cap); 332 | end; 333 | end; 334 | libusb_free_bos_descriptor(fbos); 335 | end; 336 | 337 | procedure interface_process(inter: plibusb_interface; var Memo: Tmemo); 338 | var 339 | i: integer; 340 | begin 341 | if inter.num_altsetting > -1 then 342 | begin 343 | Memo.lines.add(''); 344 | if inter.num_altsetting < 50 then 345 | Memo.lines.add(' Alt Setting number: ' + inter.num_altsetting.ToString) 346 | else 347 | Memo.lines.add(' Alt Setting number: ' + inter.num_altsetting.ToString + 348 | ' is out of bounds and not a valid to process'); 349 | Memo.lines.add('-----------------------------'); 350 | 351 | if inter.num_altsetting < 20 then 352 | // if the item is an abnormal large number ?? 353 | begin 354 | for i := 0 to inter.num_altsetting - 1 do 355 | begin 356 | Memo.lines.add(' Interface Alt Setting no : ' + i.ToString); 357 | Memo.lines.add('-------------------------------'); 358 | altsetting(@inter.altsetting[i], Memo); 359 | Memo.lines.add('--------------------------------'); 360 | end; 361 | end; 362 | end 363 | else 364 | begin 365 | Memo.lines.add(' No alternate interface found'); 366 | Memo.lines.add('--------------------------------'); 367 | end; 368 | end; 369 | 370 | procedure configuration(config: plibusb_config_descriptor; var Memo: Tmemo); 371 | var 372 | i: integer; 373 | inter: plibusb_interface; 374 | begin 375 | Memo.lines.add(' Configuration '); 376 | Memo.lines.add('------------------------------------------------'); 377 | Memo.lines.add(' wTotalLength: ' + 378 | inttostr(config.wTotalLength)); 379 | Memo.lines.add(' bNumInterfaces: ' + 380 | inttostr(config.bNumInterfaces)); 381 | Memo.lines.add(' bConfigurationValue: ' + 382 | inttostr(config.bConfigurationValue)); 383 | Memo.lines.add(' iConfiguration: ' + 384 | inttostr(config.iConfiguration)); 385 | Memo.lines.add(' bmAttributes: ' + 386 | inttostr(config.bmAttributes)); 387 | Memo.lines.add(' MaxPower: ' + 388 | inttostr(config.MaxPower)); 389 | 390 | if config.bNumInterfaces > 0 then 391 | begin 392 | for i := 0 to config.bNumInterfaces - 1 do 393 | begin 394 | interface_process(@config.&interface[i], Memo); 395 | end; 396 | end 397 | else 398 | begin 399 | Memo.lines.add(' No Alternate Settings Found'); 400 | end; 401 | end; 402 | 403 | procedure Descripinfo(dev: plibusb_device; Memo: Tmemo); 404 | var 405 | r: integer; 406 | desc: Libusb_device_descriptor; 407 | begin 408 | r := libusb_get_device_descriptor(dev, @desc); 409 | 410 | if r < 0 then 411 | begin 412 | Memo.lines.add(' failed to get device descriptor'); 413 | exit; 414 | end 415 | else 416 | begin 417 | Memo.lines.add(' device descriptor connected'); 418 | end; 419 | end; 420 | 421 | function device(deviceno: integer; var Memo: Tmemo): integer; 422 | var 423 | s, i, r,rs, op, ret, ret1, ret2: integer; 424 | devs: pplibusb_device; 425 | dev:plibusb_device; 426 | desc: Libusb_device_descriptor; 427 | config: plibusb_config_descriptor; 428 | devhandle: plibusb_device_handle; 429 | arrdev1: array of plibusb_device; 430 | description: array [0 .. 254] of byte; 431 | str: array [0 .. 254] of byte; 432 | count: ssize_t; 433 | context: plibusb_context; 434 | extract:string; 435 | begin 436 | // List devices 437 | Memo.lines.clear; 438 | Memo.lines.add(textload); 439 | Memo.lines.add('---------------------------------------------------------------------------------------------------------------'); 440 | context := nil; // declare the pointer to null 441 | 442 | r := libusb_init(context); 443 | if r <> 0 then 444 | begin 445 | Memo.lines.add('Cannot initialize the DLL Device Value ' + r.ToString + 446 | 'is less than 0'); 447 | exit; 448 | end 449 | else 450 | begin 451 | Memo.lines.add('DLL Initialized - Device connected'); 452 | end; 453 | count := libusb_get_device_list(context, @devs); 454 | 455 | // uses the referenced pointer 456 | setlength(arrdev1, count); 457 | libusb_free_device_list(devs, 1); // we now know how many devices there are 458 | 459 | if count < 1 then 460 | begin 461 | Memo.lines.add('No devices found '); 462 | exit; 463 | end 464 | else 465 | begin 466 | libusb_get_device_list(context, @arrdev1); // set new devicelist with dev 467 | 468 | rs := libusb_get_device_descriptor(arrdev1[deviceno], @desc); 469 | 470 | op := -1; 471 | if rs = 0 then 472 | begin 473 | op := libusb_open(arrdev1[deviceno], @devhandle); 474 | if op <> 0 then 475 | begin 476 | Memo.lines.add(''); 477 | Memo.lines.add('***Device is not Available to open***'); 478 | end 479 | else 480 | begin 481 | Memo.lines.add('***Device ref ID ' + inttostr(deviceno) + 482 | ' is Open and available to use***'); 483 | Memo.lines.add('------------------------------------------------------'); 484 | Memo.lines.add(''); 485 | 486 | if op = 0 then 487 | begin 488 | if desc.iManufacturer > 0 then 489 | begin 490 | ret := libusb_get_string_descriptor_ascii(devhandle, desc.iManufacturer, 491 | @str, sizeof(str)); 492 | if ret > 0 then 493 | Memo.lines.add(' Description -> ' + TEncoding.ANSI.GetString(str)) 494 | else 495 | Memo.lines.add(' Description -> Max Bytes[' + sizeof(description) 496 | .ToString + ']+ ' + inttostr(desc.idVendor) + 497 | ' No Descriptive info'); 498 | 499 | Memo.lines.add(' Id Vendor -> Max Bytes[' + sizeof(description) 500 | .ToString + '] ID: ' + inttostr(desc.idVendor)); 501 | Memo.lines.add(' Id PID -> Max Bytes[' + sizeof(description) 502 | .ToString + '] ID: ' + inttostr(desc.idProduct)); 503 | end; 504 | 505 | if desc.iProduct > 0 then 506 | begin 507 | ret := libusb_get_string_descriptor_ascii(devhandle, desc.iProduct, @str, 508 | sizeof(str)); 509 | if ret > 0 then 510 | Memo.lines.add(' Description -> Max Bytes[' + sizeof(description) 511 | .ToString + ']+ ' + TEncoding.ANSI.GetString(str)) 512 | else 513 | Memo.lines.add(' Description -> Max Bytes[' + 514 | sizeof(description).ToString + '] ID: ' + 515 | inttostr(desc.idProduct) + ' No Descriptive info'); 516 | end; 517 | 518 | Memo.lines.add(' Bus No -> ' + 519 | inttostr(libusb_get_bus_number(arrdev1[deviceno]))); 520 | Memo.lines.add(' Device -> ' + 521 | inttostr(libusb_get_device_address(arrdev1[deviceno]))); 522 | if ((devhandle <> nil) and (verbose = 0)) then 523 | begin 524 | if desc.iSerialNumber = 0 then 525 | begin 526 | ret1 := libusb_get_string_descriptor_ascii(devhandle, 527 | desc.iSerialNumber, @str, sizeof(str)); 528 | if (ret1 <> 0) then 529 | Memo.lines.add(' iSerialnumber level * 2 :' + 530 | inttostr(desc.iSerialNumber) + ' ' + 531 | TEncoding.ANSI.GetString(str)); 532 | end; 533 | end; 534 | if verbose = 0 then 535 | begin 536 | memo.lines.add(' Desc.BnumConfigurations -> '+ inttostr(desc.bNumConfigurations)); 537 | for i := 0 to desc.bNumConfigurations - 1 do 538 | begin 539 | ret2 := libusb_get_config_descriptor(arrdev1[deviceno], i, @config); 540 | if ret2 <> 0 then 541 | begin 542 | Memo.lines.add(' Could not retrieve descriptors'); 543 | end 544 | else 545 | begin 546 | Memo.lines.add(''); 547 | configuration(config, Memo); 548 | libusb_free_config_descriptor(config); 549 | end; 550 | 551 | // gives details on the usb 3.0 device 552 | if ((devhandle <> nil) and (desc.bcdUSB >= 513)) then 553 | begin 554 | Memo.lines.add('-------------------------------------'); 555 | bos(devhandle, Memo); 556 | end 557 | else 558 | begin 559 | Memo.lines.add('-------------------------------------'); 560 | Memo.lines.add 561 | (' The Binary Device Object Store (BOS) descriptor information of the USB 2.0 or USB 3.0 not available for this device'); 562 | Memo.lines.add('-------------------------------------'); 563 | end; 564 | end; 565 | end; 566 | end; 567 | end; 568 | end; 569 | (*Cannot use the function free_ device_list with an array of Plibusb_devices 570 | so have to de_ref each Plibdevice one by one from last to first *) 571 | for s := high(arrdev1) to low(arrdev1) do 572 | libusb_unref_device(arrdev1[i]); 573 | 574 | libusb_exit(context); 575 | end; 576 | end; 577 | 578 | function textload:string; 579 | begin 580 | result:= 581 | ('The device must show open and available to use before trying to ' + 582 | 'enter the device id number else the device' + #13#10 + 583 | ' will fail to open. ' + 584 | 'Just because you have a reference to a device does not mean it is ' + 585 | 'necessarily usable.' + #13#10 + 586 | ' The device may have been unplugged,you may not have ' + 587 | 'permission to operate such device,or another' + #13#10 + 588 | ' program or driver may be ' + 'using the device. ' + 589 | 'When you have found a device that you would like to operate,' + #13#10 + 590 | ' you must ask ' + 591 | 'libusb to open the device using the libusb_open() function. Assuming ' + 592 | 'success,libusb then ' + #13#10 + 'returns you a device handle ' + 593 | '(a \ref libusb_device_handle pointer). All "real" I/O operations then ' + 594 | 'operate' + #13#10 + 595 | ' on the handle rather than the original device pointer.)' + #13#10 + ''); 596 | end; 597 | 598 | 599 | end. 600 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Greg-Bayes 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.MD: -------------------------------------------------------------------------------- 1 | ![](media/c073bd0e0ba1bc6330590f0f04173b5f.png) 2 | 3 | **The Delphi Development** 4 | 5 | Libusb 1.0 is open source C library that provides generic communication to USB 6 | devices and is widely used on Windows, OSX and Linux Platforms’. Libusb 1.0 7 | supports USB 3.1 and is backwards compatible with USB 2.0 and USB 1.0. 8 | 9 | It features the following:- 10 | 11 | - Supports all transfer types such as (control / bulk / interrupt / 12 | isochronous), 13 | 14 | - Supports two transfer interfaces. 15 | 16 | - Synchronous(simple). 17 | 18 | - Asynchronous(more complicated but more powerful). 19 | 20 | - Thread safe. 21 | 22 | - Lightweight with a lean API. 23 | 24 | - Supports hotplug capability. 25 | 26 | This is a Full Delphi header translation of the Libusb.h file available for both 27 | VCL and FMX Windows 32bit and 64bit only. 28 | 29 | This supports the DLL Version 1.0.17 and up. 30 | 31 | ![](media/5e7e326f1cac06cde584741d41543d22.gif) 32 | 33 | **Testing on your IDE** 34 | 35 | Examples are created in both FMX and VCL for your usage ( created on Tokyo 36 | 10.2.3) and should be backwards compatible to Unicode versions in VCL and early 37 | FMX versions. 38 | 39 | Examples available :- 40 | 41 | - DLL Version 42 | 43 | ![](media/c3c7bec784993da828c9302fc8b567f3.gif) 44 | 45 | - Test LibUSB 46 | 47 | ![](media/3316d2a33f3684da8b72c9b55c16419b.gif) 48 | 49 | - ListDevs 50 | 51 | ![](media/de3d28c2bba393cb3b591ed27c01b0d5.gif) 52 | 53 | - Bulk Transfer 54 | 55 | Open the Example ‘DLL Version’ 32bit or 64bit and run the project. This will 56 | show the DLL version and show that all is running correctly. 57 | 58 | **Using LibUSB in your Application** 59 | 60 | Open a new application in your IDE. Add the libusb1 to the project and add the 61 | libusb1 library to the users list. Add the correct DLL to the application EXE 62 | folder. Normally in the folder structure Win32/Debug/libusb/libusb-1.0.dll or 63 | Win64/Debug/libusb/libusb-1.0.dll. Place the correct DLL in the correct folder 64 | as they are not interchangeable. The 32bit DLL shares the same name as the 64bit 65 | DLL. 66 | 67 | **Recent Changes** 68 | 69 | - Changed example Bulk Transfer various errors 06/05/2018 70 | 71 | - Changed example Arduino Transfer various errors 06/05/2018 72 | 73 | - Changed Libusb1 library various 06/04/2018 74 | 75 | - libusb_interface 76 | 77 | - altsetting: array of plibusb_interface_descriptor; 78 | 79 | - Changed Libusb1 library various 21/02/2018 80 | 81 | - libusb_interface_descriptor 82 | 83 | - endpoint: array of plibusb_endpoint_descriptor 84 | 85 | - &interface: array of plibusb_interface; 86 | 87 | - Completed and tested the TestLibusb. 88 | 89 | > **Examples in Development** 90 | 91 | The following are in development and will be added one by one after testing 92 | 93 | - Asynchronous Transfer 94 | 95 | - EZUSB 96 | 97 | - FxLoad 98 | 99 | - Hotplug Test 100 | 101 | - Synchronous Transfer 102 | 103 | - xUSB 104 | 105 | - DPFP 106 | 107 | - Bulk Transfer Arduino 108 | -------------------------------------------------------------------------------- /Src/__history/libusb1helper.pas.~1~: -------------------------------------------------------------------------------- 1 | unit libusb1helper; 2 | 3 | interface 4 | uses libusb1,System.SysUtils, System.Variants; 5 | 6 | function Getlibusbdeviceclass(dcno:uint8):string; 7 | function Getlibusbdevicetype(dcno:uint8):string; 8 | function endpointdirection(epno:uint8):string; 9 | 10 | implementation 11 | 12 | 13 | 14 | function Getlibusbdeviceclass(dcno:uint8):string; 15 | var 16 | no:integer; 17 | begin 18 | result:= 'Undefined'; 19 | no:= dcno; 20 | case no of 21 | 0:result:='LIBUSB_CLASS_PER_INTERFACE'; 22 | 1: result:='LIBUSB_CLASS_AUDIO' ; 23 | 2: result:='LIBUSB_CLASS_COMM'; 24 | 3: result:= 'LIBUSB_CLASS_HID'; 25 | 5: result:= 'LIBUSB_CLASS_PHYSICAL'; 26 | 7: result:= 'LIBUSB_CLASS_PRINTER'; 27 | 6: result:='LIBUSB_CLASS_PTP or LIBUSB_CLASS_IMAGE'; 28 | 8: result:='LIBUSB_CLASS_MASS_STORAGE'; 29 | 9: result:='LIBUSB_CLASS_HUB'; 30 | 10:result:='LIBUSB_CLASS_DATA'; 31 | 11:result:='LIBUSB_CLASS_SMART_CARD'; 32 | 13 :result:='LIBUSB_CLASS_CONTENT_SECURITY '; 33 | 14:result:='LIBUSB_CLASS_VIDEO'; 34 | 15:result:='LIBUSB_CLASS_PERSONAL_HEALTHCARE'; 35 | 220:result:='LIBUSB_CLASS_DIAGNOSTIC_DEVICE'; 36 | 224:result:='LIBUSB_CLASS_WIRELESS'; 37 | 239:result:='LIBUSB_CLASS_APPLICATION'; 38 | 255:result:='LIBUSB_CLASS_VENDOR_SPEC'; 39 | end; 40 | end; 41 | 42 | //bmdescriptortype 43 | function Getlibusbdevicetype(dcno:Uint8):string; 44 | var 45 | no:integer; 46 | begin 47 | result:= 'Undefined'; 48 | no:= dcno; 49 | case no of 50 | 1: result:='LIBUSB_DT_DEVICE'; 51 | 2:result:='LIBUSB_DT_CONFIG'; 52 | 3:result:='LIBUSB_DT_STRING'; 53 | 4:result:='LIBUSB_DT_INTERFACE'; 54 | 5:result:='LIBUSB_DT_ENDPOINT'; 55 | 15:result:='LIBUSB_DT_BOS'; 56 | 16:result:='LIBUSB_DT_DEVICE_CAPABILITY'; 57 | 33:result:='LIBUSB_DT_HID'; 58 | 34:result:= 'LIBUSB_DT_REPORT'; 59 | 36:result:='LIBUSB_DT_PHYSICAL'; 60 | 41:result:='LIBUSB_DT_HUB'; 61 | 42:result:='LIBUSB_DT_SUPERSPEED_HUB'; 62 | 48:result:='LIBUSB_DT_SS_ENDPOINT_COMPANION'; 63 | end; 64 | end; 65 | //bmDevCapibilitytype 66 | function Getlibusbcapabilitytype(dcno:Uint8):string; 67 | var 68 | no:integer; 69 | begin 70 | result:= 'Undefined'; 71 | no:= dcno; 72 | case no of 73 | 1:result:='LIBUSB_BT_WIRELESS_USB_DEVICE_CAPABILITY'; 74 | 2:result:='LIBUSB_BT_USB_2_0_EXTENSION'; 75 | 3:result:='LIBUSB_BT_SS_USB_DEVICE_CAPABILITY'; 76 | 4:result:=' LIBUSB_BT_CONTAINER_ID'; 77 | 78 | end; 79 | end; 80 | 81 | //bmAttributes speed mode 82 | function Getlibusbspeed(dcno:Uint8):string; 83 | var 84 | no:integer; 85 | begin 86 | result:= 'Undefined'; 87 | no:= dcno; 88 | case no of 89 | 1:result:='LIBUSB_LOW_SPEED_OPERATION'; 90 | 2:result:='LIBUSB_FULL_SPEED_OPERATION'; 91 | 3:result:='LIBUSB_HIGH_SPEED_OPERATION'; 92 | 8:result:='LIBUSB_SUPER_SPEED_OPERATION'; 93 | end; 94 | end; 95 | 96 | 97 | function Getlibusboperatingspeed(dcno:Uint8):string; 98 | var 99 | no:integer; 100 | begin 101 | result:= 'Undefined'; 102 | no:= dcno; 103 | case no of 104 | 0:result:='LIBUSB_SPEED_UNKNOWN'; 105 | 1:result:='LIBUSB_SPEED_LOW'; 106 | 2:result:='LIBUSB_SPEED_FULL'; 107 | 3:result:='LIBUSB_SPEED_HIGH'; 108 | 4:result:='LIBUSB_SPEED_SUPER'; 109 | 5:result:='LIBUSB_SPEED_SUPER_PLUS'; 110 | end; 111 | end; 112 | 113 | 114 | 115 | (*//bmspeedsupported 116 | function Getlibusblowestspeed(dcno:Uint8):string; 117 | var 118 | no:integer; 119 | begin 120 | result:= 'Undefined'; 121 | no:= dcno; 122 | case no of 123 | 124 | end; 125 | end; *) 126 | 127 | 128 | 129 | function endpointdirection(epno:uint8):string; 130 | var 131 | no:integer; 132 | begin 133 | no:= epno; 134 | case no of 135 | 128:result:='LIBUSB_ENDPOINT_IN'; 136 | 0:result:='LIBUSB_ENDPOINT_OUT'; 137 | end; 138 | end; 139 | 140 | 141 | function ExtractbitsRl(value,startbits,bitlength:integer):integer; 142 | begin 143 | result:= ((value shr(9-startbits)-bitlength) and ((1 shl bitlength) -1)); 144 | 145 | end; 146 | 147 | 148 | 149 | 150 | 151 | end. 152 | -------------------------------------------------------------------------------- /Src/__history/libusb1helper.pas.~2~: -------------------------------------------------------------------------------- 1 | unit libusb1helper; 2 | 3 | interface 4 | uses libusb1,System.SysUtils, System.Variants; 5 | 6 | function Getlibusbdeviceclass(dcno:uint8):string; 7 | function Getlibusbdevicetype(dcno:uint8):string; 8 | function endpointdirection(epno:uint8):string; 9 | 10 | implementation 11 | 12 | function Getlibusbdeviceclass(dcno:uint8):string; 13 | var 14 | no:integer; 15 | begin 16 | result:= 'Undefined'; 17 | no:= dcno; 18 | case no of 19 | 0:result:='LIBUSB_CLASS_PER_INTERFACE'; 20 | 1: result:='LIBUSB_CLASS_AUDIO' ; 21 | 2: result:='LIBUSB_CLASS_COMM'; 22 | 3: result:= 'LIBUSB_CLASS_HID'; 23 | 5: result:= 'LIBUSB_CLASS_PHYSICAL'; 24 | 7: result:= 'LIBUSB_CLASS_PRINTER'; 25 | 6: result:='LIBUSB_CLASS_PTP or LIBUSB_CLASS_IMAGE'; 26 | 8: result:='LIBUSB_CLASS_MASS_STORAGE'; 27 | 9: result:='LIBUSB_CLASS_HUB'; 28 | 10:result:='LIBUSB_CLASS_DATA'; 29 | 11:result:='LIBUSB_CLASS_SMART_CARD'; 30 | 13 :result:='LIBUSB_CLASS_CONTENT_SECURITY '; 31 | 14:result:='LIBUSB_CLASS_VIDEO'; 32 | 15:result:='LIBUSB_CLASS_PERSONAL_HEALTHCARE'; 33 | 220:result:='LIBUSB_CLASS_DIAGNOSTIC_DEVICE'; 34 | 224:result:='LIBUSB_CLASS_WIRELESS'; 35 | 239:result:='LIBUSB_CLASS_APPLICATION'; 36 | 255:result:='LIBUSB_CLASS_VENDOR_SPEC'; 37 | end; 38 | end; 39 | 40 | //bmdescriptortype 41 | function Getlibusbdevicetype(dcno:Uint8):string; 42 | var 43 | no:integer; 44 | begin 45 | result:= 'Undefined'; 46 | no:= dcno; 47 | case no of 48 | 1: result:='LIBUSB_DT_DEVICE'; 49 | 2:result:='LIBUSB_DT_CONFIG'; 50 | 3:result:='LIBUSB_DT_STRING'; 51 | 4:result:='LIBUSB_DT_INTERFACE'; 52 | 5:result:='LIBUSB_DT_ENDPOINT'; 53 | 15:result:='LIBUSB_DT_BOS'; 54 | 16:result:='LIBUSB_DT_DEVICE_CAPABILITY'; 55 | 33:result:='LIBUSB_DT_HID'; 56 | 34:result:= 'LIBUSB_DT_REPORT'; 57 | 36:result:='LIBUSB_DT_PHYSICAL'; 58 | 41:result:='LIBUSB_DT_HUB'; 59 | 42:result:='LIBUSB_DT_SUPERSPEED_HUB'; 60 | 48:result:='LIBUSB_DT_SS_ENDPOINT_COMPANION'; 61 | end; 62 | end; 63 | //bmDevCapibilitytype 64 | function Getlibusbcapabilitytype(dcno:Uint8):string; 65 | var 66 | no:integer; 67 | begin 68 | result:= 'Undefined'; 69 | no:= dcno; 70 | case no of 71 | 1:result:='LIBUSB_BT_WIRELESS_USB_DEVICE_CAPABILITY'; 72 | 2:result:='LIBUSB_BT_USB_2_0_EXTENSION'; 73 | 3:result:='LIBUSB_BT_SS_USB_DEVICE_CAPABILITY'; 74 | 4:result:=' LIBUSB_BT_CONTAINER_ID'; 75 | 76 | end; 77 | end; 78 | 79 | //bmAttributes speed mode 80 | function Getlibusbspeed(dcno:Uint8):string; 81 | var 82 | no:integer; 83 | begin 84 | result:= 'Undefined'; 85 | no:= dcno; 86 | case no of 87 | 1:result:='LIBUSB_LOW_SPEED_OPERATION'; 88 | 2:result:='LIBUSB_FULL_SPEED_OPERATION'; 89 | 3:result:='LIBUSB_HIGH_SPEED_OPERATION'; 90 | 8:result:='LIBUSB_SUPER_SPEED_OPERATION'; 91 | end; 92 | end; 93 | 94 | 95 | function Getlibusboperatingspeed(dcno:Uint8):string; 96 | var 97 | no:integer; 98 | begin 99 | result:= 'Undefined'; 100 | no:= dcno; 101 | case no of 102 | 0:result:='LIBUSB_SPEED_UNKNOWN'; 103 | 1:result:='LIBUSB_SPEED_LOW'; 104 | 2:result:='LIBUSB_SPEED_FULL'; 105 | 3:result:='LIBUSB_SPEED_HIGH'; 106 | 4:result:='LIBUSB_SPEED_SUPER'; 107 | 5:result:='LIBUSB_SPEED_SUPER_PLUS'; 108 | end; 109 | end; 110 | 111 | 112 | 113 | (*//bmspeedsupported 114 | function Getlibusblowestspeed(dcno:Uint8):string; 115 | var 116 | no:integer; 117 | begin 118 | result:= 'Undefined'; 119 | no:= dcno; 120 | case no of 121 | 122 | end; 123 | end; *) 124 | 125 | 126 | 127 | function endpointdirection(epno:uint8):string; 128 | var 129 | no:integer; 130 | begin 131 | no:= epno; 132 | case no of 133 | 128:result:='LIBUSB_ENDPOINT_IN'; 134 | 0:result:='LIBUSB_ENDPOINT_OUT'; 135 | end; 136 | end; 137 | 138 | 139 | function ExtractbitsRl(value,startbits,bitlength:integer):integer; 140 | begin 141 | result:= ((value shr(9-startbits)-bitlength) and ((1 shl bitlength) -1)); 142 | end; 143 | 144 | function Libusberror(name:string):integer; 145 | begin 146 | if Name = LIBUSB_SUCCESS then 147 | result := 0; 148 | if Name = LIBUSB_ERROR_IO then 149 | result = -1; 150 | (** Input/output error *) 151 | if Name = LIBUSB_ERROR_INVALID_PARAM then 152 | result:= -2; 153 | (** Invalid parameter *) 154 | if Name = LIBUSB_ERROR_ACCESS then 155 | result := -3; 156 | (** Access denied (insufficient permissions) *) 157 | if Name = LIBUSB_ERROR_NO_DEVICE then 158 | result := -4; 159 | (** No such device (it may have been disconnected) *) 160 | if Name = LIBUSB_ERROR_NOT_FOUND then 161 | result:= -5; 162 | (** Entity not found *) 163 | if Name = LIBUSB_ERROR_BUSY then 164 | result := -6; 165 | (** Resource busy *) 166 | if Name = LIBUSB_ERROR_TIMEOUT then 167 | result := -7; 168 | (** Operation timed out *) 169 | if Name = LIBUSB_ERROR_OVERFLOW then 170 | result := -8; 171 | (** Overflow *) 172 | if Name = LIBUSB_ERROR_PIPE then 173 | result:= -9; 174 | (** Pipe error *) 175 | if Name = LIBUSB_ERROR_INTERRUPTED then 176 | result:= -10; 177 | (** System call interrupted (perhaps due to signal) *) 178 | if Name = LIBUSB_ERROR_NO_MEM then 179 | result:= -11; 180 | (** Insufficient memory *) 181 | if Name = LIBUSB_ERROR_NOT_SUPPORTED then 182 | result := -12; 183 | (** Operation not supported or unimplemented on this platform *) 184 | if Name = LIBUSB_ERROR_OTHER then 185 | result:= -99; 186 | 187 | 188 | end; 189 | 190 | 191 | 192 | 193 | 194 | end. 195 | -------------------------------------------------------------------------------- /Src/__history/libusb1helper.pas.~3~: -------------------------------------------------------------------------------- 1 | unit libusb1helper; 2 | 3 | interface 4 | uses libusb1,System.SysUtils, System.Variants; 5 | 6 | function Getlibusbdeviceclass(dcno:uint8):string; 7 | function Getlibusbdevicetype(dcno:uint8):string; 8 | function endpointdirection(epno:uint8):string; 9 | 10 | implementation 11 | 12 | function Getlibusbdeviceclass(dcno:uint8):string; 13 | var 14 | no:integer; 15 | begin 16 | result:= 'Undefined'; 17 | no:= dcno; 18 | case no of 19 | 0:result:='LIBUSB_CLASS_PER_INTERFACE'; 20 | 1: result:='LIBUSB_CLASS_AUDIO' ; 21 | 2: result:='LIBUSB_CLASS_COMM'; 22 | 3: result:= 'LIBUSB_CLASS_HID'; 23 | 5: result:= 'LIBUSB_CLASS_PHYSICAL'; 24 | 7: result:= 'LIBUSB_CLASS_PRINTER'; 25 | 6: result:='LIBUSB_CLASS_PTP or LIBUSB_CLASS_IMAGE'; 26 | 8: result:='LIBUSB_CLASS_MASS_STORAGE'; 27 | 9: result:='LIBUSB_CLASS_HUB'; 28 | 10:result:='LIBUSB_CLASS_DATA'; 29 | 11:result:='LIBUSB_CLASS_SMART_CARD'; 30 | 13 :result:='LIBUSB_CLASS_CONTENT_SECURITY '; 31 | 14:result:='LIBUSB_CLASS_VIDEO'; 32 | 15:result:='LIBUSB_CLASS_PERSONAL_HEALTHCARE'; 33 | 220:result:='LIBUSB_CLASS_DIAGNOSTIC_DEVICE'; 34 | 224:result:='LIBUSB_CLASS_WIRELESS'; 35 | 239:result:='LIBUSB_CLASS_APPLICATION'; 36 | 255:result:='LIBUSB_CLASS_VENDOR_SPEC'; 37 | end; 38 | end; 39 | 40 | //bmdescriptortype 41 | function Getlibusbdevicetype(dcno:Uint8):string; 42 | var 43 | no:integer; 44 | begin 45 | result:= 'Undefined'; 46 | no:= dcno; 47 | case no of 48 | 1: result:='LIBUSB_DT_DEVICE'; 49 | 2:result:='LIBUSB_DT_CONFIG'; 50 | 3:result:='LIBUSB_DT_STRING'; 51 | 4:result:='LIBUSB_DT_INTERFACE'; 52 | 5:result:='LIBUSB_DT_ENDPOINT'; 53 | 15:result:='LIBUSB_DT_BOS'; 54 | 16:result:='LIBUSB_DT_DEVICE_CAPABILITY'; 55 | 33:result:='LIBUSB_DT_HID'; 56 | 34:result:= 'LIBUSB_DT_REPORT'; 57 | 36:result:='LIBUSB_DT_PHYSICAL'; 58 | 41:result:='LIBUSB_DT_HUB'; 59 | 42:result:='LIBUSB_DT_SUPERSPEED_HUB'; 60 | 48:result:='LIBUSB_DT_SS_ENDPOINT_COMPANION'; 61 | end; 62 | end; 63 | //bmDevCapibilitytype 64 | function Getlibusbcapabilitytype(dcno:Uint8):string; 65 | var 66 | no:integer; 67 | begin 68 | result:= 'Undefined'; 69 | no:= dcno; 70 | case no of 71 | 1:result:='LIBUSB_BT_WIRELESS_USB_DEVICE_CAPABILITY'; 72 | 2:result:='LIBUSB_BT_USB_2_0_EXTENSION'; 73 | 3:result:='LIBUSB_BT_SS_USB_DEVICE_CAPABILITY'; 74 | 4:result:=' LIBUSB_BT_CONTAINER_ID'; 75 | 76 | end; 77 | end; 78 | 79 | //bmAttributes speed mode 80 | function Getlibusbspeed(dcno:Uint8):string; 81 | var 82 | no:integer; 83 | begin 84 | result:= 'Undefined'; 85 | no:= dcno; 86 | case no of 87 | 1:result:='LIBUSB_LOW_SPEED_OPERATION'; 88 | 2:result:='LIBUSB_FULL_SPEED_OPERATION'; 89 | 3:result:='LIBUSB_HIGH_SPEED_OPERATION'; 90 | 8:result:='LIBUSB_SUPER_SPEED_OPERATION'; 91 | end; 92 | end; 93 | 94 | 95 | function Getlibusboperatingspeed(dcno:Uint8):string; 96 | var 97 | no:integer; 98 | begin 99 | result:= 'Undefined'; 100 | no:= dcno; 101 | case no of 102 | 0:result:='LIBUSB_SPEED_UNKNOWN'; 103 | 1:result:='LIBUSB_SPEED_LOW'; 104 | 2:result:='LIBUSB_SPEED_FULL'; 105 | 3:result:='LIBUSB_SPEED_HIGH'; 106 | 4:result:='LIBUSB_SPEED_SUPER'; 107 | 5:result:='LIBUSB_SPEED_SUPER_PLUS'; 108 | end; 109 | end; 110 | 111 | 112 | 113 | (*//bmspeedsupported 114 | function Getlibusblowestspeed(dcno:Uint8):string; 115 | var 116 | no:integer; 117 | begin 118 | result:= 'Undefined'; 119 | no:= dcno; 120 | case no of 121 | 122 | end; 123 | end; *) 124 | 125 | 126 | 127 | function endpointdirection(epno:uint8):string; 128 | var 129 | no:integer; 130 | begin 131 | no:= epno; 132 | case no of 133 | 128:result:='LIBUSB_ENDPOINT_IN'; 134 | 0:result:='LIBUSB_ENDPOINT_OUT'; 135 | end; 136 | end; 137 | 138 | 139 | function ExtractbitsRl(value,startbits,bitlength:integer):integer; 140 | begin 141 | result:= ((value shr(9-startbits)-bitlength) and ((1 shl bitlength) -1)); 142 | end; 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | end. 151 | -------------------------------------------------------------------------------- /Src/__history/libusb1helper.pas.~4~: -------------------------------------------------------------------------------- 1 | unit libusb1helper; 2 | 3 | interface 4 | uses libusb1,System.SysUtils, System.Variants,FMX.Dialogs; 5 | 6 | //function libusb_get_device_from_no(device_no:integer):pplibusb_device; 7 | function Getlibusbdeviceclass(dcno:uint8):string; 8 | function Getlibusbdevicetype(dcno:uint8):string; 9 | function endpointdirection(epno:uint8):string; 10 | function Getlibusbcapabilitytype(dcno:uint8):string; 11 | function endpointdirection(epno:uint8):string; 12 | 13 | implementation 14 | 15 | 16 | (*function libusb_get_device_from_no(device_no:integer):pplibusb_device; 17 | procedure extrainfo(dev: plibusb_device); 18 | var 19 | i,j,k,r,s:integer; 20 | desc:Libusb_device_descriptor; 21 | config:plibusb_config_descriptor; 22 | begin 23 | r:= libusb_get_device_descriptor(dev,@desc); 24 | 25 | if r < 0 then 26 | begin 27 | memo.lines.add('failed to get device descriptor'); 28 | exit; 29 | end 30 | else 31 | begin 32 | //format 33 | memo.lines.add(' VID : '+inttostr(desc.idVendor)+ ' PID : '+inttostr(desc.idProduct)+ 34 | ' Bus '+inttostr(libusb_get_bus_number(dev))+' Device '+inttostr(libusb_get_device_address(dev))); 35 | end; 36 | end; 37 | var 38 | i, count: ssize_t; 39 | r: integer; 40 | devs: pplibusb_device; 41 | handle:plibusb_device_handle; 42 | arrdev: array of plibusb_device; 43 | begin 44 | context := nil; // declare the pointer to null 45 | r := libusb_init(context); 46 | if r <> 0 then 47 | begin 48 | Showmessage('Cannot initialize the DLL Device Value ' + r.ToString + 49 | 'is less than 0'); 50 | if not handle = nil then 51 | begin 52 | libusb_release_interface(handle,0); 53 | libusb_close(handle); 54 | end; 55 | exit; 56 | end 57 | else 58 | begin 59 | count := libusb_get_device_list(context, @devs); 60 | // uses the referenced pointer 61 | setlength(arrdev, count); 62 | libusb_free_device_list(devs, 1); // we now know how many devices there are 63 | 64 | if count < 1 then 65 | begin 66 | memo.lines.add('No devices found '); 67 | exit; 68 | end 69 | else 70 | begin 71 | 72 | libusb_get_device_list(context, @arrdev); // set new devicelist with dev 73 | 74 | memo.lines.add('USB Activate Devices found :' + inttostr(count)); 75 | memo.lines.add(''); 76 | memo.lines.add(' Device VID / PID Device extended Information'); 77 | memo.lines.add('-------------------------------------------------------'); 78 | for i := 0 to count - 1 do 79 | begin 80 | memo.lines.add('USB Device on system - no ' + inttostr(i + 1)); 81 | extrainfo(arrdev[i],memo); 82 | end; 83 | libusb_exit(context); 84 | end; 85 | end; 86 | 87 | 88 | end; *) 89 | 90 | function Getlibusbdeviceclass(dcno:uint8):string; 91 | var 92 | no:integer; 93 | begin 94 | result:= 'Undefined'; 95 | no:= dcno; 96 | case no of 97 | 0:result:='LIBUSB_CLASS_PER_INTERFACE'; 98 | 1: result:='LIBUSB_CLASS_AUDIO' ; 99 | 2: result:='LIBUSB_CLASS_COMM'; 100 | 3: result:= 'LIBUSB_CLASS_HID'; 101 | 5: result:= 'LIBUSB_CLASS_PHYSICAL'; 102 | 7: result:= 'LIBUSB_CLASS_PRINTER'; 103 | 6: result:='LIBUSB_CLASS_PTP or LIBUSB_CLASS_IMAGE'; 104 | 8: result:='LIBUSB_CLASS_MASS_STORAGE'; 105 | 9: result:='LIBUSB_CLASS_HUB'; 106 | 10:result:='LIBUSB_CLASS_DATA'; 107 | 11:result:='LIBUSB_CLASS_SMART_CARD'; 108 | 13 :result:='LIBUSB_CLASS_CONTENT_SECURITY '; 109 | 14:result:='LIBUSB_CLASS_VIDEO'; 110 | 15:result:='LIBUSB_CLASS_PERSONAL_HEALTHCARE'; 111 | 220:result:='LIBUSB_CLASS_DIAGNOSTIC_DEVICE'; 112 | 224:result:='LIBUSB_CLASS_WIRELESS'; 113 | 239:result:='LIBUSB_CLASS_APPLICATION'; 114 | 255:result:='LIBUSB_CLASS_VENDOR_SPEC'; 115 | end; 116 | end; 117 | 118 | //bmdescriptortype 119 | function Getlibusbdevicetype(dcno:Uint8):string; 120 | var 121 | no:integer; 122 | begin 123 | result:= 'Undefined'; 124 | no:= dcno; 125 | case no of 126 | 1: result:='LIBUSB_DT_DEVICE'; 127 | 2:result:='LIBUSB_DT_CONFIG'; 128 | 3:result:='LIBUSB_DT_STRING'; 129 | 4:result:='LIBUSB_DT_INTERFACE'; 130 | 5:result:='LIBUSB_DT_ENDPOINT'; 131 | 15:result:='LIBUSB_DT_BOS'; 132 | 16:result:='LIBUSB_DT_DEVICE_CAPABILITY'; 133 | 33:result:='LIBUSB_DT_HID'; 134 | 34:result:= 'LIBUSB_DT_REPORT'; 135 | 36:result:='LIBUSB_DT_PHYSICAL'; 136 | 41:result:='LIBUSB_DT_HUB'; 137 | 42:result:='LIBUSB_DT_SUPERSPEED_HUB'; 138 | 48:result:='LIBUSB_DT_SS_ENDPOINT_COMPANION'; 139 | end; 140 | end; 141 | //bmDevCapibilitytype 142 | function Getlibusbcapabilitytype(dcno:Uint8):string; 143 | var 144 | no:integer; 145 | begin 146 | result:= 'Undefined'; 147 | no:= dcno; 148 | case no of 149 | 1:result:='LIBUSB_BT_WIRELESS_USB_DEVICE_CAPABILITY'; 150 | 2:result:='LIBUSB_BT_USB_2_0_EXTENSION'; 151 | 3:result:='LIBUSB_BT_SS_USB_DEVICE_CAPABILITY'; 152 | 4:result:=' LIBUSB_BT_CONTAINER_ID'; 153 | 154 | end; 155 | end; 156 | 157 | //bmAttributes speed mode 158 | function Getlibusbspeed(dcno:Uint8):string; 159 | var 160 | no:integer; 161 | begin 162 | result:= 'Undefined'; 163 | no:= dcno; 164 | case no of 165 | 1:result:='LIBUSB_LOW_SPEED_OPERATION'; 166 | 2:result:='LIBUSB_FULL_SPEED_OPERATION'; 167 | 3:result:='LIBUSB_HIGH_SPEED_OPERATION'; 168 | 8:result:='LIBUSB_SUPER_SPEED_OPERATION'; 169 | end; 170 | end; 171 | 172 | 173 | function Getlibusboperatingspeed(dcno:Uint8):string; 174 | var 175 | no:integer; 176 | begin 177 | result:= 'Undefined'; 178 | no:= dcno; 179 | case no of 180 | 0:result:='LIBUSB_SPEED_UNKNOWN'; 181 | 1:result:='LIBUSB_SPEED_LOW'; 182 | 2:result:='LIBUSB_SPEED_FULL'; 183 | 3:result:='LIBUSB_SPEED_HIGH'; 184 | 4:result:='LIBUSB_SPEED_SUPER'; 185 | 5:result:='LIBUSB_SPEED_SUPER_PLUS'; 186 | end; 187 | end; 188 | 189 | function endpointdirection(epno:uint8):string; 190 | var 191 | no:integer; 192 | begin 193 | no:= epno; 194 | case no of 195 | 128:result:='LIBUSB_ENDPOINT_IN'; 196 | 0:result:='LIBUSB_ENDPOINT_OUT'; 197 | end; 198 | end; 199 | 200 | 201 | function ExtractbitsRl(value,startbits,bitlength:integer):integer; 202 | begin 203 | result:= ((value shr(9-startbits)-bitlength) and ((1 shl bitlength) -1)); 204 | end; 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | end. 213 | -------------------------------------------------------------------------------- /Src/__history/libusb1helper.pas.~5~: -------------------------------------------------------------------------------- 1 | unit libusb1helper; 2 | 3 | interface 4 | uses libusb1,System.SysUtils, System.Variants,FMX.Dialogs; 5 | 6 | //function libusb_get_device_from_no(device_no:integer):pplibusb_device; 7 | function Getlibusbdeviceclass(dcno:uint8):string; 8 | function Getlibusbdevicetype(dcno:uint8):string; 9 | function endpointdirection(epno:uint8):string; 10 | function Getlibusbcapabilitytype(dcno:uint8):string; 11 | 12 | 13 | implementation 14 | 15 | 16 | (*function libusb_get_device_from_no(device_no:integer):pplibusb_device; 17 | procedure extrainfo(dev: plibusb_device); 18 | var 19 | i,j,k,r,s:integer; 20 | desc:Libusb_device_descriptor; 21 | config:plibusb_config_descriptor; 22 | begin 23 | r:= libusb_get_device_descriptor(dev,@desc); 24 | 25 | if r < 0 then 26 | begin 27 | memo.lines.add('failed to get device descriptor'); 28 | exit; 29 | end 30 | else 31 | begin 32 | //format 33 | memo.lines.add(' VID : '+inttostr(desc.idVendor)+ ' PID : '+inttostr(desc.idProduct)+ 34 | ' Bus '+inttostr(libusb_get_bus_number(dev))+' Device '+inttostr(libusb_get_device_address(dev))); 35 | end; 36 | end; 37 | var 38 | i, count: ssize_t; 39 | r: integer; 40 | devs: pplibusb_device; 41 | handle:plibusb_device_handle; 42 | arrdev: array of plibusb_device; 43 | begin 44 | context := nil; // declare the pointer to null 45 | r := libusb_init(context); 46 | if r <> 0 then 47 | begin 48 | Showmessage('Cannot initialize the DLL Device Value ' + r.ToString + 49 | 'is less than 0'); 50 | if not handle = nil then 51 | begin 52 | libusb_release_interface(handle,0); 53 | libusb_close(handle); 54 | end; 55 | exit; 56 | end 57 | else 58 | begin 59 | count := libusb_get_device_list(context, @devs); 60 | // uses the referenced pointer 61 | setlength(arrdev, count); 62 | libusb_free_device_list(devs, 1); // we now know how many devices there are 63 | 64 | if count < 1 then 65 | begin 66 | memo.lines.add('No devices found '); 67 | exit; 68 | end 69 | else 70 | begin 71 | 72 | libusb_get_device_list(context, @arrdev); // set new devicelist with dev 73 | 74 | memo.lines.add('USB Activate Devices found :' + inttostr(count)); 75 | memo.lines.add(''); 76 | memo.lines.add(' Device VID / PID Device extended Information'); 77 | memo.lines.add('-------------------------------------------------------'); 78 | for i := 0 to count - 1 do 79 | begin 80 | memo.lines.add('USB Device on system - no ' + inttostr(i + 1)); 81 | extrainfo(arrdev[i],memo); 82 | end; 83 | libusb_exit(context); 84 | end; 85 | end; 86 | 87 | 88 | end; *) 89 | 90 | function Getlibusbdeviceclass(dcno:uint8):string; 91 | var 92 | no:integer; 93 | begin 94 | result:= 'Undefined'; 95 | no:= dcno; 96 | case no of 97 | 0:result:='LIBUSB_CLASS_PER_INTERFACE'; 98 | 1: result:='LIBUSB_CLASS_AUDIO' ; 99 | 2: result:='LIBUSB_CLASS_COMM'; 100 | 3: result:= 'LIBUSB_CLASS_HID'; 101 | 5: result:= 'LIBUSB_CLASS_PHYSICAL'; 102 | 7: result:= 'LIBUSB_CLASS_PRINTER'; 103 | 6: result:='LIBUSB_CLASS_PTP or LIBUSB_CLASS_IMAGE'; 104 | 8: result:='LIBUSB_CLASS_MASS_STORAGE'; 105 | 9: result:='LIBUSB_CLASS_HUB'; 106 | 10:result:='LIBUSB_CLASS_DATA'; 107 | 11:result:='LIBUSB_CLASS_SMART_CARD'; 108 | 13 :result:='LIBUSB_CLASS_CONTENT_SECURITY '; 109 | 14:result:='LIBUSB_CLASS_VIDEO'; 110 | 15:result:='LIBUSB_CLASS_PERSONAL_HEALTHCARE'; 111 | 220:result:='LIBUSB_CLASS_DIAGNOSTIC_DEVICE'; 112 | 224:result:='LIBUSB_CLASS_WIRELESS'; 113 | 239:result:='LIBUSB_CLASS_APPLICATION'; 114 | 255:result:='LIBUSB_CLASS_VENDOR_SPEC'; 115 | end; 116 | end; 117 | 118 | //bmdescriptortype 119 | function Getlibusbdevicetype(dcno:Uint8):string; 120 | var 121 | no:integer; 122 | begin 123 | result:= 'Undefined'; 124 | no:= dcno; 125 | case no of 126 | 1: result:='LIBUSB_DT_DEVICE'; 127 | 2:result:='LIBUSB_DT_CONFIG'; 128 | 3:result:='LIBUSB_DT_STRING'; 129 | 4:result:='LIBUSB_DT_INTERFACE'; 130 | 5:result:='LIBUSB_DT_ENDPOINT'; 131 | 15:result:='LIBUSB_DT_BOS'; 132 | 16:result:='LIBUSB_DT_DEVICE_CAPABILITY'; 133 | 33:result:='LIBUSB_DT_HID'; 134 | 34:result:= 'LIBUSB_DT_REPORT'; 135 | 36:result:='LIBUSB_DT_PHYSICAL'; 136 | 41:result:='LIBUSB_DT_HUB'; 137 | 42:result:='LIBUSB_DT_SUPERSPEED_HUB'; 138 | 48:result:='LIBUSB_DT_SS_ENDPOINT_COMPANION'; 139 | end; 140 | end; 141 | //bmDevCapibilitytype 142 | function Getlibusbcapabilitytype(dcno:Uint8):string; 143 | var 144 | no:integer; 145 | begin 146 | result:= 'Undefined'; 147 | no:= dcno; 148 | case no of 149 | 1:result:='LIBUSB_BT_WIRELESS_USB_DEVICE_CAPABILITY'; 150 | 2:result:='LIBUSB_BT_USB_2_0_EXTENSION'; 151 | 3:result:='LIBUSB_BT_SS_USB_DEVICE_CAPABILITY'; 152 | 4:result:=' LIBUSB_BT_CONTAINER_ID'; 153 | 154 | end; 155 | end; 156 | 157 | //bmAttributes speed mode 158 | function Getlibusbspeed(dcno:Uint8):string; 159 | var 160 | no:integer; 161 | begin 162 | result:= 'Undefined'; 163 | no:= dcno; 164 | case no of 165 | 1:result:='LIBUSB_LOW_SPEED_OPERATION'; 166 | 2:result:='LIBUSB_FULL_SPEED_OPERATION'; 167 | 3:result:='LIBUSB_HIGH_SPEED_OPERATION'; 168 | 8:result:='LIBUSB_SUPER_SPEED_OPERATION'; 169 | end; 170 | end; 171 | 172 | 173 | function Getlibusboperatingspeed(dcno:Uint8):string; 174 | var 175 | no:integer; 176 | begin 177 | result:= 'Undefined'; 178 | no:= dcno; 179 | case no of 180 | 0:result:='LIBUSB_SPEED_UNKNOWN'; 181 | 1:result:='LIBUSB_SPEED_LOW'; 182 | 2:result:='LIBUSB_SPEED_FULL'; 183 | 3:result:='LIBUSB_SPEED_HIGH'; 184 | 4:result:='LIBUSB_SPEED_SUPER'; 185 | 5:result:='LIBUSB_SPEED_SUPER_PLUS'; 186 | end; 187 | end; 188 | 189 | function endpointdirection(epno:uint8):string; 190 | var 191 | no:integer; 192 | begin 193 | no:= epno; 194 | case no of 195 | 128:result:='LIBUSB_ENDPOINT_IN'; 196 | 0:result:='LIBUSB_ENDPOINT_OUT'; 197 | end; 198 | end; 199 | 200 | 201 | function ExtractbitsRl(value,startbits,bitlength:integer):integer; 202 | begin 203 | result:= ((value shr(9-startbits)-bitlength) and ((1 shl bitlength) -1)); 204 | end; 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | end. 213 | -------------------------------------------------------------------------------- /Src/__history/libusb1helper.pas.~6~: -------------------------------------------------------------------------------- 1 | unit libusb1helper; 2 | 3 | interface 4 | uses libusb1,System.SysUtils, System.Variants,FMX.Dialogs; 5 | 6 | function libusb_get_device_from_no(device_no:integer):pplibusb_device; 7 | function Getlibusbdeviceclass(dcno:uint8):string; 8 | function Getlibusbdevicetype(dcno:uint8):string; 9 | function endpointdirection(epno:uint8):string; 10 | function Getlibusbcapabilitytype(dcno:uint8):string; 11 | 12 | 13 | implementation 14 | 15 | 16 | function libusb_get_device_from_no(device_no:integer):pplibusb_device; 17 | procedure extrainfo(dev: plibusb_device); 18 | var 19 | i,j,k,r,s:integer; 20 | desc:Libusb_device_descriptor; 21 | config:plibusb_config_descriptor; 22 | begin 23 | r:= libusb_get_device_descriptor(dev,@desc); 24 | 25 | if r < 0 then 26 | begin 27 | memo.lines.add('failed to get device descriptor'); 28 | exit; 29 | end 30 | else 31 | begin 32 | //format 33 | memo.lines.add(' VID : '+inttostr(desc.idVendor)+ ' PID : '+inttostr(desc.idProduct)+ 34 | ' Bus '+inttostr(libusb_get_bus_number(dev))+' Device '+inttostr(libusb_get_device_address(dev))); 35 | end; 36 | end; 37 | var 38 | i, count: ssize_t; 39 | r: integer; 40 | devs: pplibusb_device; 41 | handle:plibusb_device_handle; 42 | arrdev: array of plibusb_device; 43 | begin 44 | context := nil; // declare the pointer to null 45 | r := libusb_init(context); 46 | if r <> 0 then 47 | begin 48 | Showmessage('Cannot initialize the DLL Device Value ' + r.ToString + 49 | 'is less than 0'); 50 | if not handle = nil then 51 | begin 52 | libusb_release_interface(handle,0); 53 | libusb_close(handle); 54 | end; 55 | exit; 56 | end 57 | else 58 | begin 59 | count := libusb_get_device_list(context, @devs); 60 | // uses the referenced pointer 61 | setlength(arrdev, count); 62 | libusb_free_device_list(devs, 1); // we now know how many devices there are 63 | 64 | if count < 1 then 65 | begin 66 | memo.lines.add('No devices found '); 67 | exit; 68 | end 69 | else 70 | begin 71 | 72 | libusb_get_device_list(context, @arrdev); // set new devicelist with dev 73 | 74 | memo.lines.add('USB Activate Devices found :' + inttostr(count)); 75 | memo.lines.add(''); 76 | memo.lines.add(' Device VID / PID Device extended Information'); 77 | memo.lines.add('-------------------------------------------------------'); 78 | for i := 0 to count - 1 do 79 | begin 80 | memo.lines.add('USB Device on system - no ' + inttostr(i + 1)); 81 | extrainfo(arrdev[i],memo); 82 | end; 83 | libusb_exit(context); 84 | end; 85 | end; 86 | 87 | 88 | end; *) 89 | 90 | function Getlibusbdeviceclass(dcno:uint8):string; 91 | var 92 | no:integer; 93 | begin 94 | result:= 'Undefined'; 95 | no:= dcno; 96 | case no of 97 | 0:result:='LIBUSB_CLASS_PER_INTERFACE'; 98 | 1: result:='LIBUSB_CLASS_AUDIO' ; 99 | 2: result:='LIBUSB_CLASS_COMM'; 100 | 3: result:= 'LIBUSB_CLASS_HID'; 101 | 5: result:= 'LIBUSB_CLASS_PHYSICAL'; 102 | 7: result:= 'LIBUSB_CLASS_PRINTER'; 103 | 6: result:='LIBUSB_CLASS_PTP or LIBUSB_CLASS_IMAGE'; 104 | 8: result:='LIBUSB_CLASS_MASS_STORAGE'; 105 | 9: result:='LIBUSB_CLASS_HUB'; 106 | 10:result:='LIBUSB_CLASS_DATA'; 107 | 11:result:='LIBUSB_CLASS_SMART_CARD'; 108 | 13 :result:='LIBUSB_CLASS_CONTENT_SECURITY '; 109 | 14:result:='LIBUSB_CLASS_VIDEO'; 110 | 15:result:='LIBUSB_CLASS_PERSONAL_HEALTHCARE'; 111 | 220:result:='LIBUSB_CLASS_DIAGNOSTIC_DEVICE'; 112 | 224:result:='LIBUSB_CLASS_WIRELESS'; 113 | 239:result:='LIBUSB_CLASS_APPLICATION'; 114 | 255:result:='LIBUSB_CLASS_VENDOR_SPEC'; 115 | end; 116 | end; 117 | 118 | //bmdescriptortype 119 | function Getlibusbdevicetype(dcno:Uint8):string; 120 | var 121 | no:integer; 122 | begin 123 | result:= 'Undefined'; 124 | no:= dcno; 125 | case no of 126 | 1: result:='LIBUSB_DT_DEVICE'; 127 | 2:result:='LIBUSB_DT_CONFIG'; 128 | 3:result:='LIBUSB_DT_STRING'; 129 | 4:result:='LIBUSB_DT_INTERFACE'; 130 | 5:result:='LIBUSB_DT_ENDPOINT'; 131 | 15:result:='LIBUSB_DT_BOS'; 132 | 16:result:='LIBUSB_DT_DEVICE_CAPABILITY'; 133 | 33:result:='LIBUSB_DT_HID'; 134 | 34:result:= 'LIBUSB_DT_REPORT'; 135 | 36:result:='LIBUSB_DT_PHYSICAL'; 136 | 41:result:='LIBUSB_DT_HUB'; 137 | 42:result:='LIBUSB_DT_SUPERSPEED_HUB'; 138 | 48:result:='LIBUSB_DT_SS_ENDPOINT_COMPANION'; 139 | end; 140 | end; 141 | //bmDevCapibilitytype 142 | function Getlibusbcapabilitytype(dcno:Uint8):string; 143 | var 144 | no:integer; 145 | begin 146 | result:= 'Undefined'; 147 | no:= dcno; 148 | case no of 149 | 1:result:='LIBUSB_BT_WIRELESS_USB_DEVICE_CAPABILITY'; 150 | 2:result:='LIBUSB_BT_USB_2_0_EXTENSION'; 151 | 3:result:='LIBUSB_BT_SS_USB_DEVICE_CAPABILITY'; 152 | 4:result:=' LIBUSB_BT_CONTAINER_ID'; 153 | 154 | end; 155 | end; 156 | 157 | //bmAttributes speed mode 158 | function Getlibusbspeed(dcno:Uint8):string; 159 | var 160 | no:integer; 161 | begin 162 | result:= 'Undefined'; 163 | no:= dcno; 164 | case no of 165 | 1:result:='LIBUSB_LOW_SPEED_OPERATION'; 166 | 2:result:='LIBUSB_FULL_SPEED_OPERATION'; 167 | 3:result:='LIBUSB_HIGH_SPEED_OPERATION'; 168 | 8:result:='LIBUSB_SUPER_SPEED_OPERATION'; 169 | end; 170 | end; 171 | 172 | 173 | function Getlibusboperatingspeed(dcno:Uint8):string; 174 | var 175 | no:integer; 176 | begin 177 | result:= 'Undefined'; 178 | no:= dcno; 179 | case no of 180 | 0:result:='LIBUSB_SPEED_UNKNOWN'; 181 | 1:result:='LIBUSB_SPEED_LOW'; 182 | 2:result:='LIBUSB_SPEED_FULL'; 183 | 3:result:='LIBUSB_SPEED_HIGH'; 184 | 4:result:='LIBUSB_SPEED_SUPER'; 185 | 5:result:='LIBUSB_SPEED_SUPER_PLUS'; 186 | end; 187 | end; 188 | 189 | function endpointdirection(epno:uint8):string; 190 | var 191 | no:integer; 192 | begin 193 | no:= epno; 194 | case no of 195 | 128:result:='LIBUSB_ENDPOINT_IN'; 196 | 0:result:='LIBUSB_ENDPOINT_OUT'; 197 | end; 198 | end; 199 | 200 | 201 | function ExtractbitsRl(value,startbits,bitlength:integer):integer; 202 | begin 203 | result:= ((value shr(9-startbits)-bitlength) and ((1 shl bitlength) -1)); 204 | end; 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | end. 213 | -------------------------------------------------------------------------------- /Src/__history/libusb1helper.pas.~7~: -------------------------------------------------------------------------------- 1 | unit libusb1helper; 2 | 3 | interface 4 | uses libusb1,System.SysUtils, System.Variants,FMX.Dialogs; 5 | 6 | //function libusb_get_device_from_no(device_no:integer):pplibusb_device; 7 | function Getlibusbdeviceclass(dcno:uint8):string; 8 | function Getlibusbdevicetype(dcno:uint8):string; 9 | function endpointdirection(epno:uint8):string; 10 | function Getlibusbcapabilitytype(dcno:uint8):string; 11 | 12 | 13 | implementation 14 | 15 | 16 | (*function libusb_get_device_from_no(device_no:integer):pplibusb_device; 17 | procedure extrainfo(dev: plibusb_device); 18 | var 19 | i,j,k,r,s:integer; 20 | desc:Libusb_device_descriptor; 21 | config:plibusb_config_descriptor; 22 | begin 23 | r:= libusb_get_device_descriptor(dev,@desc); 24 | 25 | if r < 0 then 26 | begin 27 | memo.lines.add('failed to get device descriptor'); 28 | exit; 29 | end 30 | else 31 | begin 32 | //format 33 | memo.lines.add(' VID : '+inttostr(desc.idVendor)+ ' PID : '+inttostr(desc.idProduct)+ 34 | ' Bus '+inttostr(libusb_get_bus_number(dev))+' Device '+inttostr(libusb_get_device_address(dev))); 35 | end; 36 | end; 37 | var 38 | i, count: ssize_t; 39 | r: integer; 40 | devs: pplibusb_device; 41 | handle:plibusb_device_handle; 42 | arrdev: array of plibusb_device; 43 | begin 44 | context := nil; // declare the pointer to null 45 | r := libusb_init(context); 46 | if r <> 0 then 47 | begin 48 | Showmessage('Cannot initialize the DLL Device Value ' + r.ToString + 49 | 'is less than 0'); 50 | if not handle = nil then 51 | begin 52 | libusb_release_interface(handle,0); 53 | libusb_close(handle); 54 | end; 55 | exit; 56 | end 57 | else 58 | begin 59 | count := libusb_get_device_list(context, @devs); 60 | // uses the referenced pointer 61 | setlength(arrdev, count); 62 | libusb_free_device_list(devs, 1); // we now know how many devices there are 63 | 64 | if count < 1 then 65 | begin 66 | memo.lines.add('No devices found '); 67 | exit; 68 | end 69 | else 70 | begin 71 | 72 | libusb_get_device_list(context, @arrdev); // set new devicelist with dev 73 | 74 | memo.lines.add('USB Activate Devices found :' + inttostr(count)); 75 | memo.lines.add(''); 76 | memo.lines.add(' Device VID / PID Device extended Information'); 77 | memo.lines.add('-------------------------------------------------------'); 78 | for i := 0 to count - 1 do 79 | begin 80 | memo.lines.add('USB Device on system - no ' + inttostr(i + 1)); 81 | extrainfo(arrdev[i],memo); 82 | end; 83 | libusb_exit(context); 84 | end; 85 | end; 86 | 87 | 88 | end; *) 89 | 90 | function Getlibusbdeviceclass(dcno:uint8):string; 91 | var 92 | no:integer; 93 | begin 94 | result:= 'Undefined'; 95 | no:= dcno; 96 | case no of 97 | 0:result:='LIBUSB_CLASS_PER_INTERFACE'; 98 | 1: result:='LIBUSB_CLASS_AUDIO' ; 99 | 2: result:='LIBUSB_CLASS_COMM'; 100 | 3: result:= 'LIBUSB_CLASS_HID'; 101 | 5: result:= 'LIBUSB_CLASS_PHYSICAL'; 102 | 7: result:= 'LIBUSB_CLASS_PRINTER'; 103 | 6: result:='LIBUSB_CLASS_PTP or LIBUSB_CLASS_IMAGE'; 104 | 8: result:='LIBUSB_CLASS_MASS_STORAGE'; 105 | 9: result:='LIBUSB_CLASS_HUB'; 106 | 10:result:='LIBUSB_CLASS_DATA'; 107 | 11:result:='LIBUSB_CLASS_SMART_CARD'; 108 | 13 :result:='LIBUSB_CLASS_CONTENT_SECURITY '; 109 | 14:result:='LIBUSB_CLASS_VIDEO'; 110 | 15:result:='LIBUSB_CLASS_PERSONAL_HEALTHCARE'; 111 | 220:result:='LIBUSB_CLASS_DIAGNOSTIC_DEVICE'; 112 | 224:result:='LIBUSB_CLASS_WIRELESS'; 113 | 239:result:='LIBUSB_CLASS_APPLICATION'; 114 | 255:result:='LIBUSB_CLASS_VENDOR_SPEC'; 115 | end; 116 | end; 117 | 118 | //bmdescriptortype 119 | function Getlibusbdevicetype(dcno:Uint8):string; 120 | var 121 | no:integer; 122 | begin 123 | result:= 'Undefined'; 124 | no:= dcno; 125 | case no of 126 | 1: result:='LIBUSB_DT_DEVICE'; 127 | 2:result:='LIBUSB_DT_CONFIG'; 128 | 3:result:='LIBUSB_DT_STRING'; 129 | 4:result:='LIBUSB_DT_INTERFACE'; 130 | 5:result:='LIBUSB_DT_ENDPOINT'; 131 | 15:result:='LIBUSB_DT_BOS'; 132 | 16:result:='LIBUSB_DT_DEVICE_CAPABILITY'; 133 | 33:result:='LIBUSB_DT_HID'; 134 | 34:result:= 'LIBUSB_DT_REPORT'; 135 | 36:result:='LIBUSB_DT_PHYSICAL'; 136 | 41:result:='LIBUSB_DT_HUB'; 137 | 42:result:='LIBUSB_DT_SUPERSPEED_HUB'; 138 | 48:result:='LIBUSB_DT_SS_ENDPOINT_COMPANION'; 139 | end; 140 | end; 141 | //bmDevCapibilitytype 142 | function Getlibusbcapabilitytype(dcno:Uint8):string; 143 | var 144 | no:integer; 145 | begin 146 | result:= 'Undefined'; 147 | no:= dcno; 148 | case no of 149 | 1:result:='LIBUSB_BT_WIRELESS_USB_DEVICE_CAPABILITY'; 150 | 2:result:='LIBUSB_BT_USB_2_0_EXTENSION'; 151 | 3:result:='LIBUSB_BT_SS_USB_DEVICE_CAPABILITY'; 152 | 4:result:=' LIBUSB_BT_CONTAINER_ID'; 153 | 154 | end; 155 | end; 156 | 157 | //bmAttributes speed mode 158 | function Getlibusbspeed(dcno:Uint8):string; 159 | var 160 | no:integer; 161 | begin 162 | result:= 'Undefined'; 163 | no:= dcno; 164 | case no of 165 | 1:result:='LIBUSB_LOW_SPEED_OPERATION'; 166 | 2:result:='LIBUSB_FULL_SPEED_OPERATION'; 167 | 3:result:='LIBUSB_HIGH_SPEED_OPERATION'; 168 | 8:result:='LIBUSB_SUPER_SPEED_OPERATION'; 169 | end; 170 | end; 171 | 172 | 173 | function Getlibusboperatingspeed(dcno:Uint8):string; 174 | var 175 | no:integer; 176 | begin 177 | result:= 'Undefined'; 178 | no:= dcno; 179 | case no of 180 | 0:result:='LIBUSB_SPEED_UNKNOWN'; 181 | 1:result:='LIBUSB_SPEED_LOW'; 182 | 2:result:='LIBUSB_SPEED_FULL'; 183 | 3:result:='LIBUSB_SPEED_HIGH'; 184 | 4:result:='LIBUSB_SPEED_SUPER'; 185 | 5:result:='LIBUSB_SPEED_SUPER_PLUS'; 186 | end; 187 | end; 188 | 189 | function endpointdirection(epno:uint8):string; 190 | var 191 | no:integer; 192 | begin 193 | no:= epno; 194 | case no of 195 | 128:result:='LIBUSB_ENDPOINT_IN'; 196 | 0:result:='LIBUSB_ENDPOINT_OUT'; 197 | end; 198 | end; 199 | 200 | 201 | function ExtractbitsRl(value,startbits,bitlength:integer):integer; 202 | begin 203 | result:= ((value shr(9-startbits)-bitlength) and ((1 shl bitlength) -1)); 204 | end; 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | end. 213 | -------------------------------------------------------------------------------- /Src/libusb1helper.pas: -------------------------------------------------------------------------------- 1 | unit libusb1helper; 2 | 3 | interface 4 | uses libusb1,System.SysUtils, System.Variants,FMX.Dialogs; 5 | 6 | function Getlibusbdeviceclass(dcno:uint8):string; 7 | function Getlibusbdevicetype(dcno:uint8):string; 8 | function endpointdirection(epno:uint8):string; 9 | function Getlibusbcapabilitytype(dcno:uint8):string; 10 | 11 | 12 | implementation 13 | 14 | function Getlibusbdeviceclass(dcno:uint8):string; 15 | var 16 | no:integer; 17 | begin 18 | result:= 'Undefined'; 19 | no:= dcno; 20 | case no of 21 | 0:result:='LIBUSB_CLASS_PER_INTERFACE'; 22 | 1: result:='LIBUSB_CLASS_AUDIO' ; 23 | 2: result:='LIBUSB_CLASS_COMM'; 24 | 3: result:= 'LIBUSB_CLASS_HID'; 25 | 5: result:= 'LIBUSB_CLASS_PHYSICAL'; 26 | 7: result:= 'LIBUSB_CLASS_PRINTER'; 27 | 6: result:='LIBUSB_CLASS_PTP or LIBUSB_CLASS_IMAGE'; 28 | 8: result:='LIBUSB_CLASS_MASS_STORAGE'; 29 | 9: result:='LIBUSB_CLASS_HUB'; 30 | 10:result:='LIBUSB_CLASS_DATA'; 31 | 11:result:='LIBUSB_CLASS_SMART_CARD'; 32 | 13 :result:='LIBUSB_CLASS_CONTENT_SECURITY '; 33 | 14:result:='LIBUSB_CLASS_VIDEO'; 34 | 15:result:='LIBUSB_CLASS_PERSONAL_HEALTHCARE'; 35 | 220:result:='LIBUSB_CLASS_DIAGNOSTIC_DEVICE'; 36 | 224:result:='LIBUSB_CLASS_WIRELESS'; 37 | 239:result:='LIBUSB_CLASS_APPLICATION'; 38 | 255:result:='LIBUSB_CLASS_VENDOR_SPEC'; 39 | end; 40 | end; 41 | 42 | //bmdescriptortype 43 | function Getlibusbdevicetype(dcno:Uint8):string; 44 | var 45 | no:integer; 46 | begin 47 | result:= 'Undefined'; 48 | no:= dcno; 49 | case no of 50 | 1: result:='LIBUSB_DT_DEVICE'; 51 | 2:result:='LIBUSB_DT_CONFIG'; 52 | 3:result:='LIBUSB_DT_STRING'; 53 | 4:result:='LIBUSB_DT_INTERFACE'; 54 | 5:result:='LIBUSB_DT_ENDPOINT'; 55 | 15:result:='LIBUSB_DT_BOS'; 56 | 16:result:='LIBUSB_DT_DEVICE_CAPABILITY'; 57 | 33:result:='LIBUSB_DT_HID'; 58 | 34:result:= 'LIBUSB_DT_REPORT'; 59 | 36:result:='LIBUSB_DT_PHYSICAL'; 60 | 41:result:='LIBUSB_DT_HUB'; 61 | 42:result:='LIBUSB_DT_SUPERSPEED_HUB'; 62 | 48:result:='LIBUSB_DT_SS_ENDPOINT_COMPANION'; 63 | end; 64 | end; 65 | //bmDevCapibilitytype 66 | function Getlibusbcapabilitytype(dcno:Uint8):string; 67 | var 68 | no:integer; 69 | begin 70 | result:= 'Undefined'; 71 | no:= dcno; 72 | case no of 73 | 1:result:='LIBUSB_BT_WIRELESS_USB_DEVICE_CAPABILITY'; 74 | 2:result:='LIBUSB_BT_USB_2_0_EXTENSION'; 75 | 3:result:='LIBUSB_BT_SS_USB_DEVICE_CAPABILITY'; 76 | 4:result:=' LIBUSB_BT_CONTAINER_ID'; 77 | 78 | end; 79 | end; 80 | 81 | //bmAttributes speed mode 82 | function Getlibusbspeed(dcno:Uint8):string; 83 | var 84 | no:integer; 85 | begin 86 | result:= 'Undefined'; 87 | no:= dcno; 88 | case no of 89 | 1:result:='LIBUSB_LOW_SPEED_OPERATION'; 90 | 2:result:='LIBUSB_FULL_SPEED_OPERATION'; 91 | 3:result:='LIBUSB_HIGH_SPEED_OPERATION'; 92 | 8:result:='LIBUSB_SUPER_SPEED_OPERATION'; 93 | end; 94 | end; 95 | 96 | 97 | function Getlibusboperatingspeed(dcno:Uint8):string; 98 | var 99 | no:integer; 100 | begin 101 | result:= 'Undefined'; 102 | no:= dcno; 103 | case no of 104 | 0:result:='LIBUSB_SPEED_UNKNOWN'; 105 | 1:result:='LIBUSB_SPEED_LOW'; 106 | 2:result:='LIBUSB_SPEED_FULL'; 107 | 3:result:='LIBUSB_SPEED_HIGH'; 108 | 4:result:='LIBUSB_SPEED_SUPER'; 109 | 5:result:='LIBUSB_SPEED_SUPER_PLUS'; 110 | end; 111 | end; 112 | 113 | function endpointdirection(epno:uint8):string; 114 | var 115 | no:integer; 116 | begin 117 | no:= epno; 118 | case no of 119 | 128:result:='LIBUSB_ENDPOINT_IN'; 120 | 0:result:='LIBUSB_ENDPOINT_OUT'; 121 | end; 122 | end; 123 | 124 | 125 | function ExtractbitsRl(value,startbits,bitlength:integer):integer; 126 | begin 127 | result:= ((value shr(9-startbits)-bitlength) and ((1 shl bitlength) -1)); 128 | end; 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | end. 137 | -------------------------------------------------------------------------------- /Windows Dll's V1.0.22.11297/Win32/libusb-1.0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYHPRO/Delphi-libusb/79d74d5466e6d588f0defa8fff75c67cf98429c0/Windows Dll's V1.0.22.11297/Win32/libusb-1.0.dll -------------------------------------------------------------------------------- /Windows Dll's V1.0.22.11297/Win64/libusb-1.0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYHPRO/Delphi-libusb/79d74d5466e6d588f0defa8fff75c67cf98429c0/Windows Dll's V1.0.22.11297/Win64/libusb-1.0.dll -------------------------------------------------------------------------------- /media/3316d2a33f3684da8b72c9b55c16419b.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYHPRO/Delphi-libusb/79d74d5466e6d588f0defa8fff75c67cf98429c0/media/3316d2a33f3684da8b72c9b55c16419b.gif -------------------------------------------------------------------------------- /media/5e7e326f1cac06cde584741d41543d22.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYHPRO/Delphi-libusb/79d74d5466e6d588f0defa8fff75c67cf98429c0/media/5e7e326f1cac06cde584741d41543d22.gif -------------------------------------------------------------------------------- /media/c073bd0e0ba1bc6330590f0f04173b5f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYHPRO/Delphi-libusb/79d74d5466e6d588f0defa8fff75c67cf98429c0/media/c073bd0e0ba1bc6330590f0f04173b5f.png -------------------------------------------------------------------------------- /media/c3c7bec784993da828c9302fc8b567f3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYHPRO/Delphi-libusb/79d74d5466e6d588f0defa8fff75c67cf98429c0/media/c3c7bec784993da828c9302fc8b567f3.gif -------------------------------------------------------------------------------- /media/de3d28c2bba393cb3b591ed27c01b0d5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZYHPRO/Delphi-libusb/79d74d5466e6d588f0defa8fff75c67cf98429c0/media/de3d28c2bba393cb3b591ed27c01b0d5.gif --------------------------------------------------------------------------------