Read the battery level from the M913

This commit is contained in:
dokutan 2021-11-24 20:41:47 +01:00
parent 4cbbb26d4d
commit d5776827e7
2 changed files with 14 additions and 0 deletions

View file

@ -56,6 +56,13 @@ int mouse_m686::read_and_print_settings( std::ostream& output ){
<< "# This configuration can be send to the mouse with mouse_m908 -c.\n"
<< "# Note: this feature is incomplete for the m686.\n\n";
// battery level
output << "# Battery level: ";
if(buffer_in[68][6] <= 10)
output << (int)(buffer_in[68][6] * 10) << " %\n\n";
else
output << "unkown, please report as a bug (" << (int)buffer_in[68][6] << ")\n\n";
output
<< "# The m686 has two profiles that can be switched using the 'mode switch' button on the bottom of the mouse.\n"
<< "# Reading the settings can only be done for the active profile, therefore only profile1 is used in this config.\n"

View file

@ -56,6 +56,13 @@ int mouse_m913::read_and_print_settings( std::ostream& output ){
<< "# This configuration can be send to the mouse with mouse_m908 -c.\n"
<< "# Note: this feature is incomplete for the M913.\n\n";
// battery level
output << "# Battery level: ";
if(buffer_in[68][6] <= 10)
output << (int)(buffer_in[68][6] * 10) << " %\n\n";
else
output << "unkown, please report as a bug (" << (int)buffer_in[68][6] << ")\n\n";
output
<< "# The M913 has two profiles that can be switched using the 'mode switch' button on the bottom of the mouse.\n"
<< "# Reading the settings can only be done for the active profile, therefore only profile1 is used in this config.\n"