react-native-mytatva-rn-sdk 1.2.42 → 1.2.43
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.
|
@@ -250,10 +250,13 @@ class CgmTrackyLibModule(reactContext: ReactApplicationContext) :
|
|
|
250
250
|
mStatus
|
|
251
251
|
}
|
|
252
252
|
|
|
253
|
+
Log.d("postEventDataToAPI: ", "Device Event Status==> $status")
|
|
254
|
+
|
|
253
255
|
if (status.isNotEmpty()) {
|
|
254
256
|
if (status != lastDeviceStatus) {
|
|
255
257
|
|
|
256
258
|
lastDeviceStatus = status
|
|
259
|
+
Log.d("postEventDataToAPI: ", "Device Event Status API==> $status")
|
|
257
260
|
|
|
258
261
|
val rawData = JSONObject().apply {
|
|
259
262
|
put("transmitterName", device?.name ?: "")
|
|
@@ -366,19 +369,7 @@ class CgmTrackyLibModule(reactContext: ReactApplicationContext) :
|
|
|
366
369
|
// Create new observer with explicit nullable parameter type
|
|
367
370
|
glucoseObserver = Observer<PocGlucose?> { pocGlucose ->
|
|
368
371
|
if (pocGlucose != null) {
|
|
369
|
-
|
|
370
|
-
val currentTime = System.currentTimeMillis()
|
|
371
|
-
val dataAge = currentTime - pocGlucose.timeInMillis
|
|
372
|
-
|
|
373
|
-
// Only process data that's relatively recent (within last 10 minutes as example)
|
|
374
|
-
if (dataAge <= 10 * 60 * 1000L) { // 10 minutes
|
|
375
|
-
handleGlucoseData(pocGlucose)
|
|
376
|
-
} else {
|
|
377
|
-
Log.d(
|
|
378
|
-
"observeGlucoseData",
|
|
379
|
-
"Skipping old glucose data: age = ${dataAge}ms"
|
|
380
|
-
)
|
|
381
|
-
}
|
|
372
|
+
handleGlucoseData(pocGlucose)
|
|
382
373
|
} else {
|
|
383
374
|
Log.w(
|
|
384
375
|
"observeGlucoseData",
|
|
@@ -610,7 +601,7 @@ class CgmTrackyLibModule(reactContext: ReactApplicationContext) :
|
|
|
610
601
|
lastDeviceStatus = null
|
|
611
602
|
|
|
612
603
|
// Clear any cached data if needed
|
|
613
|
-
|
|
604
|
+
prefsHelper.clearQRInformation() // if you have such method
|
|
614
605
|
|
|
615
606
|
} catch (e: Exception) {
|
|
616
607
|
Log.e("resetCgmState", "Error resetting CGM state: ${e.message}")
|