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