Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions BleKeyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,11 @@ void BleKeyboard::set_version(uint16_t version) {
this->version = version;
}

void BleKeyboard::sendReport(KeyReport* keys)
void BleKeyboard::sendReport(BLEKeyReport* keys)
{
if (this->isConnected())
{
this->inputKeyboard->setValue((uint8_t*)keys, sizeof(KeyReport));
this->inputKeyboard->setValue((uint8_t*)keys, sizeof(BLEKeyReport));
this->inputKeyboard->notify();
#if defined(USE_NIMBLE)
// vTaskDelay(delayTicks);
Expand Down Expand Up @@ -543,4 +543,4 @@ void BleKeyboard::delay_ms(uint64_t ms) {
}
while(esp_timer_get_time() < e) {}
}
}
}
6 changes: 3 additions & 3 deletions BleKeyboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ typedef struct
uint8_t modifiers;
uint8_t reserved;
uint8_t keys[6];
} KeyReport;
} BLEKeyReport;

class BleKeyboard : public Print, public BLEServerCallbacks, public BLECharacteristicCallbacks
{
Expand All @@ -136,7 +136,7 @@ class BleKeyboard : public Print, public BLEServerCallbacks, public BLECharacter
BLECharacteristic* outputKeyboard;
BLECharacteristic* inputMediaKeys;
BLEAdvertising* advertising;
KeyReport _keyReport;
BLEKeyReport _keyReport;
MediaKeyReport _mediaKeyReport;
std::string deviceName;
std::string deviceManufacturer;
Expand All @@ -153,7 +153,7 @@ class BleKeyboard : public Print, public BLEServerCallbacks, public BLECharacter
BleKeyboard(std::string deviceName = "ESP32 Keyboard", std::string deviceManufacturer = "Espressif", uint8_t batteryLevel = 100);
void begin(void);
void end(void);
void sendReport(KeyReport* keys);
void sendReport(BLEKeyReport* keys);
void sendReport(MediaKeyReport* keys);
size_t press(uint8_t k);
size_t press(const MediaKeyReport k);
Expand Down