diff --git a/nimble/host/include/host/ble_eddystone.h b/nimble/host/include/host/ble_eddystone.h index 4eb6d6819..b028a4aa8 100644 --- a/nimble/host/include/host/ble_eddystone.h +++ b/nimble/host/include/host/ble_eddystone.h @@ -20,6 +20,13 @@ #ifndef H_BLE_EDDYSTONE_ #define H_BLE_EDDYSTONE_ +/** + * @brief Eddystone - BLE beacon from Google + * @defgroup bt_eddystone Eddystone - BLE beacon from Google + * @ingroup bt_host + * @{ + */ + #include #ifdef __cplusplus extern "C" { @@ -51,8 +58,47 @@ struct ble_hs_adv_fields; #define BLE_EDDYSTONE_URL_SUFFIX_GOV 0x0d #define BLE_EDDYSTONE_URL_SUFFIX_NONE 0xff +/** + * Configures the device to advertise Eddystone UID beacons. + * + * @param adv_fields The base advertisement fields to transform into + * an eddystone beacon. All configured fields + * are preserved; you probably want to clear + * this struct before calling this function. + * @param uid The 16-byte UID to advertise. + * + * @return 0 on success; + * BLE_HS_EBUSY if advertising is in progress; + * BLE_HS_EMSGSIZE if the specified data is too + * large to fit in an advertisement; + * Other nonzero on failure. + */ int ble_eddystone_set_adv_data_uid(struct ble_hs_adv_fields *adv_fields, void *uid); + +/** + * Configures the device to advertise Eddystone URL beacons. + * + * @param adv_fields The base advertisement fields to transform into + * an eddystone beacon. All configured fields + * are preserved; you probably want to clear + * this struct before calling this function. + * @param url_scheme The prefix of the URL; one of the + * BLE_EDDYSTONE_URL_SCHEME values. + * @param url_body The middle of the URL. Don't include the + * suffix if there is a suitable suffix code. + * @param url_body_len The string length of the url_body argument. + * @param url_suffix The suffix of the URL; one of the + * BLE_EDDYSTONE_URL_SUFFIX values; use + * BLE_EDDYSTONE_URL_SUFFIX_NONE if the suffix + * is embedded in the body argument. + * + * @return 0 on success; + * BLE_HS_EBUSY if advertising is in progress; + * BLE_HS_EMSGSIZE if the specified data is too + * large to fit in an advertisement; + * Other nonzero on failure. + */ int ble_eddystone_set_adv_data_url(struct ble_hs_adv_fields *adv_fields, uint8_t url_scheme, char *url_body, uint8_t url_body_len, uint8_t suffix); @@ -61,4 +107,8 @@ int ble_eddystone_set_adv_data_url(struct ble_hs_adv_fields *adv_fields, } #endif +/** + * @} + */ + #endif diff --git a/nimble/host/src/ble_eddystone.c b/nimble/host/src/ble_eddystone.c index 6c367f43f..9f90ed4e3 100644 --- a/nimble/host/src/ble_eddystone.c +++ b/nimble/host/src/ble_eddystone.c @@ -105,21 +105,6 @@ ble_eddystone_set_adv_data_gen(struct ble_hs_adv_fields *adv_fields, return 0; } -/** - * Configures the device to advertise eddystone UID beacons. - * - * @param adv_fields The base advertisement fields to transform into - * an eddystone beacon. All configured fields - * are preserved; you probably want to clear - * this struct before calling this function. - * @param uid The 16-byte UID to advertise. - * - * @return 0 on success; - * BLE_HS_EBUSY if advertising is in progress; - * BLE_HS_EMSGSIZE if the specified data is too - * large to fit in an advertisement; - * Other nonzero on failure. - */ int ble_eddystone_set_adv_data_uid(struct ble_hs_adv_fields *adv_fields, void *uid) { @@ -152,29 +137,6 @@ ble_eddystone_set_adv_data_uid(struct ble_hs_adv_fields *adv_fields, void *uid) return 0; } -/** - * Configures the device to advertise eddystone URL beacons. - * - * @param adv_fields The base advertisement fields to transform into - * an eddystone beacon. All configured fields - * are preserved; you probably want to clear - * this struct before calling this function. - * @param url_scheme The prefix of the URL; one of the - * BLE_EDDYSTONE_URL_SCHEME values. - * @param url_body The middle of the URL. Don't include the - * suffix if there is a suitable suffix code. - * @param url_body_len The string length of the url_body argument. - * @param url_suffix The suffix of the URL; one of the - * BLE_EDDYSTONE_URL_SUFFIX values; use - * BLE_EDDYSTONE_URL_SUFFIX_NONE if the suffix - * is embedded in the body argument. - * - * @return 0 on success; - * BLE_HS_EBUSY if advertising is in progress; - * BLE_HS_EMSGSIZE if the specified data is too - * large to fit in an advertisement; - * Other nonzero on failure. - */ int ble_eddystone_set_adv_data_url(struct ble_hs_adv_fields *adv_fields, uint8_t url_scheme, char *url_body,