From 2e736d81c035f0380f4178caf9e56d58c30954e9 Mon Sep 17 00:00:00 2001 From: Matthew Date: Wed, 10 Jul 2024 15:39:57 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E5=90=AF=E8=AE=BE=E5=A4=87=E5=91=BD?= =?UTF-8?q?=E4=BB=A4=E5=B0=9D=E8=AF=953=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mpmaster/src/main/cpp/mpmaster.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mpmaster/src/main/cpp/mpmaster.cpp b/mpmaster/src/main/cpp/mpmaster.cpp index 7b9c71d8..e4cb8591 100644 --- a/mpmaster/src/main/cpp/mpmaster.cpp +++ b/mpmaster/src/main/cpp/mpmaster.cpp @@ -77,7 +77,12 @@ Java_com_xypower_mpmaster_MpMasterService_setInt(JNIEnv* env, jclass cls, jint c extern "C" JNIEXPORT void JNICALL Java_com_xypower_mpmaster_MpMasterService_rebootDevice(JNIEnv* env, jclass cls) { // setInt(CMD_SET_SYSTEM_RESET, 1); - Java_com_xypower_mpmaster_MpMasterService_setInt(env, cls, 202, 1); + for (int idx = 0; idx < 3; idx++) { + if (Java_com_xypower_mpmaster_MpMasterService_setInt(env, cls, 202, 1) == 0) { + break; + } + } + } extern "C" JNIEXPORT jintArray JNICALL