react-native-mytatva-rn-sdk 1.2.70 → 1.2.71
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.
|
@@ -159,6 +159,29 @@
|
|
|
159
159
|
|
|
160
160
|
KLTLog(@"ERROR_CODE_ALGORITHM_DATA:dataId=%@, operatingCurrent=%@, blankCurrent=%@, temperature=%@, algo_k=%@, algo_r=%@, day=%@, hour=%@, minute=%@, localName=%@, newBgValue=%@, algorithm=%@", @(d.glucoseId), @(d.Iw), @(d.Ib), @(d.T), @(d.K0), @(d.R), @(d.day), @(d.hour), @(d.minute), d.name, @(d.newBgValue), @(d.algorithm));
|
|
161
161
|
currentGlucose = [AlgorithmTools algorithmLatestGlucose:d];
|
|
162
|
+
NSString *logString = [NSString stringWithFormat:@"glucoseId=%@, Iw=%@, Ib=%@, T=%@,dayCount=%@, hour=%@, minute=%@, milles=%@, GluMG=%@,BGCount=%@, BGICount=%@, errorCode=%@ trend=%@ calibrationStatus=%@, countdownDays=%@, countdownHours=%@, countdownMinutes=%@ ",
|
|
163
|
+
@(d.glucoseId),
|
|
164
|
+
@(d.Iw),
|
|
165
|
+
@(d.Ib),
|
|
166
|
+
@(d.T),
|
|
167
|
+
@(d.day),
|
|
168
|
+
@(d.hour),
|
|
169
|
+
@(d.minute),
|
|
170
|
+
@(d.timeMillis),
|
|
171
|
+
@(currentGlucose.GluMG),
|
|
172
|
+
@(currentGlucose.BGCount),
|
|
173
|
+
@(currentGlucose.BGICount),
|
|
174
|
+
@(currentGlucose.errorCode),
|
|
175
|
+
@(currentGlucose.trend),
|
|
176
|
+
@(currentGlucose.BGMG),
|
|
177
|
+
@(currentGlucose.countdownDays),
|
|
178
|
+
@(currentGlucose.countdownHours),
|
|
179
|
+
@(currentGlucose.countdownHours)
|
|
180
|
+
|
|
181
|
+
];
|
|
182
|
+
KLTRunLog *runLog = [KLTAppDelegate getCurrentKLTRunLog];
|
|
183
|
+
[runLog useCurrentCSV:localName];
|
|
184
|
+
KLTRunWarn(logString);
|
|
162
185
|
}
|
|
163
186
|
|
|
164
187
|
glucose.errorCode = @(currentGlucose.errorCode);
|
|
@@ -192,7 +215,29 @@
|
|
|
192
215
|
|
|
193
216
|
// [Notification_Center postNotificationName:@"ErrorStatusFromTransmitter" object: glucose];
|
|
194
217
|
[Notification_Center postNotificationName:@"CheckErrorStatusFromLastBatchData" object: glucose];
|
|
195
|
-
|
|
218
|
+
NSString *logString = [NSString stringWithFormat:@"glucoseId=%@, Iw=%@, Ib=%@, T=%@,dayCount=%@, hour=%@, minute=%@, milles=%@, GluMG=%@,BGCount=%@, BGICount=%@, errorCode=%@ trend=%@ calibrationStatus=%@, countdownDays=%@, countdownHours=%@, countdownMinutes=%@ ",
|
|
219
|
+
@(d.glucoseId),
|
|
220
|
+
@(d.Iw),
|
|
221
|
+
@(d.Ib),
|
|
222
|
+
@(d.T),
|
|
223
|
+
@(d.day),
|
|
224
|
+
@(d.hour),
|
|
225
|
+
@(d.minute),
|
|
226
|
+
@(d.timeMillis),
|
|
227
|
+
@(currentGlucose.GluMG),
|
|
228
|
+
@(currentGlucose.BGCount),
|
|
229
|
+
@(currentGlucose.BGICount),
|
|
230
|
+
@(currentGlucose.errorCode),
|
|
231
|
+
@(currentGlucose.trend),
|
|
232
|
+
@(currentGlucose.BGMG),
|
|
233
|
+
@(currentGlucose.countdownDays),
|
|
234
|
+
@(currentGlucose.countdownHours),
|
|
235
|
+
@(currentGlucose.countdownHours)
|
|
236
|
+
|
|
237
|
+
];
|
|
238
|
+
KLTRunLog *runLog = [KLTAppDelegate getCurrentKLTRunLog];
|
|
239
|
+
[runLog useCurrentCSV:localName];
|
|
240
|
+
KLTRunWarn(logString);
|
|
196
241
|
[self.appDelegate saveContext];
|
|
197
242
|
return glucose;
|
|
198
243
|
}
|
|
@@ -204,6 +204,8 @@
|
|
|
204
204
|
#import <React/RCTEventEmitter.h>
|
|
205
205
|
#import "react_native_mytatva_rn_sdk-Swift.h"
|
|
206
206
|
#import "KLTDatabaseHandler.h"
|
|
207
|
+
#import "KLTRunLog.h"
|
|
208
|
+
#import "KLTAppDelegate.h"
|
|
207
209
|
|
|
208
210
|
@implementation MyEventEmitterManager
|
|
209
211
|
|
|
@@ -608,52 +610,67 @@ RCT_EXPORT_METHOD(observeTransmitterUnbindStatus:(NSString *)token
|
|
|
608
610
|
* Get all CGM log file paths
|
|
609
611
|
* Returns array of absolute file paths to CGM log files (CSV format)
|
|
610
612
|
*/
|
|
611
|
-
|
|
612
|
-
|
|
613
|
+
RCT_REMAP_METHOD(getCgmLogFiles,
|
|
614
|
+
getCgmLogFilesWithResolver:(RCTPromiseResolveBlock)resolve
|
|
615
|
+
rejecter:(RCTPromiseRejectBlock)reject)
|
|
613
616
|
{
|
|
614
617
|
@try {
|
|
615
618
|
NSMutableArray *logFilePaths = [NSMutableArray array];
|
|
616
|
-
|
|
617
|
-
//
|
|
618
|
-
NSArray *
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
NSError *error = [NSError errorWithDomain:@"CgmTrackyLib"
|
|
623
|
-
code:1002
|
|
624
|
-
userInfo:@{NSLocalizedDescriptionKey: @"Could not access Documents directory"}];
|
|
619
|
+
|
|
620
|
+
// Use the same base path strategy as getTrackLibDbPath
|
|
621
|
+
NSArray<NSURL *> *urls = [[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask];
|
|
622
|
+
NSURL *documentsURL = [urls lastObject];
|
|
623
|
+
if (documentsURL.path.length == 0) {
|
|
624
|
+
NSError *error = [NSError errorWithDomain:@"CgmTrackyLib" code:1002 userInfo:@{NSLocalizedDescriptionKey: @"Could not access Documents directory"}];
|
|
625
625
|
reject(@"ERROR_DOCUMENTS_DIR", @"Failed to get documents directory", error);
|
|
626
626
|
return;
|
|
627
627
|
}
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
NSArray *fileList = [fileManager contentsOfDirectoryAtPath:logFolderPath error:&error];
|
|
641
|
-
|
|
642
|
-
if (error) {
|
|
643
|
-
reject(@"ERROR_READ_DIRECTORY", @"Failed to read log directory", error);
|
|
644
|
-
return;
|
|
628
|
+
|
|
629
|
+
NSLog(@"CGM Documents path: %@", documentsURL.path);
|
|
630
|
+
|
|
631
|
+
// Ensure runLog directory exists (SDK may not create it before first write)
|
|
632
|
+
NSURL *logFolderURL = [documentsURL URLByAppendingPathComponent:@"runLog" isDirectory:YES];
|
|
633
|
+
NSFileManager *fm = [NSFileManager defaultManager];
|
|
634
|
+
BOOL isDir = NO;
|
|
635
|
+
if (![fm fileExistsAtPath:logFolderURL.path isDirectory:&isDir]) {
|
|
636
|
+
NSError *mkErr = nil;
|
|
637
|
+
[fm createDirectoryAtURL:logFolderURL withIntermediateDirectories:YES attributes:nil error:&mkErr];
|
|
638
|
+
if (mkErr) {
|
|
639
|
+
NSLog(@"CGM could not create runLog dir: %@", mkErr.localizedDescription);
|
|
645
640
|
}
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
NSLog(@"CGM runLog path: %@", logFolderURL.path);
|
|
644
|
+
|
|
645
|
+
// Use exactly what the SDK uses first: current runlog absolute path
|
|
646
|
+
KLTRunLog *current = [KLTAppDelegate getCurrentKLTRunLog];
|
|
647
|
+
NSString *currentPath = current.path; // absolute path the SDK writes to
|
|
648
|
+
NSLog(@"CGM current runlog path: %@", currentPath);
|
|
649
|
+
if (currentPath.length > 0) {
|
|
650
|
+
BOOL isDir3 = NO;
|
|
651
|
+
if ([fm fileExistsAtPath:currentPath isDirectory:&isDir3] && !isDir3) {
|
|
652
|
+
[logFilePaths addObject:currentPath];
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
// If current file isn’t there yet, list the runLog dir contents
|
|
657
|
+
if (logFilePaths.count == 0) {
|
|
658
|
+
NSError *dirErr = nil;
|
|
659
|
+
NSArray<NSString *> *runLogList = [fm contentsOfDirectoryAtPath:logFolderURL.path error:&dirErr];
|
|
660
|
+
if (dirErr) {
|
|
661
|
+
NSLog(@"CGM failed reading runLog dir: %@", dirErr.localizedDescription);
|
|
662
|
+
} else {
|
|
663
|
+
for (NSString *name in runLogList) {
|
|
664
|
+
NSString *fullPath = [logFolderURL.path stringByAppendingPathComponent:name];
|
|
665
|
+
BOOL isDirLocal = NO;
|
|
666
|
+
if ([fm fileExistsAtPath:fullPath isDirectory:&isDirLocal] && !isDirLocal) {
|
|
667
|
+
[logFilePaths addObject:fullPath];
|
|
668
|
+
}
|
|
652
669
|
}
|
|
653
670
|
}
|
|
654
671
|
}
|
|
655
|
-
|
|
656
|
-
NSLog(@"
|
|
672
|
+
|
|
673
|
+
NSLog(@"CGM runLog resolved %lu file(s)", (unsigned long)logFilePaths.count);
|
|
657
674
|
resolve(logFilePaths);
|
|
658
675
|
|
|
659
676
|
} @catch (NSException *exception) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_MyTatvaRnSdkView","_interopRequireDefault","require","_MyTatvaRnSdkView2","_reactNative","_CGMConnect","e","__esModule","default","MyTatvaRnSdkView","exports","Platform","select","ios","MyTatvaRnSdkViewIOS","android","MyTatvaRnSdkViewAndroid","_default","startCGM","initializeCGMEventListener","removeCGMEventListener","observeAllGlucoseDataHandler","reconnectCGM","helpCGM","observeTransmitterUnbindStatusHandler","observeResetLogoutHandler","getSqliteDBPath","getCgmLogFilePaths"],"sources":["index.js"],"sourcesContent":["import MyTatvaRnSdkViewAndroid from './MyTatvaRnSdkView.android';\nimport MyTatvaRnSdkViewIOS from './MyTatvaRnSdkView.ios';\nimport { Platform } from 'react-native';\nimport { startCGM, initializeCGMEventListener, removeCGMEventListener, observeAllGlucoseDataHandler, reconnectCGM, helpCGM, observeTransmitterUnbindStatusHandler, observeResetLogoutHandler, getSqliteDBPath, getCgmLogFilePaths } from './CGMConnect';\n// ... other imports\n\n// Export the platform-specific component\nexport const MyTatvaRnSdkView = Platform.select({\n ios: MyTatvaRnSdkViewIOS,\n android: MyTatvaRnSdkViewAndroid,\n});\n\n// Export individual functions\nexport {\n startCGM,\n initializeCGMEventListener,\n removeCGMEventListener,\n observeAllGlucoseDataHandler,\n reconnectCGM,\n helpCGM,\n observeTransmitterUnbindStatusHandler,\n observeResetLogoutHandler,\n getSqliteDBPath,\n getCgmLogFilePaths\n // ... other functions\n};\n\n// Export a default object with everything\nexport default {\n MyTatvaRnSdkView,\n startCGM,\n initializeCGMEventListener,\n removeCGMEventListener,\n observeAllGlucoseDataHandler,\n reconnectCGM,\n helpCGM,\n observeTransmitterUnbindStatusHandler,\n observeResetLogoutHandler,\n getSqliteDBPath,\n getCgmLogFilePaths
|
|
1
|
+
{"version":3,"names":["_MyTatvaRnSdkView","_interopRequireDefault","require","_MyTatvaRnSdkView2","_reactNative","_CGMConnect","e","__esModule","default","MyTatvaRnSdkView","exports","Platform","select","ios","MyTatvaRnSdkViewIOS","android","MyTatvaRnSdkViewAndroid","_default","startCGM","initializeCGMEventListener","removeCGMEventListener","observeAllGlucoseDataHandler","reconnectCGM","helpCGM","observeTransmitterUnbindStatusHandler","observeResetLogoutHandler","getSqliteDBPath","getCgmLogFilePaths"],"sources":["index.js"],"sourcesContent":["import MyTatvaRnSdkViewAndroid from './MyTatvaRnSdkView.android';\nimport MyTatvaRnSdkViewIOS from './MyTatvaRnSdkView.ios';\nimport { Platform } from 'react-native';\nimport { startCGM, initializeCGMEventListener, removeCGMEventListener, observeAllGlucoseDataHandler, reconnectCGM, helpCGM, observeTransmitterUnbindStatusHandler, observeResetLogoutHandler, getSqliteDBPath, getCgmLogFilePaths } from './CGMConnect';\n// ... other imports\n\n// Export the platform-specific component\nexport const MyTatvaRnSdkView = Platform.select({\n ios: MyTatvaRnSdkViewIOS,\n android: MyTatvaRnSdkViewAndroid,\n});\n\n// Export individual functions\nexport {\n startCGM,\n initializeCGMEventListener,\n removeCGMEventListener,\n observeAllGlucoseDataHandler,\n reconnectCGM,\n helpCGM,\n observeTransmitterUnbindStatusHandler,\n observeResetLogoutHandler,\n getSqliteDBPath,\n getCgmLogFilePaths\n // ... other functions\n};\n\n// Export a default object with everything\nexport default {\n MyTatvaRnSdkView,\n startCGM,\n initializeCGMEventListener,\n removeCGMEventListener,\n observeAllGlucoseDataHandler,\n reconnectCGM,\n helpCGM,\n observeTransmitterUnbindStatusHandler,\n observeResetLogoutHandler,\n getSqliteDBPath,\n getCgmLogFilePaths,\n};"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAAwP,SAAAD,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AACxP;;AAEA;AACO,MAAMG,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAGE,qBAAQ,CAACC,MAAM,CAAC;EAC9CC,GAAG,EAAEC,0BAAmB;EACxBC,OAAO,EAAEC;AACX,CAAC,CAAC;;AAEF;AAeA;AAAA,IAAAC,QAAA,GAAAP,OAAA,CAAAF,OAAA,GACe;EACbC,gBAAgB;EAChBS,QAAQ,EAARA,oBAAQ;EACRC,0BAA0B,EAA1BA,sCAA0B;EAC1BC,sBAAsB,EAAtBA,kCAAsB;EACtBC,4BAA4B,EAA5BA,wCAA4B;EAC5BC,YAAY,EAAZA,wBAAY;EACZC,OAAO,EAAPA,mBAAO;EACPC,qCAAqC,EAArCA,iDAAqC;EACrCC,yBAAyB,EAAzBA,qCAAyB;EACzBC,eAAe,EAAfA,2BAAe;EACfC,kBAAkB,EAAlBA;AACF,CAAC","ignoreList":[]}
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MyTatvaRnSdkViewAndroid","MyTatvaRnSdkViewIOS","Platform","startCGM","initializeCGMEventListener","removeCGMEventListener","observeAllGlucoseDataHandler","reconnectCGM","helpCGM","observeTransmitterUnbindStatusHandler","observeResetLogoutHandler","getSqliteDBPath","getCgmLogFilePaths","MyTatvaRnSdkView","select","ios","android"],"sources":["index.js"],"sourcesContent":["import MyTatvaRnSdkViewAndroid from './MyTatvaRnSdkView.android';\nimport MyTatvaRnSdkViewIOS from './MyTatvaRnSdkView.ios';\nimport { Platform } from 'react-native';\nimport { startCGM, initializeCGMEventListener, removeCGMEventListener, observeAllGlucoseDataHandler, reconnectCGM, helpCGM, observeTransmitterUnbindStatusHandler, observeResetLogoutHandler, getSqliteDBPath, getCgmLogFilePaths } from './CGMConnect';\n// ... other imports\n\n// Export the platform-specific component\nexport const MyTatvaRnSdkView = Platform.select({\n ios: MyTatvaRnSdkViewIOS,\n android: MyTatvaRnSdkViewAndroid,\n});\n\n// Export individual functions\nexport {\n startCGM,\n initializeCGMEventListener,\n removeCGMEventListener,\n observeAllGlucoseDataHandler,\n reconnectCGM,\n helpCGM,\n observeTransmitterUnbindStatusHandler,\n observeResetLogoutHandler,\n getSqliteDBPath,\n getCgmLogFilePaths\n // ... other functions\n};\n\n// Export a default object with everything\nexport default {\n MyTatvaRnSdkView,\n startCGM,\n initializeCGMEventListener,\n removeCGMEventListener,\n observeAllGlucoseDataHandler,\n reconnectCGM,\n helpCGM,\n observeTransmitterUnbindStatusHandler,\n observeResetLogoutHandler,\n getSqliteDBPath,\n getCgmLogFilePaths
|
|
1
|
+
{"version":3,"names":["MyTatvaRnSdkViewAndroid","MyTatvaRnSdkViewIOS","Platform","startCGM","initializeCGMEventListener","removeCGMEventListener","observeAllGlucoseDataHandler","reconnectCGM","helpCGM","observeTransmitterUnbindStatusHandler","observeResetLogoutHandler","getSqliteDBPath","getCgmLogFilePaths","MyTatvaRnSdkView","select","ios","android"],"sources":["index.js"],"sourcesContent":["import MyTatvaRnSdkViewAndroid from './MyTatvaRnSdkView.android';\nimport MyTatvaRnSdkViewIOS from './MyTatvaRnSdkView.ios';\nimport { Platform } from 'react-native';\nimport { startCGM, initializeCGMEventListener, removeCGMEventListener, observeAllGlucoseDataHandler, reconnectCGM, helpCGM, observeTransmitterUnbindStatusHandler, observeResetLogoutHandler, getSqliteDBPath, getCgmLogFilePaths } from './CGMConnect';\n// ... other imports\n\n// Export the platform-specific component\nexport const MyTatvaRnSdkView = Platform.select({\n ios: MyTatvaRnSdkViewIOS,\n android: MyTatvaRnSdkViewAndroid,\n});\n\n// Export individual functions\nexport {\n startCGM,\n initializeCGMEventListener,\n removeCGMEventListener,\n observeAllGlucoseDataHandler,\n reconnectCGM,\n helpCGM,\n observeTransmitterUnbindStatusHandler,\n observeResetLogoutHandler,\n getSqliteDBPath,\n getCgmLogFilePaths\n // ... other functions\n};\n\n// Export a default object with everything\nexport default {\n MyTatvaRnSdkView,\n startCGM,\n initializeCGMEventListener,\n removeCGMEventListener,\n observeAllGlucoseDataHandler,\n reconnectCGM,\n helpCGM,\n observeTransmitterUnbindStatusHandler,\n observeResetLogoutHandler,\n getSqliteDBPath,\n getCgmLogFilePaths,\n};"],"mappings":"AAAA,OAAOA,uBAAuB,MAAM,4BAA4B;AAChE,OAAOC,mBAAmB,MAAM,wBAAwB;AACxD,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,QAAQ,EAAEC,0BAA0B,EAAEC,sBAAsB,EAAEC,4BAA4B,EAAEC,YAAY,EAAEC,OAAO,EAAEC,qCAAqC,EAAEC,yBAAyB,EAAEC,eAAe,EAAEC,kBAAkB,QAAQ,cAAc;AACvP;;AAEA;AACA,OAAO,MAAMC,gBAAgB,GAAGX,QAAQ,CAACY,MAAM,CAAC;EAC9CC,GAAG,EAAEd,mBAAmB;EACxBe,OAAO,EAAEhB;AACX,CAAC,CAAC;;AAEF;AACA,SACEG,QAAQ,EACRC,0BAA0B,EAC1BC,sBAAsB,EACtBC,4BAA4B,EAC5BC,YAAY,EACZC,OAAO,EACPC,qCAAqC,EACrCC,yBAAyB,EACzBC,eAAe,EACfC;AACA;AAAA;;AAGF;AACA,eAAe;EACbC,gBAAgB;EAChBV,QAAQ;EACRC,0BAA0B;EAC1BC,sBAAsB;EACtBC,4BAA4B;EAC5BC,YAAY;EACZC,OAAO;EACPC,qCAAqC;EACrCC,yBAAyB;EACzBC,eAAe;EACfC;AACF,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
package/src/index.js
CHANGED