@@ -49,7 +49,7 @@ enum ble_adv_mode {
4949 */
5050 BLE_ADV_MODE_IDLE ,
5151 /**
52- * @brief Directed advertising (high duty cycle).
52+ * @brief Directed advertising (high duty cycle).
5353 *
5454 * Attempt to connect to the most recently disconnected peer.
5555 */
@@ -67,7 +67,7 @@ enum ble_adv_mode {
6767 */
6868 BLE_ADV_MODE_FAST ,
6969 /**
70- * @brief Slow advertising.
70+ * @brief Slow advertising.
7171 *
7272 * Similar to fast advertising. By default it uses a longer advertising interval and
7373 * time-out than fast advertising. However, these options can be adjusted by the user.
@@ -136,7 +136,7 @@ struct ble_adv_evt {
136136 union {
137137 /** @ref BLE_ADV_EVT_ERROR event data. */
138138 struct {
139- int reason ;
139+ uint32_t reason ;
140140 } error ;
141141 };
142142};
@@ -233,7 +233,7 @@ struct ble_adv_config {
233233 */
234234 struct ble_adv_data sr_data ;
235235 /**
236- * @brief Event handler.
236+ * @brief Event handler.
237237 */
238238 ble_adv_evt_handler_t evt_handler ;
239239 /**
@@ -256,19 +256,22 @@ void ble_adv_on_ble_evt(const ble_evt_t *ble_evt, void *ble_adv);
256256 * @param[in] ble_adv BLE advertising instance.
257257 * @param[in] ble_adv_config Initialization configuration.
258258 *
259- * @retval 0 On success.
260- * @retval -FAULT If @p ble_adv or @p ble_adv_config are @c NULL.
261- * @retval -EINVAL If the configuration @p ble_adv_config is invalid.
259+ * @retval NRF_SUCCESS On success.
260+ * @retval NRF_ERROR_NULL If @p ble_adv or @p ble_adv_config are @c NULL.
261+ * @retval NRF_ERROR_INVALID_PARAM If the configuration @p ble_adv_config is invalid.
262262 */
263- int ble_adv_init (struct ble_adv * ble_adv , struct ble_adv_config * ble_adv_config );
263+ uint32_t ble_adv_init (struct ble_adv * ble_adv , struct ble_adv_config * ble_adv_config );
264264
265265/**
266266 * @brief Set the connection configuration tag used for connections.
267267 *
268268 * @param[in] ble_adv BLE advertising instance.
269269 * @param[in] ble_cfg_tag Connection configuration tag.
270+ *
271+ * @retval NRF_SUCCESS On success.
272+ * @retval NRF_ERROR_NULL If @p ble_adv is @c NULL.
270273 */
271- int ble_adv_conn_cfg_tag_set (struct ble_adv * ble_adv , uint8_t ble_cfg_tag );
274+ uint32_t ble_adv_conn_cfg_tag_set (struct ble_adv * ble_adv , uint8_t ble_cfg_tag );
272275
273276/**
274277 * @brief Start advertising in given mode.
@@ -279,12 +282,12 @@ int ble_adv_conn_cfg_tag_set(struct ble_adv *ble_adv, uint8_t ble_cfg_tag);
279282 * @param[in] ble_adv BLE advertising instance.
280283 * @param[in] mode Desired advertising mode.
281284 *
282- * @retval 0 On success.
283- * @retval -EPERM Library is not initialized.
284- * @retval -EFAULT @p ble_adv is @c NULL.
285- * @retval -EINVAL Invalid parameters.
285+ * @retval NRF_SUCCESS On success.
286+ * @retval NRF_ERROR_INVALID_STATE Library is not initialized.
287+ * @retval NRF_ERROR_NULL @p ble_adv is @c NULL.
288+ * @retval NRF_ERROR_INVALID_PARAM Invalid parameters.
286289 */
287- int ble_adv_start (struct ble_adv * ble_adv , enum ble_adv_mode mode );
290+ uint32_t ble_adv_start (struct ble_adv * ble_adv , enum ble_adv_mode mode );
288291
289292/**
290293 * @brief Set the peer address for directed advertising.
@@ -293,15 +296,15 @@ int ble_adv_start(struct ble_adv *ble_adv, enum ble_adv_mode mode);
293296 * @ref BLE_ADV_EVT_PEER_ADDR_REQUEST event. If the application does not reply
294297 * with a peer address, the device starts advertising in the next advertising mode.
295298 *
296- * @param[in] p_advertising Advertising Module instance.
297- * @param[in] p_peer_addr Pointer to a peer address.
299+ * @param[in] advertising Advertising Module instance.
300+ * @param[in] peer_addr Pointer to a peer address.
298301 *
299- * @retval 0 On success.
300- * @retval -EPERM Library is not initialized.
301- * @retval -EFAULT @p ble_adv is @c NULL.
302- * @retval -EINVAL Invalid parameters.
302+ * @retval NRF_SUCCESS On success.
303+ * @retval NRF_ERROR_INVALID_STATE Library is not initialized.
304+ * @retval NRF_ERROR_NULL @p ble_adv is @c NULL.
305+ * @retval NRF_ERROR_INVALID_PARAM Invalid parameters.
303306 */
304- int ble_adv_peer_addr_reply (struct ble_adv * ble_adv , const ble_gap_addr_t * peer_addr );
307+ uint32_t ble_adv_peer_addr_reply (struct ble_adv * ble_adv , const ble_gap_addr_t * peer_addr );
305308
306309/**
307310 * @brief Set a whitelist for fast and slow advertising.
@@ -315,14 +318,14 @@ int ble_adv_peer_addr_reply(struct ble_adv *ble_adv, const ble_gap_addr_t *peer_
315318 * @param[in] gap_irks The list of peer IRK to whitelist.
316319 * @param[in] irk_cnt The number of peer IRK to whitelist.
317320 *
318- * @retval 0 On success.
319- * @retval -EPERM Library is not initialized.
320- * @retval -EFAULT @p ble_adv is @c NULL.
321- * @retval -EINVAL Invalid parameters.
321+ * @retval NRF_SUCCESS On success.
322+ * @retval NRF_ERROR_INVALID_STATE Library is not initialized.
323+ * @retval NRF_ERROR_NULL @p ble_adv is @c NULL.
324+ * @retval NRF_ERROR_INVALID_PARAM Invalid parameters.
322325 */
323- int ble_adv_whitelist_reply (struct ble_adv * ble_adv ,
324- const ble_gap_addr_t * gap_addrs , uint32_t addr_cnt ,
325- const ble_gap_irk_t * gap_irks , uint32_t irk_cnt );
326+ uint32_t ble_adv_whitelist_reply (struct ble_adv * ble_adv ,
327+ const ble_gap_addr_t * gap_addrs , uint32_t addr_cnt ,
328+ const ble_gap_irk_t * gap_irks , uint32_t irk_cnt );
326329
327330/**
328331 * @brief Restart advertising without whitelist.
@@ -332,32 +335,36 @@ int ble_adv_whitelist_reply(struct ble_adv *ble_adv,
332335 *
333336 * @param[in] ble_adv Advertising Module instance.
334337 *
335- * @retval 0 On success.
336- * @retval -EPERM Library is not initialized.
337- * @retval -EFAULT @p ble_adv is @c NULL.
338+ * @retval NRF_SUCCESS On success.
339+ * @retval NRF_ERROR_INVALID_STATE Library is not initialized.
340+ * @retval NRF_ERROR_NULL @p ble_adv is @c NULL.
341+ * @retval NRF_ERROR_INVALID_PARAM Invalid advertising parameters.
338342 */
339- int ble_adv_restart_without_whitelist (struct ble_adv * ble_adv );
343+ uint32_t ble_adv_restart_without_whitelist (struct ble_adv * ble_adv );
340344
341- /**@brief Function for updating advertising data.
345+ /**
346+ * @brief Function for updating advertising data.
342347 *
343348 * @details This function can be called if you wish to reconfigure the advertising data The update
344349 * will be effective even if advertising has already been started.
345350 *
346- * @param[in] p_advertising Advertising Module instance.
347- * @param[in] p_advdata Pointer to the structure for specifying the content of advertising
348- * data. Or null if there should be no advertising data.
349- * @param[in] p_srdata Pointer to the structure for specifying the content of scan response
350- * data. Or null if there should be no advertising data.
351+ * @param[in] ble_adv Advertising Module instance.
352+ * @param[in] adv Pointer to the structure for specifying the content of advertising
353+ * data. Or null if there should be no advertising data.
354+ * @param[in] sr Pointer to the structure for specifying the content of scan response
355+ * data. Or null if there should be no advertising data.
351356 *
352- * @retval @ref NRF_ERROR_NULL If advertising instance was null.
353- * If both \p p_advdata and \p p_srdata are null.
354- * @retval @ref NRF_ERROR_INVALID_STATE If advertising instance was not initialized.
355- * @retval @ref NRF_SUCCESS or any error from @ref ble_advdata_encode or
356- * @ref sd_ble_gap_adv_set_configure().
357+ * @retval NRF_SUCCESS If the operation was successful.
358+ * @retval NRF_ERROR_NULL If @p ble_adv is null or if both @p adv and @p sr are @p NULL.
359+ * @retval NRF_ERROR_INVALID_STATE If advertising instance was not initialized.
360+ * @retval NRF_ERROR_INVALID_ADDR Invalid address.
361+ * @retval NRF_ERROR_INVALID_PARAM Invalid parameter provided in the advertising data context.
362+ * @retval NRF_ERROR_DATA_SIZE Buffer is too small to encode all data.
363+ * @returns Any error from @c sd_ble_gap_adv_set_configure on failure.
357364 */
358- int ble_adv_data_update (struct ble_adv * ble_adv ,
359- const struct ble_adv_data * adv ,
360- const struct ble_adv_data * sr );
365+ uint32_t ble_adv_data_update (struct ble_adv * ble_adv ,
366+ const struct ble_adv_data * adv ,
367+ const struct ble_adv_data * sr );
361368
362369#ifdef __cplusplus
363370}
0 commit comments