Lotlab / nrf52-keyboard

A ble keyboard firmware using nrf52810/52832
Other
415 stars 260 forks source link

允许用户自定义蓝牙设备类型 #119

Closed myst729 closed 1 year ago

myst729 commented 1 year ago

在键盘文件的 config.h 中 定义宏 DEVICE_BLE_APPEARANCE

FYI

jim-kirisame commented 1 year ago

see https://github.com/Lotlab/nrf52-keyboard/commit/f7239f9060e21220bf29359462d2755aa48b32f3

myst729 commented 1 year ago

这是为啥 😆 可以让用户在 config.h 里面声明吗?类似这种:

#ifdef DEVICE_BLE_APPEARANCE
    err_code = sd_ble_gap_appearance_set(DEVICE_BLE_APPEARANCE);
#else
    err_code = sd_ble_gap_appearance_set(BLE_APPEARANCE_GENERIC_HID);
#endif
jim-kirisame commented 1 year ago

我记得是好像部分设备如果不设置成Generic的话,有些特殊的功能就用不了

myst729 commented 1 year ago

现在这种改法呢?

jim-kirisame commented 1 year ago

可以