24#include "nimble/porting/nimble/include/syscfg/syscfg.h"
30#define BLE_SM_ERR_PASSKEY 0x01
31#define BLE_SM_ERR_OOB 0x02
32#define BLE_SM_ERR_AUTHREQ 0x03
33#define BLE_SM_ERR_CONFIRM_MISMATCH 0x04
34#define BLE_SM_ERR_PAIR_NOT_SUPP 0x05
35#define BLE_SM_ERR_ENC_KEY_SZ 0x06
36#define BLE_SM_ERR_CMD_NOT_SUPP 0x07
37#define BLE_SM_ERR_UNSPECIFIED 0x08
38#define BLE_SM_ERR_REPEATED 0x09
39#define BLE_SM_ERR_INVAL 0x0a
40#define BLE_SM_ERR_DHKEY 0x0b
41#define BLE_SM_ERR_NUMCMP 0x0c
42#define BLE_SM_ERR_ALREADY 0x0d
43#define BLE_SM_ERR_CROSS_TRANS 0x0e
44#define BLE_SM_ERR_MAX_PLUS_1 0x0f
46#define BLE_SM_PAIR_ALG_JW 0
47#define BLE_SM_PAIR_ALG_PASSKEY 1
48#define BLE_SM_PAIR_ALG_OOB 2
49#define BLE_SM_PAIR_ALG_NUMCMP 3
51#define BLE_SM_PAIR_KEY_DIST_ENC 0x01
52#define BLE_SM_PAIR_KEY_DIST_ID 0x02
53#define BLE_SM_PAIR_KEY_DIST_SIGN 0x04
54#define BLE_SM_PAIR_KEY_DIST_LINK 0x08
55#define BLE_SM_PAIR_KEY_DIST_RESERVED 0xf0
57#define BLE_SM_IO_CAP_DISP_ONLY 0x00
58#define BLE_SM_IO_CAP_DISP_YES_NO 0x01
59#define BLE_SM_IO_CAP_KEYBOARD_ONLY 0x02
60#define BLE_SM_IO_CAP_NO_IO 0x03
61#define BLE_SM_IO_CAP_KEYBOARD_DISP 0x04
62#define BLE_SM_IO_CAP_RESERVED 0x05
64#define BLE_SM_PAIR_OOB_NO 0x00
65#define BLE_SM_PAIR_OOB_YES 0x01
66#define BLE_SM_PAIR_OOB_RESERVED 0x02
68#define BLE_SM_PAIR_AUTHREQ_BOND 0x01
69#define BLE_SM_PAIR_AUTHREQ_MITM 0x04
70#define BLE_SM_PAIR_AUTHREQ_SC 0x08
71#define BLE_SM_PAIR_AUTHREQ_KEYPRESS 0x10
72#define BLE_SM_PAIR_AUTHREQ_RESERVED 0xe2
74#define BLE_SM_PAIR_KEY_SZ_MIN 7
75#define BLE_SM_PAIR_KEY_SZ_MAX 16
82#define BLE_SM_IOACT_NONE 0
83#define BLE_SM_IOACT_OOB 1
84#define BLE_SM_IOACT_INPUT 2
85#define BLE_SM_IOACT_DISP 3
86#define BLE_SM_IOACT_NUMCMP 4
87#define BLE_SM_IOACT_OOB_SC 5
88#define BLE_SM_IOACT_MAX_PLUS_ONE 6
90struct ble_sm_sc_oob_data {
103 uint8_t numcmp_accept;
105 struct ble_sm_sc_oob_data *local;
106 struct ble_sm_sc_oob_data *remote;
111int ble_sm_sc_oob_generate_data(
struct ble_sm_sc_oob_data *oob_data);
114int ble_sm_inject_io(uint16_t conn_handle,
struct ble_sm_io *pkey);
116#define ble_sm_inject_io(conn_handle, pkey) \
117 ((void)(conn_handle), BLE_HS_ENOTSUP)