Added support for obtaining BLE device name by parsing advertising data.
Fork of BLE_BlueNRG by
hci/inc/sm.h@0:309c845d289d, 2014-07-16 (annotated)
- Committer:
- mridup
- Date:
- Wed Jul 16 04:59:51 2014 +0000
- Revision:
- 0:309c845d289d
Full BlueNRG library
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mridup | 0:309c845d289d | 1 | /******************** (C) COPYRIGHT 2012 STMicroelectronics ******************** |
mridup | 0:309c845d289d | 2 | * File Name : sm.h |
mridup | 0:309c845d289d | 3 | * Author : AMS - HEA&RF BU |
mridup | 0:309c845d289d | 4 | * Version : V1.0.0 |
mridup | 0:309c845d289d | 5 | * Date : 19-July-2012 |
mridup | 0:309c845d289d | 6 | * Description : Header file for BlueNRG's security manager. |
mridup | 0:309c845d289d | 7 | ******************************************************************************** |
mridup | 0:309c845d289d | 8 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS |
mridup | 0:309c845d289d | 9 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. |
mridup | 0:309c845d289d | 10 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, |
mridup | 0:309c845d289d | 11 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE |
mridup | 0:309c845d289d | 12 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING |
mridup | 0:309c845d289d | 13 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. |
mridup | 0:309c845d289d | 14 | *******************************************************************************/ |
mridup | 0:309c845d289d | 15 | |
mridup | 0:309c845d289d | 16 | #ifndef __SM_H__ |
mridup | 0:309c845d289d | 17 | #define __SM_H__ |
mridup | 0:309c845d289d | 18 | |
mridup | 0:309c845d289d | 19 | /****************************************************************************** |
mridup | 0:309c845d289d | 20 | * Macros |
mridup | 0:309c845d289d | 21 | *****************************************************************************/ |
mridup | 0:309c845d289d | 22 | |
mridup | 0:309c845d289d | 23 | /* IO capabilities */ |
mridup | 0:309c845d289d | 24 | typedef tHalUint8 tSMIoCapability; |
mridup | 0:309c845d289d | 25 | #define IO_CAP_DISPLAY_ONLY (0x00) |
mridup | 0:309c845d289d | 26 | #define IO_CAP_DISPLAY_YES_NO (0x01) |
mridup | 0:309c845d289d | 27 | #define KEYBOARD_ONLY (0x02) |
mridup | 0:309c845d289d | 28 | #define IO_CAP_NO_INPUT_NO_OUTPUT (0x03) |
mridup | 0:309c845d289d | 29 | #define IO_CAP_KEYBOARD_DISPLAY (0x04) |
mridup | 0:309c845d289d | 30 | |
mridup | 0:309c845d289d | 31 | /* authentication requirements */ |
mridup | 0:309c845d289d | 32 | typedef tHalUint8 tSMBondingMode; |
mridup | 0:309c845d289d | 33 | #define BONDING (0x01) |
mridup | 0:309c845d289d | 34 | #define NO_BONDING (0x00) |
mridup | 0:309c845d289d | 35 | |
mridup | 0:309c845d289d | 36 | typedef tHalUint8 tSMMIMTMode; |
mridup | 0:309c845d289d | 37 | #define MITM_PROTECTION_NOT_REQUIRED (0x00) |
mridup | 0:309c845d289d | 38 | #define MITM_PROTECTION_REQUIRED (0x01) |
mridup | 0:309c845d289d | 39 | |
mridup | 0:309c845d289d | 40 | #define OOB_AUTH_DATA_ABSENT (0x00) |
mridup | 0:309c845d289d | 41 | #define OOB_AUTH_DATA_PRESENT (0x01) |
mridup | 0:309c845d289d | 42 | |
mridup | 0:309c845d289d | 43 | #define AUTHORIZATION_NOT_REQUIRED (0x00) |
mridup | 0:309c845d289d | 44 | #define AUTHORIZATION_REQUIRED (0x01) |
mridup | 0:309c845d289d | 45 | |
mridup | 0:309c845d289d | 46 | /* valid authorization responses */ |
mridup | 0:309c845d289d | 47 | #define CONNECTION_AUTHORIZED (0x01) |
mridup | 0:309c845d289d | 48 | #define CONNECTION_REJECTED (0x02) |
mridup | 0:309c845d289d | 49 | |
mridup | 0:309c845d289d | 50 | #define USE_FIXED_PIN_FOR_PAIRING (0x0) |
mridup | 0:309c845d289d | 51 | #define DONOT_USE_FIXED_PIN_FOR_PAIRING (0x01) |
mridup | 0:309c845d289d | 52 | #define PASSKEY_ENTERED (0x02) |
mridup | 0:309c845d289d | 53 | |
mridup | 0:309c845d289d | 54 | /* link security status */ |
mridup | 0:309c845d289d | 55 | #define SM_LINK_AUTHENTICATED (0x01) |
mridup | 0:309c845d289d | 56 | #define SM_LINK_AUTHORIZED (0x02) |
mridup | 0:309c845d289d | 57 | #define SM_LINK_ENCRYPTED (0x04) |
mridup | 0:309c845d289d | 58 | |
mridup | 0:309c845d289d | 59 | /* SMP pairing failed reason codes */ |
mridup | 0:309c845d289d | 60 | #define PASSKEY_ENTRY_FAILED (0x01) |
mridup | 0:309c845d289d | 61 | #define OOB_NOT_AVAILABLE (0x02) |
mridup | 0:309c845d289d | 62 | #define AUTH_REQ_CANNOT_BE_MET (0x03) |
mridup | 0:309c845d289d | 63 | #define CONFIRM_VALUE_FAILED (0x04) |
mridup | 0:309c845d289d | 64 | #define PAIRING_NOT_SUPPORTED (0x05) |
mridup | 0:309c845d289d | 65 | #define INSUFF_ENCRYPTION_KEY_SIZE (0x06) |
mridup | 0:309c845d289d | 66 | #define CMD_NOT_SUPPORTED (0x07) |
mridup | 0:309c845d289d | 67 | #define UNSPECIFIED_REASON (0x08) |
mridup | 0:309c845d289d | 68 | #define VERY_EARLY_NEXT_ATTEMPT (0x09) |
mridup | 0:309c845d289d | 69 | #define SM_INVALID_PARAMS (0x0A) |
mridup | 0:309c845d289d | 70 | |
mridup | 0:309c845d289d | 71 | |
mridup | 0:309c845d289d | 72 | /* error codes to be sent with the pairing complete event */ |
mridup | 0:309c845d289d | 73 | #define SM_PAIRING_TIMEOUT (0x01) |
mridup | 0:309c845d289d | 74 | #define SM_PAIRING_FAILED (0x02) |
mridup | 0:309c845d289d | 75 | |
mridup | 0:309c845d289d | 76 | |
mridup | 0:309c845d289d | 77 | #endif /* __SM_H__ */ |