Skip to content

Commit

Permalink
Merge pull request #4 from grafmar/master
Browse files Browse the repository at this point in the history
batteryLevel fix
  • Loading branch information
T-vK authored Feb 13, 2020
2 parents 00ca282 + 1a39410 commit 0efcc28
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion BleMouse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ static const uint8_t _hidReportDescriptor[] = {
END_COLLECTION(0) // END_COLLECTION
};

BleMouse::BleMouse(std::string deviceName, std::string deviceManufacturer, uint8_t batteryLevel) : _buttons(0)
BleMouse::BleMouse(std::string deviceName, std::string deviceManufacturer, uint8_t batteryLevel) :
_buttons(0),
hid(0)
{
this->deviceName = deviceName;
this->deviceManufacturer = deviceManufacturer;
Expand Down Expand Up @@ -133,6 +135,8 @@ bool BleMouse::isConnected(void) {

void BleMouse::setBatteryLevel(uint8_t level) {
this->batteryLevel = level;
if (hid != 0)
this->hid->setBatteryLevel(this->batteryLevel);
}

void BleMouse::taskServer(void* pvParameter) {
Expand Down

0 comments on commit 0efcc28

Please sign in to comment.