Monday, March 3, 2014

Under android platform how to call socketcan drive


Louzhu being developed TI AM3359 android4.0 platform CAN bus driver. Kernel TI AM3359 android4.0 platform which contains the socketcan drive, open it, and use canutil (canconfig, cansend, candump ....) tool to test the CAN controller to send and receive data are normal.

Now consider how to use android application inside socketcan kernel driver.

I can think of is the current reference canutil open source package for android java using JNI layer. But found good canutil code running inside the adb shell, run JNI library inside, the result will be different. For example if_nametoindex.

Was very upset, I do not know what good heroes suggestions?<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
hm .... no problem with permissions you how the tune?
Reply:
cited a floor guoyoulei520 reply:
hm .... no problem with regard to the authority of it is how you tune
.?

I built a directory in the external directory canjni, the canutil transplanted into the source code, write a android.mk and application.mk, a so successfully compiled file and placed under system / lib directory. Permissions should be no problem.

How to see the permissions problem?
Reply:
I do not know if it is a permissions issue. Do not know if you tune ko file, look his property group.

You first positioning it,


Reply:
reference to the third floor guoyoulei520 reply:
I do not know if it is a permissions issue I do not know that you are not tone ko file, look his property group. .

You first positioning it,


I wrote a JNI library is so files; not driven ko file; socketcan driver has TI comes.

Will the JNI code inside the library to use a network drive, no problem, right?


Reply:
references, 4th Floor suck666 reply:
Quote: references to the third floor guoyoulei520 reply:

I do not know if it is a permissions issue. Do not know if you tune ko file, look his property group.

You first positioning it,


I wrote a JNI library is so files; not driven ko file; socketcan driver has TI comes.

Will the JNI code inside the library to use a network drive, no problem, right?



Do not understand, you now are the result of calling jni and adb shell inside is not the same is it?
Jni return results that is right or wrong?
Reply:
references, 5th Floor guoyoulei520 reply:
Quote: references to the 4th floor suck666 reply:

Quote: references to the third floor guoyoulei520 reply:

I do not know if it is a permissions issue. Do not know if you tune ko file, look his property group.

You first positioning it,


I wrote a JNI library is so files; not driven ko file; socketcan driver has TI comes.

Will the JNI code inside the library to use a network drive, no problem, right?



Do not understand, you now are the result of calling jni and adb shell inside is not the same is it?
That return results jni is right or wrong?


Yes. The results are different.
canconfig result adb shell inside running correctly;
I will canconfig transformed into a jni library java program to call a function with a if_nametoindex the results are not the same.
Reply:
I tracked down the if_nametoindex JNI function found in the results is not correct because: jni layer calls socket (AF_INET, SOCK_DGRAM, 0) failed

Do not know if you have any suggestions? Why " jni layer calls socket (AF_INET, SOCK_DGRAM, 0) failed "? ? ? ? ? ? ?
Reply:
jni using the socket, there may be a problem permissions, you put your program after obtaining system, in obtaining su root, permission to try the results. I am also trying
Reply:
The landlord is now under android how to find ways to use socketCAN not ah?

I also want to get recently.
Reply:
Landlord somehow it? Prawn seeking help ah, my relatively simple interface with qt write on the line to achieve socketCAN communication, Linux under the C on the line, I novice, confused, there is relevant information it? Thank qq980713898

No comments:

Post a Comment