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.

The Central mode API is accessible via Bluefruit.Central.* and has the following public functions:

void begin(void);

/*------------------------------------------------------------------*/
/* GAP
 *------------------------------------------------------------------*/
bool     setConnInterval(uint16_t min, uint16_t max);
bool     setConnIntervalMS (uint16_t min_ms, uint16_t max_ms);

bool     connect(const ble_gap_evt_adv_report_t* adv_report);
bool     connect(const ble_gap_addr_t *peer_addr);
bool     disconnect(uint16_t conn_handle);

bool     connected (uint16_t conn_handle); // If connected to a specific peripheral
bool     connected (void);                 // If connected to any peripherals

/*------------- Callbacks -------------*/
void setConnectCallback   ( BLEGap::connect_callback_t    fp);
void setDisconnectCallback( BLEGap::disconnect_callback_t fp);

For examples of how to use the Central mode API, see the Central examples folder.

This guide was first published on Mar 22, 2017. It was last updated on Mar 29, 2024.

This page (BLECentral) was last updated on Mar 08, 2024.

Text editor powered by tinymce.