@@ -57,6 +57,7 @@ public class LibreAlarmReceiver extends BroadcastReceiver {
5757 private static final Object lock = new Object ();
5858 private static long sensorAge = 0 ;
5959 private static long timeShiftNearest = -1 ;
60+ public static final String LIBRE_SOURCE_INFO = "Libre2" ;
6061
6162 public static void clearSensorStats () {
6263 Pref .setInt ("nfc_sensor_age" , 0 ); // reset for nfc sensors
@@ -273,7 +274,7 @@ public static void CalculateFromDataTransferObject(ReadingData readingData, bool
273274 if (use_raw ) {
274275 createBGfromGD (gd , use_smoothed_data , false ); // not quick for recent
275276 } else {
276- BgReading .bgReadingInsertFromInt (use_smoothed_data ? gd .glucoseLevelSmoothed : gd .glucoseLevel , gd .realDate , segmentation_timeslice , true );
277+ BgReading .bgReadingInsertFromInt (use_smoothed_data ? gd .glucoseLevelSmoothed : gd .glucoseLevel , gd .realDate , segmentation_timeslice , true , LIBRE_SOURCE_INFO );
277278 }
278279 }
279280 } else {
@@ -306,7 +307,9 @@ public static void insertFromHistory(final List<GlucoseData> mHistory, final boo
306307 } else {
307308 polyyList .add ((double ) gd .glucoseLevel );
308309 // add in the actual value
309- BgReading .bgReadingInsertFromInt (gd .glucoseLevel , gd .realDate , timeslice , false );
310+ if (gd .glucoseLevel > 0 ) {
311+ BgReading .bgReadingInsertFromInt (gd .glucoseLevel , gd .realDate , timeslice , false , LIBRE_SOURCE_INFO );
312+ }
310313 }
311314 }
312315
@@ -332,7 +335,7 @@ public static void insertFromHistory(final List<GlucoseData> mHistory, final boo
332335 // Here we do not use smoothed data, since data is already smoothed for the history
333336 createBGfromGD (new GlucoseData ((int ) polySplineF .value (ptime ), ptime ), false , true );
334337 } else {
335- BgReading .bgReadingInsertFromInt ((int ) polySplineF .value (ptime ), ptime , timeslice , false );
338+ BgReading .bgReadingInsertFromInt ((int ) polySplineF .value (ptime ), ptime , timeslice , false , LIBRE_SOURCE_INFO );
336339 }
337340 }
338341 } catch (org .apache .commons .math3 .exception .NonMonotonicSequenceException e ) {
0 commit comments