连接后发送重启命令
This commit is contained in:
parent
10d9ef2954
commit
017022c195
|
|
@ -26,5 +26,5 @@ android.enableJetifier=true
|
|||
android.useAndroidX=true
|
||||
android.useDeprecatedNdk=true
|
||||
|
||||
versionCode=48
|
||||
versionName=4.11.8
|
||||
versionCode=49
|
||||
versionName=4.11.9
|
||||
|
|
@ -66,6 +66,7 @@ import com.ifish.tcp.BackFunctionCode7_11;
|
|||
import com.ifish.tcp.ModelCodec;
|
||||
import com.ifish.tcp.OrderDeviceConnectModel;
|
||||
import com.ifish.tcp.OrderModel;
|
||||
import com.ifish.tcp.QueryTempeSettingModel;
|
||||
import com.ifish.tcp.ResetDeviceModel;
|
||||
import com.ifish.utils.AnimationUtil;
|
||||
import com.ifish.utils.BlueToothUtil;
|
||||
|
|
@ -714,7 +715,25 @@ public class NewBindDeviceActivity extends AppCompatActivity {
|
|||
}
|
||||
});
|
||||
}
|
||||
private void toReset(){
|
||||
ResetDeviceModel model = OrderModel.resetDevice();//设置正式环境域名
|
||||
byte[] data = ModelCodec.enCode(model);
|
||||
// data = new byte[1];
|
||||
|
||||
// QueryTempeSettingModel xx = OrderModel.OrderQueryTempeSettingModel(device_mac);
|
||||
// byte[] data = ModelCodec.enCode(xx);
|
||||
BleManager.getInstance().write(currentDevice, SERVICE_UUID, WRITE_UUID, data,false, new BleWriteCallback() {
|
||||
@Override
|
||||
public void onWriteSuccess(int current, int total, byte[] justWrite) {
|
||||
L.i("jjia-------------重启 发送 成功-");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWriteFailure(BleException exception) {
|
||||
L.i("jjia-------------重启 发送 失败"+exception.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
private void resetDevice(int type){
|
||||
|
||||
dismissProgressDialogCancelble();
|
||||
|
|
@ -893,9 +912,11 @@ public class NewBindDeviceActivity extends AppCompatActivity {
|
|||
public int compareTo(Boolean available) {
|
||||
if (available) {
|
||||
// TODO 设备访问Internet正常
|
||||
toReset();
|
||||
isContinue = false;
|
||||
connectDevice.cancel();
|
||||
doPostBindDevice();
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue