| | |
| | | #include "driver_test.h" |
| | | #include "master/comm_if.h" |
| | | #include "rtk_module/virtual_rtk.h" |
| | | #include "defs.h" |
| | | |
| | | #define DEBUG(fmt, args...) LOGD("<native-lib> <%s>: " fmt, __func__, ##args) |
| | | |
| | |
| | | Java_com_anyun_exam_lib_RemoteService_MainProcMsgEntry(JNIEnv *env, jobject thiz, jint cmd, |
| | | jstring value) { |
| | | // TODO: implement MainProcMsgEntry() |
| | | union { |
| | | int a; |
| | | uint8_t b[sizeof(int)]; |
| | | } c; |
| | | |
| | | c.a = cmd; |
| | | |
| | | if (value != NULL) { |
| | | const char *str = env->GetStringUTFChars(value, 0); |
| | | MA_MainProcMsgEntry(cmd, str); |
| | | |
| | | uint8_t *data = new uint8_t[4 + strlen(str) + 1]; |
| | | |
| | | data[0] = c.b[0]; |
| | | data[1] = c.b[1]; |
| | | data[2] = c.b[2]; |
| | | data[3] = c.b[3]; |
| | | |
| | | strcpy((char *)data + 4, str); |
| | | // MA_MainProcMsgEntry(cmd, str); |
| | | PlatformStatusChanged(MASTER_COMM_EVT, data, 4 + strlen(str) + 1); |
| | | env->ReleaseStringUTFChars(value, str); |
| | | |
| | | delete []data; |
| | | } else { |
| | | MA_MainProcMsgEntry(cmd, NULL); |
| | | //MA_MainProcMsgEntry(cmd, NULL); |
| | | PlatformStatusChanged(MASTER_COMM_EVT, c.b, sizeof(int)); |
| | | } |
| | | } |
| | | |