@@ -2970,6 +2970,22 @@ SettingValueResponse getSettingValue(bool inCommands, const char *settingName, c
2970
2970
settingIsString = true ;
2971
2971
}
2972
2972
}
2973
+ else if (strcmp (settingName, " bluetoothId" ) == 0 )
2974
+ {
2975
+ // Get the last two digits of Bluetooth MAC
2976
+ char macAddress[5 ];
2977
+ snprintf (macAddress, sizeof (macAddress), " %02X%02X" , btMACAddress[4 ], btMACAddress[5 ]);
2978
+
2979
+ writeToString (settingValueStr, macAddress);
2980
+ knownSetting = true ;
2981
+ settingIsString = true ;
2982
+ }
2983
+ else if (strcmp (settingName, " deviceName" ) == 0 )
2984
+ {
2985
+ writeToString (settingValueStr, (char *)productDisplayNames[productVariant]);
2986
+ knownSetting = true ;
2987
+ settingIsString = true ;
2988
+ }
2973
2989
else if (strcmp (settingName, " deviceId" ) == 0 )
2974
2990
{
2975
2991
writeToString (settingValueStr, (char *)printDeviceId ());
@@ -3011,19 +3027,20 @@ SettingValueResponse getSettingValue(bool inCommands, const char *settingName, c
3011
3027
else if (strcmp (settingName, " batteryLevelPercent" ) == 0 )
3012
3028
{
3013
3029
checkBatteryLevels ();
3014
- writeToString (settingValueStr, batteryLevelPercent);
3030
+ writeToString (settingValueStr, batteryLevelPercent, 0 );
3015
3031
knownSetting = true ;
3032
+ settingIsString = true ;
3016
3033
}
3017
3034
else if (strcmp (settingName, " batteryVoltage" ) == 0 )
3018
3035
{
3019
3036
checkBatteryLevels ();
3020
- writeToString (settingValueStr, batteryVoltage);
3037
+ writeToString (settingValueStr, batteryVoltage, 2 );
3021
3038
knownSetting = true ;
3022
3039
}
3023
3040
else if (strcmp (settingName, " batteryChargingPercentPerHour" ) == 0 )
3024
3041
{
3025
3042
checkBatteryLevels ();
3026
- writeToString (settingValueStr, batteryChargingPercentPerHour);
3043
+ writeToString (settingValueStr, batteryChargingPercentPerHour, 0 );
3027
3044
knownSetting = true ;
3028
3045
}
3029
3046
@@ -3596,11 +3613,27 @@ const char *commandGetName(int stringIndex, int rtkIndex)
3596
3613
else if (rtkIndex == COMMAND_GNSS_MODULE_INFO)
3597
3614
return " gnssModuleInfo" ;
3598
3615
3616
+ // Display the current battery level as a percent
3617
+ else if (rtkIndex == COMMAND_BATTERY_LEVEL_PERCENT)
3618
+ return " batteryLevelPercent" ;
3619
+
3620
+ // Display the current battery level as a percent
3621
+ else if (rtkIndex == COMMAND_BATTERY_VOLTAGE)
3622
+ return " batteryVoltage" ;
3623
+
3624
+ // Display the current battery charging percent per hour
3625
+ else if (rtkIndex == COMMAND_BATTERY_CHARGING_PERCENT)
3626
+ return " batteryChargingPercentPerHour" ;
3627
+
3599
3628
// Display the last four characters of the Bluetooth MAC address
3600
3629
else if (rtkIndex == COMMAND_BLUETOOTH_ID)
3601
3630
return " bluetoothId" ;
3602
3631
3603
- // Display the device ID - used in PointPerfect
3632
+ // Display the device Name
3633
+ else if (rtkIndex == COMMAND_DEVICE_NAME)
3634
+ return " deviceName" ;
3635
+
3636
+ // Display the device ID
3604
3637
else if (rtkIndex == COMMAND_DEVICE_ID)
3605
3638
return " deviceId" ;
3606
3639
@@ -3871,7 +3904,55 @@ void printAvailableSettings()
3871
3904
commandSendExecuteListResponse (" gnssModuleInfo" , settingType, printGnssModuleInfo ());
3872
3905
}
3873
3906
3874
- // Display the current RTK Firmware version
3907
+ // Display the current battery level as a percent
3908
+ else if (commandIndex[i] == COMMAND_BATTERY_LEVEL_PERCENT)
3909
+ {
3910
+ checkBatteryLevels ();
3911
+
3912
+ // Convert int to string
3913
+ char batteryLvlStr[4 ] = {0 }; // 104
3914
+ snprintf (batteryLvlStr, sizeof (batteryLvlStr), " %d" , batteryLevelPercent);
3915
+
3916
+ // Create the settingType based on the length of the firmware version
3917
+ char settingType[100 ];
3918
+ snprintf (settingType, sizeof (settingType), " char[%d]" , strlen (batteryLvlStr));
3919
+
3920
+ commandSendExecuteListResponse (" batteryLevelPercent" , settingType, batteryLvlStr);
3921
+ }
3922
+
3923
+ // Display the current battery voltage
3924
+ else if (commandIndex[i] == COMMAND_BATTERY_VOLTAGE)
3925
+ {
3926
+ checkBatteryLevels ();
3927
+
3928
+ // Convert int to string
3929
+ char batteryVoltageStr[6 ] = {0 }; // 11.25
3930
+ snprintf (batteryVoltageStr, sizeof (batteryVoltageStr), " %0.2f" , batteryVoltage);
3931
+
3932
+ // Create the settingType based on the length of the firmware version
3933
+ char settingType[100 ];
3934
+ snprintf (settingType, sizeof (settingType), " char[%d]" , strlen (batteryVoltageStr));
3935
+
3936
+ commandSendExecuteListResponse (" batteryVoltage" , settingType, batteryVoltageStr);
3937
+ }
3938
+
3939
+ // Display the current battery charging percent per hour
3940
+ else if (commandIndex[i] == COMMAND_BATTERY_CHARGING_PERCENT)
3941
+ {
3942
+ checkBatteryLevels ();
3943
+
3944
+ // Convert int to string
3945
+ char batteryChargingPercentStr[3 ] = {0 }; // 45
3946
+ snprintf (batteryChargingPercentStr, sizeof (batteryChargingPercentStr), " %0.0f" , batteryChargingPercentStr);
3947
+
3948
+ // Create the settingType based on the length of the firmware version
3949
+ char settingType[100 ];
3950
+ snprintf (settingType, sizeof (settingType), " char[%d]" , strlen (batteryChargingPercentStr));
3951
+
3952
+ commandSendExecuteListResponse (" batteryChargingPercentPerHour" , settingType, batteryChargingPercentStr);
3953
+ }
3954
+
3955
+ // Display the last four characters of the Bluetooth MAC
3875
3956
else if (commandIndex[i] == COMMAND_BLUETOOTH_ID)
3876
3957
{
3877
3958
// Get the last two digits of Bluetooth MAC
@@ -3885,7 +3966,15 @@ void printAvailableSettings()
3885
3966
commandSendExecuteListResponse (" bluetoothId" , settingType, macAddress);
3886
3967
}
3887
3968
3888
- // Display the device ID - used in PointPerfect
3969
+ // Display the device name
3970
+ else if (commandIndex[i] == COMMAND_DEVICE_NAME)
3971
+ {
3972
+ char settingType[100 ];
3973
+ snprintf (settingType, sizeof (settingType), " char[%d]" , strlen (productDisplayNames[productVariant]));
3974
+ commandSendExecuteListResponse (" deviceName" , settingType, productDisplayNames[productVariant]);
3975
+ }
3976
+
3977
+ // Display the device ID
3889
3978
else if (commandIndex[i] == COMMAND_DEVICE_ID)
3890
3979
{
3891
3980
char settingType[100 ];
0 commit comments