This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Appearance icon does not seem to be properly used

I have developed a BLE app on a nRF52382 which advertised those service UUIDs

static ble_uuid_t m_adv_uuids[] =
{

{BLE_UUID_CYCLING_SPEED_AND_CADENCE, BLE_UUID_TYPE_BLE},
//{BLE_UUID_HEART_RATE_SERVICE, BLE_UUID_TYPE_BLE},
{BLE_UUID_CYCLING_POWER, BLE_UUID_TYPE_BLE},
//{BLE_UUID_BATTERY_SERVICE, BLE_UUID_TYPE_BLE},
//{BLE_UUID_FITNESS_MACHINE, BLE_UUID_TYPE_BLE}
};

and set the appearance to BLE_APPEARANCE_CYCLING_POWER_SENSOR which is 1156.

static void gap_params_init(void)
{
ret_code_t err_code;
ble_gap_conn_params_t gap_conn_params;
ble_gap_conn_sec_mode_t sec_mode;

BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode);

err_code = sd_ble_gap_device_name_set(&sec_mode,
(const uint8_t *)DEVICE_NAME,
strlen(DEVICE_NAME));
APP_ERROR_CHECK(err_code);

err_code = sd_ble_gap_appearance_set(BLE_APPEARANCE_CYCLING_POWER_SENSOR);
APP_ERROR_CHECK(err_code);

memset(&gap_conn_params, 0, sizeof(gap_conn_params));

gap_conn_params.min_conn_interval = m_scan.conn_params.min_conn_interval;
gap_conn_params.max_conn_interval = m_scan.conn_params.max_conn_interval;
gap_conn_params.slave_latency = m_scan.conn_params.slave_latency;
gap_conn_params.conn_sup_timeout = m_scan.conn_params.conn_sup_timeout;

err_code = sd_ble_gap_ppcp_set(&gap_conn_params);
APP_ERROR_CHECK(err_code);
}

When I scan for the device in nRF Connect I see a bicycle as device icon as expected.

As soon as I add the HEART_RATE_SERVICE

to

static ble_uuid_t m_adv_uuids[] =
{
    
     {BLE_UUID_CYCLING_SPEED_AND_CADENCE, BLE_UUID_TYPE_BLE},    
     {BLE_UUID_HEART_RATE_SERVICE,        BLE_UUID_TYPE_BLE},   
     {BLE_UUID_CYCLING_POWER,             BLE_UUID_TYPE_BLE},
    //{BLE_UUID_BATTERY_SERVICE,           BLE_UUID_TYPE_BLE},
    //{BLE_UUID_FITNESS_MACHINE,           BLE_UUID_TYPE_BLE}
};

the icon in any scanning application is replaced with a heart symbol despite I did not change sd_ble_gap_appearance_set(BLE_APPEARANCE_CYCLING_POWER_SENSOR);

Why is the app no longer advertising the bike symbol anymore?

I also played around with the advertising package itself, e.g. only advertising the HRS but still keeping the sd_ble_gap_appearance_set to BLE_APPEARANCE_CYCLING_POWER_SENSOR but even then the symbol is a heart and not a bike anymore.

Why is this? Is there some kind of priority maybe that as soon as a HRS is advertised it's symbol is used no matter what is configured else-wise?

Related