bugfix for duplicate symbol
Fork of nRF51822 by
nordic-sdk/components/ble/common/ble_advdata.h@177:7a1917171a20, 2015-05-15 (annotated)
- Committer:
- finneyj
- Date:
- Fri May 15 12:12:21 2015 +0000
- Revision:
- 177:7a1917171a20
- Parent:
- 103:138bdc859cc9
- Child:
- 112:737b08b3b995
bug fix - redefined symbol
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
rgrover1 | 103:138bdc859cc9 | 1 | /* Copyright (c) 2012 Nordic Semiconductor. All Rights Reserved. |
rgrover1 | 103:138bdc859cc9 | 2 | * |
rgrover1 | 103:138bdc859cc9 | 3 | * The information contained herein is property of Nordic Semiconductor ASA. |
rgrover1 | 103:138bdc859cc9 | 4 | * Terms and conditions of usage are described in detail in NORDIC |
rgrover1 | 103:138bdc859cc9 | 5 | * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. |
rgrover1 | 103:138bdc859cc9 | 6 | * |
rgrover1 | 103:138bdc859cc9 | 7 | * Licensees are granted free, non-transferable use of the information. NO |
rgrover1 | 103:138bdc859cc9 | 8 | * WARRANTY of ANY KIND is provided. This heading must NOT be removed from |
rgrover1 | 103:138bdc859cc9 | 9 | * the file. |
rgrover1 | 103:138bdc859cc9 | 10 | * |
rgrover1 | 103:138bdc859cc9 | 11 | */ |
rgrover1 | 103:138bdc859cc9 | 12 | |
rgrover1 | 103:138bdc859cc9 | 13 | /** @file |
rgrover1 | 103:138bdc859cc9 | 14 | * |
rgrover1 | 103:138bdc859cc9 | 15 | * @defgroup ble_sdk_lib_advdata Advertising Data Encoder |
rgrover1 | 103:138bdc859cc9 | 16 | * @{ |
rgrover1 | 103:138bdc859cc9 | 17 | * @ingroup ble_sdk_lib |
rgrover1 | 103:138bdc859cc9 | 18 | * @brief Function for encoding the advertising data and/or scan response data, and passing them to |
rgrover1 | 103:138bdc859cc9 | 19 | * the stack. |
rgrover1 | 103:138bdc859cc9 | 20 | */ |
rgrover1 | 103:138bdc859cc9 | 21 | |
rgrover1 | 103:138bdc859cc9 | 22 | #ifndef BLE_ADVDATA_H__ |
rgrover1 | 103:138bdc859cc9 | 23 | #define BLE_ADVDATA_H__ |
rgrover1 | 103:138bdc859cc9 | 24 | |
rgrover1 | 103:138bdc859cc9 | 25 | #include <stdint.h> |
rgrover1 | 103:138bdc859cc9 | 26 | #include <stdbool.h> |
rgrover1 | 103:138bdc859cc9 | 27 | #include <string.h> |
rgrover1 | 103:138bdc859cc9 | 28 | #include "ble.h" |
rgrover1 | 103:138bdc859cc9 | 29 | #include "app_util.h" |
rgrover1 | 103:138bdc859cc9 | 30 | |
rgrover1 | 103:138bdc859cc9 | 31 | /**@brief Advertising data name type. This contains the options available for the device name inside |
rgrover1 | 103:138bdc859cc9 | 32 | * the advertising data. */ |
rgrover1 | 103:138bdc859cc9 | 33 | typedef enum |
rgrover1 | 103:138bdc859cc9 | 34 | { |
rgrover1 | 103:138bdc859cc9 | 35 | BLE_ADVDATA_NO_NAME, /**< Include no device name in advertising data. */ |
rgrover1 | 103:138bdc859cc9 | 36 | BLE_ADVDATA_SHORT_NAME, /**< Include short device name in advertising data. */ |
rgrover1 | 103:138bdc859cc9 | 37 | BLE_ADVDATA_FULL_NAME /**< Include full device name in advertising data. */ |
rgrover1 | 103:138bdc859cc9 | 38 | } ble_advdata_name_type_t; |
rgrover1 | 103:138bdc859cc9 | 39 | |
rgrover1 | 103:138bdc859cc9 | 40 | /**@brief UUID list type. */ |
rgrover1 | 103:138bdc859cc9 | 41 | typedef struct |
rgrover1 | 103:138bdc859cc9 | 42 | { |
rgrover1 | 103:138bdc859cc9 | 43 | uint16_t uuid_cnt; /**< Number of UUID entries. */ |
rgrover1 | 103:138bdc859cc9 | 44 | ble_uuid_t * p_uuids; /**< Pointer to UUID array entries. */ |
rgrover1 | 103:138bdc859cc9 | 45 | } ble_advdata_uuid_list_t; |
rgrover1 | 103:138bdc859cc9 | 46 | |
rgrover1 | 103:138bdc859cc9 | 47 | /**@brief Connection interval range structure. */ |
rgrover1 | 103:138bdc859cc9 | 48 | typedef struct |
rgrover1 | 103:138bdc859cc9 | 49 | { |
rgrover1 | 103:138bdc859cc9 | 50 | uint16_t min_conn_interval; /**< Minimum Connection Interval, in units of 1.25ms, range 6 to 3200 (i.e. 7.5ms to 4s). */ |
rgrover1 | 103:138bdc859cc9 | 51 | uint16_t max_conn_interval; /**< Maximum Connection Interval, in units of 1.25ms, range 6 to 3200 (i.e. 7.5ms to 4s). Value of 0xFFFF indicates no specific maximum. */ |
rgrover1 | 103:138bdc859cc9 | 52 | } ble_advdata_conn_int_t; |
rgrover1 | 103:138bdc859cc9 | 53 | |
rgrover1 | 103:138bdc859cc9 | 54 | /**@brief Manufacturer specific data structure. */ |
rgrover1 | 103:138bdc859cc9 | 55 | typedef struct |
rgrover1 | 103:138bdc859cc9 | 56 | { |
rgrover1 | 103:138bdc859cc9 | 57 | uint16_t company_identifier; /**< Company Identifier Code. */ |
rgrover1 | 103:138bdc859cc9 | 58 | uint8_array_t data; /**< Additional manufacturer specific data. */ |
rgrover1 | 103:138bdc859cc9 | 59 | } ble_advdata_manuf_data_t; |
rgrover1 | 103:138bdc859cc9 | 60 | |
rgrover1 | 103:138bdc859cc9 | 61 | /**@brief Service data structure. */ |
rgrover1 | 103:138bdc859cc9 | 62 | typedef struct |
rgrover1 | 103:138bdc859cc9 | 63 | { |
rgrover1 | 103:138bdc859cc9 | 64 | uint16_t service_uuid; /**< Service UUID. */ |
rgrover1 | 103:138bdc859cc9 | 65 | uint8_array_t data; /**< Additional service data. */ |
rgrover1 | 103:138bdc859cc9 | 66 | } ble_advdata_service_data_t; |
rgrover1 | 103:138bdc859cc9 | 67 | |
rgrover1 | 103:138bdc859cc9 | 68 | /**@brief Advertising data structure. This contains all options and data needed for encoding and |
rgrover1 | 103:138bdc859cc9 | 69 | * setting the advertising data. */ |
rgrover1 | 103:138bdc859cc9 | 70 | typedef struct |
rgrover1 | 103:138bdc859cc9 | 71 | { |
rgrover1 | 103:138bdc859cc9 | 72 | ble_advdata_name_type_t name_type; /**< Type of device name. */ |
rgrover1 | 103:138bdc859cc9 | 73 | uint8_t short_name_len; /**< Length of short device name (if short type is specified). */ |
rgrover1 | 103:138bdc859cc9 | 74 | bool include_appearance; /**< Determines if Appearance shall be included. */ |
rgrover1 | 103:138bdc859cc9 | 75 | uint8_array_t flags; /**< Advertising data Flags field. */ |
rgrover1 | 103:138bdc859cc9 | 76 | int8_t * p_tx_power_level; /**< TX Power Level field. */ |
rgrover1 | 103:138bdc859cc9 | 77 | ble_advdata_uuid_list_t uuids_more_available; /**< List of UUIDs in the 'More Available' list. */ |
rgrover1 | 103:138bdc859cc9 | 78 | ble_advdata_uuid_list_t uuids_complete; /**< List of UUIDs in the 'Complete' list. */ |
rgrover1 | 103:138bdc859cc9 | 79 | ble_advdata_uuid_list_t uuids_solicited; /**< List of solcited UUIDs. */ |
rgrover1 | 103:138bdc859cc9 | 80 | ble_advdata_conn_int_t * p_slave_conn_int; /**< Slave Connection Interval Range. */ |
rgrover1 | 103:138bdc859cc9 | 81 | ble_advdata_manuf_data_t * p_manuf_specific_data; /**< Manufacturer specific data. */ |
rgrover1 | 103:138bdc859cc9 | 82 | ble_advdata_service_data_t * p_service_data_array; /**< Array of Service data structures. */ |
rgrover1 | 103:138bdc859cc9 | 83 | uint8_t service_data_count; /**< Number of Service data structures. */ |
rgrover1 | 103:138bdc859cc9 | 84 | } ble_advdata_t; |
rgrover1 | 103:138bdc859cc9 | 85 | |
rgrover1 | 103:138bdc859cc9 | 86 | /**@brief Function for encoding and setting the advertising data and/or scan response data. |
rgrover1 | 103:138bdc859cc9 | 87 | * |
rgrover1 | 103:138bdc859cc9 | 88 | * @details This function encodes advertising data and/or scan response data based on the selections |
rgrover1 | 103:138bdc859cc9 | 89 | * in the supplied structures, and passes the encoded data to the stack. |
rgrover1 | 103:138bdc859cc9 | 90 | * |
rgrover1 | 103:138bdc859cc9 | 91 | * @param[in] p_advdata Structure for specifying the content of the advertising data. |
rgrover1 | 103:138bdc859cc9 | 92 | * Set to NULL if advertising data is not to be set. |
rgrover1 | 103:138bdc859cc9 | 93 | * @param[in] p_srdata Structure for specifying the content of the scan response data. |
rgrover1 | 103:138bdc859cc9 | 94 | * Set to NULL if scan response data is not to be set. |
rgrover1 | 103:138bdc859cc9 | 95 | * |
rgrover1 | 103:138bdc859cc9 | 96 | * @return NRF_SUCCESS on success, NRF_ERROR_DATA_SIZE if not all the requested data could fit |
rgrover1 | 103:138bdc859cc9 | 97 | * into the advertising packet. The maximum size of the advertisement packet is @ref |
rgrover1 | 103:138bdc859cc9 | 98 | * BLE_GAP_ADV_MAX_SIZE. |
rgrover1 | 103:138bdc859cc9 | 99 | * |
rgrover1 | 103:138bdc859cc9 | 100 | * @warning This API may override application's request to use the long name and use a short name |
rgrover1 | 103:138bdc859cc9 | 101 | * instead. This truncation will occur in case the long name does not fit advertisement data size. |
rgrover1 | 103:138bdc859cc9 | 102 | * Application is permitted to specify a preferred short name length in case truncation is required. |
rgrover1 | 103:138bdc859cc9 | 103 | * For example, if the complete device name is ABCD_HRMonitor, application can specify short name |
rgrover1 | 103:138bdc859cc9 | 104 | * length to 8 such that short device name appears as ABCD_HRM instead of ABCD_HRMo or ABCD_HRMoni |
rgrover1 | 103:138bdc859cc9 | 105 | * etc if available size for short name is 9 or 12 respectively to have more apporpriate short name. |
rgrover1 | 103:138bdc859cc9 | 106 | * However, it should be noted that this is just a preference that application can specify and |
rgrover1 | 103:138bdc859cc9 | 107 | * if the preference too large to fit in Advertisement Data, this can be further truncated. |
rgrover1 | 103:138bdc859cc9 | 108 | */ |
rgrover1 | 103:138bdc859cc9 | 109 | uint32_t ble_advdata_set(const ble_advdata_t * p_advdata, const ble_advdata_t * p_srdata); |
rgrover1 | 103:138bdc859cc9 | 110 | |
rgrover1 | 103:138bdc859cc9 | 111 | #endif // BLE_ADVDATA_H__ |
rgrover1 | 103:138bdc859cc9 | 112 | |
rgrover1 | 103:138bdc859cc9 | 113 | /** @} */ |