linsocketcan
Marc Kleine-Budde
maintainerHey Robert,
please use the linux-can mailinglist (Cc'ed). Don't post HTML mails there.
Quoted 9 lines · Robert
Hi,
I try use libsocketcan in my android application to work with CANbus
(ti_HECC) in HMI device TH-1535 based on ARM3517 Sitara .OS Android IceCream Linux kernel 2.6.37
Quoted 7 lines
Add
libsocketcan.cto my jni folder and build library
libsocketcan.so use ndk-build (all ok no errors)If use *can_set_bitrate**(“can0”, 125000),*function*send_mod_request return -1 (errno = 1,
err->error= 2).*
If the libsocketcan isn't buggy here, and errno equals 1, you should have a look at the errno definition[1]. An errno of 1 means "Operation not permitted". In non Android Linux systems you need to be the root user to set the bitrate.
[1] http://lxr.free-electrons.com/source/include/asm-generic/errno-base.h#L4
Marc
Signature · 4 lines
Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
Marc Kleine-Budde
maintainerHello Robert,
please keep the mailinglist on Cc.
Quoted 2 lines · Robert
OS Android on my device is rooted.
I know the error codes and so I asked what may have caused the error No. 1.
A rooted devices doesn't mean that every process runs as root. Have you started your program as root?
Marc
Signature · 4 lines
Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
Marc Kleine-Budde
maintainerHello,
for the protocol, problem solved:
Quoted 4 lines · Robert
Quoted 2 lines
A rooted devices doesn't mean that every process runs as root. Have you started your program as root?
All ok, CANbus is Up. Thanks for suggestions.
\o/
Marc
Signature · 4 lines
Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |