NimBLE-Arduino 1.4.2
Loading...
Searching...
No Matches
NimBLESecurity Class Reference

A class to handle BLE security operations. Deprecated - provided for backward compatibility only. More...

#include <NimBLESecurity.h>

Public Member Functions

void setAuthenticationMode (esp_ble_auth_req_t auth_req)
 Set requested authentication mode. More...
 
void setCapability (esp_ble_io_cap_t iocap)
 Set our device IO capability to let end user perform authorization either by displaying or entering generated 6-digit pin code or use "just works". More...
 
void setInitEncryptionKey (uint8_t init_key)
 Sets the keys we will distribute during encryption. More...
 
void setRespEncryptionKey (uint8_t resp_key)
 Sets the keys we will accept during encryption. More...
 
void setKeySize (uint8_t key_size=16)
 
void setStaticPIN (uint32_t pin)
 Sets a static PIN used to authenticate/encrypt the connection. More...
 

Detailed Description

A class to handle BLE security operations. Deprecated - provided for backward compatibility only.

Deprecated:
Use the security methods provided in NimBLEDevice instead.

Member Function Documentation

◆ setAuthenticationMode()

void NimBLESecurity::setAuthenticationMode ( esp_ble_auth_req_t  auth_req)

Set requested authentication mode.

Parameters
[in]auth_reqA bitmask containing one or more of:
  • ESP_LE_AUTH_NO_BOND 0x00
  • ESP_LE_AUTH_BOND 0x01
  • ESP_LE_AUTH_REQ_MITM (1 << 2)
  • ESP_LE_AUTH_REQ_BOND_MITM (ESP_LE_AUTH_BOND | ESP_LE_AUTH_REQ_MITM)
  • ESP_LE_AUTH_REQ_SC_ONLY (1 << 3)
  • ESP_LE_AUTH_REQ_SC_BOND (ESP_LE_AUTH_BOND | ESP_LE_AUTH_REQ_SC_ONLY)
  • ESP_LE_AUTH_REQ_SC_MITM (ESP_LE_AUTH_REQ_MITM | ESP_LE_AUTH_REQ_SC_ONLY)
  • ESP_LE_AUTH_REQ_SC_MITM_BOND (ESP_LE_AUTH_REQ_MITM | ESP_LE_AUTH_REQ_SC_ONLY | ESP_LE_AUTH_BOND)

◆ setCapability()

void NimBLESecurity::setCapability ( esp_ble_io_cap_t  iocap)

Set our device IO capability to let end user perform authorization either by displaying or entering generated 6-digit pin code or use "just works".

Parameters
[in]iocapThe IO capabilites our device has.
Can be set to one of:
  • ESP_IO_CAP_OUT 0
  • ESP_IO_CAP_IO 1
  • ESP_IO_CAP_IN 2
  • ESP_IO_CAP_NONE 3
  • ESP_IO_CAP_KBDISP 4

◆ setInitEncryptionKey()

void NimBLESecurity::setInitEncryptionKey ( uint8_t  init_key)

Sets the keys we will distribute during encryption.

Parameters
[in]init_keyA bitmask of the keys we will distribute.
Can be one or more of:
  • ESP_BLE_ENC_KEY_MASK (1 << 0)
  • ESP_BLE_ID_KEY_MASK (1 << 1)
  • ESP_BLE_CSR_KEY_MASK (1 << 2)
  • ESP_BLE_LINK_KEY_MASK (1 << 3)

◆ setKeySize()

void NimBLESecurity::setKeySize ( uint8_t  key_size = 16)
Todo:
Requires implementation

◆ setRespEncryptionKey()

void NimBLESecurity::setRespEncryptionKey ( uint8_t  resp_key)

Sets the keys we will accept during encryption.

Parameters
[in]resp_keyA bitmask of the keys we will accept.
Can be one or more of:
  • ESP_BLE_ENC_KEY_MASK (1 << 0)
  • ESP_BLE_ID_KEY_MASK (1 << 1)
  • ESP_BLE_CSR_KEY_MASK (1 << 2)
  • ESP_BLE_LINK_KEY_MASK (1 << 3)

◆ setStaticPIN()

void NimBLESecurity::setStaticPIN ( uint32_t  pin)

Sets a static PIN used to authenticate/encrypt the connection.

Parameters
[in]pinThe 6 digit pin code to accept.