android-ndk,handler usbfs read write

269 views
Skip to first unread message

WuZhenda

unread,
Mar 17, 2011, 10:26:32 PM3/17/11
to andro...@googlegroups.com, android-porting
hi,all
I have ported the libusb &  hidapi  to the android,

but when I use  ndk-build to operate the usb device on java platform,I always return false.

so I do "chmod 666 /proc/bus/usb/002/001" cmd manually to make the device can be read & write ,  then it return OK.

but I think when I mount the usbfs,I have made the  usb  can be read & write already by the cmd "mount usbfs none /proc/bus/usb -o devmode=0666".


why?



WuZhenda

unread,
Mar 17, 2011, 10:33:10 PM3/17/11
to andro...@googlegroups.com, android-porting
should I change the device  read&write mode  each time ? and how ?

the device bus number & device number changed every time !


2011/3/18 WuZhenda <wuzh...@gmail.com>

Giang Pham

unread,
Mar 17, 2011, 11:54:41 PM3/17/11
to andro...@googlegroups.com

Hi WuZhenda,

 

As far as I know, the emulator by default doesn’t let u do anything u want like the real mobile, such as connecting to Internet, or saving file to Storage

 

You must, by some ways, make it opening the options for u. One way I know is that configuring the Android manifest file.

 

Maybe doing “chmod” is another way, but u must do everytime u start the emulator.

 

Try configuring the manifest file.

 

Gud luck, ^^

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.

David Turner

unread,
Mar 18, 2011, 6:55:08 AM3/18/11
to WuZhenda, android-porting
On Fri, Mar 18, 2011 at 3:26 AM, WuZhenda <wuzh...@gmail.com> wrote:
hi,all
I have ported the libusb &  hidapi  to the android,

but when I use  ndk-build to operate the usb device on java platform,I always return false.

I doubt you're using ndk-build to operate anything on the device :-)
 
so I do "chmod 666 /proc/bus/usb/002/001" cmd manually to make the device can be read & write ,  then it return OK.


Not NDK related. Normal applications can't modify the system. Moving this forum to bcc.
 
but I think when I mount the usbfs,I have made the  usb  can be read & write already by the cmd "mount usbfs none /proc/bus/usb -o devmode=0666".


why?

WuZhenda

unread,
Mar 24, 2011, 4:47:01 AM3/24/11
to andro...@googlegroups.com, Giang Pham
I am not using emulator,neither  a phone.
It's a develop-board.
I use the real hardware.
As I descriped before ,when I mount the device to "/proc/bus/usb",I have use the "666" proper,It should be read &write.
But actually can't by ndk-build way.

I  do the cmd  "chmod 666 /proc/bus/usb/002/001" again, then all  goes right.


2011/3/18 Giang Pham <giang...@gmail.com>

Hélène

unread,
May 22, 2015, 5:32:55 AM5/22/15
to andro...@googlegroups.com, android...@googlegroups.com
Hi, 
I bring out an old topic hoping have a solution to my project.
I want ported hidapi to android but I don't succeed. When I build Android.mk (with ndk-build) I have the error : 
[armeabi] Compile thumb  : hidapi <= hid.c
/home/helene/Téléchargements/hidapi-master/android/jni/../../libusb/hid.c:47:20: fatal error: libusb.h: No such file or directory
 #include <libusb.h>
I don't understand the problem. I have copy hidapi project from https://github.com/signal11/hidapi

I start with android ndk, I have maybe forget something. 

Thank you for your help

Hélène

unread,
May 22, 2015, 5:32:55 AM5/22/15
to andro...@googlegroups.com, android...@googlegroups.com

Hi,

I stand out an old topic hoping to have a solution to my problem.

I want ported hidapi to android. I have copy the project : https://github.com/signal11/hidapi and I have built Android.mk with android ndk but I have the error : 
[armeabi] Compile thumb  : hidapi <= hid.c
/home/helene/Téléchargements/test_hidapi/android/jni/../../libusb/hid.c:47:20: fatal error: libusb.h: No such file or directory
 #include <libusb.h>

I have yet a file libusb.h on /usr/include/libusb-1.0/libusb.h. I've tried to change #include by #include without success.

 I start with android ndk, I have maybe forget something.

Thank you for your help.

Le vendredi 18 mars 2011 03:26:32 UTC+1, ddy a écrit :
Reply all
Reply to author
Forward
0 new messages