HW layer for the Nucleo board, it only work with old BLE_API
Dependents: Hello_BLE F446RE-BLE
Fork of X_NUCLEO_IDB0XA1 by
BlueNRG_HCI/includes/sm.h@70:d20d30f59b1c, 2015-06-08 (annotated)
- Committer:
- Silvio Lucio Oliva
- Date:
- Mon Jun 08 17:08:01 2015 +0200
- Revision:
- 70:d20d30f59b1c
Initial commit for mbed support
Signed-off-by: Silvio Lucio Oliva <silvio.oliva@st.com>
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Silvio Lucio Oliva |
70:d20d30f59b1c | 1 | /******************** (C) COPYRIGHT 2012 STMicroelectronics ******************** |
Silvio Lucio Oliva |
70:d20d30f59b1c | 2 | * File Name : sm.h |
Silvio Lucio Oliva |
70:d20d30f59b1c | 3 | * Author : AMS - HEA&RF BU |
Silvio Lucio Oliva |
70:d20d30f59b1c | 4 | * Version : V1.0.0 |
Silvio Lucio Oliva |
70:d20d30f59b1c | 5 | * Date : 19-July-2012 |
Silvio Lucio Oliva |
70:d20d30f59b1c | 6 | * Description : Header file for BlueNRG's security manager. |
Silvio Lucio Oliva |
70:d20d30f59b1c | 7 | ******************************************************************************** |
Silvio Lucio Oliva |
70:d20d30f59b1c | 8 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS |
Silvio Lucio Oliva |
70:d20d30f59b1c | 9 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. |
Silvio Lucio Oliva |
70:d20d30f59b1c | 10 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, |
Silvio Lucio Oliva |
70:d20d30f59b1c | 11 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE |
Silvio Lucio Oliva |
70:d20d30f59b1c | 12 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING |
Silvio Lucio Oliva |
70:d20d30f59b1c | 13 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. |
Silvio Lucio Oliva |
70:d20d30f59b1c | 14 | *******************************************************************************/ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 15 | |
Silvio Lucio Oliva |
70:d20d30f59b1c | 16 | #ifndef __SM_H__ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 17 | #define __SM_H__ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 18 | |
Silvio Lucio Oliva |
70:d20d30f59b1c | 19 | /****************************************************************************** |
Silvio Lucio Oliva |
70:d20d30f59b1c | 20 | * Macros |
Silvio Lucio Oliva |
70:d20d30f59b1c | 21 | *****************************************************************************/ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 22 | |
Silvio Lucio Oliva |
70:d20d30f59b1c | 23 | /** |
Silvio Lucio Oliva |
70:d20d30f59b1c | 24 | *@addtogroup GAP GAP |
Silvio Lucio Oliva |
70:d20d30f59b1c | 25 | *@brief API for GAP layer. |
Silvio Lucio Oliva |
70:d20d30f59b1c | 26 | *@{ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 27 | */ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 28 | |
Silvio Lucio Oliva |
70:d20d30f59b1c | 29 | /* IO capabilities */ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 30 | /** |
Silvio Lucio Oliva |
70:d20d30f59b1c | 31 | * @anchor IO_capabilities |
Silvio Lucio Oliva |
70:d20d30f59b1c | 32 | * @name IO capabilities |
Silvio Lucio Oliva |
70:d20d30f59b1c | 33 | * @{ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 34 | */ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 35 | #define IO_CAP_DISPLAY_ONLY (0x00) |
Silvio Lucio Oliva |
70:d20d30f59b1c | 36 | #define IO_CAP_DISPLAY_YES_NO (0x01) |
Silvio Lucio Oliva |
70:d20d30f59b1c | 37 | #define IO_CAP_KEYBOARD_ONLY (0x02) |
Silvio Lucio Oliva |
70:d20d30f59b1c | 38 | #define IO_CAP_NO_INPUT_NO_OUTPUT (0x03) |
Silvio Lucio Oliva |
70:d20d30f59b1c | 39 | #define IO_CAP_KEYBOARD_DISPLAY (0x04) |
Silvio Lucio Oliva |
70:d20d30f59b1c | 40 | /** |
Silvio Lucio Oliva |
70:d20d30f59b1c | 41 | * @} |
Silvio Lucio Oliva |
70:d20d30f59b1c | 42 | */ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 43 | |
Silvio Lucio Oliva |
70:d20d30f59b1c | 44 | /** |
Silvio Lucio Oliva |
70:d20d30f59b1c | 45 | * @anchor Auth_req |
Silvio Lucio Oliva |
70:d20d30f59b1c | 46 | * @name Authentication requirements |
Silvio Lucio Oliva |
70:d20d30f59b1c | 47 | * @{ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 48 | */ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 49 | #define BONDING (0x01) |
Silvio Lucio Oliva |
70:d20d30f59b1c | 50 | #define NO_BONDING (0x00) |
Silvio Lucio Oliva |
70:d20d30f59b1c | 51 | /** |
Silvio Lucio Oliva |
70:d20d30f59b1c | 52 | * @} |
Silvio Lucio Oliva |
70:d20d30f59b1c | 53 | */ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 54 | |
Silvio Lucio Oliva |
70:d20d30f59b1c | 55 | /** |
Silvio Lucio Oliva |
70:d20d30f59b1c | 56 | * @anchor MITM_req |
Silvio Lucio Oliva |
70:d20d30f59b1c | 57 | * @name MITM protection requirements |
Silvio Lucio Oliva |
70:d20d30f59b1c | 58 | * @{ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 59 | */ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 60 | #define MITM_PROTECTION_NOT_REQUIRED (0x00) |
Silvio Lucio Oliva |
70:d20d30f59b1c | 61 | #define MITM_PROTECTION_REQUIRED (0x01) |
Silvio Lucio Oliva |
70:d20d30f59b1c | 62 | /** |
Silvio Lucio Oliva |
70:d20d30f59b1c | 63 | * @} |
Silvio Lucio Oliva |
70:d20d30f59b1c | 64 | */ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 65 | |
Silvio Lucio Oliva |
70:d20d30f59b1c | 66 | /** |
Silvio Lucio Oliva |
70:d20d30f59b1c | 67 | * @anchor OOB_Data |
Silvio Lucio Oliva |
70:d20d30f59b1c | 68 | * @name Out-Of-Band data |
Silvio Lucio Oliva |
70:d20d30f59b1c | 69 | * @{ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 70 | */ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 71 | #define OOB_AUTH_DATA_ABSENT (0x00) |
Silvio Lucio Oliva |
70:d20d30f59b1c | 72 | #define OOB_AUTH_DATA_PRESENT (0x01) |
Silvio Lucio Oliva |
70:d20d30f59b1c | 73 | /** |
Silvio Lucio Oliva |
70:d20d30f59b1c | 74 | * @} |
Silvio Lucio Oliva |
70:d20d30f59b1c | 75 | */ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 76 | |
Silvio Lucio Oliva |
70:d20d30f59b1c | 77 | /** |
Silvio Lucio Oliva |
70:d20d30f59b1c | 78 | * @anchor Author_req |
Silvio Lucio Oliva |
70:d20d30f59b1c | 79 | * @name Authorization requirements |
Silvio Lucio Oliva |
70:d20d30f59b1c | 80 | * @{ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 81 | */ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 82 | #define AUTHORIZATION_NOT_REQUIRED (0x00) |
Silvio Lucio Oliva |
70:d20d30f59b1c | 83 | #define AUTHORIZATION_REQUIRED (0x01) |
Silvio Lucio Oliva |
70:d20d30f59b1c | 84 | /** |
Silvio Lucio Oliva |
70:d20d30f59b1c | 85 | * @} |
Silvio Lucio Oliva |
70:d20d30f59b1c | 86 | */ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 87 | |
Silvio Lucio Oliva |
70:d20d30f59b1c | 88 | /** |
Silvio Lucio Oliva |
70:d20d30f59b1c | 89 | * @anchor Conn_authorization |
Silvio Lucio Oliva |
70:d20d30f59b1c | 90 | * @name Connection authorization |
Silvio Lucio Oliva |
70:d20d30f59b1c | 91 | * @{ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 92 | */ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 93 | #define CONNECTION_AUTHORIZED (0x01) |
Silvio Lucio Oliva |
70:d20d30f59b1c | 94 | #define CONNECTION_REJECTED (0x02) |
Silvio Lucio Oliva |
70:d20d30f59b1c | 95 | /** |
Silvio Lucio Oliva |
70:d20d30f59b1c | 96 | * @} |
Silvio Lucio Oliva |
70:d20d30f59b1c | 97 | */ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 98 | |
Silvio Lucio Oliva |
70:d20d30f59b1c | 99 | /** |
Silvio Lucio Oliva |
70:d20d30f59b1c | 100 | * @anchor Use_fixed_pin |
Silvio Lucio Oliva |
70:d20d30f59b1c | 101 | * @name Use fixed pin |
Silvio Lucio Oliva |
70:d20d30f59b1c | 102 | * @{ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 103 | */ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 104 | #define USE_FIXED_PIN_FOR_PAIRING (0x0) |
Silvio Lucio Oliva |
70:d20d30f59b1c | 105 | #define DONOT_USE_FIXED_PIN_FOR_PAIRING (0x01) |
Silvio Lucio Oliva |
70:d20d30f59b1c | 106 | /** |
Silvio Lucio Oliva |
70:d20d30f59b1c | 107 | * @} |
Silvio Lucio Oliva |
70:d20d30f59b1c | 108 | */ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 109 | |
Silvio Lucio Oliva |
70:d20d30f59b1c | 110 | /** |
Silvio Lucio Oliva |
70:d20d30f59b1c | 111 | * @anchor link_security_status |
Silvio Lucio Oliva |
70:d20d30f59b1c | 112 | * @name Link security status |
Silvio Lucio Oliva |
70:d20d30f59b1c | 113 | * @{ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 114 | */ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 115 | #define SM_LINK_AUTHENTICATED (0x01) |
Silvio Lucio Oliva |
70:d20d30f59b1c | 116 | #define SM_LINK_AUTHORIZED (0x02) |
Silvio Lucio Oliva |
70:d20d30f59b1c | 117 | #define SM_LINK_ENCRYPTED (0x04) |
Silvio Lucio Oliva |
70:d20d30f59b1c | 118 | /** |
Silvio Lucio Oliva |
70:d20d30f59b1c | 119 | * @} |
Silvio Lucio Oliva |
70:d20d30f59b1c | 120 | */ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 121 | |
Silvio Lucio Oliva |
70:d20d30f59b1c | 122 | /** |
Silvio Lucio Oliva |
70:d20d30f59b1c | 123 | * @anchor SMP_pairing_failed_codes |
Silvio Lucio Oliva |
70:d20d30f59b1c | 124 | * @name SMP pairing failed reason codes |
Silvio Lucio Oliva |
70:d20d30f59b1c | 125 | * @{ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 126 | */ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 127 | #define PASSKEY_ENTRY_FAILED (0x01) |
Silvio Lucio Oliva |
70:d20d30f59b1c | 128 | #define OOB_NOT_AVAILABLE (0x02) |
Silvio Lucio Oliva |
70:d20d30f59b1c | 129 | #define AUTH_REQ_CANNOT_BE_MET (0x03) |
Silvio Lucio Oliva |
70:d20d30f59b1c | 130 | #define CONFIRM_VALUE_FAILED (0x04) |
Silvio Lucio Oliva |
70:d20d30f59b1c | 131 | #define PAIRING_NOT_SUPPORTED (0x05) |
Silvio Lucio Oliva |
70:d20d30f59b1c | 132 | #define INSUFF_ENCRYPTION_KEY_SIZE (0x06) |
Silvio Lucio Oliva |
70:d20d30f59b1c | 133 | #define CMD_NOT_SUPPORTED (0x07) |
Silvio Lucio Oliva |
70:d20d30f59b1c | 134 | #define UNSPECIFIED_REASON (0x08) |
Silvio Lucio Oliva |
70:d20d30f59b1c | 135 | #define VERY_EARLY_NEXT_ATTEMPT (0x09) |
Silvio Lucio Oliva |
70:d20d30f59b1c | 136 | #define SM_INVALID_PARAMS (0x0A) |
Silvio Lucio Oliva |
70:d20d30f59b1c | 137 | /** |
Silvio Lucio Oliva |
70:d20d30f59b1c | 138 | * @} |
Silvio Lucio Oliva |
70:d20d30f59b1c | 139 | */ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 140 | |
Silvio Lucio Oliva |
70:d20d30f59b1c | 141 | /** |
Silvio Lucio Oliva |
70:d20d30f59b1c | 142 | * @anchor pairing_failed_codes |
Silvio Lucio Oliva |
70:d20d30f59b1c | 143 | * @name Pairing failed error codes |
Silvio Lucio Oliva |
70:d20d30f59b1c | 144 | * Error codes in @ref EVT_BLUE_GAP_PAIRING_CMPLT event |
Silvio Lucio Oliva |
70:d20d30f59b1c | 145 | * @{ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 146 | */ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 147 | #define SM_PAIRING_SUCCESS (0x00) |
Silvio Lucio Oliva |
70:d20d30f59b1c | 148 | #define SM_PAIRING_TIMEOUT (0x01) |
Silvio Lucio Oliva |
70:d20d30f59b1c | 149 | #define SM_PAIRING_FAILED (0x02) |
Silvio Lucio Oliva |
70:d20d30f59b1c | 150 | /** |
Silvio Lucio Oliva |
70:d20d30f59b1c | 151 | * @} |
Silvio Lucio Oliva |
70:d20d30f59b1c | 152 | */ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 153 | |
Silvio Lucio Oliva |
70:d20d30f59b1c | 154 | /** |
Silvio Lucio Oliva |
70:d20d30f59b1c | 155 | * @} |
Silvio Lucio Oliva |
70:d20d30f59b1c | 156 | */ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 157 | |
Silvio Lucio Oliva |
70:d20d30f59b1c | 158 | #endif /* __SM_H__ */ |