This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Why is there no advertisment for a beacon with services?

I'm creating a custom beacon, similar to iBeacon, but with a custom data format. It advertises only once every 8 seconds, but the iPhone app doesn't receive advertisements when the app is in the background. In order to get around this, I've added a service to the advertisement data (BLE_UUID_DEVICE_INFORMATION_SERVICE) but now the device won't advertise at all. When I remove the service UUID from the advertisement data, then the device will advertise again. Am I violating some sort of spec? I can't tell what's going on inside the soft device, why won't it advertise?

Parents
  • Here is the advertising data I'm setting in advertising_init:

    uint8_t       flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
    
    ble_uuid_t adv_uuids[] =
    {
        {BLE_UUID_DEVICE_INFORMATION_SERVICE,        BLE_UUID_TYPE_BLE}
    };
    
    ble_advdata_manuf_data_t manuf_specific_data;
    manuf_specific_data.company_identifier = APP_COMPANY_IDENTIFIER;
    manuf_specific_data.data.p_data = (uint8_t *) m_beacon_info;
    manuf_specific_data.data.size   = APP_BEACON_INFO_LENGTH;
    
    // Build and set advertising data.
    memset(&advdata, 0, sizeof(advdata));
    advdata.name_type             = BLE_ADVDATA_NO_NAME;
    advdata.include_appearance    = true;
    advdata.flags.size            = sizeof (flags);
    advdata.flags.p_data          = &flags;
    advdata.p_manuf_specific_data = &manuf_specific_data;
    advdata.uuids_complete.uuid_cnt = sizeof(adv_uuids) / sizeof(adv_uuids[0]);
    advdata.uuids_complete.p_uuids  = adv_uuids;
    
    err_code = ble_advdata_set(&advdata, NULL);
    APP_ERROR_CHECK(err_code);
    

    When I enter a debug session and set a breakpoint at the end, it tells me err_code is "not in scope". How can I view the return value of ble_advdata_set()? Thanks for your help.

  • The Keil IDE doesn't play nice with displaying local variables. Sometimes I find it will display if I hover the mouse pointer over the variable. The sure fire way is to make the variable a global and then you can put it in a watch window and see what it's value is when you hit your breakpoint.

Reply
  • The Keil IDE doesn't play nice with displaying local variables. Sometimes I find it will display if I hover the mouse pointer over the variable. The sure fire way is to make the variable a global and then you can put it in a watch window and see what it's value is when you hit your breakpoint.

Children
No Data
Related