英文:
How to configure device type in bluethooth advertising package?
问题
I'm developing a custom bluetooth keyboard. It works now smoothly, but there's one thing I can't figure out. In macOS bluetooth settings page, the icon doesn't properly imply its device type. AirPods Pro and Logitech M590 mouse do the job well.
Going through the system information, both AirPods Pro and Logitech M590 have a minor type field in its device information. I believe it's sent to Macbook via the device bluetooth advertising.
My keyboard is developed on top of an nRF52832 module. I'm not very familiar with NRF SDK, this is my first attempt. How can I add such information to my device? Any links to the doc or sample code would help.
英文:
I'm developing a custom bluetooth keyboard. It works now smoothly, but there's one thing I can't figure out. In macOS bluetooth settings page, the icon doesn't properly imply its device type. AirPods Pro and Logitech M590 mouse do the job well.
Going through the system information, both AirPods Pro and Logitech M590 have a minor type field in its device information. I believe it's sent to Macbook via the device bluetooth advertising.
My keyboard is developed on top of an nRF52832 module. I'm not very familiar with NRF SDK, this is my first attempt. How can I add such information to my device? Any links to the doc or sample code would help.
答案1
得分: 3
感谢@MichaelKotzjan提供的有用信息。
答案很简单(是的,我对nRF是新手)。只需在GAP初始化中调用sd_ble_gap_appearance_set
方法,将BLE_APPEARANCE_HID_KEYBOARD
作为参数传递。
这里有一个示例。根据您正在开发的设备,您肯定可以传递另一个宏。
static void gap_params_init(void)
{
// 一些代码
err_code = sd_ble_gap_appearance_set(BLE_APPEARANCE_HID_KEYBOARD);
APP_ERROR_CHECK(err_code);
// 一些代码
}
现在我得到了正确的图标。
英文:
Great thanks to @MichaelKotzjan who provides the helpful information.
The answer is kinda simple (yeah I'm a newbie for nRF). Just call sd_ble_gap_appearance_set
method in your GAP initialization, passing BLE_APPEARANCE_HID_KEYBOARD
as the argument.
Here's a sample. You can definitely pass another macro depending on the device you're developing.
static void gap_params_init(void)
{
// some code
err_code = sd_ble_gap_appearance_set(BLE_APPEARANCE_HID_KEYBOARD);
APP_ERROR_CHECK(err_code);
// some code
}
Now I get the proper icon
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论