Recently I created the Open-Source Delphi LibUSB x86 / x64 library with Examples. Refer to the LibUSB Library for more in-depth info.
For further updates, I wrote an article about the Libusb Library here: https://bayeseanblog.com/blog/delphi-libusb-library-introduction/28 and further information on the library can be found at the Wiki Page which provides an indepth view https://github.com/Greg-Bayes/Delphi-libusb/wiki
To further assist the Developer, I found two more tools to assist when working with the Libusb Project.
To solve these issues, two great applications are available that can help to solve these possible situations.
This Microsoft Windows 10 application will help you with obtaining all the connection information of your device that you will be working with.
This application will install a signed driver for your device on Windows 10 and offers different driver choices. Libusb will connect to all the driver choices although it must be noted that certain drivers may only support Synchronous connections only and may not support plug n’ play features.
SO here’s an in-depth understanding of the two complimentary helper apps that can be used to make working with your project a little easier.
USBView.exe or known as Universal Serial Bus Viewer is a Windows graphical user interface application that enables you to browse all USB controllers and connected USB devices on your computer. It can work on all windows versions.
With the use of Delphi Libusb in play, it allows your application to talk directly to your windows usb device. The information that the USBVIEW creates will provide all required information about the device to assist you in creating a connection to your device and set up transferring of data between your windows device and the usb device.
This is a recommended helper tool that you should use for your Delphi Libusb Library translated by me found in my direct Github Repository.
Where to get USBView
If you have a Delphi Enterprise and up IDE then by default, the Windows 10 SDK Kit is installed.
First check to see if it is available on your Windows 10 operating system, if not then you can follow the steps below to install the SDK.
Download and install the Windows SDK from here
If you only require this helper tool then, select just the Debugging Tools for Windows box and clear all the other boxes during installation.
By default the USBView directory for a X64 PC will be installed to this directory.
Navigate to the kits debugger directory for the processor type you are running and click on usbview.exe to start the utility.
USBView is also available in the Windows driver samples repository on GitHub with all its source code however it is easier to download it from the Windows directory.
If it is installed and you have an empty Debugger folder then the debugger apps were not installed.
It is easy to enable these apps without downloading the kit SDK again by doing the following:-
open Apps & features (right click on Windows sign bottom left),on the dropdown screen- select Apps and Features.
Scroll to Windows SDK and select Modify.
Check the debugging tools for Windows – to install the tools.
USBView can enumerate USB host controllers, USB hubs, and attached USB devices. It can also query information about the devices from the registry and through USB requests to the devices.
The main USBView window contains two panes. The left pane displays a connection-oriented tree view, enabling you to select any USB device.
The right pane displays the USB data structures that pertain to the selected USB device. These structures include Device, Configuration, Interface, and Endpoint Descriptors, as well as the current device configuration.
For development this tool will provide the Busses and EP in and EP out points required in your application to read and write to your usb device. Whilst this information can be obtained through extracting it directly using the Delphi Libusb library, USBVIEW will speed up your development time by giving you all required information instantly. You can then focus on connecting reading and writing information to the USB device.
This tool packs out the ports of your USB Enhanced Host Controller. Each connected port will show the Device name.
It provides extensive data on all aspects of the device such as the following:-
Full Configuration Descriptors
Interface Descriptor (multiple)
(this has detailed required information)
Endpoint Descriptors (multiple)
(this has detailed required information)
For Video Specific the following
Class –Specific Video Control Interfaces Header Description
Video Control POutput Terminal Descriptor
Video Control Extension Unit Descriptor
Video Control Input Terminal Descriptor
Video Control Processing Unit Descriptor
Class Specific Interrupt Endpoint Descriptor
Video Class Specific VS Video Input Header Descriptor
Video streaming Uncompressed Format Type Descriptors
Color Matching Descriptor
Video Streaming MJPEG Format Descriptor
Above is demonstrating how easy it is to obtain the IN- ENDPOINT info $82(0x82) of the interrupt transfer type endpoint descriptor. The endpoint byte info can be added to your application to read that endpoint.
This tool should make it much quicker for you to code the usb to production level.
Zadig.exe is a Windows application that installs generic drivers, such as WinUSB, LibUSB-win32/libusb0.sys or libusbK.
What is its purpose?
Download the Application executable and run it. First plug in the USB-device to be set up then read the device by selecting “List All Device’s” from the options menu. Select your device from the drop down menu. Then select the type of driver that you require. Then install the driver. Zadig will install a signed Windows 10 driver behind the scenes. Once this is done, you are good to go.
Refer to the usage guide for more info and also reference to libwidi which allows the use of installing the driver using the inno-scripts whilst installing your own app.
Using these two apps saved me a lot of time with a device that was not recognised and then to identify the actual endpoints to use in my application without having to create my own Libusb helper application which might not give you all the information required.
I hope this helps you.
August 2019Delphi Delimited String to Fields
June 2019Delphi A Professional VCL DBGrid Part Four
May 2019Delphi A Professional VCL DBGrid Part Three
April 2019Delphi A Professional VCL DBGrid Part Two
March 2019Delphi A Professional VCL DBGrid Part One
November 2018Delphi VCL Buttons in DBGrid
October 2018Two Helper Apps for Delphi LibUSB
September 2018Delphi Libusb Library Introduction
August 2018Delphi Object directly to a Json string in a REST Client
July 2018Delphi FMX Leaflet Plotter using OSM Maps
June 2018C2PAS32 Convertor Application
May 2018Delphi PDF Embedded viewer with PDF.js
March 2018Delphi FMX - Changing TCharacter to TCharHelper
January 2018Delphi FMX Dashboard using Chart.JS
December 2017PHP Slim REST Server & Delphi Auth Part 5
November 2017Delphi FMX REST Client App Part 4
October 2017Delphi VCL REST Pricing Client App Part 3
September 2017Delphi REST VCL Client Basic Auth Part 2B
August 2017Delphi REST Client Part 2A
July 2017PHP REST Server and Delphi Client Intro
June 2017Delphi SQLite Encryptor-Decryptor Tool
May 2017Create a Visual IP Address Geolocation with PHP
March 2017PHP Downloader using Countdown timer
January 2017Morris Charts and PHP-PDO
December 2016CSS to create a functional Toggle Button