Java application layer sequence I wrote a CAN bus for the upper JNI library calls.
Since the kernel is the underlying driver can apply socketcan architecture, so JNI library which is suitable for linux socket programming to call the driver.
I found the call socket (AF_INET, SOCK_DGRAM, 0) failed JNI library inside, the return value is 0xffffffff.
Will the heroes who have not encountered a similar problem? Give some advice?<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) -> Reply: This root socket does not matter, it is estimated sokcet after receiving the results of the command processing returns wrong Reply:
Then why, "after receiving the results of the command processing returns sokcet wrong"? Reply:
In this way, you would first make sure that the entire call flow is correct socket Then you look at the socket receive command processing piece is correct. Reply:
This root socket does not matter, it is estimated sokcet after receiving the results of the command processing returns wrong
Then why, "after receiving the results of the command processing returns sokcet wrong"?
In this way, you would first make sure that the entire call flow is correct socket Then you look at the socket after receiving the command processing piece is correct.
I was the top JNI code, socket is linux standard API, I do not need to manage socket inside to achieve it?
Anyway, I run the "socket (AF_INET, SOCK_DGRAM, 0)" should not fail, right?
Reply:
This root socket does not matter, it is estimated sokcet after receiving the results of the command processing returns wrong
Then why, "after receiving the results of the command processing returns sokcet wrong"?
In this way, you would first make sure that the entire call flow is correct socket Then you look at the socket after receiving the command processing piece is correct.
I was the top JNI code, socket is linux standard API, I do not need to manage socket inside to achieve it?
Anyway, I run the "socket (AF_INET, SOCK_DGRAM, 0)" should not fail, right?
Ah, it should not fail, I think adb shell and jni tune inside a big difference there is the adb shell with root privileges ...
Other I do not know your code, so it is not very clear. Reply:
This root socket does not matter, it is estimated sokcet after receiving the results of the command processing returns wrong
Then why, "after receiving the results of the command processing returns sokcet wrong"?
In this way, you would first make sure that the entire call flow is correct socket Then you look at the socket after receiving the command processing piece is correct.
I was the top JNI code, socket is linux standard API, I do not need to manage socket inside to achieve it?
Anyway, I run the "socket (AF_INET, SOCK_DGRAM, 0)" should not fail, right?
Ah, it should not fail, I think adb shell and jni tune inside a big difference there is the adb shell with root privileges ...
Other I do not know your code, so it is not very clear.
Is not right, like a long time, not your code, do not know what the problem Reply:
This root socket does not matter, it is estimated sokcet after receiving the results of the command processing returns wrong
Then why, "after receiving the results of the command processing returns sokcet wrong"?
In this way, you would first make sure that the entire call flow is correct socket Then you look at the socket after receiving the command processing piece is correct.
I was the top JNI code, socket is linux standard API, I do not need to manage socket inside to achieve it?
Anyway, I run the "socket (AF_INET, SOCK_DGRAM, 0)" should not fail, right?
Ah, it should not fail, I think adb shell and jni tune inside a big difference there is the adb shell with root privileges ...
Other I do not know your code, so it is not very clear.
Is not right, like a long time, not your code, do not know what the problem
How to pass the code you see? You have mail?
Reply:
unsigned int if_nametoindex (const char * ifname) { int index; int ctl_sock; struct ifreq ifr;
/ * Mark end of data section * / data-> rta_len = (void *) NLMSG_TAIL (& req.n) - (void *) data;
/ * Mark end of link info section * / linkinfo-> rta_len = (Void *) NLMSG_TAIL (& req.n) - (void *) linkinfo; }
return send_mod_request (fd, & req.n); }
Reply:
such as title,
Java application layer sequence I wrote a CAN bus for the upper JNI library calls.
Since the kernel is the underlying driver can apply socketcan architecture, so JNI library which is suitable for linux socket programming to call the driver.
I found the call socket (AF_INET, SOCK_DGRAM, 0) failed JNI library inside, the return value is 0xffffffff.
Will the heroes who have not encountered a similar problem? Give some advice?
You run adb shell in which it is a bin file, you now to transform this into a bin jni call is not successful and you have a system source code of it. I think you do not reform, made init.rc inside the bin file services, in jni start this service by ctrl.start in this way, with you in the adb shell which is the same effect. Reply:
Such as the title,
Java application layer sequence I wrote a CAN bus for the upper JNI library calls.
Since the kernel is the underlying driver can apply socketcan architecture, so JNI library which is suitable for linux socket programming to call the driver.
I found the call socket (AF_INET, SOCK_DGRAM, 0) failed JNI library inside, the return value is 0xffffffff.
Will the heroes who have not encountered a similar problem? Give some advice?
You run adb shell in which it is a bin file, you now to transform this into a bin jni call is not successful and you have a system source code of it. I think you do not reform, made init.rc inside the bin file services, in jni start this service by ctrl.start in this way, with you in the adb shell which is the same effect.
Your analysis is right. My bin file to run properly. Thank you for your suggestion. But I want to do it yourself JAVA UI's. How my java application data to be sent and received from the CAN bus data to the JAVA code? Reply: I know the answer to that question is a permissions issue.
When I call the JNI library java program which added, , socket (AF_INET, SOCK_DGRAM, 0) to run successful
android: allowBackup = "true" android: icon = "@ drawable / ic_launcher" android: label = "@ string / app_name" android: theme = "@ style / AppTheme"> Reply: Reply: The landlord, ask you a question rc = ioctl (sockfd, SIOCSARP, & req); I tried to set the arp binding android found above this function is always executed unsuccessful, the landlord can help analyze it?
No comments:
Post a Comment