ble_gap_adv_start
int
ble_gap_adv_start(
uint8_t own_addr_type,
const ble_addr_t *direct_addr,
int32_t duration_ms,
const struct ble_gap_adv_params *adv_params,
ble_gap_event_fn *cb,
void *cb_arg
)
Description
Initiates advertising.
Parameters
Parameter | Description |
---|
own_addr_type | The type of address the stack should use for itself. Valid values are: BLE_OWN_ADDR_PUBLIC BLE_OWN_ADDR_RANDOM BLE_OWN_ADDR_RPA_PUBLIC_DEFAULT BLE_OWN_ADDR_RPA_RANDOM_DEFAULT |
direct_addr | The peer's address for directed advertising. This parameter shall be non-NULL if directed advertising is being used. |
duration_ms | The duration of the advertisement procedure. On expiration, the procedure ends and a BLE_GAP_EVENT_ADV_COMPLETE event is reported. Units are milliseconds. Specify BLE_HS_FOREVER for no expiration. |
adv_params | Additional arguments specifying the particulars of the advertising procedure. |
cb | The callback to associate with this advertising procedure. If advertising ends, the event is reported through this callback. If advertising results in a connection, the connection inherits this callback as its event-reporting mechanism. |
cb_arg | The optional argument to pass to the callback function. |
Returned values