1

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.

Leo
  • 13,428
  • 5
  • 43
  • 61
  • 1
    THis was discussed 4 years ago in the nordic devzone: https://devzone.nordicsemi.com/f/nordic-q-a/44826/setting-class-of-device Not sure what the status is now regarding a COD field, but there is also a mention of a manual way – Michael Kotzjan Apr 17 '23 at 05:29
  • 1
    @MichaelKotzjan your comment is very helpful. Now I found there is a list of pre-defined macros https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s132.api.v6.1.0%2Fgroup___b_l_e___a_p_p_e_a_r_a_n_c_e_s.html – Leo Apr 17 '23 at 07:05
  • 1
    Please share your findings as an answer once you figure it out completely :) – Michael Kotzjan Apr 17 '23 at 07:20

1 Answers1

3

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

Leo
  • 13,428
  • 5
  • 43
  • 61