Skip to content

Commit 00ca282

Browse files
committed
Improve documentation; Change default device info
1 parent 834621d commit 00ca282

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

BleMouse.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ bool BleMouse::isConnected(void) {
133133

134134
void BleMouse::setBatteryLevel(uint8_t level) {
135135
this->batteryLevel = level;
136-
this->hid->setBatteryLevel(level);
137136
}
138137

139138
void BleMouse::taskServer(void* pvParameter) {

BleMouse.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class BleMouse {
2424
void rawAction(uint8_t msg[], char msgSize);
2525
static void taskServer(void* pvParameter);
2626
public:
27-
BleMouse(std::string deviceName = "Espressif", std::string deviceManufacturer = "ESP32 Bluetooth Mouse", uint8_t batteryLevel = 100);
27+
BleMouse(std::string deviceName = "ESP32 Bluetooth Mouse", std::string deviceManufacturer = "Espressif", uint8_t batteryLevel = 100);
2828
void begin(void);
2929
void end(void);
3030
void click(uint8_t b = MOUSE_LEFT);

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ This library allows you to make the ESP32 act as a Bluetooth Mouse and control w
1212
- [x] Move mouse pointer up/down
1313
- [x] Scroll up/down
1414
- [x] Scroll left/right
15+
- [ ] Report optional battery level to host
16+
- [x] Customize Bluetooth device name/manufacturer
1517
- [x] Compatible with Android
1618
- [x] Compatible with Windows
1719
- [x] Compatible with Linux
@@ -59,11 +61,18 @@ Just remember that you have to use `bleMouse` instead of just `Mouse` and you ne
5961
BleMouse bleMouse;
6062
```
6163

62-
This library supports two additional features that the Mouse library does not support at the time of writing:
64+
This library supports a few additional features that the Mouse library does not support at the time of writing:
6365

6466
- Scrolling left/right E.g.: `bleMouse.move(0,0,0,1)` (Scroll left) and `bleMouse.move(0,0,0,-1)` (Scroll right)
6567
- Using the back and forward buttons E.g.: `bleMouse.click(MOUSE_BACK)` and `bleMouse.click(MOUSE_FORWARD)`
6668

69+
There is also Bluetooth specific information that you can use (optional):
70+
71+
Instead of `BleMouse bleMouse;` you can do `BleMouse bleMouse("Bluetooth Device Name", "Bluetooth Device Manufacturer", 100);`.
72+
The third parameter is the initial battery level of your device. To adjust the battery level later on you can simply call e.g. `bleMouse.setBatteryLevel(50)` (set battery level to 50%).
73+
By default the battery level will be set to 100%, the device name will be `ESP32 Bluetooth Mouse` and the manufacturer will be `Espressif`.
74+
75+
6776
## Credits
6877

6978
Credits to [chegewara](https://github.com/chegewara) as this library is based on [this piece of code](https://github.com/nkolban/esp32-snippets/issues/230#issuecomment-473135679) that he provided.

0 commit comments

Comments
 (0)