I am currently trying to write a Bluetooth Mouse library for the ESP32 that works with the Arduino IDE.
But I'm having trouble fixing a couple of errors:
/home/fedora/Arduino/libraries/ESP32-BLE-Mouse/BleMouse.cpp: In constructor 'BleMouse::BleMouse()':
/home/fedora/Arduino/libraries/ESP32-BLE-Mouse/BleMouse.cpp:14:20: error: no matching function for call to 'BleConnectionStatus::BleConnectionStatus()'
BleMouse::BleMouse() {
^
In file included from /home/fedora/Arduino/libraries/ESP32-BLE-Mouse/BleMouse.cpp:11:0:
/home/fedora/Arduino/libraries/ESP32-BLE-Mouse/BleConnectionStatus.h:12:3: note: candidate: BleConnectionStatus::BleConnectionStatus(BLECharacteristic*)
BleConnectionStatus(BLECharacteristic* inputMouse);
^
/home/fedora/Arduino/libraries/ESP32-BLE-Mouse/BleConnectionStatus.h:12:3: note: candidate expects 1 argument, 0 provided
/home/fedora/Arduino/libraries/ESP32-BLE-Mouse/BleConnectionStatus.h:10:7: note: candidate: constexpr BleConnectionStatus::BleConnectionStatus(const BleConnectionStatus&)
class BleConnectionStatus : public BLEServerCallbacks {
^
/home/fedora/Arduino/libraries/ESP32-BLE-Mouse/BleConnectionStatus.h:10:7: note: candidate expects 1 argument, 0 provided
/home/fedora/Arduino/libraries/ESP32-BLE-Mouse/BleConnectionStatus.h:10:7: note: candidate: constexpr BleConnectionStatus::BleConnectionStatus(BleConnectionStatus&&)
/home/fedora/Arduino/libraries/ESP32-BLE-Mouse/BleConnectionStatus.h:10:7: note: candidate expects 1 argument, 0 provided
/home/fedora/Arduino/libraries/ESP32-BLE-Mouse/BleMouse.cpp:15:26: error: no match for 'operator=' (operand types are 'BleConnectionStatus' and 'BleConnectionStatus*')
this->connectionStatus = new BleConnectionStatus(this->inputMouse);
^
In file included from /home/fedora/Arduino/libraries/ESP32-BLE-Mouse/BleMouse.cpp:11:0:
/home/fedora/Arduino/libraries/ESP32-BLE-Mouse/BleConnectionStatus.h:10:7: note: candidate: BleConnectionStatus& BleConnectionStatus::operator=(const BleConnectionStatus&)
class BleConnectionStatus : public BLEServerCallbacks {
^
/home/fedora/Arduino/libraries/ESP32-BLE-Mouse/BleConnectionStatus.h:10:7: note: no known conversion for argument 1 from 'BleConnectionStatus*' to 'const BleConnectionStatus&'
/home/fedora/Arduino/libraries/ESP32-BLE-Mouse/BleConnectionStatus.h:10:7: note: candidate: BleConnectionStatus& BleConnectionStatus::operator=(BleConnectionStatus&&)
/home/fedora/Arduino/libraries/ESP32-BLE-Mouse/BleConnectionStatus.h:10:7: note: no known conversion for argument 1 from 'BleConnectionStatus*' to 'BleConnectionStatus&&'
/home/fedora/Arduino/libraries/ESP32-BLE-Mouse/BleMouse.cpp: In member function 'void BleMouse::init()':
/home/fedora/Arduino/libraries/ESP32-BLE-Mouse/BleMouse.cpp:19:57: error: invalid use of non-static member function
xTaskCreate(taskServer, "server", 20000, NULL, 5, NULL);
^
/home/fedora/Arduino/libraries/ESP32-BLE-Mouse/BleMouse.cpp: In member function 'void BleMouse::taskServer(void*)':
/home/fedora/Arduino/libraries/ESP32-BLE-Mouse/BleMouse.cpp:25:47: error: no matching function for call to 'BLEServer::setCallbacks(BleConnectionStatus&)'
pServer->setCallbacks(this->connectionStatus);
^
In file included from /home/fedora/.arduino15/packages/esp32/hardware/esp32/1.0.2/libraries/BLE/src/BLEDevice.h:18:0,
from /home/fedora/Arduino/libraries/ESP32-BLE-Mouse/BleMouse.cpp:1:
/home/fedora/.arduino15/packages/esp32/hardware/esp32/1.0.2/libraries/BLE/src/BLEServer.h:69:18: note: candidate: void BLEServer::setCallbacks(BLEServerCallbacks*)
void setCallbacks(BLEServerCallbacks* pCallbacks);
^
/home/fedora/.arduino15/packages/esp32/hardware/esp32/1.0.2/libraries/BLE/src/BLEServer.h:69:18: note: no known conversion for argument 1 from 'BleConnectionStatus' to 'BLEServerCallbacks*'
/home/fedora/Arduino/libraries/ESP32-BLE-Mouse/BleMouse.cpp:80:12: error: 'LOG_TAG' was not declared in this scope
ESP_LOGD(LOG_TAG, "Advertising started!");
^
/home/fedora/Arduino/libraries/ESP32-BLE-Mouse/BleMouse.cpp:80:43: error: 'ESP_LOGD' was not declared in this scope
ESP_LOGD(LOG_TAG, "Advertising started!");
^
/home/fedora/Arduino/libraries/ESP32-BLE-Mouse/BleMouse.cpp:81:22: error: 'delay' was not declared in this scope
delay(portMAX_DELAY);
^
/home/fedora/Arduino/libraries/ESP32-BLE-Mouse/BleMouse.cpp: In member function 'bool BleMouse::isConnected()':
/home/fedora/Arduino/libraries/ESP32-BLE-Mouse/BleMouse.cpp:85:32: error: base operand of '->' has non-pointer type 'BleConnectionStatus'
return this->connectionStatus->connected;
^
/home/fedora/Arduino/libraries/ESP32-BLE-Mouse/BleMouse.cpp: In function 'void rawAction(uint8_t, char)':
/home/fedora/Arduino/libraries/ESP32-BLE-Mouse/BleMouse.cpp:89:3: error: invalid use of 'this' in non-member function
this->inputMouse->setValue(msg, msgSize);
^
/home/fedora/Arduino/libraries/ESP32-BLE-Mouse/BleMouse.cpp:90:3: error: invalid use of 'this' in non-member function
this->inputMouse->notify();
^
/home/fedora/Arduino/libraries/ESP32-BLE-Mouse/BleMouse.cpp: In member function 'void BleMouse::scrollDown(char)':
/home/fedora/Arduino/libraries/ESP32-BLE-Mouse/BleMouse.cpp:96:27: error: invalid conversion from 'uint8_t* {aka unsigned char*}' to 'uint8_t {aka unsigned char}' [-fpermissive]
this->rawAction(msg, 4);
^
In file included from /home/fedora/Arduino/libraries/ESP32-BLE-Mouse/BleMouse.cpp:12:0:
/home/fedora/Arduino/libraries/ESP32-BLE-Mouse/BleMouse.h:18:8: note: initializing argument 1 of 'void BleMouse::rawAction(uint8_t, char)'
void rawAction(uint8_t msg, char msgSize);
^
/home/fedora/Arduino/libraries/ESP32-BLE-Mouse/BleMouse.cpp: In member function 'void BleMouse::scrollUp(char)':
/home/fedora/Arduino/libraries/ESP32-BLE-Mouse/BleMouse.cpp:103:27: error: invalid conversion from 'uint8_t* {aka unsigned char*}' to 'uint8_t {aka unsigned char}' [-fpermissive]
this->rawAction(msg, 4);
^
In file included from /home/fedora/Arduino/libraries/ESP32-BLE-Mouse/BleMouse.cpp:12:0:
/home/fedora/Arduino/libraries/ESP32-BLE-Mouse/BleMouse.h:18:8: note: initializing argument 1 of 'void BleMouse::rawAction(uint8_t, char)'
void rawAction(uint8_t msg, char msgSize);
^
exit status 1
Error compiling for board ESP32 Dev Module.
To me the code looks just fine though:
BleMouse::BleMouse() {
this->connectionStatus = new BleConnectionStatus(this->inputMouse);
}
Any ideas?
The full source code can be found here: GitHub - T-vK/ESP32-BLE-Mouse: Bluetooth LE Mouse library for the ESP32 (Arduino IDE compatible)
The library in its current state can be downloaded here: https://github.com/T-vK/ESP32-BLE-Mouse/archive/not-working-v0.1.zip
I tried to compile the example.