|
@@ -1045,19 +1045,20 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
|
@@ -1045,19 +1045,20 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
|
1045
|
// if (info == null || info.getData() == null) {
|
1045
|
// if (info == null || info.getData() == null) {
|
|
1046
|
// break;
|
1046
|
// break;
|
|
1047
|
// }
|
1047
|
// }
|
|
1048
|
- presenter.getCleanQrCode(roomStatusInfo.getData().getOrder_sn(), roomInfo.getData().getRoom_sn());
|
1048
|
+ if (System.currentTimeMillis() - lastRequest > 3000) {
|
|
|
|
1049
|
+ lastRequest = System.currentTimeMillis();
|
|
|
|
1050
|
+ presenter.getCleanQrCode(roomStatusInfo.getData().getOrder_sn(), roomInfo.getData().getRoom_sn());
|
|
|
|
1051
|
+ }
|
|
1049
|
// startActivity(new Intent(this, QrCodeShowActivity.class).putExtra("qr", "updateOrderInfo"));
|
1052
|
// startActivity(new Intent(this, QrCodeShowActivity.class).putExtra("qr", "updateOrderInfo"));
|
|
1050
|
break;
|
1053
|
break;
|
|
1051
|
}
|
1054
|
}
|
|
1052
|
}
|
1055
|
}
|
|
1053
|
|
1056
|
|
|
|
|
1057
|
+ private long lastRequest = 0;
|
|
|
|
1058
|
+
|
|
1054
|
private void openDoor() {
|
1059
|
private void openDoor() {
|
|
1055
|
Log.d("room-info", "openDoor called");
|
1060
|
Log.d("room-info", "openDoor called");
|
|
1056
|
- //TODO move to write success if release
|
|
|
|
1057
|
- if (needReport) {
|
|
|
|
1058
|
- handler.postDelayed(reportRunnable, 10 * 1000);
|
|
|
|
1059
|
- Log.d("room-info", "user open door ,report the open success status");
|
|
|
|
1060
|
- }
|
1061
|
+
|
|
1061
|
bleBroadcastReceiver.setResponseObj(new GREENCITYBLEProtocolFactory.GREENCITYBleDataWritten() {
|
1062
|
bleBroadcastReceiver.setResponseObj(new GREENCITYBLEProtocolFactory.GREENCITYBleDataWritten() {
|
|
1062
|
|
1063
|
|
|
1063
|
@Override
|
1064
|
@Override
|
|
@@ -1071,7 +1072,10 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
|
@@ -1071,7 +1072,10 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
|
1071
|
intent.setAction(GREENBluetoothLeService.ACTION_OPEN_SUCCESS);
|
1072
|
intent.setAction(GREENBluetoothLeService.ACTION_OPEN_SUCCESS);
|
|
1072
|
intent.putExtra("openrecord", bleOpenRecord);
|
1073
|
intent.putExtra("openrecord", bleOpenRecord);
|
|
1073
|
sendBroadcast(intent);
|
1074
|
sendBroadcast(intent);
|
|
1074
|
-
|
1075
|
+ if (needReport) {
|
|
|
|
1076
|
+ handler.postDelayed(reportRunnable, 10 * 1000);
|
|
|
|
1077
|
+ Log.d("room-info", "user open door ,report the open success status");
|
|
|
|
1078
|
+ }
|
|
1075
|
Log.d("room-info", "open success");
|
1079
|
Log.d("room-info", "open success");
|
|
1076
|
}
|
1080
|
}
|
|
1077
|
|
1081
|
|