<span class="wikiword">ble.setPairingMode()</span>

Description

Sets whether to use security and when to initiate it.

Syntax

ble.setPairingMode(pairingMode);

Parameters

pairingMode: The mode to use.

  • BLE_SECURITY_NONE: No security.

  • BLE_SECURITY_WAIT_FOR_REQUEST: Wait for the client to request security.

  • BLE_SECURITY_INITIATE_UPON_CONNECTION: Request that the NP initiate security when a connection is formed.

Example

#include <BLE.h>
void setup() {
  Serial.begin(115200);
  ble.begin();
  ble.setPairingMode(BLE_SECURITY_WAIT_FOR_REQUEST);
  ble.setIoCapabilities(BLE_DISPLAY_YES_NO);
  ble.useBonding(true);
}
void loop() {
  ble.handleEvents();
}

[Reference Home](http://energia.nu/reference/ "Reference"){.wikilink}<span style="color: #202020;"> || </span>[BLE Library](http://energia.nu/reference/ble/ "WiFi")