Access a USB device from PB?

Just starting out? Need help? Post your questions and find answers here.
RobertRioja
User
User
Posts: 80
Joined: Thu May 02, 2019 3:57 am
Location: USA
Contact:

Access a USB device from PB?

Post by RobertRioja »

Is there a way to access a USB device from PB? Is there a library?

I tried to search the forum for "USB" but the search function will not accept words of less than 4 characters!
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4946
Joined: Sun Apr 12, 2009 6:27 am

Re: Access a USB device from PB?

Post by RASHAD »

Hi
What kind of USB device ?
HDD , BT , Wireless Mouse ...etc
And what do you want to do with it
Egypt my love
User avatar
idle
Always Here
Always Here
Posts: 5836
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Access a USB device from PB?

Post by idle »

you will need a library unless the usb appears as a serial port or drive
see https://github.com/libusb/hidapi
I have hidapi build for windows x86/x64 if you need to access a hid device.
juergenkulow
Enthusiast
Enthusiast
Posts: 581
Joined: Wed Sep 25, 2019 10:18 am

Re: Access a USB device from PB?

Post by juergenkulow »

User avatar
blueb
Addict
Addict
Posts: 1111
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Re: Access a USB device from PB?

Post by blueb »

Much like juergenkulow's suggestion..

I've bookmarked my web browser to: https://www.google.com/advanced_search?hl=en-DE&fg=1
(Google's advanced search page).. it allows 3 character searches.

In this case:
all these words:USB
desired site search is: www.purebasic.fr
- It was too lonely at the top.

System : PB 6.21(x64) and Win 11 Pro (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
RobertRioja
User
User
Posts: 80
Joined: Thu May 02, 2019 3:57 am
Location: USA
Contact:

Re: Access a USB device from PB?

Post by RobertRioja »

Thank you all for your replies!!!

Idle: Please send me the Win64 library, or tell me how to get it. Thanks.

I downloaded the library that User_Russian posted but it asks for another lib called MISC, which I cannot find.

Thank you
Robert
User avatar
idle
Always Here
Always Here
Posts: 5836
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Access a USB device from PB?

Post by idle »

check you Messages for include and dll
RobertRioja
User
User
Posts: 80
Joined: Thu May 02, 2019 3:57 am
Location: USA
Contact:

Re: Access a USB device from PB?

Post by RobertRioja »

Idle: Thank you for the library. I cannot find documentation on how to use it, routine names, parameters, etc. Where can I find it?

Thanks,
Robert
User avatar
idle
Always Here
Always Here
Posts: 5836
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Access a USB device from PB?

Post by idle »

RobertRioja wrote: Thu May 16, 2024 12:41 am Idle: Thank you for the library. I cannot find documentation on how to use it, routine names, parameters, etc. Where can I find it?

Thanks,
Robert
should be docs and examples here
https://github.com/libusb/hidapi
RobertRioja
User
User
Posts: 80
Joined: Thu May 02, 2019 3:57 am
Location: USA
Contact:

Re: Access a USB device from PB?

Post by RobertRioja »

Idle,

Thanks again.
Robert
AZJIO
Addict
Addict
Posts: 2141
Joined: Sun May 14, 2017 1:48 am

Re: Access a USB device from PB?

Post by AZJIO »

If it is a USB drive, then it is easier to use WM_DEVICECHANGE
RobertRioja
User
User
Posts: 80
Joined: Thu May 02, 2019 3:57 am
Location: USA
Contact:

Re: Access a USB device from PB?

Post by RobertRioja »

AZJIO,
Thank you.
Robert
Post Reply