Code refactoring. Using LibUsb async transfer.

This commit is contained in:
radiomanV 2025-02-03 01:54:52 +02:00
parent 523e70fc92
commit 96ace87a0d
7 changed files with 835 additions and 456 deletions

View File

@ -65,5 +65,10 @@ cp -R TL866_Updater.app /Applications
```
### InfoicDump utility
This utility can dump the `infoic.dll` and `infoic2plus.dll` to an XML format database.
This utility can dump the `infoic.dll` and `infoic2plus.dll` to an XML format database.
More information on this here: [InfoicDump](https://github.com/radiomanV/TL866/tree/master/InfoIcDump#infoicdump)
### WineLib wrapper
This library provide an easy way to make Minipro/Xgpro software work in Linux.
More information on this here: [Wine](https://github.com/radiomanV/TL866/tree/master/wine#)

View File

@ -23,7 +23,10 @@ SUBSYSTEM!="usb", GOTO="minipro_rules_end"
# TL866A/CS
ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="e11c", ENV{ID_MINIPRO}="1"
# TL866II+
# TL866II+, T48, T56
ATTRS{idVendor}=="a466", ATTRS{idProduct}=="0a53", ENV{ID_MINIPRO}="1"
# T76
ATTRS{idVendor}=="a466", ATTRS{idProduct}=="1a86", ENV{ID_MINIPRO}="1"
LABEL="minipro_rules_end"

View File

@ -2,9 +2,15 @@ SRCDIR = .
DLL = setupapi.dll
### Common settings
CFLAGS =
CFLAGS =
CEXTRA = -m32 -mincoming-stack-boundary=2
LIBRARIES = -lusb-1.0 -ludev
LIBRARIES = -lusb-1.0
ifeq ($(hotplug),udev)
CFLAGS += -DUDEV
LIBRARIES += -ludev
endif
### setupapi.dll sources and settings

View File

@ -1,21 +0,0 @@
Simple low level winelib usb wrapper for the TL866A/CS, TL866II+ and Xgecu T56 programmers
This version will autodetect the software used.
Add the following rule to the udev subsystem:
sudo cp ./udev/* /etc/udev/rules.d/ && sudo udevadm trigger
How to install:
1. Install wine, libusb
2. Copy the provided setupapi.dll file in the Minipro or Xgpro folder
3. Run the Minipro.exe or Xgpro.exe
How to compile:
1. Install wine, wine-devel, libusb-devel, libudev-devel packages
2. Run make
3. Rename the setup.dll.so file as setupapi.dll and copy this file in the Minipro/Xgpro folder
You should install the 32 bit version of the libusb library (Debian users libusb-1.0-0:i386, Arch users lib32-libusb)
To compile the debug version pass the DBG define to make like this: make CFLAGS=-DDBG. This will print to console all the usb communication.

48
wine/readme.md Normal file
View File

@ -0,0 +1,48 @@
## Simple low level winelib usb wrapper for the Minipro TL866A/CS, TL866II+, Xgecu T48, T56 and T76 programmers.
#### Installing the udev rules:
Add the following rules to the udev subsystem:
```nohighlight
sudo cp ./udev/* /etc/udev/rules.d/ && sudo udevadm control --reload-rules && sudo udevadm trigger
```
This will grant you permission to run the software as regular user, otherwise you must be a superuser.
#### How to install:
1. Install `wine`, `libusb` and `libudev` packages
You should install the 32 bit version of `LibUsb` and `libudev` and create a 32 bit wine prefix:
```nohighlight
sudo apt install libusb-1.0-0:i386 libudev1:i386
WINEPREFIX="$HOME/wine32" WINEARCH=win32 wine wineboot
```
2. Copy the provided setupapi.dll file in the Minipro or Xgpro folder
3. Run the `Minipro.exe`, `Xgpro.exe` or `Xgpro_T76.exe` using `wine`:
```nohighlight
WINEPREFIX="$HOME/wine32" wine ./Xgpro.exe 2>/dev/null
```
If you already have a default 32 bit `wine` prefix located in `$HOME/.wine` you can use it without creating a new one:
```nohighlight
wine ./Xgpro.exe 2>/dev/null
```
#### How to compile:
1. Install `wine`, `wine-devel`, `libusb-1.0-0-dev:i386`, `libudev-dev:i386` packages
2. Run `make hotplug=udev` to compile the `setupapi.dll` using `udev` library for hotplug notifications subsystem.
Running only `make` will compile the `setupapi.dll` using `libusb` library for handling hotplug events which can
be useful if `udev` subsystem is not available in your OS.
4. Rename the compiled `setupapi.dll.so` file as `setupapi.dll` and copy this file in the Minipro/Xgpro folder
#### Debugging:
Running this in a terminal session:
```nohighligh
TL_DEBUG=1 wine ./Xgpro.exe or TL_DEBUG=1 wine ./Xgpro.exe 2>/dev/null
```
will dump all usb communication to the console which can be very useful when something goes wrong.
The `2>/dev/null` will redirect the `stderr` to `/dev/null` thus cancelling the wine debugging messages which can be
very annoying sometime.

File diff suppressed because it is too large Load Diff

BIN
wine/setupapi.dll Executable file → Normal file

Binary file not shown.