forked from NightscoutFoundation/xDrip
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
- Loading branch information
Showing
13 changed files
with
512 additions
and
10 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
app/src/main/java/com/eveningoutpost/dexdrip/receivers/aidex/AidexBroadcastIntents.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
package com.eveningoutpost.dexdrip.receivers.aidex; | ||
|
||
/** | ||
* created by Andy 4/3/2022 | ||
*/ | ||
public interface AidexBroadcastIntents { | ||
// DON'T CHANGE THIS - START | ||
|
||
/** | ||
* Permission receiving application will need to use if not running in old model | ||
*/ | ||
String RECEIVER_PERMISSION = "com.microtechmd.cgms.aidex.permissions.RECEIVE_BG_ESTIMATE"; | ||
|
||
/** | ||
* Aidex Action: New Bg Estimate | ||
*/ | ||
String ACTION_NEW_BG_ESTIMATE = "com.microtechmd.cgms.aidex.action.BgEstimate"; | ||
|
||
/** | ||
* Aidex Action: Calibration | ||
*/ | ||
String ACTION_CALIBRATION = "com.microtechmd.cgms.aidex.action.Calibration"; | ||
|
||
/** | ||
* Aidex Action: New Sensor | ||
*/ | ||
String ACTION_SENSOR_NEW = "com.microtechmd.cgms.aidex.action.SensorNew"; | ||
|
||
/** | ||
* Aidex Action: Restart Sensor | ||
*/ | ||
String ACTION_SENSOR_RESTART = "com.microtechmd.cgms.aidex.action.SensorRestart"; | ||
|
||
/** | ||
* Aidex Action: Stop Sensor | ||
*/ | ||
String ACTION_SENSOR_STOP = "com.microtechmd.cgms.aidex.action.SensorStop"; | ||
|
||
/** | ||
* Aidex Action: Notification | ||
*/ | ||
String ACTION_NOTIFICATION = "com.microtechmd.cgms.aidex.action.Notification"; | ||
|
||
|
||
// DATA | ||
/** | ||
* BG Type: Can be either mmol/l or mg/dl | ||
*/ | ||
String AIDEX_BG_TYPE = "com.microtechmd.cgms.aidex.BgType"; | ||
|
||
/** | ||
* BG Value: Its float (so it can be 10.0 or 181.0) | ||
*/ | ||
String AIDEX_BG_VALUE = "com.microtechmd.cgms.aidex.BgValue"; | ||
|
||
/** | ||
* BG Slope Name: following values are valid: | ||
* "DoubleUp", "SingleUp", "FortyFiveUp", "Flat", "FortyFiveDown", "SingleDown", | ||
* "DoubleDown", "NotComputable", "RateOutOfRange" | ||
*/ | ||
String AIDEX_BG_SLOPE_NAME = "com.microtechmd.cgms.aidex.BgSlopeName"; | ||
|
||
/** | ||
* Timestamp as Epoch (System.currentTimeMillis()) in miliseconds | ||
*/ | ||
String AIDEX_TIMESTAMP = "com.microtechmd.cgms.aidex.Time"; // epoch in ms | ||
|
||
/** | ||
* Transmitter Id (String) | ||
*/ | ||
String AIDEX_TRANSMITTER_SN = "com.microtechmd.cgms.aidex.TransmitterSerialNumber"; | ||
|
||
/** | ||
* Sensor Id (String) | ||
*/ | ||
String AIDEX_SENSOR_ID = "com.microtechmd.cgms.aidex.SensorId"; | ||
|
||
/** | ||
* Message Type (SENSOR_ERROR, CALIBRATION_REQUESTED, BATTERY_LOW, | ||
* BATTERY_EMPTY, SENSOR_EXPIRED, OTHER) | ||
*/ | ||
String AIDEX_MESSAGE_TYPE = "com.microtechmd.cgms.aidex.MessageType"; | ||
|
||
/** | ||
* Message Value | ||
*/ | ||
String AIDEX_MESSAGE_VALUE = "com.microtechmd.cgms.aidex.MessageValue"; | ||
|
||
String UNIT_MMOL_L = "mmol/l"; | ||
String UNIT_MG_DL = "mg/dl"; | ||
|
||
// DON'T CHANGE THIS - END | ||
|
||
// You can add your own data here | ||
|
||
} |
45 changes: 45 additions & 0 deletions
45
app/src/main/java/com/eveningoutpost/dexdrip/receivers/aidex/AidexMessageType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package com.eveningoutpost.dexdrip.receivers.aidex; | ||
|
||
import android.support.annotation.StringRes; | ||
|
||
import com.eveningoutpost.dexdrip.R; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public enum AidexMessageType { | ||
SENSOR_ERROR(null), | ||
TRANSMITTER_ERROR(null), | ||
CALIBRATION_REQUESTED(null), | ||
GLUCOSE_INVALID(null), | ||
BATTERY_LOW(null), | ||
BATTERY_EMPTY(null), | ||
SENSOR_EXPIRED(null), | ||
OTHER(null); | ||
|
||
static Map<String,AidexMessageType> mapByKey; | ||
private @StringRes Integer resourceId; | ||
|
||
static { | ||
mapByKey = new HashMap<>(); | ||
|
||
for (AidexMessageType value : values()) { | ||
mapByKey.put(value.name(), value); | ||
} | ||
} | ||
|
||
AidexMessageType(@StringRes Integer resourceId) { | ||
this.resourceId = resourceId; | ||
} | ||
|
||
public static AidexMessageType getByKey(String key) { | ||
if (mapByKey.containsKey(key)) | ||
return mapByKey.get(key); | ||
else | ||
return OTHER; | ||
} | ||
|
||
public int getResourceId() { | ||
return resourceId; | ||
} | ||
} |
Oops, something went wrong.