Filippo Casamassima / Nucleo_blueNRG

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers sm.h Source File

sm.h

00001 /******************** (C) COPYRIGHT 2012 STMicroelectronics ********************
00002 * File Name          : sm.h
00003 * Author             : AMS - HEA&RF BU
00004 * Version            : V1.0.0
00005 * Date               : 19-July-2012
00006 * Description        : Header file for BlueNRG's security manager.
00007 ********************************************************************************
00008 * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
00009 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
00010 * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
00011 * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
00012 * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
00013 * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
00014 *******************************************************************************/
00015 
00016 #ifndef __SM_H__
00017 #define __SM_H__
00018 
00019 /******************************************************************************
00020 * Macros
00021 *****************************************************************************/
00022 
00023 /* IO capabilities */
00024 /**
00025  * @defgroup IO_capabilities IO capabilities
00026  * @{
00027  */
00028 #define IO_CAP_DISPLAY_ONLY             (0x00)
00029 #define IO_CAP_DISPLAY_YES_NO           (0x01)
00030 #define IO_CAP_KEYBOARD_ONLY            (0x02)
00031 #define IO_CAP_NO_INPUT_NO_OUTPUT       (0x03)
00032 #define IO_CAP_KEYBOARD_DISPLAY         (0x04)
00033 /**
00034  * @}
00035  */
00036 
00037 /**
00038  * @defgroup Auth_req Authentication requirements
00039  * @{
00040  */
00041 #define BONDING                         (0x01)
00042 #define NO_BONDING                      (0x00)
00043 /**
00044  * @}
00045  */
00046 
00047 /**
00048  * @defgroup MITM_req MITM protection requirements
00049  * @{
00050  */
00051 #define MITM_PROTECTION_NOT_REQUIRED    (0x00)
00052 #define MITM_PROTECTION_REQUIRED        (0x01)
00053 /**
00054  * @}
00055  */
00056 
00057 /**
00058  * @defgroup OOB_Data Out-Of-Band data
00059  * @{
00060  */
00061 #define OOB_AUTH_DATA_ABSENT            (0x00)
00062 #define OOB_AUTH_DATA_PRESENT           (0x01)
00063 /**
00064  * @}
00065  */
00066 
00067 /**
00068  * @defgroup Author_req Authorization requirements
00069  * @{
00070  */
00071 #define AUTHORIZATION_NOT_REQUIRED       (0x00)
00072 #define AUTHORIZATION_REQUIRED           (0x01)
00073 /**
00074  * @}
00075  */
00076 
00077 /**
00078  * @defgroup Conn_authorization Connection authorization
00079  * @{
00080  */
00081 #define CONNECTION_AUTHORIZED           (0x01)
00082 #define CONNECTION_REJECTED             (0x02)
00083 /**
00084  * @}
00085  */
00086 
00087 /**
00088  * @defgroup  Use_fixed_pin Use fixed pin
00089  * @{
00090  */
00091 #define USE_FIXED_PIN_FOR_PAIRING       (0x0)
00092 #define DONOT_USE_FIXED_PIN_FOR_PAIRING (0x01)
00093 /**
00094  * @}
00095  */
00096 
00097 /**
00098  * @defgroup  link_security_status Link security status
00099  * @{
00100  */
00101 #define SM_LINK_AUTHENTICATED               (0x01)
00102 #define SM_LINK_AUTHORIZED                  (0x02)
00103 #define SM_LINK_ENCRYPTED                   (0x04)
00104 /**
00105  * @}
00106  */
00107 
00108 /**
00109  * @defgroup  SMP_pairing_failed_codes SMP pairing failed reason codes
00110  * @{
00111  */
00112 #define PASSKEY_ENTRY_FAILED            (0x01)
00113 #define OOB_NOT_AVAILABLE               (0x02)
00114 #define AUTH_REQ_CANNOT_BE_MET          (0x03)
00115 #define CONFIRM_VALUE_FAILED            (0x04)
00116 #define PAIRING_NOT_SUPPORTED           (0x05)
00117 #define INSUFF_ENCRYPTION_KEY_SIZE      (0x06)
00118 #define CMD_NOT_SUPPORTED               (0x07)
00119 #define UNSPECIFIED_REASON              (0x08)
00120 #define VERY_EARLY_NEXT_ATTEMPT         (0x09)
00121 #define SM_INVALID_PARAMS               (0x0A)
00122 /**
00123  * @}
00124  */
00125 
00126 /* error codes to be sent with the pairing complete event */
00127 /**
00128  * @defgroup  pairing_failed_codes Pairing failed error codes
00129  * @brief     Error codes in @ref EVT_BLUE_GAP_PAIRING_CMPLT event
00130  * @{
00131  */
00132 #define SM_PAIRING_SUCCESS              (0x00)
00133 #define SM_PAIRING_TIMEOUT              (0x01)
00134 #define SM_PAIRING_FAILED               (0x02)
00135 /**
00136  * @}
00137  */
00138 
00139 
00140 #endif /* __SM_H__ */
00141