It is currently Thu Dec 12, 2019 9:37 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Support for USB devices in PureBasic?
PostPosted: Sun Oct 06, 2019 12:35 am 
Offline
New User
New User

Joined: Sat Sep 05, 2009 11:08 pm
Posts: 7
Hello all, I'm considering PureBasic for a cross-platform software project (Windows/Linux), but I could not find information as to whether PureBasic supports communication with USB devices (other than mouse, keyboard, game controllers) out of the box, i.e. without the use of OS APIs. In my case, it's a self-developed USB device using the USB HID standard for sending data to the PC. Are there commands in PureBasic to access such a device directly? I assume I could achieve that via Windows/Linux APIs, but it would be nicer and easier to have platform-independent code.


Top
 Profile  
Reply with quote  
 Post subject: Re: Support for USB devices in PureBasic?
PostPosted: Sun Oct 06, 2019 12:55 am 
Offline
Addict
Addict
User avatar

Joined: Tue Nov 09, 2010 10:15 pm
Posts: 1579
I don't believe it's in the documentation, but if you try a search you might find something suitable.
Here's an old thread from 2010-2017
viewtopic.php?t=41729


Top
 Profile  
Reply with quote  
 Post subject: Re: Support for USB devices in PureBasic?
PostPosted: Sun Oct 06, 2019 1:01 am 
Offline
Addict
Addict
User avatar

Joined: Tue Nov 09, 2010 10:15 pm
Posts: 1579
Or this:
viewtopic.php?t=71931

Both links found with this:
https://duckduckgo.com/?q=hid+usb+site% ... ish&ia=web


Top
 Profile  
Reply with quote  
 Post subject: Re: Support for USB devices in PureBasic?
PostPosted: Sun Oct 06, 2019 1:17 am 
Offline
New User
New User

Joined: Sat Sep 05, 2009 11:08 pm
Posts: 7
Thank you, I meanwhile also found that Russian HID library. However, it seems to be Windows only. I had hoped for something that would fully encapsulate the OS API calls, allowing us to use the same code on all platforms.


Top
 Profile  
Reply with quote  
 Post subject: Re: Support for USB devices in PureBasic?
PostPosted: Sun Oct 06, 2019 7:28 am 
Offline
Addict
Addict
User avatar

Joined: Sun Nov 05, 2006 11:42 pm
Posts: 4545
Location: Lyon - France
Native library will be great and very very usefull...today all is usb :|
Thanks for the links Tenaja 8)

_________________
ImageThe happiness is a road...
Not a destination


Top
 Profile  
Reply with quote  
 Post subject: Re: Support for USB devices in PureBasic?
PostPosted: Sun Oct 06, 2019 11:02 am 
Offline
Addict
Addict

Joined: Wed Nov 12, 2008 5:01 pm
Posts: 1056
Location: Russia
laserjones wrote:
I assume I could achieve that via Windows/Linux APIs
The USB HID API is available on Windows only. On Linux and MacOS X need use libudev.

_________________
Library XP_Menu_Lib - office menu; HID_Lib - USB Library
Torrent client - pbTorrent (source code); Create driver in PureBasic.


Top
 Profile  
Reply with quote  
 Post subject: Re: Support for USB devices in PureBasic?
PostPosted: Sun Oct 06, 2019 11:36 am 
Offline
New User
New User

Joined: Sat Sep 05, 2009 11:08 pm
Posts: 7
User_Russian wrote:
laserjones wrote:
I assume I could achieve that via Windows/Linux APIs
The USB HID API is available on Windows only. On Linux and MacOS X need use libudev.

But nevertheless, Linux supports many HID devices (such as mice and keyboards) out of the box, so there should be a way to access HID devices via OS calls on Linux, too. We would need USB-READ() and USB-WRITE() functions in PB that hide these OS-specific aspects from the user.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye