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

expression must have struct or union type

 uint32_t      err_code;
ble_advdata_t advdata;  // Struct containing advertising parameters

ble_advdata_manuf_data_t        manuf_data; // Variable to hold manufacturer specific data
uint8_t data[]                      = "SomeData!"; // Our data to adverise
manuf_data.company_identifier       = 0x0059; // Nordics company ID
manuf_data.data.p_data              = data;  *****here is that probelm that uint8_t data[] is not strucure or union type*****

manuf_data.data.size                = sizeof(data);

// Build advertising data struct to pass into @ref ble_advertising_init.
memset(&advdata, 0, sizeof(advdata));

advdata.Nilesh               = BLE_ADVDATA_SHORT_NAME;
advdata.short_name_len          = 6;
advdata.flags                   = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
advdata.p_manuf_specific_data   = &manuf_data;

ble_adv_modes_config_t options = {0};
options.ble_adv_fast_enabled  = true;
options.ble_adv_fast_interval = APP_ADV_INTERVAL;
options.ble_adv_fast_timeout  = APP_ADV_TIMEOUT_IN_SECONDS;

err_code = ble_advertising_init(&advdata, NULL, &options, on_adv_evt, NULL);
APP_ERROR_CHECK(err_code);
Related