| | |
| | | |
| | | import com.anyun.exam.lib.AYSdk; |
| | | import com.anyun.exam.lib.MyLog; |
| | | import com.anyun.exam.lib.util.ByteUtil; |
| | | import com.google.gson.Gson; |
| | | |
| | | import org.json.JSONException; |
| | | import org.json.JSONObject; |
| | | |
| | | import java.io.IOException; |
| | | import java.nio.charset.Charset; |
| | | import java.util.List; |
| | | |
| | | import safeluck.drive.evaluation.util.FileUtil; |
| | | import safeluck.drive.evaluation.util.PermissionManager; |
| | | import safeluck.drive.evaluation.viewmodels.MainViewModel; |
| | | import safeluck.drive.evaluation.viewmodels.RTKConnAndLogin; |
| | |
| | | } |
| | | if (msgCode == Constant.NDK_START){ |
| | | sendRtkConfigInfo(); |
| | | sendMcuUprgrade(); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | private void sendMcuUprgrade() { |
| | | try { |
| | | byte[] datas = FileUtil.readLocalFile(this,"dfu.bin"); |
| | | Log.i(TAG, ByteUtil.byte2hex(datas)); |
| | | if (datas != null){ |
| | | |
| | | String strs = new String(datas, Charset.forName("ISO-8859-1")); |
| | | MyLog.i(TAG, "mcu upgrade datas.legnth=="+strs.getBytes("ISO-8859-1").length); |
| | | AYSdk.getInstance().sendCmd(Constant.UPGRADE_MCU_CONTENT_FILE, strs); |
| | | }else{ |
| | | MyLog.i(TAG,"mcu升级文件不存在"); |
| | | } |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | private void sendRtkConfigInfo() { |
| | | if (mRTKConfig != null) { |
| | | String rtkjson = gson.toJson(mRTKConfig); |