Skip to content

Commit 7589e11

Browse files
committed
Add battery check commands to CLI
1 parent 6db6e7f commit 7589e11

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Firmware/RTK_Everywhere/menuCommands.ino

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1890,6 +1890,8 @@ void writeToString(char *settingValueStr, char *value)
18901890
// Given a settingName, create a string with setting value
18911891
// Used in conjunction with the command line interface
18921892
// The order of variables matches the order found in settings.h
1893+
// $SPGET,[setting name]*FF<CR><LF>
1894+
// Ex: $SPGET,batteryLevelPercent*19
18931895
SettingValueResponse getSettingValue(bool inCommands, const char *settingName, char *settingValueStr)
18941896
{
18951897
int i;
@@ -2264,6 +2266,24 @@ SettingValueResponse getSettingValue(bool inCommands, const char *settingName, c
22642266
writeToString(settingValueStr, enableRCFirmware);
22652267
knownSetting = true;
22662268
}
2269+
else if (strcmp(settingName, "batteryLevelPercent") == 0)
2270+
{
2271+
checkBatteryLevels();
2272+
writeToString(settingValueStr, batteryLevelPercent);
2273+
knownSetting = true;
2274+
}
2275+
else if (strcmp(settingName, "batteryVoltage") == 0)
2276+
{
2277+
checkBatteryLevels();
2278+
writeToString(settingValueStr, batteryVoltage);
2279+
knownSetting = true;
2280+
}
2281+
else if (strcmp(settingName, "batteryChargingPercentPerHour") == 0)
2282+
{
2283+
checkBatteryLevels();
2284+
writeToString(settingValueStr, batteryChargingPercentPerHour);
2285+
knownSetting = true;
2286+
}
22672287

22682288
// Unused variables - read to avoid errors
22692289
// TODO: check this! Is this really what we want?

0 commit comments

Comments
 (0)