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