meh

Fork of mbed by mbed official

Committer:
bogdanm
Date:
Fri Aug 15 15:28:31 2014 +0100
Revision:
88:9327015d4013
Parent:
TARGET_ARCH_BLE/TARGET_NORDIC/TARGET_NRF51822/Lib/s110_nrf51822_7_0_0/s110_nrf51822_7.0.0_API/include/ble_types.h@87:6213f644d804
Release 88 of the mbed library

Main changes:

- changed "error.h" to "mbed_error.h" to avoid conflicts with 3rd party code
- LPC1549 SPI driver fixes
- K64F Ethernet TX buffer reclaim mechanism fix
- STDIO initialization fix
- NUCLEO_F334R8 I2C clock fix
- various other fixes

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bogdanm 87:6213f644d804 1 /* Copyright (c) 2011 Nordic Semiconductor. All Rights Reserved.
bogdanm 87:6213f644d804 2 *
bogdanm 87:6213f644d804 3 * The information contained herein is confidential property of Nordic Semiconductor. The use,
bogdanm 87:6213f644d804 4 * copying, transfer or disclosure of such information is prohibited except by express written
bogdanm 87:6213f644d804 5 * agreement with Nordic Semiconductor.
bogdanm 87:6213f644d804 6 *
bogdanm 87:6213f644d804 7 */
bogdanm 87:6213f644d804 8 /**
bogdanm 87:6213f644d804 9 @addtogroup BLE_COMMON
bogdanm 87:6213f644d804 10 @{
bogdanm 87:6213f644d804 11 @defgroup ble_types Common types and macro definitions
bogdanm 87:6213f644d804 12 @{
bogdanm 87:6213f644d804 13
bogdanm 87:6213f644d804 14 @brief Common types and macro definitions for the S110 SoftDevice.
bogdanm 87:6213f644d804 15 */
bogdanm 87:6213f644d804 16
bogdanm 87:6213f644d804 17 #ifndef BLE_TYPES_H__
bogdanm 87:6213f644d804 18 #define BLE_TYPES_H__
bogdanm 87:6213f644d804 19
bogdanm 87:6213f644d804 20 #include <stdint.h>
bogdanm 87:6213f644d804 21
bogdanm 87:6213f644d804 22 /** @addtogroup BLE_COMMON_DEFINES Defines
bogdanm 87:6213f644d804 23 * @{ */
bogdanm 87:6213f644d804 24
bogdanm 87:6213f644d804 25 /** @defgroup BLE_CONN_HANDLES BLE Connection Handles
bogdanm 87:6213f644d804 26 * @{ */
bogdanm 87:6213f644d804 27 #define BLE_CONN_HANDLE_INVALID 0xFFFF /**< Invalid Connection Handle. */
bogdanm 87:6213f644d804 28 #define BLE_CONN_HANDLE_ALL 0xFFFE /**< Applies to all Connection Handles. */
bogdanm 87:6213f644d804 29 /** @} */
bogdanm 87:6213f644d804 30
bogdanm 87:6213f644d804 31
bogdanm 87:6213f644d804 32 /** @defgroup BLE_UUID_VALUES Assigned Values for BLE UUIDs
bogdanm 87:6213f644d804 33 * @{ */
bogdanm 87:6213f644d804 34 /* Generic UUIDs, applicable to all services */
bogdanm 87:6213f644d804 35 #define BLE_UUID_UNKNOWN 0x0000 /**< Reserved UUID. */
bogdanm 87:6213f644d804 36 #define BLE_UUID_SERVICE_PRIMARY 0x2800 /**< Primary Service. */
bogdanm 87:6213f644d804 37 #define BLE_UUID_SERVICE_SECONDARY 0x2801 /**< Secondary Service. */
bogdanm 87:6213f644d804 38 #define BLE_UUID_SERVICE_INCLUDE 0x2802 /**< Include. */
bogdanm 87:6213f644d804 39 #define BLE_UUID_CHARACTERISTIC 0x2803 /**< Characteristic. */
bogdanm 87:6213f644d804 40 #define BLE_UUID_DESCRIPTOR_CHAR_EXT_PROP 0x2900 /**< Characteristic Extended Properties Descriptor. */
bogdanm 87:6213f644d804 41 #define BLE_UUID_DESCRIPTOR_CHAR_USER_DESC 0x2901 /**< Characteristic User Description Descriptor. */
bogdanm 87:6213f644d804 42 #define BLE_UUID_DESCRIPTOR_CLIENT_CHAR_CONFIG 0x2902 /**< Client Characteristic Configuration Descriptor. */
bogdanm 87:6213f644d804 43 #define BLE_UUID_DESCRIPTOR_SERVER_CHAR_CONFIG 0x2903 /**< Server Characteristic Configuration Descriptor. */
bogdanm 87:6213f644d804 44 #define BLE_UUID_DESCRIPTOR_CHAR_PRESENTATION_FORMAT 0x2904 /**< Characteristic Presentation Format Descriptor. */
bogdanm 87:6213f644d804 45 #define BLE_UUID_DESCRIPTOR_CHAR_AGGREGATE_FORMAT 0x2905 /**< Characteristic Aggregate Format Descriptor. */
bogdanm 87:6213f644d804 46 /* GATT specific UUIDs */
bogdanm 87:6213f644d804 47 #define BLE_UUID_GATT 0x1801 /**< Generic Attribute Profile. */
bogdanm 87:6213f644d804 48 #define BLE_UUID_GATT_CHARACTERISTIC_SERVICE_CHANGED 0x2A05 /**< Service Changed Characteristic. */
bogdanm 87:6213f644d804 49 /* GAP specific UUIDs */
bogdanm 87:6213f644d804 50 #define BLE_UUID_GAP 0x1800 /**< Generic Access Profile. */
bogdanm 87:6213f644d804 51 #define BLE_UUID_GAP_CHARACTERISTIC_DEVICE_NAME 0x2A00 /**< Device Name Characteristic. */
bogdanm 87:6213f644d804 52 #define BLE_UUID_GAP_CHARACTERISTIC_APPEARANCE 0x2A01 /**< Appearance Characteristic. */
bogdanm 87:6213f644d804 53 #define BLE_UUID_GAP_CHARACTERISTIC_PPF 0x2A02 /**< Peripheral Privacy Flag Characteristic. */
bogdanm 87:6213f644d804 54 #define BLE_UUID_GAP_CHARACTERISTIC_RECONN_ADDR 0x2A03 /**< Reconnection Address Characteristic. */
bogdanm 87:6213f644d804 55 #define BLE_UUID_GAP_CHARACTERISTIC_PPCP 0x2A04 /**< Peripheral Preferred Connection Parameters Characteristic. */
bogdanm 87:6213f644d804 56 /** @} */
bogdanm 87:6213f644d804 57
bogdanm 87:6213f644d804 58
bogdanm 87:6213f644d804 59 /** @defgroup BLE_UUID_TYPES Types of UUID
bogdanm 87:6213f644d804 60 * @{ */
bogdanm 87:6213f644d804 61 #define BLE_UUID_TYPE_UNKNOWN 0x00 /**< Invalid UUID type. */
bogdanm 87:6213f644d804 62 #define BLE_UUID_TYPE_BLE 0x01 /**< Bluetooth SIG UUID (16-bit). */
bogdanm 87:6213f644d804 63 #define BLE_UUID_TYPE_VENDOR_BEGIN 0x02 /**< Vendor UUID types start at this index (128-bit). */
bogdanm 87:6213f644d804 64 /** @} */
bogdanm 87:6213f644d804 65
bogdanm 87:6213f644d804 66
bogdanm 87:6213f644d804 67 /** @defgroup BLE_APPEARANCES Bluetooth Appearance values
bogdanm 87:6213f644d804 68 * @note Retrieved from http://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.gap.appearance.xml
bogdanm 87:6213f644d804 69 * @{ */
bogdanm 87:6213f644d804 70 #define BLE_APPEARANCE_UNKNOWN 0 /**< Unknown. */
bogdanm 87:6213f644d804 71 #define BLE_APPEARANCE_GENERIC_PHONE 64 /**< Generic Phone. */
bogdanm 87:6213f644d804 72 #define BLE_APPEARANCE_GENERIC_COMPUTER 128 /**< Generic Computer. */
bogdanm 87:6213f644d804 73 #define BLE_APPEARANCE_GENERIC_WATCH 192 /**< Generic Watch. */
bogdanm 87:6213f644d804 74 #define BLE_APPEARANCE_WATCH_SPORTS_WATCH 193 /**< Watch: Sports Watch. */
bogdanm 87:6213f644d804 75 #define BLE_APPEARANCE_GENERIC_CLOCK 256 /**< Generic Clock. */
bogdanm 87:6213f644d804 76 #define BLE_APPEARANCE_GENERIC_DISPLAY 320 /**< Generic Display. */
bogdanm 87:6213f644d804 77 #define BLE_APPEARANCE_GENERIC_REMOTE_CONTROL 384 /**< Generic Remote Control. */
bogdanm 87:6213f644d804 78 #define BLE_APPEARANCE_GENERIC_EYE_GLASSES 448 /**< Generic Eye-glasses. */
bogdanm 87:6213f644d804 79 #define BLE_APPEARANCE_GENERIC_TAG 512 /**< Generic Tag. */
bogdanm 87:6213f644d804 80 #define BLE_APPEARANCE_GENERIC_KEYRING 576 /**< Generic Keyring. */
bogdanm 87:6213f644d804 81 #define BLE_APPEARANCE_GENERIC_MEDIA_PLAYER 640 /**< Generic Media Player. */
bogdanm 87:6213f644d804 82 #define BLE_APPEARANCE_GENERIC_BARCODE_SCANNER 704 /**< Generic Barcode Scanner. */
bogdanm 87:6213f644d804 83 #define BLE_APPEARANCE_GENERIC_THERMOMETER 768 /**< Generic Thermometer. */
bogdanm 87:6213f644d804 84 #define BLE_APPEARANCE_THERMOMETER_EAR 769 /**< Thermometer: Ear. */
bogdanm 87:6213f644d804 85 #define BLE_APPEARANCE_GENERIC_HEART_RATE_SENSOR 832 /**< Generic Heart rate Sensor. */
bogdanm 87:6213f644d804 86 #define BLE_APPEARANCE_HEART_RATE_SENSOR_HEART_RATE_BELT 833 /**< Heart Rate Sensor: Heart Rate Belt. */
bogdanm 87:6213f644d804 87 #define BLE_APPEARANCE_GENERIC_BLOOD_PRESSURE 896 /**< Generic Blood Pressure. */
bogdanm 87:6213f644d804 88 #define BLE_APPEARANCE_BLOOD_PRESSURE_ARM 897 /**< Blood Pressure: Arm. */
bogdanm 87:6213f644d804 89 #define BLE_APPEARANCE_BLOOD_PRESSURE_WRIST 898 /**< Blood Pressure: Wrist. */
bogdanm 87:6213f644d804 90 #define BLE_APPEARANCE_GENERIC_HID 960 /**< Human Interface Device (HID). */
bogdanm 87:6213f644d804 91 #define BLE_APPEARANCE_HID_KEYBOARD 961 /**< Keyboard (HID Subtype). */
bogdanm 87:6213f644d804 92 #define BLE_APPEARANCE_HID_MOUSE 962 /**< Mouse (HID Subtype). */
bogdanm 87:6213f644d804 93 #define BLE_APPEARANCE_HID_JOYSTICK 963 /**< Joystiq (HID Subtype). */
bogdanm 87:6213f644d804 94 #define BLE_APPEARANCE_HID_GAMEPAD 964 /**< Gamepad (HID Subtype). */
bogdanm 87:6213f644d804 95 #define BLE_APPEARANCE_HID_DIGITIZERSUBTYPE 965 /**< Digitizer Tablet (HID Subtype). */
bogdanm 87:6213f644d804 96 #define BLE_APPEARANCE_HID_CARD_READER 966 /**< Card Reader (HID Subtype). */
bogdanm 87:6213f644d804 97 #define BLE_APPEARANCE_HID_DIGITAL_PEN 967 /**< Digital Pen (HID Subtype). */
bogdanm 87:6213f644d804 98 #define BLE_APPEARANCE_HID_BARCODE 968 /**< Barcode Scanner (HID Subtype). */
bogdanm 87:6213f644d804 99 #define BLE_APPEARANCE_GENERIC_GLUCOSE_METER 1024 /**< Generic Glucose Meter. */
bogdanm 87:6213f644d804 100 #define BLE_APPEARANCE_GENERIC_RUNNING_WALKING_SENSOR 1088 /**< Generic Running Walking Sensor. */
bogdanm 87:6213f644d804 101 #define BLE_APPEARANCE_RUNNING_WALKING_SENSOR_IN_SHOE 1089 /**< Running Walking Sensor: In-Shoe. */
bogdanm 87:6213f644d804 102 #define BLE_APPEARANCE_RUNNING_WALKING_SENSOR_ON_SHOE 1090 /**< Running Walking Sensor: On-Shoe. */
bogdanm 87:6213f644d804 103 #define BLE_APPEARANCE_RUNNING_WALKING_SENSOR_ON_HIP 1091 /**< Running Walking Sensor: On-Hip. */
bogdanm 87:6213f644d804 104 #define BLE_APPEARANCE_GENERIC_CYCLING 1152 /**< Generic Cycling. */
bogdanm 87:6213f644d804 105 #define BLE_APPEARANCE_CYCLING_CYCLING_COMPUTER 1153 /**< Cycling: Cycling Computer. */
bogdanm 87:6213f644d804 106 #define BLE_APPEARANCE_CYCLING_SPEED_SENSOR 1154 /**< Cycling: Speed Sensor. */
bogdanm 87:6213f644d804 107 #define BLE_APPEARANCE_CYCLING_CADENCE_SENSOR 1155 /**< Cycling: Cadence Sensor. */
bogdanm 87:6213f644d804 108 #define BLE_APPEARANCE_CYCLING_POWER_SENSOR 1156 /**< Cycling: Power Sensor. */
bogdanm 87:6213f644d804 109 #define BLE_APPEARANCE_CYCLING_SPEED_CADENCE_SENSOR 1157 /**< Cycling: Speed and Cadence Sensor. */
bogdanm 87:6213f644d804 110 #define BLE_APPEARANCE_GENERIC_PULSE_OXIMETER 3136 /**< Generic Pulse Oximeter. */
bogdanm 87:6213f644d804 111 #define BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP 3137 /**< Fingertip (Pulse Oximeter subtype). */
bogdanm 87:6213f644d804 112 #define BLE_APPEARANCE_PULSE_OXIMETER_WRIST_WORN 3138 /**< Wrist Worn(Pulse Oximeter subtype). */
bogdanm 87:6213f644d804 113 #define BLE_APPEARANCE_GENERIC_WEIGHT_SCALE 3200 /**< Generic Weight Scale. */
bogdanm 87:6213f644d804 114 #define BLE_APPEARANCE_GENERIC_OUTDOOR_SPORTS_ACT 5184 /**< Generic Outdoor Sports Activity. */
bogdanm 87:6213f644d804 115 #define BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_DISP 5185 /**< Location Display Device (Outdoor Sports Activity subtype). */
bogdanm 87:6213f644d804 116 #define BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_AND_NAV_DISP 5186 /**< Location and Navigation Display Device (Outdoor Sports Activity subtype). */
bogdanm 87:6213f644d804 117 #define BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_POD 5187 /**< Location Pod (Outdoor Sports Activity subtype). */
bogdanm 87:6213f644d804 118 #define BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_AND_NAV_POD 5188 /**< Location and Navigation Pod (Outdoor Sports Activity subtype). */
bogdanm 87:6213f644d804 119 /** @} */
bogdanm 87:6213f644d804 120
bogdanm 87:6213f644d804 121 /** @brief Set .type and .uuid fields of ble_uuid_struct to specified uuid value. */
bogdanm 87:6213f644d804 122 #define BLE_UUID_BLE_ASSIGN(instance, value) do {\
bogdanm 87:6213f644d804 123 instance.type = BLE_UUID_TYPE_BLE; \
bogdanm 87:6213f644d804 124 instance.uuid = value;} while(0)
bogdanm 87:6213f644d804 125
bogdanm 87:6213f644d804 126 /** @brief Copy type and uuid members from src to dst ble_uuid_t pointer. Both pointers must be valid/non-null. */
bogdanm 87:6213f644d804 127 #define BLE_UUID_COPY_PTR(dst, src) do {\
bogdanm 87:6213f644d804 128 (dst)->type = (src)->type; \
bogdanm 87:6213f644d804 129 (dst)->uuid = (src)->uuid;} while(0)
bogdanm 87:6213f644d804 130
bogdanm 87:6213f644d804 131 /** @brief Copy type and uuid members from src to dst ble_uuid_t struct. */
bogdanm 87:6213f644d804 132 #define BLE_UUID_COPY_INST(dst, src) do {\
bogdanm 87:6213f644d804 133 (dst).type = (src).type; \
bogdanm 87:6213f644d804 134 (dst).uuid = (src).uuid;} while(0)
bogdanm 87:6213f644d804 135
bogdanm 87:6213f644d804 136 /** @brief Compare for equality both type and uuid members of two (valid, non-null) ble_uuid_t pointers. */
bogdanm 87:6213f644d804 137 #define BLE_UUID_EQ(p_uuid1, p_uuid2) \
bogdanm 87:6213f644d804 138 (((p_uuid1)->type == (p_uuid2)->type) && ((p_uuid1)->uuid == (p_uuid2)->uuid))
bogdanm 87:6213f644d804 139
bogdanm 87:6213f644d804 140 /** @brief Compare for difference both type and uuid members of two (valid, non-null) ble_uuid_t pointers. */
bogdanm 87:6213f644d804 141 #define BLE_UUID_NEQ(p_uuid1, p_uuid2) \
bogdanm 87:6213f644d804 142 (((p_uuid1)->type != (p_uuid2)->type) || ((p_uuid1)->uuid != (p_uuid2)->uuid))
bogdanm 87:6213f644d804 143
bogdanm 87:6213f644d804 144 /** @} */
bogdanm 87:6213f644d804 145
bogdanm 87:6213f644d804 146 /** @addtogroup BLE_TYPES_STRUCTURES Structures
bogdanm 87:6213f644d804 147 * @{ */
bogdanm 87:6213f644d804 148
bogdanm 87:6213f644d804 149 /** @brief 128 bit UUID values. */
bogdanm 87:6213f644d804 150 typedef struct
bogdanm 87:6213f644d804 151 {
bogdanm 87:6213f644d804 152 unsigned char uuid128[16];
bogdanm 87:6213f644d804 153 } ble_uuid128_t;
bogdanm 87:6213f644d804 154
bogdanm 87:6213f644d804 155 /** @brief Bluetooth Low Energy UUID type, encapsulates both 16-bit and 128-bit UUIDs. */
bogdanm 87:6213f644d804 156 typedef struct
bogdanm 87:6213f644d804 157 {
bogdanm 87:6213f644d804 158 uint16_t uuid; /**< 16-bit UUID value or octets 12-13 of 128-bit UUID. */
bogdanm 87:6213f644d804 159 uint8_t type; /**< UUID type, see @ref BLE_UUID_TYPES. If type is BLE_UUID_TYPE_UNKNOWN, the value of uuid is undefined. */
bogdanm 87:6213f644d804 160 } ble_uuid_t;
bogdanm 87:6213f644d804 161
bogdanm 87:6213f644d804 162 /** @} */
bogdanm 87:6213f644d804 163
bogdanm 87:6213f644d804 164 #endif /* BLE_TYPES_H__ */
bogdanm 87:6213f644d804 165
bogdanm 87:6213f644d804 166 /**
bogdanm 87:6213f644d804 167 @}
bogdanm 87:6213f644d804 168 @}
bogdanm 87:6213f644d804 169 */