bluetoothbluetooth-lowenergynrf52

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.

enter image description here

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.

enter image description here

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.


Solution

  • 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

    enter image description here