nRF Connect for Mobile: 16bit Service Data not showing

My company has been assigned a 16bit Service UUID from Bluetooth SIG, which we wish to use in advertising with the Service Data AD type.

However as soon as I swap our binary payload from a MANUFACTURER_DATA to a SVC_DATA16 AD type, advertising devices no longer appear in the scan window of nRF Connect for Mobile. This is the case no matter what other AD types I put along side it (DEVICE_NAME, SERVICE_UUID lists, etc). Removing the custom service data immediately brings the device back into the scan results.

I am confident that the packet contents are correct as the nRF Sniffer in Wireshark has no problems decoding the transmitted packets:

Tested software:

iPad 14 Air: nRF Connect for Mobile v2.7.7
iPhone 15: nRF Connect for Mobile v2.7.8

Parents
  • Hi,

    I have been trying to modify a beacon sample to try to reproduce this, but without success. Could it be that you had some form of filtering enabled in the nRF Connect for Mobile app? If not, do you have some code I can run on a DK to reproduce this on my end?

  • I have no filtering enabled.

    On Zephyr v3.7.0 (Upstream Zephyr, not NCS)

    west build -b nrf52840dk/nrf52840 samples/bluetooth/extended_adv/advertiser
    west flash --erase

    The sample as it exists in-tree shows up fine.
    Update the sample data structure from:

    static const struct bt_data ad[] = {
    	BT_DATA(BT_DATA_NAME_COMPLETE, CONFIG_BT_DEVICE_NAME, sizeof(CONFIG_BT_DEVICE_NAME) - 1),
    };

    to (with CONFIG_BT_CTLR_ADV_DATA_LEN_MAX=124)

    static struct {
    	uint16_t service_id;
    	uint8_t payload[32];
    } __packed service_data;
    
    static const struct bt_data ad[] = {
    	BT_DATA(BT_DATA_NAME_COMPLETE, CONFIG_BT_DEVICE_NAME, sizeof(CONFIG_BT_DEVICE_NAME) - 1),
    	BT_DATA(BT_DATA_SVC_DATA16, &service_data, sizeof(service_data)),
    };
    
    int main(void)
    {
    	service_data.service_id = 0xFC74;
        ...

    And the device no longer appears (make sure you terminate and re-open the app, sometimes devices get cached).

    While creating the reproduction I noticed that if the payload is only 4 bytes it shows fine, increase it past a certain limit, the device no longer appears.

Reply
  • I have no filtering enabled.

    On Zephyr v3.7.0 (Upstream Zephyr, not NCS)

    west build -b nrf52840dk/nrf52840 samples/bluetooth/extended_adv/advertiser
    west flash --erase

    The sample as it exists in-tree shows up fine.
    Update the sample data structure from:

    static const struct bt_data ad[] = {
    	BT_DATA(BT_DATA_NAME_COMPLETE, CONFIG_BT_DEVICE_NAME, sizeof(CONFIG_BT_DEVICE_NAME) - 1),
    };

    to (with CONFIG_BT_CTLR_ADV_DATA_LEN_MAX=124)

    static struct {
    	uint16_t service_id;
    	uint8_t payload[32];
    } __packed service_data;
    
    static const struct bt_data ad[] = {
    	BT_DATA(BT_DATA_NAME_COMPLETE, CONFIG_BT_DEVICE_NAME, sizeof(CONFIG_BT_DEVICE_NAME) - 1),
    	BT_DATA(BT_DATA_SVC_DATA16, &service_data, sizeof(service_data)),
    };
    
    int main(void)
    {
    	service_data.service_id = 0xFC74;
        ...

    And the device no longer appears (make sure you terminate and re-open the app, sometimes devices get cached).

    While creating the reproduction I noticed that if the payload is only 4 bytes it shows fine, increase it past a certain limit, the device no longer appears.

Children
No Data
Related