Hi,
we try to send two advertisements directly after eachother since we need to transmit more data than can fit in one advertisement. We do it the following way.
1. trigger by an external interrupt, collects data.
2. when finished, a message is transmitted using app_advertise_start_msg_send();
3. In the .app_on_ble_powered callback we start a timer 30ms.
4. Upon execution of timer we call app_advertise_stop_op();
5. We then get a .app_on_adv_nonconn_complete callback with status GAP_ERR_ADV_DATA_INVALID, why is this, what is invalid?
the transmit (no 2 above) looks like this:
struct gapm_start_advertise_cmd* cmd;
cmd = app_advertise_start_msg_create();
cmd->op.code = GAPM_ADV_NON_CONN;
cmd->op.addr_src = GAPM_PUBLIC_ADDR;
cmd->op.renew_dur = 0;
cmd->intv_min = LLM_ADV_INTERVAL_MIN_NONCON_DISC; //160
cmd->intv_max = LLM_ADV_INTERVAL_MIN_NONCON_DISC; //160
cmd->channel_map = 1;
cmd->info.host.mode = GAP_BROADCASTER_MODE;
cmd->info.host.adv_filt_policy = ADV_ALLOW_SCAN_ANY_CON_ANY;
//adv_msg = 0201041B00AC00023B120000F0000000F1000010F00100F00F1F10F1F1F11A (in hex)
memcpy(&cmd->info.host.adv_data[0], &adv_msg, sizeof(adv_msg));
cmd->info.host.adv_data_len = sizeof(adv_msg); //28
app_advertise_start_msg_send(cmd);
and the 4. just calls the function app_advertise_stop_op(); (no modifiactions to command).
What is invalid, the stop command, or the advertisement command?
Regards
Sebastian