feat: 全量同步 254 个常用的 Arduino 扩展库文件
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
#include "KeyboardOutputCallbacks.h"
|
||||
|
||||
#if defined(CONFIG_ARDUHAL_ESP_LOG)
|
||||
#include "esp32-hal-log.h"
|
||||
#define LOG_TAG ""
|
||||
#else
|
||||
#include "esp_log.h"
|
||||
static const char* LOG_TAG = "BLEDevice";
|
||||
#endif
|
||||
|
||||
KeyboardOutputCallbacks::KeyboardOutputCallbacks(void) {
|
||||
}
|
||||
|
||||
void KeyboardOutputCallbacks::onWrite(BLECharacteristic* me) {
|
||||
uint8_t* value = (uint8_t*)(me->getValue().c_str());
|
||||
ESP_LOGI(LOG_TAG, "special keys: %d", *value);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
#ifndef ESP32_BLE_KEYBOARD_OUTPUT_CALLBACKS_H
|
||||
#define ESP32_BLE_KEYBOARD_OUTPUT_CALLBACKS_H
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
|
||||
#include <BLEServer.h>
|
||||
#include "BLE2902.h"
|
||||
#include "BLECharacteristic.h"
|
||||
|
||||
class KeyboardOutputCallbacks : public BLECharacteristicCallbacks
|
||||
{
|
||||
public:
|
||||
KeyboardOutputCallbacks(void);
|
||||
void onWrite(BLECharacteristic* me);
|
||||
};
|
||||
|
||||
#endif // CONFIG_BT_ENABLED
|
||||
#endif // ESP32_BLE_KEYBOARD_OUTPUT_CALLBACKS_H
|
||||
Reference in New Issue
Block a user