hi dialog,
here is my setting, once I started, I observe the advertising never ends. but I have set the timeout.
//---------------------------------------------------------------------
//-------------NON-CONNECTABLE ADVERTISE---RELATED---------------------
static const struct advertise_configuration user_non_connectable_advertise_conf ={
/// Advertise operation type.
.advertise_operation=ADV_NON_CONN,
/// Own BD address source of the device:
.address_src=GAPM_PUBLIC_ADDR,
/// Advertise interval
.intv = 1100,
///Advertising channel map
.channel_map = 0x7,
};
static const enum gap_adv_mode user_non_connectable_advertise_mode = GAP_BROADCASTER_MODE;
static const struct default_handlers_configuration user_default_hnd_conf= {
//Configure the advertise operation used by the default handlers
//Possible values:
// - DEF_ADV_FOREVER
// - DEF_ADV_WITH_TIMEOUT
.adv_scenario=DEF_ADV_WITH_TIMEOUT,
//Configure the advertise period in case of DEF_ADV_WITH_TIMEOUT.
//It is measured in timer units (10ms). Use MS_TO_TIMERUNITS macro to convert
//from milliseconds (ms) to timer units.
.advertise_period=MS_TO_TIMERUNITS(10000),
//Configure the security start operation of the default handlers
//if the security is enabled (CFG_APP_SECURITY)
.security_request_scenario = DEF_SEC_REQ_NEVER
};
Hi achao1104,
I guess that you are using the template, this particular source code uses undirected advertising as a default advertising operation, i suppose that you ve changed the default advertise operation since you are advertising in non-connectable mode. There is no implementation for advertising in a limited amount of time when you are in non-connectable mode. What you can do is replicate the code in the default_advertise_operation() function but for non-connectable mode (invoke the app_easy_gap_non_connectable_advertise_start() instead of the undirected function when operating under DEF_ADV_WITH_TIMEOUT - please check the app_easy_gap_undirected_advertise_with_timeout_start() function).
Thanks MT_dialog
l如何ong the data length we can use in the broadcasting package to carry our data for sending ?
Hello liuluan002,
"Assuming, you are referring to the data you can send through an Advertising packet in Broadcast mode"
The advertising packet in broadcasting mode can take a maximum of28 Bytesof data. The data can include length/ type/ UUID/ general data.
Note: The actual maximum lenght is31 Bytes. However,3 bytesare reserved for setting some flags and cannot be used.
Please let us know if your question is answered and if you have any more questions.
***IMPORTANT***
Note: Please make sure you post your questions on a new thread unless the query headline is very close to your question. You can always post your questions on a new thread irrespectively but when using an exisiting thread, the question has to allign well.
Thanks,
LC