BLE_Nano nRF51 Central heart rate
nRF51_SDK_11/components/softdevice/s130/headers/ble_types.h@0:2b9b5764efb5, 2016-05-26 (annotated)
- Committer:
- FranKP2138
- Date:
- Thu May 26 10:12:27 2016 +0000
- Revision:
- 0:2b9b5764efb5
RedBearLab BLE_Nano Central role for heart rate
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
FranKP2138 | 0:2b9b5764efb5 | 1 | /* |
FranKP2138 | 0:2b9b5764efb5 | 2 | * Copyright (c) Nordic Semiconductor ASA |
FranKP2138 | 0:2b9b5764efb5 | 3 | * All rights reserved. |
FranKP2138 | 0:2b9b5764efb5 | 4 | * |
FranKP2138 | 0:2b9b5764efb5 | 5 | * Redistribution and use in source and binary forms, with or without modification, |
FranKP2138 | 0:2b9b5764efb5 | 6 | * are permitted provided that the following conditions are met: |
FranKP2138 | 0:2b9b5764efb5 | 7 | * |
FranKP2138 | 0:2b9b5764efb5 | 8 | * 1. Redistributions of source code must retain the above copyright notice, this |
FranKP2138 | 0:2b9b5764efb5 | 9 | * list of conditions and the following disclaimer. |
FranKP2138 | 0:2b9b5764efb5 | 10 | * |
FranKP2138 | 0:2b9b5764efb5 | 11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this |
FranKP2138 | 0:2b9b5764efb5 | 12 | * list of conditions and the following disclaimer in the documentation and/or |
FranKP2138 | 0:2b9b5764efb5 | 13 | * other materials provided with the distribution. |
FranKP2138 | 0:2b9b5764efb5 | 14 | * |
FranKP2138 | 0:2b9b5764efb5 | 15 | * 3. Neither the name of Nordic Semiconductor ASA nor the names of other |
FranKP2138 | 0:2b9b5764efb5 | 16 | * contributors to this software may be used to endorse or promote products |
FranKP2138 | 0:2b9b5764efb5 | 17 | * derived from this software without specific prior written permission. |
FranKP2138 | 0:2b9b5764efb5 | 18 | * |
FranKP2138 | 0:2b9b5764efb5 | 19 | * 4. This software must only be used in a processor manufactured by Nordic |
FranKP2138 | 0:2b9b5764efb5 | 20 | * Semiconductor ASA, or in a processor manufactured by a third party that |
FranKP2138 | 0:2b9b5764efb5 | 21 | * is used in combination with a processor manufactured by Nordic Semiconductor. |
FranKP2138 | 0:2b9b5764efb5 | 22 | * |
FranKP2138 | 0:2b9b5764efb5 | 23 | * |
FranKP2138 | 0:2b9b5764efb5 | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
FranKP2138 | 0:2b9b5764efb5 | 25 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
FranKP2138 | 0:2b9b5764efb5 | 26 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
FranKP2138 | 0:2b9b5764efb5 | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR |
FranKP2138 | 0:2b9b5764efb5 | 28 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
FranKP2138 | 0:2b9b5764efb5 | 29 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
FranKP2138 | 0:2b9b5764efb5 | 30 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
FranKP2138 | 0:2b9b5764efb5 | 31 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
FranKP2138 | 0:2b9b5764efb5 | 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
FranKP2138 | 0:2b9b5764efb5 | 33 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
FranKP2138 | 0:2b9b5764efb5 | 34 | * |
FranKP2138 | 0:2b9b5764efb5 | 35 | */ |
FranKP2138 | 0:2b9b5764efb5 | 36 | |
FranKP2138 | 0:2b9b5764efb5 | 37 | /** |
FranKP2138 | 0:2b9b5764efb5 | 38 | @addtogroup BLE_COMMON |
FranKP2138 | 0:2b9b5764efb5 | 39 | @{ |
FranKP2138 | 0:2b9b5764efb5 | 40 | @defgroup ble_types Common types and macro definitions |
FranKP2138 | 0:2b9b5764efb5 | 41 | @{ |
FranKP2138 | 0:2b9b5764efb5 | 42 | |
FranKP2138 | 0:2b9b5764efb5 | 43 | @brief Common types and macro definitions for the BLE SoftDevice. |
FranKP2138 | 0:2b9b5764efb5 | 44 | */ |
FranKP2138 | 0:2b9b5764efb5 | 45 | |
FranKP2138 | 0:2b9b5764efb5 | 46 | #ifndef BLE_TYPES_H__ |
FranKP2138 | 0:2b9b5764efb5 | 47 | #define BLE_TYPES_H__ |
FranKP2138 | 0:2b9b5764efb5 | 48 | |
FranKP2138 | 0:2b9b5764efb5 | 49 | #include <stdint.h> |
FranKP2138 | 0:2b9b5764efb5 | 50 | |
FranKP2138 | 0:2b9b5764efb5 | 51 | #ifdef __cplusplus |
FranKP2138 | 0:2b9b5764efb5 | 52 | extern "C" { |
FranKP2138 | 0:2b9b5764efb5 | 53 | #endif |
FranKP2138 | 0:2b9b5764efb5 | 54 | |
FranKP2138 | 0:2b9b5764efb5 | 55 | /** @addtogroup BLE_TYPES_DEFINES Defines |
FranKP2138 | 0:2b9b5764efb5 | 56 | * @{ */ |
FranKP2138 | 0:2b9b5764efb5 | 57 | |
FranKP2138 | 0:2b9b5764efb5 | 58 | /** @defgroup BLE_CONN_HANDLES BLE Connection Handles |
FranKP2138 | 0:2b9b5764efb5 | 59 | * @{ */ |
FranKP2138 | 0:2b9b5764efb5 | 60 | #define BLE_CONN_HANDLE_INVALID 0xFFFF /**< Invalid Connection Handle. */ |
FranKP2138 | 0:2b9b5764efb5 | 61 | #define BLE_CONN_HANDLE_ALL 0xFFFE /**< Applies to all Connection Handles. */ |
FranKP2138 | 0:2b9b5764efb5 | 62 | /** @} */ |
FranKP2138 | 0:2b9b5764efb5 | 63 | |
FranKP2138 | 0:2b9b5764efb5 | 64 | |
FranKP2138 | 0:2b9b5764efb5 | 65 | /** @defgroup BLE_UUID_VALUES Assigned Values for BLE UUIDs |
FranKP2138 | 0:2b9b5764efb5 | 66 | * @{ */ |
FranKP2138 | 0:2b9b5764efb5 | 67 | /* Generic UUIDs, applicable to all services */ |
FranKP2138 | 0:2b9b5764efb5 | 68 | #define BLE_UUID_UNKNOWN 0x0000 /**< Reserved UUID. */ |
FranKP2138 | 0:2b9b5764efb5 | 69 | #define BLE_UUID_SERVICE_PRIMARY 0x2800 /**< Primary Service. */ |
FranKP2138 | 0:2b9b5764efb5 | 70 | #define BLE_UUID_SERVICE_SECONDARY 0x2801 /**< Secondary Service. */ |
FranKP2138 | 0:2b9b5764efb5 | 71 | #define BLE_UUID_SERVICE_INCLUDE 0x2802 /**< Include. */ |
FranKP2138 | 0:2b9b5764efb5 | 72 | #define BLE_UUID_CHARACTERISTIC 0x2803 /**< Characteristic. */ |
FranKP2138 | 0:2b9b5764efb5 | 73 | #define BLE_UUID_DESCRIPTOR_CHAR_EXT_PROP 0x2900 /**< Characteristic Extended Properties Descriptor. */ |
FranKP2138 | 0:2b9b5764efb5 | 74 | #define BLE_UUID_DESCRIPTOR_CHAR_USER_DESC 0x2901 /**< Characteristic User Description Descriptor. */ |
FranKP2138 | 0:2b9b5764efb5 | 75 | #define BLE_UUID_DESCRIPTOR_CLIENT_CHAR_CONFIG 0x2902 /**< Client Characteristic Configuration Descriptor. */ |
FranKP2138 | 0:2b9b5764efb5 | 76 | #define BLE_UUID_DESCRIPTOR_SERVER_CHAR_CONFIG 0x2903 /**< Server Characteristic Configuration Descriptor. */ |
FranKP2138 | 0:2b9b5764efb5 | 77 | #define BLE_UUID_DESCRIPTOR_CHAR_PRESENTATION_FORMAT 0x2904 /**< Characteristic Presentation Format Descriptor. */ |
FranKP2138 | 0:2b9b5764efb5 | 78 | #define BLE_UUID_DESCRIPTOR_CHAR_AGGREGATE_FORMAT 0x2905 /**< Characteristic Aggregate Format Descriptor. */ |
FranKP2138 | 0:2b9b5764efb5 | 79 | /* GATT specific UUIDs */ |
FranKP2138 | 0:2b9b5764efb5 | 80 | #define BLE_UUID_GATT 0x1801 /**< Generic Attribute Profile. */ |
FranKP2138 | 0:2b9b5764efb5 | 81 | #define BLE_UUID_GATT_CHARACTERISTIC_SERVICE_CHANGED 0x2A05 /**< Service Changed Characteristic. */ |
FranKP2138 | 0:2b9b5764efb5 | 82 | /* GAP specific UUIDs */ |
FranKP2138 | 0:2b9b5764efb5 | 83 | #define BLE_UUID_GAP 0x1800 /**< Generic Access Profile. */ |
FranKP2138 | 0:2b9b5764efb5 | 84 | #define BLE_UUID_GAP_CHARACTERISTIC_DEVICE_NAME 0x2A00 /**< Device Name Characteristic. */ |
FranKP2138 | 0:2b9b5764efb5 | 85 | #define BLE_UUID_GAP_CHARACTERISTIC_APPEARANCE 0x2A01 /**< Appearance Characteristic. */ |
FranKP2138 | 0:2b9b5764efb5 | 86 | #define BLE_UUID_GAP_CHARACTERISTIC_PPF 0x2A02 /**< Peripheral Privacy Flag Characteristic. */ |
FranKP2138 | 0:2b9b5764efb5 | 87 | #define BLE_UUID_GAP_CHARACTERISTIC_RECONN_ADDR 0x2A03 /**< Reconnection Address Characteristic. */ |
FranKP2138 | 0:2b9b5764efb5 | 88 | #define BLE_UUID_GAP_CHARACTERISTIC_PPCP 0x2A04 /**< Peripheral Preferred Connection Parameters Characteristic. */ |
FranKP2138 | 0:2b9b5764efb5 | 89 | /** @} */ |
FranKP2138 | 0:2b9b5764efb5 | 90 | |
FranKP2138 | 0:2b9b5764efb5 | 91 | |
FranKP2138 | 0:2b9b5764efb5 | 92 | /** @defgroup BLE_UUID_TYPES Types of UUID |
FranKP2138 | 0:2b9b5764efb5 | 93 | * @{ */ |
FranKP2138 | 0:2b9b5764efb5 | 94 | #define BLE_UUID_TYPE_UNKNOWN 0x00 /**< Invalid UUID type. */ |
FranKP2138 | 0:2b9b5764efb5 | 95 | #define BLE_UUID_TYPE_BLE 0x01 /**< Bluetooth SIG UUID (16-bit). */ |
FranKP2138 | 0:2b9b5764efb5 | 96 | #define BLE_UUID_TYPE_VENDOR_BEGIN 0x02 /**< Vendor UUID types start at this index (128-bit). */ |
FranKP2138 | 0:2b9b5764efb5 | 97 | /** @} */ |
FranKP2138 | 0:2b9b5764efb5 | 98 | |
FranKP2138 | 0:2b9b5764efb5 | 99 | |
FranKP2138 | 0:2b9b5764efb5 | 100 | /** @defgroup BLE_APPEARANCES Bluetooth Appearance values |
FranKP2138 | 0:2b9b5764efb5 | 101 | * @note Retrieved from http://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.gap.appearance.xml |
FranKP2138 | 0:2b9b5764efb5 | 102 | * @{ */ |
FranKP2138 | 0:2b9b5764efb5 | 103 | #define BLE_APPEARANCE_UNKNOWN 0 /**< Unknown. */ |
FranKP2138 | 0:2b9b5764efb5 | 104 | #define BLE_APPEARANCE_GENERIC_PHONE 64 /**< Generic Phone. */ |
FranKP2138 | 0:2b9b5764efb5 | 105 | #define BLE_APPEARANCE_GENERIC_COMPUTER 128 /**< Generic Computer. */ |
FranKP2138 | 0:2b9b5764efb5 | 106 | #define BLE_APPEARANCE_GENERIC_WATCH 192 /**< Generic Watch. */ |
FranKP2138 | 0:2b9b5764efb5 | 107 | #define BLE_APPEARANCE_WATCH_SPORTS_WATCH 193 /**< Watch: Sports Watch. */ |
FranKP2138 | 0:2b9b5764efb5 | 108 | #define BLE_APPEARANCE_GENERIC_CLOCK 256 /**< Generic Clock. */ |
FranKP2138 | 0:2b9b5764efb5 | 109 | #define BLE_APPEARANCE_GENERIC_DISPLAY 320 /**< Generic Display. */ |
FranKP2138 | 0:2b9b5764efb5 | 110 | #define BLE_APPEARANCE_GENERIC_REMOTE_CONTROL 384 /**< Generic Remote Control. */ |
FranKP2138 | 0:2b9b5764efb5 | 111 | #define BLE_APPEARANCE_GENERIC_EYE_GLASSES 448 /**< Generic Eye-glasses. */ |
FranKP2138 | 0:2b9b5764efb5 | 112 | #define BLE_APPEARANCE_GENERIC_TAG 512 /**< Generic Tag. */ |
FranKP2138 | 0:2b9b5764efb5 | 113 | #define BLE_APPEARANCE_GENERIC_KEYRING 576 /**< Generic Keyring. */ |
FranKP2138 | 0:2b9b5764efb5 | 114 | #define BLE_APPEARANCE_GENERIC_MEDIA_PLAYER 640 /**< Generic Media Player. */ |
FranKP2138 | 0:2b9b5764efb5 | 115 | #define BLE_APPEARANCE_GENERIC_BARCODE_SCANNER 704 /**< Generic Barcode Scanner. */ |
FranKP2138 | 0:2b9b5764efb5 | 116 | #define BLE_APPEARANCE_GENERIC_THERMOMETER 768 /**< Generic Thermometer. */ |
FranKP2138 | 0:2b9b5764efb5 | 117 | #define BLE_APPEARANCE_THERMOMETER_EAR 769 /**< Thermometer: Ear. */ |
FranKP2138 | 0:2b9b5764efb5 | 118 | #define BLE_APPEARANCE_GENERIC_HEART_RATE_SENSOR 832 /**< Generic Heart rate Sensor. */ |
FranKP2138 | 0:2b9b5764efb5 | 119 | #define BLE_APPEARANCE_HEART_RATE_SENSOR_HEART_RATE_BELT 833 /**< Heart Rate Sensor: Heart Rate Belt. */ |
FranKP2138 | 0:2b9b5764efb5 | 120 | #define BLE_APPEARANCE_GENERIC_BLOOD_PRESSURE 896 /**< Generic Blood Pressure. */ |
FranKP2138 | 0:2b9b5764efb5 | 121 | #define BLE_APPEARANCE_BLOOD_PRESSURE_ARM 897 /**< Blood Pressure: Arm. */ |
FranKP2138 | 0:2b9b5764efb5 | 122 | #define BLE_APPEARANCE_BLOOD_PRESSURE_WRIST 898 /**< Blood Pressure: Wrist. */ |
FranKP2138 | 0:2b9b5764efb5 | 123 | #define BLE_APPEARANCE_GENERIC_HID 960 /**< Human Interface Device (HID). */ |
FranKP2138 | 0:2b9b5764efb5 | 124 | #define BLE_APPEARANCE_HID_KEYBOARD 961 /**< Keyboard (HID Subtype). */ |
FranKP2138 | 0:2b9b5764efb5 | 125 | #define BLE_APPEARANCE_HID_MOUSE 962 /**< Mouse (HID Subtype). */ |
FranKP2138 | 0:2b9b5764efb5 | 126 | #define BLE_APPEARANCE_HID_JOYSTICK 963 /**< Joystiq (HID Subtype). */ |
FranKP2138 | 0:2b9b5764efb5 | 127 | #define BLE_APPEARANCE_HID_GAMEPAD 964 /**< Gamepad (HID Subtype). */ |
FranKP2138 | 0:2b9b5764efb5 | 128 | #define BLE_APPEARANCE_HID_DIGITIZERSUBTYPE 965 /**< Digitizer Tablet (HID Subtype). */ |
FranKP2138 | 0:2b9b5764efb5 | 129 | #define BLE_APPEARANCE_HID_CARD_READER 966 /**< Card Reader (HID Subtype). */ |
FranKP2138 | 0:2b9b5764efb5 | 130 | #define BLE_APPEARANCE_HID_DIGITAL_PEN 967 /**< Digital Pen (HID Subtype). */ |
FranKP2138 | 0:2b9b5764efb5 | 131 | #define BLE_APPEARANCE_HID_BARCODE 968 /**< Barcode Scanner (HID Subtype). */ |
FranKP2138 | 0:2b9b5764efb5 | 132 | #define BLE_APPEARANCE_GENERIC_GLUCOSE_METER 1024 /**< Generic Glucose Meter. */ |
FranKP2138 | 0:2b9b5764efb5 | 133 | #define BLE_APPEARANCE_GENERIC_RUNNING_WALKING_SENSOR 1088 /**< Generic Running Walking Sensor. */ |
FranKP2138 | 0:2b9b5764efb5 | 134 | #define BLE_APPEARANCE_RUNNING_WALKING_SENSOR_IN_SHOE 1089 /**< Running Walking Sensor: In-Shoe. */ |
FranKP2138 | 0:2b9b5764efb5 | 135 | #define BLE_APPEARANCE_RUNNING_WALKING_SENSOR_ON_SHOE 1090 /**< Running Walking Sensor: On-Shoe. */ |
FranKP2138 | 0:2b9b5764efb5 | 136 | #define BLE_APPEARANCE_RUNNING_WALKING_SENSOR_ON_HIP 1091 /**< Running Walking Sensor: On-Hip. */ |
FranKP2138 | 0:2b9b5764efb5 | 137 | #define BLE_APPEARANCE_GENERIC_CYCLING 1152 /**< Generic Cycling. */ |
FranKP2138 | 0:2b9b5764efb5 | 138 | #define BLE_APPEARANCE_CYCLING_CYCLING_COMPUTER 1153 /**< Cycling: Cycling Computer. */ |
FranKP2138 | 0:2b9b5764efb5 | 139 | #define BLE_APPEARANCE_CYCLING_SPEED_SENSOR 1154 /**< Cycling: Speed Sensor. */ |
FranKP2138 | 0:2b9b5764efb5 | 140 | #define BLE_APPEARANCE_CYCLING_CADENCE_SENSOR 1155 /**< Cycling: Cadence Sensor. */ |
FranKP2138 | 0:2b9b5764efb5 | 141 | #define BLE_APPEARANCE_CYCLING_POWER_SENSOR 1156 /**< Cycling: Power Sensor. */ |
FranKP2138 | 0:2b9b5764efb5 | 142 | #define BLE_APPEARANCE_CYCLING_SPEED_CADENCE_SENSOR 1157 /**< Cycling: Speed and Cadence Sensor. */ |
FranKP2138 | 0:2b9b5764efb5 | 143 | #define BLE_APPEARANCE_GENERIC_PULSE_OXIMETER 3136 /**< Generic Pulse Oximeter. */ |
FranKP2138 | 0:2b9b5764efb5 | 144 | #define BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP 3137 /**< Fingertip (Pulse Oximeter subtype). */ |
FranKP2138 | 0:2b9b5764efb5 | 145 | #define BLE_APPEARANCE_PULSE_OXIMETER_WRIST_WORN 3138 /**< Wrist Worn(Pulse Oximeter subtype). */ |
FranKP2138 | 0:2b9b5764efb5 | 146 | #define BLE_APPEARANCE_GENERIC_WEIGHT_SCALE 3200 /**< Generic Weight Scale. */ |
FranKP2138 | 0:2b9b5764efb5 | 147 | #define BLE_APPEARANCE_GENERIC_OUTDOOR_SPORTS_ACT 5184 /**< Generic Outdoor Sports Activity. */ |
FranKP2138 | 0:2b9b5764efb5 | 148 | #define BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_DISP 5185 /**< Location Display Device (Outdoor Sports Activity subtype). */ |
FranKP2138 | 0:2b9b5764efb5 | 149 | #define BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_AND_NAV_DISP 5186 /**< Location and Navigation Display Device (Outdoor Sports Activity subtype). */ |
FranKP2138 | 0:2b9b5764efb5 | 150 | #define BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_POD 5187 /**< Location Pod (Outdoor Sports Activity subtype). */ |
FranKP2138 | 0:2b9b5764efb5 | 151 | #define BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_AND_NAV_POD 5188 /**< Location and Navigation Pod (Outdoor Sports Activity subtype). */ |
FranKP2138 | 0:2b9b5764efb5 | 152 | /** @} */ |
FranKP2138 | 0:2b9b5764efb5 | 153 | |
FranKP2138 | 0:2b9b5764efb5 | 154 | /** @brief Set .type and .uuid fields of ble_uuid_struct to specified uuid value. */ |
FranKP2138 | 0:2b9b5764efb5 | 155 | #define BLE_UUID_BLE_ASSIGN(instance, value) do {\ |
FranKP2138 | 0:2b9b5764efb5 | 156 | instance.type = BLE_UUID_TYPE_BLE; \ |
FranKP2138 | 0:2b9b5764efb5 | 157 | instance.uuid = value;} while(0) |
FranKP2138 | 0:2b9b5764efb5 | 158 | |
FranKP2138 | 0:2b9b5764efb5 | 159 | /** @brief Copy type and uuid members from src to dst ble_uuid_t pointer. Both pointers must be valid/non-null. */ |
FranKP2138 | 0:2b9b5764efb5 | 160 | #define BLE_UUID_COPY_PTR(dst, src) do {\ |
FranKP2138 | 0:2b9b5764efb5 | 161 | (dst)->type = (src)->type; \ |
FranKP2138 | 0:2b9b5764efb5 | 162 | (dst)->uuid = (src)->uuid;} while(0) |
FranKP2138 | 0:2b9b5764efb5 | 163 | |
FranKP2138 | 0:2b9b5764efb5 | 164 | /** @brief Copy type and uuid members from src to dst ble_uuid_t struct. */ |
FranKP2138 | 0:2b9b5764efb5 | 165 | #define BLE_UUID_COPY_INST(dst, src) do {\ |
FranKP2138 | 0:2b9b5764efb5 | 166 | (dst).type = (src).type; \ |
FranKP2138 | 0:2b9b5764efb5 | 167 | (dst).uuid = (src).uuid;} while(0) |
FranKP2138 | 0:2b9b5764efb5 | 168 | |
FranKP2138 | 0:2b9b5764efb5 | 169 | /** @brief Compare for equality both type and uuid members of two (valid, non-null) ble_uuid_t pointers. */ |
FranKP2138 | 0:2b9b5764efb5 | 170 | #define BLE_UUID_EQ(p_uuid1, p_uuid2) \ |
FranKP2138 | 0:2b9b5764efb5 | 171 | (((p_uuid1)->type == (p_uuid2)->type) && ((p_uuid1)->uuid == (p_uuid2)->uuid)) |
FranKP2138 | 0:2b9b5764efb5 | 172 | |
FranKP2138 | 0:2b9b5764efb5 | 173 | /** @brief Compare for difference both type and uuid members of two (valid, non-null) ble_uuid_t pointers. */ |
FranKP2138 | 0:2b9b5764efb5 | 174 | #define BLE_UUID_NEQ(p_uuid1, p_uuid2) \ |
FranKP2138 | 0:2b9b5764efb5 | 175 | (((p_uuid1)->type != (p_uuid2)->type) || ((p_uuid1)->uuid != (p_uuid2)->uuid)) |
FranKP2138 | 0:2b9b5764efb5 | 176 | |
FranKP2138 | 0:2b9b5764efb5 | 177 | /** @} */ |
FranKP2138 | 0:2b9b5764efb5 | 178 | |
FranKP2138 | 0:2b9b5764efb5 | 179 | /** @addtogroup BLE_TYPES_STRUCTURES Structures |
FranKP2138 | 0:2b9b5764efb5 | 180 | * @{ */ |
FranKP2138 | 0:2b9b5764efb5 | 181 | |
FranKP2138 | 0:2b9b5764efb5 | 182 | /** @brief 128 bit UUID values. */ |
FranKP2138 | 0:2b9b5764efb5 | 183 | typedef struct |
FranKP2138 | 0:2b9b5764efb5 | 184 | { |
FranKP2138 | 0:2b9b5764efb5 | 185 | uint8_t uuid128[16]; /**< Little-Endian UUID bytes. */ |
FranKP2138 | 0:2b9b5764efb5 | 186 | } ble_uuid128_t; |
FranKP2138 | 0:2b9b5764efb5 | 187 | |
FranKP2138 | 0:2b9b5764efb5 | 188 | /** @brief Bluetooth Low Energy UUID type, encapsulates both 16-bit and 128-bit UUIDs. */ |
FranKP2138 | 0:2b9b5764efb5 | 189 | typedef struct |
FranKP2138 | 0:2b9b5764efb5 | 190 | { |
FranKP2138 | 0:2b9b5764efb5 | 191 | uint16_t uuid; /**< 16-bit UUID value or octets 12-13 of 128-bit UUID. */ |
FranKP2138 | 0:2b9b5764efb5 | 192 | uint8_t type; /**< UUID type, see @ref BLE_UUID_TYPES. If type is @ref BLE_UUID_TYPE_UNKNOWN, the value of uuid is undefined. */ |
FranKP2138 | 0:2b9b5764efb5 | 193 | } ble_uuid_t; |
FranKP2138 | 0:2b9b5764efb5 | 194 | |
FranKP2138 | 0:2b9b5764efb5 | 195 | /** @} */ |
FranKP2138 | 0:2b9b5764efb5 | 196 | #ifdef __cplusplus |
FranKP2138 | 0:2b9b5764efb5 | 197 | } |
FranKP2138 | 0:2b9b5764efb5 | 198 | #endif |
FranKP2138 | 0:2b9b5764efb5 | 199 | |
FranKP2138 | 0:2b9b5764efb5 | 200 | #endif /* BLE_TYPES_H__ */ |
FranKP2138 | 0:2b9b5764efb5 | 201 | |
FranKP2138 | 0:2b9b5764efb5 | 202 | /** |
FranKP2138 | 0:2b9b5764efb5 | 203 | @} |
FranKP2138 | 0:2b9b5764efb5 | 204 | @} |
FranKP2138 | 0:2b9b5764efb5 | 205 | */ |
FranKP2138 | 0:2b9b5764efb5 | 206 |