Home javascript android java php c# ubuntu python c++ c ios TAGS

USB Linux API: call ioctl requests from user space app


Date : 2019-07-09 11:32:08 , By :

I want to create Linux app responsible to get/set some usb settings especially settings responsible of followings:

  • USB ports

  • USB Host controller and USB driver

  • USB devices

I followed the linux api document: https://www.kernel.org/doc/html/v4.14/driver-api/usb/usb.html I found that it can be done through ioctl I found a list of ioctl requests, for example USBDEVFS_GETDRIVER.

I found that if I want a first small test it can be like that:

struct usbdevfs_getdriver usbdriver;
int fd = open("device_file_name", O_RDWR);
ioctl(fd, USBDEVFS_GETDRIVER, (struct usbdevfs_getdriver*) &usbdriver);

Is that the right way? What should be the device_file_name in the second line of my code?

TAGS : linux
- Technology - Yellow pages
» java
» php
» c#
» ubuntu
» python
» c++
» c
» ios
» jquery
» html
» sql
» r
» mysql
» linux
» access
» iphone
» css
» excel
» vb.net
» .net
» ruby
Privacy Policy - Copyrights Notice - Terms - Contact Us 2019 © tinytut
Licensed under cc by-sa 3.0 with attribution required.