Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ public static enum BT_MODULE_VERSION {
RN4678_VERSION_RESPONSE_V1_22_0("RN4678 V1.22 12/08/2020 (c)Microchip Technology Inc ", "RN4678 V1.22 ", "RN4678 v1.23"),
RN4678_VERSION_RESPONSE_V1_23_0("RN4678 V1.23 06/30/2021 (c)Microchip Technology Inc", "RN4678 V1.23 ", "RN4678 v1.23"),

VELA_IF820_V01_04_12_12("CYW20820 app=v01.04.12.12", "CYW20820 app=v01.04.12.12", "IF820 v01.04.12.12"),
VELA_IF820_V01_04_16_16("CYW20820 app=v01.04.16.16", "CYW20820 app=v01.04.16.16", "IF820 v01.04.16.16"),

UNKNOWN("Unknown", "Unknown", "Unknown");

public String btModuleVerStrFull = "";
Expand All @@ -46,8 +49,15 @@ public void parseBtModuleVerBytes(byte[] responseData) {

mBtModuleVersionParsed = BT_MODULE_VERSION.UNKNOWN;
for (BT_MODULE_VERSION btModuleVersion : BT_MODULE_VERSION.values()) {
if(mBtModuleVersionReceived.contains(btModuleVersion.btModuleVerStrComparison)) {
if(btModuleVersion == BT_MODULE_VERSION.NOT_READ) {
if(mBtModuleVersionReceived.isEmpty()) {
mBtModuleVersionParsed = BT_MODULE_VERSION.NOT_READ;
break;
}
}
else if(mBtModuleVersionReceived.contains(btModuleVersion.btModuleVerStrComparison)) {
mBtModuleVersionParsed = btModuleVersion;
break;
}
}
}
Expand All @@ -60,4 +70,8 @@ public String getUserFriendlyName() {
}
}

public String getBtModuleVersionReceived() {
return mBtModuleVersionReceived;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ else if((mChargingStatusRaw & 0xFF) == CHARGING_STATUS_BYTE.UNKNOWN) {
}
}

public CHARGING_STATUS getChargingStatus() {
return mChargingStatus;
}

public static double adcValToBattVoltage(int adcVal){
double calibratedData = SensorADC.calibrateU12AdcValueToMillivolts(adcVal, 0.0, 3.0, 1.0);
double battVoltage = ((calibratedData * 1.988)) / 1000; // 1.988 is due to components on the Shimmmer, 1000 is to convert to volts
Expand Down
Loading