| | |
| | | private Gson gson = new Gson(); |
| | | String[] PERMISSIONS = new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.CAMERA}; |
| | | RTKConfigViewModel rtkConfigViewModel; |
| | | private boolean onlySendOnceRTKConfig = true; |
| | | |
| | | |
| | | private ICEventListener icEventListener = new ICEventListener() { |
| | | @Override |
| | | public void onCEvent(String topic, int msgCode, int resultCode, Object obj) { |
| | | if (msgCode == Constant.FETCH_RTK_PLATFORM_INFO) { |
| | | // sendRtkConfigInfo(); |
| | | } |
| | | |
| | | if (msgCode == Constant.RTK_PLATFORM_REGISTER_STATUS) { |
| | | try { |
| | | JSONObject jsonObject = new JSONObject((String) obj); |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | if (msgCode == Constant.NDK_START){ |
| | | MyLog.i(TAG,"NDK_start"); |
| | | // sendRtkConfigInfo(); |
| | | sendMcuUprgrade(); |
| | | } |
| | | |
| | | } |
| | | }; |
| | | private List<SignalConfigRemote> signalConfiglist = new ArrayList<>(); |
| | |
| | | |
| | | } |
| | | |
| | | // private void sendRtkConfigInfo() { |
| | | // if (mRTKConfig != null) { |
| | | // String rtkjson = gson.toJson(mRTKConfig); |
| | | // |
| | | // //去除id字段 |
| | | // JSONObject jsonObject = null; |
| | | // try { |
| | | // jsonObject = new JSONObject(rtkjson); |
| | | // } catch (JSONException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // jsonObject.remove("_id"); |
| | | // rtkjson = null; |
| | | // rtkjson = jsonObject.toString(); |
| | | // MyLog.i(TAG, "RTK配置信息:" + rtkjson); |
| | | // AYSdk.getInstance().sendCmd(Constant.PUSH_RTK_PLATFORM_INFO, rtkjson); |
| | | // } else { |
| | | // MyLog.d(TAG, "RTKConfig未取到数据"); |
| | | // onlySendOnceRTKConfig = true; |
| | | // } |
| | | // } |
| | | public ExamPlatformModel examPlatformModel; |
| | | @Override |
| | | protected void onCreate(Bundle savedInstanceState) { |
| | |
| | | loadRootFragment(R.id.fl_container, HomeFragment.newInstance()); |
| | | } |
| | | |
| | | CEventCenter.onBindEvent(true, icEventListener, Constant.BIND_RTKCONFIG_TOPIC);//发送rtk配置消息 |
| | | CEventCenter.onBindEvent(true, icEventListener, Constant.BIND_CONNECT_RTK_TOPIC);//收到rtk连接 登录结果 |
| | | |
| | | } |
| | |
| | | @Override |
| | | protected void onDestroy() { |
| | | super.onDestroy(); |
| | | CEventCenter.onBindEvent(false, icEventListener, Constant.BIND_RTKCONFIG_TOPIC); |
| | | |
| | | CEventCenter.onBindEvent(false, icEventListener, Constant.BIND_CONNECT_RTK_TOPIC); |
| | | Log.i(TAG, "onDestroy: "); |