Merge branch 'master' of https://gitee.com/endian11/DriveJudge
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project version="4"> |
| | | <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK"> |
| | | <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="JDK" project-jdk-type="JavaSDK"> |
| | | <output url="file://$PROJECT_DIR$/build/classes" /> |
| | | </component> |
| | | <component name="ProjectType"> |
| | |
| | | public void onCreate() { |
| | | super.onCreate(); |
| | | //初始化Fragment 建议在Application onCreate里面初始化 |
| | | |
| | | |
| | | if (SystemUtil.compareProcessName(this)){ |
| | | Fragmentation.builder().stackViewMode(Fragmentation.BUBBLE).debug(false) |
| | | .handleException(new ExceptionHandler() { |
| | |
| | | ndk { |
| | | // Specifies the ABI configurations of your native |
| | | // libraries Gradle should build and package with your APK. |
| | | abiFilters 'armeabi-v7a','arm64-v8a' |
| | | abiFilters 'armeabi-v7a' |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | const char *RTK_PLATFORM_IP = "47.93.80.84"; |
| | | const int RTK_PLATFORM_PORT = 12125; |
| | | const uint8_t phone[] = {0x20,0x19,0x10,0x15,0x00,0x00,0x00,0x02}; |
| | | const uint8_t phone[] = {0x20,0x19,0x10,0x15,0x00,0x00,0x00,0x01}; |
| | | |
| | | #define IMEI_LENGTH 15 |
| | | |
| | |
| | | gpsStatus.bcd_time[1] = ((MM/10)<<4) + (MM%10); |
| | | gpsStatus.bcd_time[2] = ((DD/10)<<4) + (DD%10); |
| | | gpsStatus.bcd_time[3] = ((hh/10)<<4) + (hh%10); |
| | | gpsStatus.bcd_time[4] = ((ss/10)<<4) + (ss%10); |
| | | gpsStatus.bcd_time[5] = ((mm/10)<<4) + (mm%10); |
| | | gpsStatus.bcd_time[4] = ((mm/10)<<4) + (mm%10); |
| | | gpsStatus.bcd_time[5] = ((ss/10)<<4) + (ss%10); |
| | | |
| | | recved_gprmc_time = AppTimer_GetTickCount(); |
| | | |
| | |
| | | } |
| | | case ID_PC_RTK_DOWNLOAD: |
| | | DEBUG("ID_PC_RTK_DOWNLOAD"); |
| | | // 汇报给单片机 |
| | | if (length > 0) { |
| | | SendRtkToMcu(data, length); |
| | | } |
| | | ReceivedRtk(data, length); |
| | | break; |
| | | default: |
| | | break; |
| | |
| | | uint8_t data[MAX_CONTENT_SIZE]; |
| | | int x = 0; |
| | | |
| | | data[x++] = 0; |
| | | data[x++] = gps_status; |
| | | data[x++] = BREAK_UINT32(latitude, 3); |
| | | data[x++] = BREAK_UINT32(latitude, 2); |
| | |
| | | #include "parse_net.h" |
| | | #include "../defs.h" |
| | | #include "../rtk_module/rtk.h" |
| | | #include "../mcu/mcu_if.h" |
| | | |
| | | #define PARSE_BUFF_SIZE 4096 |
| | | |
| | |
| | | static void LoginPlatform(void); |
| | | static void LoginPlatformTimeout(union sigval sig); |
| | | static void TriggerHeartbeat(union sigval sig); |
| | | static void RequestRtkNoResp(union sigval sig); |
| | | |
| | | void InitPlatform(const uint8_t *phone, const char *domain_name, int port) |
| | | { |
| | |
| | | pthread_attr_init(&attr); |
| | | pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);//detached |
| | | pthread_create(&pid, &attr, StatusListenThread, NULL); |
| | | |
| | | strcpy(deviceInfo.imei, GetImei()); |
| | | |
| | | ConnectPlatform(domain_name, port); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | void ReceivedRtk(const uint8_t *data, int length) |
| | | { |
| | | AppTimer_delete(RequestRtkNoResp); |
| | | // 汇报给单片机 |
| | | if (length > 0) { |
| | | SendRtkToMcu(data, length); |
| | | } |
| | | } |
| | | |
| | | static void RequestRtkNoResp(union sigval sig) |
| | | { |
| | | AppTimer_delete(RequestRtkNoResp); |
| | | requestPlatformSendRtk = true; |
| | | } |
| | | |
| | | void RequestRtkDownload(uint32_t latitude, uint32_t longitude, uint16_t altitude, |
| | | const uint8_t *bcd_time, uint16_t rtk_pkt_interval) |
| | | { |
| | | if (requestPlatformSendRtk) { |
| | | DisplayText("请求下载RTK数据"); |
| | | requestPlatformSendRtk = false; |
| | | |
| | | AppTimer_delete(RequestRtkNoResp); |
| | | AppTimer_add(RequestRtkNoResp, D_SEC(5)); |
| | | |
| | | SendRTKStart(latitude, longitude, altitude, bcd_time, rtk_pkt_interval); |
| | | } |
| | | } |
| | |
| | | int WritePlatform(const uint8_t * buf, uint32_t len); |
| | | void DeviceRegisterCallback(uint8_t res, const uint8_t *data, int length); |
| | | void DeviceLoginCallback(uint8_t res); |
| | | void ReceivedRtk(const uint8_t *data, int length); |
| | | |
| | | void RequestRtkDownload(uint32_t latitude, uint32_t longitude, uint16_t altitude, |
| | | const uint8_t *bcd_time, uint16_t rtk_pkt_interval); |
| | |
| | | |
| | | import com.anyun.exam.lib.util.DESUtil; |
| | | import com.anyun.exam.lib.util.NetUtils; |
| | | import com.anyun.exam.lib.util.Speaker; |
| | | |
| | | import androidx.annotation.Nullable; |
| | | |
| | |
| | | private RemoteCallbackList<IListenerInterface> mListenerList = new RemoteCallbackList(); |
| | | private IListenerInterface mListener; |
| | | private int msgId = 0; |
| | | private Speaker speaker = null; |
| | | |
| | | private IRemoteInterface.Stub iRemoteInterface = new IRemoteInterface.Stub(){ |
| | | @Override |
| | | public void registListener(IListenerInterface i) throws RemoteException { |
| | |
| | | public void onCreate() { |
| | | super.onCreate(); |
| | | Log.i(TAG,"onCreate()"); |
| | | speaker = new Speaker(getApplicationContext()); |
| | | |
| | | startNative(); |
| | | new Thread(new Worker()).start(); |
| | | } |
| | |
| | | public void run() { |
| | | while (!mIsServiceDestroyed.get()){ |
| | | try { |
| | | Thread.sleep(4*1000); |
| | | Thread.sleep(1000); |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | |
| | | private void onMessageArrived(String json){ |
| | | int N = mListenerList.getRegisteredCallbackCount(); |
| | | |
| | | Log.d(TAG, "getRegisteredCallbackCount = " + N); |
| | | mListenerList.beginBroadcast(); |
| | | |
| | | for (int i = 0; i < N; i++) { |
| | | mListenerList.beginBroadcast(); |
| | | |
| | | mListener = mListenerList.getBroadcastItem(i); |
| | | if (mListener != null){ |
| | | try { |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | mListenerList.finishBroadcast(); |
| | | |
| | | } |
| | | mListenerList.finishBroadcast(); |
| | | } |
| | | |
| | | public String javaGetImei() { |
| | |
| | | } |
| | | |
| | | public void TextSpeak(String text) { |
| | | /* if (speaker != null) { |
| | | if (speaker != null) { |
| | | speaker.speak(text); |
| | | }*/ |
| | | } |
| | | } |
| | | |
| | | // Used to load the 'native-lib' library on application startup. |