68dd7e95ab
- 在 sdkconfig.defaults 中更新 BLE 配置以支持 HID 键盘功能 - 新增 ble_hid.c 和 ble_hid.h 文件,实现 BLE HID 键盘的核心功能 - 更新 CMakeLists.txt,包含新的服务文件以支持 BLE HID - 修改 ui_handlers.c,响应启动按钮事件以发送 HID 按键 - 更新 ble_manager.c,初始化 BLE HID 功能并处理连接状态 - 新增 esp_hid_gap.c 和 esp_hid_gap.h 文件,管理 BLE HID 的 GAP 相关功能
45 lines
642 B
C
45 lines
642 B
C
#include "ui_handlers.h"
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include "ble_hid.h"
|
|
#include "boot_button.h"
|
|
#include "esp_log.h"
|
|
#include "ui_events.h"
|
|
|
|
static const char *TAG = "ui_handlers";
|
|
|
|
static void on_boot_press(void)
|
|
{
|
|
if (ble_hid_ready()) {
|
|
ble_hid_send_combo(0, HID_KEY_C);
|
|
} else {
|
|
ESP_LOGW(TAG, "HID not ready");
|
|
}
|
|
}
|
|
|
|
void ui_handlers_init(void)
|
|
{
|
|
boot_button_init(on_boot_press);
|
|
}
|
|
|
|
void update_year_action(lv_event_t * e)
|
|
{
|
|
(void)e;
|
|
}
|
|
|
|
void click_button_two(lv_event_t * e)
|
|
{
|
|
(void)e;
|
|
}
|
|
|
|
void click_button_three(lv_event_t * e)
|
|
{
|
|
(void)e;
|
|
}
|
|
|
|
void click_button_one(lv_event_t * e)
|
|
{
|
|
(void)e;
|
|
}
|