Seite 2 von 3

Re: libusb-1.0 Include for Linux

Verfasst: 31.03.2016 10:43
von NicTheQuick
Ich hab hier mal alles in ein ZIP gepackt. In 'wrapper.pbi' ist ein kleines Beispiel enthalten und natürlich der noch nicht fertig gestellte Wrapper. Auf Windows hab ich es noch nicht getestet, aber unter Linux läuft es wunderbar, wenn das Paket libusb-1.0-0-dev installiert ist.

Edit: Hier der Link: https://cloud.goeddel.net/index.php/s/HwkXCDHLNASPSAT :lol:

Re: libusb-1.0 Include for Linux

Verfasst: 31.03.2016 16:58
von ProgOldie
Danke fürs Packen, aber der Link fehlt leider.

Re: libusb-1.0 Include for Linux

Verfasst: 31.03.2016 17:22
von NicTheQuick
:lol:
Siehe oben. :wink:

Re: libusb-1.0 Include for Linux

Verfasst: 28.05.2016 20:15
von Sicro
Das ausgepackte Download-Paket wird zum CodeArchiv unter Hardware/pbusb hinzugefügt.

Re: libusb-1.0 Include for Linux

Verfasst: 22.05.2017 18:39
von Sicro
Folgende Fehler werden bei den Codes deiner ZIP-Datei ausgegeben:

Code: Alles auswählen

Check file: pbusb/backend/core.pbi
******************************************
PureBasic 5.60 (Linux - x64)
******************************************
Loading external modules...
Starting syntax check...
Starting compilation...
Including source: pbusb/backend//backend.pbi
Error: Line 175 - Structure field not found: _ctx.
at line 1 of the expanded macro (Macro.out)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Check file: pbusb/backend/util.pbi
******************************************
PureBasic 5.60 (Linux - x64)
******************************************
Loading external modules...
Starting syntax check...
Starting compilation...
Error: Line 53 - The module procedure 'ctrl_direction()' has been declared but not defined.

Re: libusb-1.0 Include for Linux

Verfasst: 04.09.2018 00:17
von vwidmer
Sorry I only find here this libusb code.

when I run the example code I get some strange characters.

Code: Alles auswählen

Version: 1.0.22.11312琀潯洠湡⁹潣普杩牵瑡潩獮搀獥牴祯搠癥捩⁥搥┮d敮 (瑨灴⼺氯扩獵⹢湩潦)
䥌啂䉓卟䍕䕃卓⼠䰠䉉单彂剔乁䙓剅䍟䵏䱐呅䑅
*context = 94641999562272
Bus 004 Device 013: ID 04E8:6860 䅓卍乕G 䅓卍乕彇湁牤楯d
[ERR] LIBUSB::openDevice: 䥌啂䉓䕟剒剏䅟䍃卅S䥌啂䉓䕟剒剏也彏䕄䥖䕃䰀䉉单
Bus 004 Device 002: ID 8087:0024
[ERR] LIBUSB::openDevice: 䥌啂䉓䕟剒剏䅟䍃卅S䥌啂䉓䕟剒剏也彏䕄䥖䕃䰀䉉单
Bus 004 Device 001: ID 1D6B:0002
[ERR] LIBUSB::openDevice: 䥌啂䉓䕟剒剏䅟䍃卅S䥌啂䉓䕟剒剏也彏䕄䥖䕃䰀䉉单
Bus 003 Device 006: ID 5986:02D5
Bus 003 Device 005: ID 0A5C:21E6 牂慯捤浯䌠牯p 䍂㉍㜰㈰ぁ
[ERR] LIBUSB::openDevice: 䥌啂䉓䕟剒剏䅟䍃卅S䥌啂䉓䕟剒剏也彏䕄䥖䕃䰀䉉单
Bus 003 Device 004: ID 147E:2020
[ERR] LIBUSB::openDevice: 䥌啂䉓䕟剒剏䅟䍃卅S䥌啂䉓䕟剒剏也彏䕄䥖䕃䰀䉉单
Bus 003 Device 037: ID 04D8:F8B9
[ERR] LIBUSB::openDevice: 䥌啂䉓䕟剒剏䅟䍃卅S䥌啂䉓䕟剒剏也彏䕄䥖䕃䰀䉉单
Bus 003 Device 002: ID 8087:0024
[ERR] LIBUSB::openDevice: 䥌啂䉓䕟剒剏䅟䍃卅S䥌啂䉓䕟剒剏也彏䕄䥖䕃䰀䉉单
Bus 003 Device 001: ID 1D6B:0002
[ERR] LIBUSB::openDevice: 䥌啂䉓䕟剒剏䅟䍃卅S䥌啂䉓䕟剒剏也彏䕄䥖䕃䰀䉉单
Bus 002 Device 001: ID 1D6B:0003
[ERR] LIBUSB::openDevice: 䥌啂䉓䕟剒剏䅟䍃卅S䥌啂䉓䕟剒剏也彏䕄䥖䕃䰀䉉单
Bus 001 Device 001: ID 1D6B:0002 
I see a lot of weird text. Any one know how to fix this?

Thank you.

Re: libusb-1.0 Include for Linux

Verfasst: 19.09.2018 18:13
von NicTheQuick
I guess the problem is that Purebasic now only supports Unicode. So I need to change some things in the library to make it compatible for Unicode.

Re: libusb-1.0 Include for Linux

Verfasst: 19.09.2018 18:37
von DePe
Bei mir lese ich den Fehlernamen und die Beschreibung so ein:

Code: Alles auswählen

Import "libusb-1.0.22.lib"
libusb_error_name.i(iErrorCode.i)
libusb_strerror.i(iErrorCode.i)
EndImport

*sUTF8 = libusb_strerror(iErrorCode)
sReturn = PeekS(*sUTF8, 200, #PB_UTF8)

*sASCII = libusb_error_name(iErrorCode)
sReturn = PeekS(*sASCII, 100, #PB_Ascii)
Peter

Re: libusb-1.0 Include for Linux

Verfasst: 19.09.2018 23:31
von NicTheQuick
Hm, ich hab jetzt alles probiert. Ich bekomme überall nur chinesische Zeichen. :lol:

Vielleicht hab ich mal mehr Zeit und erörtere das Problem näher.

Re: libusb-1.0 Include for Linux

Verfasst: 20.09.2018 10:09
von juergenkulow
Hallo vwidmer,

Code: Alles auswählen

s.s="琀潯洠湡⁹潣普杩牵瑡潩獮搀獥牴祯搠癥捩⁥搥┮d敮 (瑨灴⼺氯扩獵⹢湩潦)䥌啂䉓卟䍕䕃卓⼠䰠䉉单彂剔乁䙓剅䍟䵏䱐呅䑅"
s+Space(7)+"䅓卍乕G 䅓卍乕彇湁牤楯d"
s+Space(3)+" 䥌啂䉓䕟剒剏䅟䍃卅S䥌啂䉓䕟剒剏也彏䕄䥖䕃䰀䉉单"
s+Space(7)+"牂慯捤浯䌠牯p 䍂㉍㜰㈰ぁ"
ShowMemoryViewer(@s,Len(s)*2)
; 0000000001F45430  00 74 6F 6F 20 6D 61 6E 79 20 63 6F 6E 66 69 67  .too many config
; 0000000001F45440  75 72 61 74 69 6F 6E 73 00 64 65 73 74 72 6F 79  urations.destroy
; 0000000001F45450  20 64 65 76 69 63 65 20 25 64 2E 25 64 00 6E 65   device %d.%d.ne
; 0000000001F45460  20 00 28 00 68 74 74 70 3A 2F 2F 6C 69 62 75 73   .(.http://libus
; 0000000001F45470  62 2E 69 6E 66 6F 29 00 4C 49 42 55 53 42 5F 53  b.info).LIBUSB_S
; 0000000001F45480  55 43 43 45 53 53 20 2F 20 4C 49 42 55 53 42 5F  UCCESS / LIBUSB_
; 0000000001F45490  54 52 41 4E 53 46 45 52 5F 43 4F 4D 50 4C 45 54  TRANSFER_COMPLET
; 0000000001F454A0  45 44 20 00 20 00 20 00 20 00 20 00 20 00 20 00  ED . . . . . . .
; 0000000001F454B0  53 41 4D 53 55 4E 47 00 20 00 53 41 4D 53 55 4E  SAMSUNG. .SAMSUN
; 0000000001F454C0  47 5F 41 6E 64 72 6F 69 64 00 20 00 20 00 20 00  G_Android. . . .
; 0000000001F454D0  20 00 4C 49 42 55 53 42 5F 45 52 52 4F 52 5F 41   .LIBUSB_ERROR_A
; 0000000001F454E0  43 43 45 53 53 00 4C 49 42 55 53 42 5F 45 52 52  CCESS.LIBUSB_ERR
; 0000000001F454F0  4F 52 5F 4E 4F 5F 44 45 56 49 43 45 00 4C 49 42  OR_NO_DEVICE.LIB
; 0000000001F45500  55 53 20 00 20 00 20 00 20 00 20 00 20 00 20 00  US . . . . . . .
; 0000000001F45510  42 72 6F 61 64 63 6F 6D 20 43 6F 72 70 00 20 00  Broadcom Corp. .
; 0000000001F45520  42 43 4D 32 30 37 30 32 41 30                    BCM20702A0