react-native-mytatva-rn-sdk 1.2.56 → 1.2.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -213,48 +213,6 @@
|
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
|
|
216
|
-
//- (void)centralManager:(CBCentralManager *)central didDisconnectPeripheral:(CBPeripheral *)peripheral error:(NSError *)error {
|
|
217
|
-
// KLTLog(@"%s", __FUNCTION__);
|
|
218
|
-
//
|
|
219
|
-
// self.bgConnectPeripheral = peripheral;
|
|
220
|
-
//
|
|
221
|
-
// // Update disconnect time in local database
|
|
222
|
-
// [[KLTDatabaseHandler shared] updateDeviceWithDeviceId:[self.connectedPeripheral.identifier UUIDString]
|
|
223
|
-
// scannedTime:nil
|
|
224
|
-
// connectTime:nil
|
|
225
|
-
// disConnectTime:[NSString getWholeStringWithDate:NSDate.date]];
|
|
226
|
-
//
|
|
227
|
-
// self.connectedPeripheral = nil;
|
|
228
|
-
// self.status = BluetoothManagerStatusDisconnected;
|
|
229
|
-
//
|
|
230
|
-
// UIApplicationState appState = [UIApplication sharedApplication].applicationState;
|
|
231
|
-
// BOOL isInBackground = (appState == UIApplicationStateBackground);
|
|
232
|
-
// BOOL isBgModeEnabled = [[User_Defaults objectForKey:@"bgmode"] intValue] == 1;
|
|
233
|
-
// BOOL canReconnect = !KLTLocalSettingManager.shareInstance.canConnectOtherDevice;
|
|
234
|
-
//
|
|
235
|
-
// if (isInBackground && isBgModeEnabled && canReconnect) {
|
|
236
|
-
// if (!self.isBgForceConnectDevice) {
|
|
237
|
-
// [self connectPeripheral:peripheral];
|
|
238
|
-
// self.isBgForceConnectDevice = YES;
|
|
239
|
-
// }
|
|
240
|
-
//
|
|
241
|
-
// // Just trigger the scanning logic — it will manage the timer
|
|
242
|
-
// [self startScan];
|
|
243
|
-
// } else {
|
|
244
|
-
// // Foreground or inactive state behavior
|
|
245
|
-
// self.isBgForceConnectDevice = NO;
|
|
246
|
-
//
|
|
247
|
-
// if ([self.peripherals containsObject:peripheral]) {
|
|
248
|
-
// [self.peripherals removeObject:peripheral];
|
|
249
|
-
// }
|
|
250
|
-
//
|
|
251
|
-
// if ([self.bluetoothDelegate respondsToSelector:@selector(onFindDevices:connectedDevice:)]) {
|
|
252
|
-
// [self.bluetoothDelegate onFindDevices:self.peripherals connectedDevice:nil];
|
|
253
|
-
// }
|
|
254
|
-
// }
|
|
255
|
-
//}
|
|
256
|
-
|
|
257
|
-
|
|
258
216
|
#pragma mark - peripheral delgate
|
|
259
217
|
|
|
260
218
|
- (void)peripheral:(CBPeripheral *)peripheral didDiscoverServices:(NSError *)error {
|
|
@@ -359,6 +317,7 @@
|
|
|
359
317
|
|
|
360
318
|
if ([command isEqualToString:@"06"]) {
|
|
361
319
|
// 06:CT3初始化协议响应后发射低功耗
|
|
320
|
+
//After CT3 initialization protocol response, the transmitter enters low power mode.
|
|
362
321
|
if ([ProtocalTools init_response:characteristic.value andEDevice:self.eDevice]) {
|
|
363
322
|
KLTLocalSettingManager.shareInstance.canConnectOtherDevice = NO;
|
|
364
323
|
|
|
@@ -31,9 +31,10 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
31
31
|
@property (nonatomic, assign) BOOL hasNumberPrefix;
|
|
32
32
|
|
|
33
33
|
// 是否能连其他发射器 NO:标识当前已绑定发射器 YES:当前未绑定发射器
|
|
34
|
-
|
|
35
|
-
//NO
|
|
36
|
-
//YES
|
|
34
|
+
//“Whether another transmitter can be connected”
|
|
35
|
+
//NO – a transmitter is already bound.
|
|
36
|
+
//YES – no transmitter is currently bound.
|
|
37
|
+
|
|
37
38
|
@property (nonatomic, assign) BOOL canConnectOtherDevice;
|
|
38
39
|
|
|
39
40
|
@end
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
import UIKit
|
|
9
9
|
import AVFoundation
|
|
10
10
|
class ConnectToSensorViewController: UIViewController {
|
|
11
|
+
let viewModel = FinalViewModel()
|
|
12
|
+
|
|
11
13
|
@IBOutlet weak var contactSupport: CustomOverlayButton!
|
|
12
14
|
@IBOutlet weak var customTopView: CustomTopUIView!
|
|
13
15
|
@IBOutlet weak var tableView: UITableView!
|
|
@@ -51,6 +53,7 @@ class ConnectToSensorViewController: UIViewController {
|
|
|
51
53
|
var isCodeDetected = false
|
|
52
54
|
var isPermissionGiven: Bool = false
|
|
53
55
|
let manager = KLTBluetoothManager.shared()
|
|
56
|
+
let debouncer = EnumDebouncer<CGMConnectionStatus>()
|
|
54
57
|
|
|
55
58
|
override func viewDidLoad() {
|
|
56
59
|
super.viewDidLoad()
|
|
@@ -240,6 +243,7 @@ class ConnectToSensorViewController: UIViewController {
|
|
|
240
243
|
UserDefaults.standard.synchronize()
|
|
241
244
|
//self.connected?()
|
|
242
245
|
//controller.navigationController?.popViewController(animated: true)
|
|
246
|
+
viewModel.debouncer.update(with: .connected)
|
|
243
247
|
self.showConfirmInsulinUser()
|
|
244
248
|
//showConfirmInsulinUser()
|
|
245
249
|
return
|