Fork for the GitHub
lib_NDEF_Bluetooth.h@0:de13951f30f6, 2019-11-14 (annotated)
- Committer:
- DiegoOstuni
- Date:
- Thu Nov 14 10:34:11 2019 +0000
- Revision:
- 0:de13951f30f6
Add files
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
DiegoOstuni | 0:de13951f30f6 | 1 | /** |
DiegoOstuni | 0:de13951f30f6 | 2 | ****************************************************************************** |
DiegoOstuni | 0:de13951f30f6 | 3 | * @file lib_NDEF_Bluetooth.h |
DiegoOstuni | 0:de13951f30f6 | 4 | * @author MMY Application Team |
DiegoOstuni | 0:de13951f30f6 | 5 | * @version $Revision: 2475 $ |
DiegoOstuni | 0:de13951f30f6 | 6 | * @date $Date: 2016-06-24 12:11:59 +0200 (Fri, 24 Jun 2016) $ |
DiegoOstuni | 0:de13951f30f6 | 7 | * @brief This file help to manage a NDEF file representing a Bluetooth pairing info. |
DiegoOstuni | 0:de13951f30f6 | 8 | ****************************************************************************** |
DiegoOstuni | 0:de13951f30f6 | 9 | * @attention |
DiegoOstuni | 0:de13951f30f6 | 10 | * |
DiegoOstuni | 0:de13951f30f6 | 11 | * <h2><center>© COPYRIGHT 2016 STMicroelectronics</center></h2> |
DiegoOstuni | 0:de13951f30f6 | 12 | * |
DiegoOstuni | 0:de13951f30f6 | 13 | * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); |
DiegoOstuni | 0:de13951f30f6 | 14 | * You may not use this file except in compliance with the License. |
DiegoOstuni | 0:de13951f30f6 | 15 | * You may obtain a copy of the License at: |
DiegoOstuni | 0:de13951f30f6 | 16 | * |
DiegoOstuni | 0:de13951f30f6 | 17 | * http://www.st.com/myliberty |
DiegoOstuni | 0:de13951f30f6 | 18 | * |
DiegoOstuni | 0:de13951f30f6 | 19 | * Unless required by applicable law or agreed to in writing, software |
DiegoOstuni | 0:de13951f30f6 | 20 | * distributed under the License is distributed on an "AS IS" BASIS, |
DiegoOstuni | 0:de13951f30f6 | 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, |
DiegoOstuni | 0:de13951f30f6 | 22 | * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, |
DiegoOstuni | 0:de13951f30f6 | 23 | * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. |
DiegoOstuni | 0:de13951f30f6 | 24 | * See the License for the specific language governing permissions and |
DiegoOstuni | 0:de13951f30f6 | 25 | * limitations under the License. |
DiegoOstuni | 0:de13951f30f6 | 26 | * |
DiegoOstuni | 0:de13951f30f6 | 27 | ****************************************************************************** |
DiegoOstuni | 0:de13951f30f6 | 28 | */ |
DiegoOstuni | 0:de13951f30f6 | 29 | |
DiegoOstuni | 0:de13951f30f6 | 30 | /* Define to prevent recursive inclusion -------------------------------------*/ |
DiegoOstuni | 0:de13951f30f6 | 31 | #ifndef __LIB_NDEF_BLUETOOTH_H |
DiegoOstuni | 0:de13951f30f6 | 32 | #define __LIB_NDEF_BLUETOOTH_H |
DiegoOstuni | 0:de13951f30f6 | 33 | |
DiegoOstuni | 0:de13951f30f6 | 34 | |
DiegoOstuni | 0:de13951f30f6 | 35 | /* Includes ------------------------------------------------------------------*/ |
DiegoOstuni | 0:de13951f30f6 | 36 | #include "lib_NDEF.h" |
DiegoOstuni | 0:de13951f30f6 | 37 | |
DiegoOstuni | 0:de13951f30f6 | 38 | /** @addtogroup lib_NDEF_Bluetooth |
DiegoOstuni | 0:de13951f30f6 | 39 | * @{ |
DiegoOstuni | 0:de13951f30f6 | 40 | */ |
DiegoOstuni | 0:de13951f30f6 | 41 | |
DiegoOstuni | 0:de13951f30f6 | 42 | /** @brief MIME type for the Bluetooth BR/EDR Out-Of-Band data. */ |
DiegoOstuni | 0:de13951f30f6 | 43 | #define NDEF_BLUETOOTH_BREDR_MIME_TYPE "application/vnd.bluetooth.ep.oob" |
DiegoOstuni | 0:de13951f30f6 | 44 | /** @brief MIME type for the Bluetooth Low Energy Out-Of-Band data. */ |
DiegoOstuni | 0:de13951f30f6 | 45 | #define NDEF_BLUETOOTH_BLE_MIME_TYPE "application/vnd.bluetooth.le.oob" |
DiegoOstuni | 0:de13951f30f6 | 46 | |
DiegoOstuni | 0:de13951f30f6 | 47 | |
DiegoOstuni | 0:de13951f30f6 | 48 | /** @brief Enumerates the Extended Inquiry Responses, as defined in the Bluetooth v4.0 core specification. */ |
DiegoOstuni | 0:de13951f30f6 | 49 | typedef enum { |
DiegoOstuni | 0:de13951f30f6 | 50 | BLUETOOTH_EIR_FLAGS = 0x01, /**< Bluetooth flags:\n |
DiegoOstuni | 0:de13951f30f6 | 51 | b0: LE limited Discoverable Mode,\n |
DiegoOstuni | 0:de13951f30f6 | 52 | b1: LE general Discoverable Mode,\n |
DiegoOstuni | 0:de13951f30f6 | 53 | b2: BR/EDR not supported,\n |
DiegoOstuni | 0:de13951f30f6 | 54 | b3: Simultaneous LE & BR/EDR Conroller,\n |
DiegoOstuni | 0:de13951f30f6 | 55 | b4: Simultaneous LE & BR/EDR Host |
DiegoOstuni | 0:de13951f30f6 | 56 | */ |
DiegoOstuni | 0:de13951f30f6 | 57 | BLUETOOTH_EIR_SERVICE_CLASS_UUID_PARTIAL_16 = 0x02, /**< Bluetooth service UUID on 16-bits (partial list) */ |
DiegoOstuni | 0:de13951f30f6 | 58 | BLUETOOTH_EIR_SERVICE_CLASS_UUID_COMPLETE_16 = 0x03, /**< Bluetooth service UUID on 16-bits (complete list) */ |
DiegoOstuni | 0:de13951f30f6 | 59 | BLUETOOTH_EIR_SERVICE_CLASS_UUID_PARTIAL_32 = 0x04, /**< Bluetooth service UUID on 32-bits (partial list) */ |
DiegoOstuni | 0:de13951f30f6 | 60 | BLUETOOTH_EIR_SERVICE_CLASS_UUID_COMPLETE_32 = 0x05, /**< Bluetooth service UUID on 32-bits (complete list) */ |
DiegoOstuni | 0:de13951f30f6 | 61 | BLUETOOTH_EIR_SERVICE_CLASS_UUID_PARTIAL_128 = 0x06, /**< Bluetooth service UUID on 128-bits (partial list) */ |
DiegoOstuni | 0:de13951f30f6 | 62 | BLUETOOTH_EIR_SERVICE_CLASS_UUID_COMPLETE_128 = 0x07, /**< Bluetooth service UUID on 128-bits (complete list) */ |
DiegoOstuni | 0:de13951f30f6 | 63 | BLUETOOTH_EIR_SHORT_LOCAL_NAME = 0x08, /**< Shortened local name */ |
DiegoOstuni | 0:de13951f30f6 | 64 | BLUETOOTH_EIR_COMPLETE_LOCAL_NAME = 0x09, /**< Complete local name */ |
DiegoOstuni | 0:de13951f30f6 | 65 | BLUETOOTH_EIR_TX_POWER_LEVEL = 0x0A, /**< TX Power Level (1 byte): 0xXX:-127 to +127dBm */ |
DiegoOstuni | 0:de13951f30f6 | 66 | BLUETOOTH_EIR_DEVICE_CLASS = 0x0D, /**< Class of device, Format defined in Assigned Numbers */ |
DiegoOstuni | 0:de13951f30f6 | 67 | BLUETOOTH_EIR_SIMPLE_PAIRING_HASH = 0x0E, /**< Simple Pairing Hash C (16 octets), Format defined in [Vol. 2], Part H Section 7.2.2*/ |
DiegoOstuni | 0:de13951f30f6 | 68 | BLUETOOTH_EIR_SIMPLE_PAIRING_RANDOMIZER = 0x0F, /**< Simple Pairing Randomizer R (16 octets), Format defined in[Vol. 2], Part H Section 7.2.2 */ |
DiegoOstuni | 0:de13951f30f6 | 69 | BLUETOOTH_EIR_SECURITY_MANAGER_TK_VALUE = 0x10, /**< TK Value: Value as used in pairing over LE Physical channel. Format defined in [Vol. 3], Part H Section 2.3*/ |
DiegoOstuni | 0:de13951f30f6 | 70 | BLUETOOTH_EIR_SECURITY_MANAGER_FLAGS = 0x11, /**< Flags (1 octet):\n |
DiegoOstuni | 0:de13951f30f6 | 71 | b0: OOB Flags Field (0 = OOB data not present, 1 = OOB data present),\n |
DiegoOstuni | 0:de13951f30f6 | 72 | b1: LE supported (Host) (i.e. bit 65 of LMP Extended Feature bits Page 1),\n |
DiegoOstuni | 0:de13951f30f6 | 73 | b2: Simultaneous LE and BR/EDR to Same Device Capable (Host) (i.e. bit 66 of LMP Extended Feature bits Page 1)\n |
DiegoOstuni | 0:de13951f30f6 | 74 | b3: Address type (0 = Public Address, 1 = Random Address) |
DiegoOstuni | 0:de13951f30f6 | 75 | */ |
DiegoOstuni | 0:de13951f30f6 | 76 | BLUETOOTH_EIR_SLAVE_CONNECTION_INTERVAL_RANGE = 0x12, /**< Slave Connection Interval Range: The first 2 octets defines the minimum value for the connection interval, The second 2 octets defines the maximum value for the connection interval */ |
DiegoOstuni | 0:de13951f30f6 | 77 | BLUETOOTH_EIR_SERVICE_SOLICITATION_16 = 0x14, /**< Service UUIDs: List of 16 bit Service UUIDs*/ |
DiegoOstuni | 0:de13951f30f6 | 78 | BLUETOOTH_EIR_SERVICE_SOLICITATION_128 = 0x15, /**< Service UUIDs: List of 128 bit Service UUID*/ |
DiegoOstuni | 0:de13951f30f6 | 79 | BLUETOOTH_EIR_SERVICE_DATA = 0x16, /**< Service Data (2 or more octets): The first 2 octets contain the 16 bit Service UUID followed by additional service data */ |
DiegoOstuni | 0:de13951f30f6 | 80 | BLUETOOTH_EIR_APPEARANCE = 0x19, /**< UUID for `Appearance`: The Appearance characteristic value shall be the enumerated value as defined by Bluetooth Assigned Numbers document. */ |
DiegoOstuni | 0:de13951f30f6 | 81 | BLUETOOTH_EIR_BLE_DEVICE_ADDRESS = 0x1B, /**< 6 LSB bytes: Device address, 7th byte: Address type (Public/Random) */ |
DiegoOstuni | 0:de13951f30f6 | 82 | BLUETOOTH_EIR_BLE_ROLE = 0x1C, /**< Device Role: Periph only, Central only, Periph prefered, Central prefered */ |
DiegoOstuni | 0:de13951f30f6 | 83 | BLUETOOTH_EIR_MANUFACTURER_DATA = 0xFF /**< Manufacturer Specific Data (2 or more octets): The first 2 octets contain the Company Identifier Code followed by additional manufacturer specific data */ |
DiegoOstuni | 0:de13951f30f6 | 84 | } Ndef_Bluetooth_Eir_Types_t; |
DiegoOstuni | 0:de13951f30f6 | 85 | |
DiegoOstuni | 0:de13951f30f6 | 86 | |
DiegoOstuni | 0:de13951f30f6 | 87 | /** @brief Bluetooth Flag field: LE limited discovery. */ |
DiegoOstuni | 0:de13951f30f6 | 88 | #define NDEF_BLE_LIMITED_DISCOVERY_FLAG (0x1) |
DiegoOstuni | 0:de13951f30f6 | 89 | /** @brief Bluetooth Flag field: LE general discovery. */ |
DiegoOstuni | 0:de13951f30f6 | 90 | #define NDEF_BLE_GENERAL_DISCOVERY_FLAG (0x2) |
DiegoOstuni | 0:de13951f30f6 | 91 | /** @brief Bluetooth Flag field: BR/EDR compliant. */ |
DiegoOstuni | 0:de13951f30f6 | 92 | #define NDEF_BLE_NOT_BREDR_COMPLIANT_FLAG (0x4) |
DiegoOstuni | 0:de13951f30f6 | 93 | /** @brief Bluetooth Flag field: LE & BR/EDR simultaneous support. */ |
DiegoOstuni | 0:de13951f30f6 | 94 | #define NDEF_BLE_LE_BREDR_SIMULTANEOUS_FLAG (0x8) |
DiegoOstuni | 0:de13951f30f6 | 95 | |
DiegoOstuni | 0:de13951f30f6 | 96 | /** @brief Enumerates the Bluetooth LE address types. */ |
DiegoOstuni | 0:de13951f30f6 | 97 | typedef enum { |
DiegoOstuni | 0:de13951f30f6 | 98 | NDEF_BLE_PUBLIC_ADDRESS_TYPE = 0x0, /**< Public Device Address. */ |
DiegoOstuni | 0:de13951f30f6 | 99 | NDEF_BLE_RANDOM_ADDRESS_TYPE = 0x1, /**< Random Device Address. */ |
DiegoOstuni | 0:de13951f30f6 | 100 | NDEF_BLE_UNDEF_ADDRESS_TYPE = 0xff /**< Device Address is undefined. */ |
DiegoOstuni | 0:de13951f30f6 | 101 | } Ndef_BLE_Address_Type_t; |
DiegoOstuni | 0:de13951f30f6 | 102 | |
DiegoOstuni | 0:de13951f30f6 | 103 | /** @brief Enumerates Bluetooth LE Roles */ |
DiegoOstuni | 0:de13951f30f6 | 104 | typedef enum { |
DiegoOstuni | 0:de13951f30f6 | 105 | NDEF_BLE_ROLE_PERIPH_ONLY = 0x0, /**< Only Peripheral Role supported. */ |
DiegoOstuni | 0:de13951f30f6 | 106 | NDEF_BLE_ROLE_CENTRAL_ONLY = 0x1, /**< Only Central Role supported. */ |
DiegoOstuni | 0:de13951f30f6 | 107 | NDEF_BLE_ROLE_PERIPH_PREFERRED = 0x2, /**< Peripheral and Central Role supported, Peripheral Role preferred for connection establishment. */ |
DiegoOstuni | 0:de13951f30f6 | 108 | NDEF_BLE_ROLE_CENTRAL_PREFERRED = 0x3, /**< Peripheral and Central Role supported, Central Role preferred for connection establishment. */ |
DiegoOstuni | 0:de13951f30f6 | 109 | NDEF_BLE_ROLE_UNDEF = 0xff /**< LE Role is undefined. */ |
DiegoOstuni | 0:de13951f30f6 | 110 | } Ndef_BLE_Role_t; |
DiegoOstuni | 0:de13951f30f6 | 111 | |
DiegoOstuni | 0:de13951f30f6 | 112 | /** @brief Enumerates Bluetooth protocols */ |
DiegoOstuni | 0:de13951f30f6 | 113 | typedef enum { |
DiegoOstuni | 0:de13951f30f6 | 114 | NDEF_BLUETOOTH_BREDR, /**< Standard bluetooth */ |
DiegoOstuni | 0:de13951f30f6 | 115 | NDEF_BLUETOOTH_BLE /**< Bluetooth Low Energy */ |
DiegoOstuni | 0:de13951f30f6 | 116 | } Ndef_Bluetooth_type_t; |
DiegoOstuni | 0:de13951f30f6 | 117 | |
DiegoOstuni | 0:de13951f30f6 | 118 | /** @brief Helper macro to set a particular EIR in the EIR mask of a `Ndef_Bluetooth_OOB_t` instance. |
DiegoOstuni | 0:de13951f30f6 | 119 | * @param bt Pointer to a `Ndef_Bluetooth_OOB_t` struct |
DiegoOstuni | 0:de13951f30f6 | 120 | * @param option Index of the option based on the `Ndef_Bluetooth_Eir_Types_t` */ |
DiegoOstuni | 0:de13951f30f6 | 121 | #define NDEF_BLUETOOTH_SET_OPTIONAL_MASK(bt,option) do { bt->OptionalMask |= (1<<(option)); } while (0) |
DiegoOstuni | 0:de13951f30f6 | 122 | |
DiegoOstuni | 0:de13951f30f6 | 123 | /** @brief Helper macro to unset a particular EIR in the EIR mask of a `Ndef_Bluetooth_OOB_t` instance. |
DiegoOstuni | 0:de13951f30f6 | 124 | * @param bt Pointer to a `Ndef_Bluetooth_OOB_t` struct |
DiegoOstuni | 0:de13951f30f6 | 125 | * @param option Index of the option based on the `Ndef_Bluetooth_Eir_Types_t` */ |
DiegoOstuni | 0:de13951f30f6 | 126 | #define NDEF_BLUETOOTH_UNSET_OPTIONAL_MASK(bt,option) do {bt->OptionalMask &= ~(1<<(option)); } while (0) |
DiegoOstuni | 0:de13951f30f6 | 127 | |
DiegoOstuni | 0:de13951f30f6 | 128 | /** @brief Helper macro to know if a particular EIR is present in the EIR mask of a `Ndef_Bluetooth_OOB_t` instance. |
DiegoOstuni | 0:de13951f30f6 | 129 | * @param bt Pointer to a `Ndef_Bluetooth_OOB_t` struct |
DiegoOstuni | 0:de13951f30f6 | 130 | * @param option Index of the option based on the `Ndef_Bluetooth_Eir_Types_t` */ |
DiegoOstuni | 0:de13951f30f6 | 131 | #define NDEF_BLUETOOTH_GET_OPTIONAL_MASK(bt,option) ((bt->OptionalMask & (1<<(option))) >> (option)) |
DiegoOstuni | 0:de13951f30f6 | 132 | |
DiegoOstuni | 0:de13951f30f6 | 133 | /** @brief Helper macro to create a mask for a particular EIR. |
DiegoOstuni | 0:de13951f30f6 | 134 | * @param option Index of the option based on the `Ndef_Bluetooth_Eir_Types_t` */ |
DiegoOstuni | 0:de13951f30f6 | 135 | #define NDEF_BLUETOOTH_OPTION(option) (1<<(option)) |
DiegoOstuni | 0:de13951f30f6 | 136 | |
DiegoOstuni | 0:de13951f30f6 | 137 | /** @brief Bluetooth Out-Of-Band data structure. |
DiegoOstuni | 0:de13951f30f6 | 138 | * @details Some fields are shared by both Br/Edr & LE Bluetooth, some are specific... |
DiegoOstuni | 0:de13951f30f6 | 139 | * No union used here to comply with the Cube coding guidelines, despite the fact that it could have save memory space. |
DiegoOstuni | 0:de13951f30f6 | 140 | */ |
DiegoOstuni | 0:de13951f30f6 | 141 | typedef struct |
DiegoOstuni | 0:de13951f30f6 | 142 | { |
DiegoOstuni | 0:de13951f30f6 | 143 | /* Mandatory fields */ |
DiegoOstuni | 0:de13951f30f6 | 144 | Ndef_Bluetooth_type_t Type; /**< *Mandatory*: Bluetooth type (Br/Edr or LE). */ |
DiegoOstuni | 0:de13951f30f6 | 145 | char DeviceAddress[6]; /**< *Mandatory*: Device address. For LE: 6 LSB of Device Address EIR. */ |
DiegoOstuni | 0:de13951f30f6 | 146 | /* Optionnal common fields */ |
DiegoOstuni | 0:de13951f30f6 | 147 | uint32_t OptionalMask; /**< This Mask is used to keep track of EIRs present in the OOB: each bit index corresponds to a `Ndef_Bluetooth_Eir_Types_t` value. */ |
DiegoOstuni | 0:de13951f30f6 | 148 | uint8_t Flags; /**< Flags from BLUETOOTH_EIR_FLAGS. */ |
DiegoOstuni | 0:de13951f30f6 | 149 | |
DiegoOstuni | 0:de13951f30f6 | 150 | uint16_t ClassUUID16[0xff/2]; /**< UUIDs from BLUETOOTH_EIR_SERVICE_CLASS_UUID_PARTIAL_16 or BLUETOOTH_EIR_SERVICE_CLASS_UUID_COMPLETE_16. */ |
DiegoOstuni | 0:de13951f30f6 | 151 | uint32_t ClassUUID32[0xff/4]; /**< UUIDs from BLUETOOTH_EIR_SERVICE_CLASS_UUID_PARTIAL_32 or BLUETOOTH_EIR_SERVICE_CLASS_UUID_COMPLETE_32. */ |
DiegoOstuni | 0:de13951f30f6 | 152 | uint32_t ClassUUID128[0xff/16][4]; /**< UUIDs from BLUETOOTH_EIR_SERVICE_CLASS_UUID_PARTIAL_128 or BLUETOOTH_EIR_SERVICE_CLASS_UUID_COMPLETE_128. */ |
DiegoOstuni | 0:de13951f30f6 | 153 | uint8_t nbUUID16; /**< Number of UUIDs speficied in ClassUUID16. */ |
DiegoOstuni | 0:de13951f30f6 | 154 | uint8_t nbUUID32; /**< Number of UUIDs speficied in ClassUUID32. */ |
DiegoOstuni | 0:de13951f30f6 | 155 | uint8_t nbUUID128; /**< Number of UUIDs speficied in ClassUUID128. */ |
DiegoOstuni | 0:de13951f30f6 | 156 | |
DiegoOstuni | 0:de13951f30f6 | 157 | char LocalName[0xff]; /**< Device local name from BLUETOOTH_EIR_SHORT_LOCAL_NAME or BLUETOOTH_EIR_COMPLETE_LOCAL_NAME. */ |
DiegoOstuni | 0:de13951f30f6 | 158 | uint8_t DeviceClass[3]; /**< Class of device from BLUETOOTH_EIR_DEVICE_CLASS. */ |
DiegoOstuni | 0:de13951f30f6 | 159 | // if no TPL, TPL is unknown |
DiegoOstuni | 0:de13951f30f6 | 160 | uint8_t TxPowerLevel; /**< TX power Level from BLUETOOTH_EIR_TX_POWER_LEVEL. */ |
DiegoOstuni | 0:de13951f30f6 | 161 | |
DiegoOstuni | 0:de13951f30f6 | 162 | uint8_t SMFlags; /**< Security Manager Flags from BLUETOOTH_EIR_SECURITY_MANAGER_FLAGS. */ |
DiegoOstuni | 0:de13951f30f6 | 163 | uint16_t SlaveConnIntervalRange[2]; /**< Slave Connection Interval Range from BLUETOOTH_EIR_SLAVE_CONNECTION_INTERVAL_RANGE. */ |
DiegoOstuni | 0:de13951f30f6 | 164 | uint16_t ServiceSolicitation16[0xff/2]; /**< Service Solicitation from BLUETOOTH_EIR_SERVICE_SOLICITATION_16. */ |
DiegoOstuni | 0:de13951f30f6 | 165 | uint32_t ServiceSolicitation128[0xff/16][4]; /**< Service Solicitation from BLUETOOTH_EIR_SERVICE_SOLICITATION_128. */ |
DiegoOstuni | 0:de13951f30f6 | 166 | uint8_t nbServiceSolicitation16; /**< Number of UUIDs in ServiceSolicitation16. */ |
DiegoOstuni | 0:de13951f30f6 | 167 | uint8_t nbServiceSolicitation128; /**< Number of UUIDs in ServiceSolicitation128. */ |
DiegoOstuni | 0:de13951f30f6 | 168 | /* for br/edr only */ |
DiegoOstuni | 0:de13951f30f6 | 169 | uint8_t SimplePairingHash[16]; /**< *For Br/Edr only*: Simple Pairing Hash from BLUETOOTH_EIR_SIMPLE_PAIRING_HASH. */ |
DiegoOstuni | 0:de13951f30f6 | 170 | uint8_t SimplePairingRandomizer[16]; /**< *For Br/Edr only*: Simple Pairing Randomizer from BLUETOOTH_EIR_SIMPLE_PAIRING_RANDOMIZER. */ |
DiegoOstuni | 0:de13951f30f6 | 171 | /* BLE mandatory fields */ |
DiegoOstuni | 0:de13951f30f6 | 172 | Ndef_BLE_Address_Type_t DeviceAddressType; /**< *For LE only*, *Mandatory*: Address Type, MSB of the Device Address EIR (Public or Random) */ |
DiegoOstuni | 0:de13951f30f6 | 173 | Ndef_BLE_Role_t Role; /**< *For LE only*, *Mandatory*: LE Role from BLUETOOTH_EIR_BLE_ROLE and defined in `Ndef_BLE_Role_t`. */ |
DiegoOstuni | 0:de13951f30f6 | 174 | /* BLE optional fields */ |
DiegoOstuni | 0:de13951f30f6 | 175 | uint8_t SecureManagerTK[16]; /**< *For LE only*: Security Manager TK from BLUETOOTH_EIR_SECURITY_MANAGER_TK_VALUE. */ |
DiegoOstuni | 0:de13951f30f6 | 176 | uint16_t Appearance; /**< *For LE only*: Appearance from BLUETOOTH_EIR_APPEARANCE. */ |
DiegoOstuni | 0:de13951f30f6 | 177 | /* track number of unparsed EIR */ |
DiegoOstuni | 0:de13951f30f6 | 178 | uint8_t nbUnknown; /**< Number of EIRs not parsed because of an unknown EIR type. */ |
DiegoOstuni | 0:de13951f30f6 | 179 | uint8_t nbServiceData; /**< Number of EIRs not parsed because being of type BLUETOOTH_EIR_SERVICE_DATA. */ |
DiegoOstuni | 0:de13951f30f6 | 180 | uint8_t nbManufacturerData; /**< Number of EIRs not parsed because being of type BLUETOOTH_EIR_MANUFACTURER_DATA. */ |
DiegoOstuni | 0:de13951f30f6 | 181 | } Ndef_Bluetooth_OOB_t ; |
DiegoOstuni | 0:de13951f30f6 | 182 | |
DiegoOstuni | 0:de13951f30f6 | 183 | /** @brief Extended Inquiry Response format. |
DiegoOstuni | 0:de13951f30f6 | 184 | * @details This structure is used to parse/build EIRs in the Bluetooth OOB. |
DiegoOstuni | 0:de13951f30f6 | 185 | */ |
DiegoOstuni | 0:de13951f30f6 | 186 | typedef struct { |
DiegoOstuni | 0:de13951f30f6 | 187 | uint8_t length; /**< Length of the EIRs, including the type field (1 byte). */ |
DiegoOstuni | 0:de13951f30f6 | 188 | uint8_t type; /**< EIR type as defined in `Ndef_Bluetooth_Eir_Types_t`. */ |
DiegoOstuni | 0:de13951f30f6 | 189 | uint8_t value[1]; /**< single-element array, to keep track of the address of the EIR data */ |
DiegoOstuni | 0:de13951f30f6 | 190 | } NDEF_EIR_t ; |
DiegoOstuni | 0:de13951f30f6 | 191 | |
DiegoOstuni | 0:de13951f30f6 | 192 | uint16_t NDEF_ReadBluetoothOOB( sRecordInfo_t *pRecordStruct, Ndef_Bluetooth_OOB_t *pBluetooth ); |
DiegoOstuni | 0:de13951f30f6 | 193 | uint16_t NDEF_AppendBluetoothOOB( Ndef_Bluetooth_OOB_t *pBluetooth, char* RecordID, I2C* mi2cChannel ); |
DiegoOstuni | 0:de13951f30f6 | 194 | void NDEF_PrepareBluetoothMessage(Ndef_Bluetooth_OOB_t *pBluetooth, uint8_t *pNDEFMessage, uint16_t *size ); |
DiegoOstuni | 0:de13951f30f6 | 195 | uint32_t NDEF_GetBluetoothOOBLength( Ndef_Bluetooth_OOB_t *pBluetooth ); |
DiegoOstuni | 0:de13951f30f6 | 196 | |
DiegoOstuni | 0:de13951f30f6 | 197 | |
DiegoOstuni | 0:de13951f30f6 | 198 | |
DiegoOstuni | 0:de13951f30f6 | 199 | /** @} |
DiegoOstuni | 0:de13951f30f6 | 200 | */ |
DiegoOstuni | 0:de13951f30f6 | 201 | |
DiegoOstuni | 0:de13951f30f6 | 202 | #endif /* __LIB_NDEF_BLUETOOTH_H */ |
DiegoOstuni | 0:de13951f30f6 | 203 | |
DiegoOstuni | 0:de13951f30f6 | 204 | /******************* (C) COPYRIGHT 2015 STMicroelectronics *****END OF FILE****/ |