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

Error Code 7 in Advertising Init

Hi,

I am trying to set up a custom service and I have it all setup and it works properly. The only problem is that it is advertising as a 16bit service. I am moving from a Broadcom chip with that chip I was able to advertise the entire 128-bit UUID. I keep receiving error code 7 when I use BLE_UUID_TYPE_VENDOR_BEGIN.

static void advertising_init(void)

uint32_t      err_code;
ble_advdata_t advdata;
ble_advdata_t scanrsp;
uint8_t       flags = BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE;

// YOUR_JOB: Use UUIDs for service(s) used in your application.
//BLE_UUID_TYPE_BLE
//BLE_UUID_TYPE_VENDOR_BEGIN
ble_uuid_t adv_uuids[] = { 
                            {BLE_UUID_BATTERY_SERVICE,                  BLE_UUID_TYPE_BLE},
                            {LBS_UUID_SERVICE, BLE_UUID_TYPE_VENDOR_BEGIN}
                        };

// Build and set advertising data
memset(&advdata, 0, sizeof(advdata));
advdata.name_type               = BLE_ADVDATA_FULL_NAME;
advdata.include_appearance      = true;
advdata.flags.size              = sizeof(flags);
advdata.flags.p_data            = &flags;
//advdata.uuids_complete.uuid_cnt = sizeof(adv_uuids) / sizeof(adv_uuids[0]);
//advdata.uuids_complete.p_uuids  = adv_uuids;

 memset(&scanrsp, 0, sizeof(scanrsp));
scanrsp.uuids_complete.uuid_cnt = sizeof(adv_uuids) / sizeof(adv_uuids[0]);
scanrsp.uuids_complete.p_uuids  = adv_uuids;


err_code = ble_advdata_set(&advdata, &scanrsp);
APP_ERROR_CHECK(err_code);

}

I also attached the code for the service I am setting up. If someone could shed some insight that would be terrific.

ble_lbs.c ble_lbs.h

Related