This page is a work in progress as the API is changing as we migrate to S132v5 (nRF52832) and S140 (nRF52840) and add better Central mode support.

This GAP API for Bluefruit is accessible via Bluefruit.Gap.*** and has the following public functions:

Download: file
typedef void (*connect_callback_t    ) (uint16_t conn_handle);
typedef void (*disconnect_callback_t ) (uint16_t conn_handle, uint8_t reason);

uint8_t        getAddr               (uint8_t mac[6]);
bool           setAddr               (uint8_t mac[6], uint8_t type);

bool           connected            (uint16_t conn_handle);

uint8_t        getRole              (uint16_t conn_handle);

uint8_t        getPeerAddr          (uint16_t conn_handle, uint8_t addr[6]);
ble_gap_addr_t getPeerAddr          (uint16_t conn_handle);
uint16_t       getPeerName          (uint16_t conn_handle, char* buf, uint16_t bufsize);

uint16_t       getMTU               (uint16_t conn_handle);
uint16_t       getMaxMtuByConnCfg   (uint8_t conn_cfg);
uint16_t       getMaxMtu            (uint8_t conn_handle);
This guide was first published on Mar 22, 2017. It was last updated on Mar 22, 2017. This page (BLEGap) was last updated on May 23, 2019.