| | |
| | | import android.os.Bundle; |
| | | import androidx.annotation.NonNull; |
| | | import androidx.annotation.Nullable; |
| | | |
| | | import android.util.Log; |
| | | import android.view.LayoutInflater; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | |
| | | |
| | | import com.anyun.exam.lib.AYSdk; |
| | | import com.anyun.exam.lib.MyLog; |
| | | import com.anyun.exam.lib.util.ByteUtil; |
| | | |
| | | import java.io.IOException; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.nio.charset.Charset; |
| | | |
| | | import me.yokeyword.fragmentation.SupportFragment; |
| | | import safeluck.drive.evaluation.Constant; |
| | |
| | | ((BaseSettingFragment)getParentFragment()).startBrotherFragment(SignalConfigFragment.newInstance()); |
| | | break; |
| | | case R.id.btn_mcu_upgrade: |
| | | StringBuffer stringBuffer = FileUtil.readMCUtFileFromSD(getContext(),"dfu.bin"); |
| | | if (stringBuffer != null){ |
| | | |
| | | AYSdk.getInstance().sendCmd(Constant.UPGRADE_MCU_CONTENT_FILE, stringBuffer.toString()); |
| | | }else{ |
| | | MyLog.i(TAG,"mcu升级文件不存在"); |
| | | |
| | | |
| | | try { |
| | | byte[] datas =FileUtil.readLocalFile(getActivity(),"dfu.bin"); |
| | | if (datas != null){ |
| | | |
| | | String strs = new String(datas, Charset.forName("ISO-8859-1")); |
| | | Log.i(TAG, "onClick: 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(); |
| | | } |
| | | |
| | | break; |
| | | default: |
| | | break; |