Added an EddystoneURLConfigService in addition to UriBeaconConfigService. Updated README and converted comments that used UriBeacon to EddystoneURL in the EddystoneService.h

Dependents:   mbed_EddystoneURL_Beacon_ssci mbed_EddystoneURL_Beacon_ssci mbed_EddystoneURL_Beacon_ssci

Fork of BLE_API by Bluetooth Low Energy

Embed: (wiki syntax)

« Back to documentation index

BLE Class Reference

BLE Class Reference

The base class used to abstract away BLE capable radio transceivers or SOCs, to enable this BLE API to work with any radio transparently. More...

#include <BLE.h>

Public Member Functions

ble_error_t init ()
 Initialize the BLE controller.
ble_error_t shutdown (void)
 Purge the BLE stack of GATT and GAP state.
const char * getVersion (void)
 This call allows the application to get the BLE stack version information.
void waitForEvent (void)
 Yield control to the BLE stack or to other tasks waiting for events.
ble_error_t setAddress (Gap::AddressType_t type, const Gap::Address_t address)
 Set the BTLE MAC address and type.
ble_error_t getAddress (Gap::AddressType_t *typeP, Gap::Address_t address)
 Fetch the BTLE MAC address and type.
void setAdvertisingType (GapAdvertisingParams::AdvertisingType advType)
 Set the GAP advertising mode to use for this device.
void setAdvertisingInterval (uint16_t interval)
uint16_t getMinAdvertisingInterval (void) const
uint16_t getMinNonConnectableAdvertisingInterval (void) const
uint16_t getMaxAdvertisingInterval (void) const
void setAdvertisingTimeout (uint16_t timeout)
void setAdvertisingParams (const GapAdvertisingParams &advParams)
 Setup a particular, user-constructed set of advertisement parameters for the underlying stack.
const GapAdvertisingParamsgetAdvertisingParams (void) const
ble_error_t accumulateAdvertisingPayload (uint8_t flags)
 Accumulate an AD structure in the advertising payload.
ble_error_t accumulateAdvertisingPayload (GapAdvertisingData::Appearance app)
 Accumulate an AD structure in the advertising payload.
ble_error_t accumulateAdvertisingPayloadTxPower (int8_t power)
 Accumulate an AD structure in the advertising payload.
ble_error_t accumulateAdvertisingPayload (GapAdvertisingData::DataType type, const uint8_t *data, uint8_t len)
 Accumulate a variable length byte-stream as an AD structure in the advertising payload.
ble_error_t setAdvertisingData (const GapAdvertisingData &advData)
 Setup a particular, user-constructed advertisement payload for the underlying stack.
const GapAdvertisingDatagetAdvertisingData (void) const
void clearAdvertisingPayload (void)
 Reset any advertising payload prepared from prior calls to accumulateAdvertisingPayload().
ble_error_t setAdvertisingPayload (void)
 This API is *deprecated* and resolves to a no-operation.
ble_error_t accumulateScanResponse (GapAdvertisingData::DataType type, const uint8_t *data, uint8_t len)
 Accumulate a variable length byte-stream as an AD structure in the scanResponse payload.
void clearScanResponse (void)
 Reset any scan response prepared from prior calls to accumulateScanResponse().
ble_error_t startAdvertising (void)
 Start advertising.
ble_error_t stopAdvertising (void)
 Stop advertising.
ble_error_t setScanParams (uint16_t interval=GapScanningParams::SCAN_INTERVAL_MAX, uint16_t window=GapScanningParams::SCAN_WINDOW_MAX, uint16_t timeout=0, bool activeScanning=false)
 Setup parameters for GAP scanning--i.e.
ble_error_t setScanInterval (uint16_t interval)
 Setup the scanInterval parameter for GAP scanning--i.e.
ble_error_t setScanWindow (uint16_t window)
 Setup the scanWindow parameter for GAP scanning--i.e.
ble_error_t setScanTimeout (uint16_t timeout)
 Setup parameters for GAP scanning--i.e.
void setActiveScan (bool activeScanning)
 Setup parameters for GAP scanning--i.e.
ble_error_t startScan (void(*callback)(const Gap::AdvertisementCallbackParams_t *params))
 Start scanning (Observer Procedure) based on the parameters currently in effect.
template<typename T >
ble_error_t startScan (T *object, void(T::*memberCallback)(const Gap::AdvertisementCallbackParams_t *params))
 Same as above, but this takes an (object, method) pair for a callback.
ble_error_t stopScan (void)
 Stop scanning.
ble_error_t connect (const Gap::Address_t peerAddr, Gap::AddressType_t peerAddrType=Gap::ADDR_TYPE_RANDOM_STATIC, const Gap::ConnectionParams_t *connectionParams=NULL, const GapScanningParams *scanParams=NULL)
 Create a connection (GAP Link Establishment).
ble_error_t disconnect (Gap::Handle_t connectionHandle, Gap::DisconnectionReason_t reason)
 This call initiates the disconnection procedure, and its completion will be communicated to the application with an invocation of the onDisconnection callback.
ble_error_t disconnect (Gap::DisconnectionReason_t reason)
 This call initiates the disconnection procedure, and its completion will be communicated to the application with an invocation of the onDisconnection callback.
Gap::GapState_t getGapState (void) const
 Returns the current GAP state of the device using a bitmask which describes whether the device is advertising and/or connected.
ble_error_t getPreferredConnectionParams (Gap::ConnectionParams_t *params)
 Get the GAP peripheral preferred connection parameters.
ble_error_t setPreferredConnectionParams (const Gap::ConnectionParams_t *params)
 Set the GAP peripheral preferred connection parameters.
ble_error_t updateConnectionParams (Gap::Handle_t handle, const Gap::ConnectionParams_t *params)
 Update connection parameters while in the peripheral role.
ble_error_t setDeviceName (const uint8_t *deviceName)
 Set the device name characteristic in the GAP service.
ble_error_t getDeviceName (uint8_t *deviceName, unsigned *lengthP)
 Get the value of the device name characteristic in the GAP service.
ble_error_t setAppearance (GapAdvertisingData::Appearance appearance)
 Set the appearance characteristic in the GAP service.
ble_error_t getAppearance (GapAdvertisingData::Appearance *appearanceP)
 Get the appearance characteristic in the GAP service.
ble_error_t setTxPower (int8_t txPower)
 Set the radio's transmit power.
void getPermittedTxPowerValues (const int8_t **valueArrayPP, size_t *countP)
 Query the underlying stack for permitted arguments for setTxPower().
ble_error_t addService (GattService &service)
 Add a service declaration to the local server ATT table.
ble_error_t readCharacteristicValue (GattAttribute::Handle_t attributeHandle, uint8_t *buffer, uint16_t *lengthP)
 Read the value of a characteristic from the local GattServer.
ble_error_t readCharacteristicValue (Gap::Handle_t connectionHandle, GattAttribute::Handle_t attributeHandle, uint8_t *buffer, uint16_t *lengthP)
 Read the value of a characteristic from the local GattServer.
ble_error_t updateCharacteristicValue (GattAttribute::Handle_t attributeHandle, const uint8_t *value, uint16_t size, bool localOnly=false)
 Update the value of a characteristic on the local GattServer.
ble_error_t updateCharacteristicValue (Gap::Handle_t connectionHandle, GattAttribute::Handle_t attributeHandle, const uint8_t *value, uint16_t size, bool localOnly=false)
 Update the value of a characteristic on the local GattServer.
ble_error_t initializeSecurity (bool enableBonding=true, bool requireMITM=true, SecurityManager::SecurityIOCapabilities_t iocaps=SecurityManager::IO_CAPS_NONE, const SecurityManager::Passkey_t passkey=NULL)
 Enable the BLE stack's Security Manager.
ble_error_t getLinkSecurity (Gap::Handle_t connectionHandle, SecurityManager::LinkSecurityStatus_t *securityStatusP)
 Get the security status of a connection.
ble_error_t purgeAllBondingState (void)
 Delete all peer device context and all related bonding information from the database within the security manager.
void onTimeout (Gap::TimeoutEventCallback_t timeoutCallback)
 Setup a callback for timeout events.
void onConnection (Gap::ConnectionEventCallback_t connectionCallback)
 Setup a callback for connection events.
void onDisconnection (Gap::DisconnectionEventCallback_t disconnectionCallback)
 Used to setup a callback for GAP disconnection.
template<typename T >
void addToDisconnectionCallChain (T *tptr, void(T::*mptr)(void))
 Append to a chain of callbacks to be invoked upon disconnection; these callbacks receive no context and are therefore different from the onDisconnection callback.
void onRadioNotification (void(*callback)(bool))
 Radio Notification is a feature that enables ACTIVE and INACTIVE (nACTIVE) signals from the stack that notify the application when the radio is in use.
void onDataSent (void(*callback)(unsigned count))
 Add a callback for the GATT event DATA_SENT (which is triggered when updates are sent out by GATT in the form of notifications).
void onDataWritten (void(*callback)(const GattWriteCallbackParams *eventDataP))
 Setup a callback for when an attribute has its value updated by or at the connected peer.
ble_error_t onDataRead (void(*callback)(const GattReadCallbackParams *eventDataP))
 Setup a callback to be invoked on the peripheral when an attribute is being read by a remote client.
void onUpdatesEnabled (GattServer::EventCallback_t callback)
 Setup a callback for when notifications/indications are enabled for a characteristic on the local GattServer.
void onUpdatesDisabled (GattServer::EventCallback_t callback)
 Setup a callback for when notifications/indications are disabled for a characteristic on the local GattServer.
void onConfirmationReceived (GattServer::EventCallback_t callback)
 Setup a callback for when the GATT server receives a response for an indication event sent previously.
void onSecuritySetupInitiated (SecurityManager::SecuritySetupInitiatedCallback_t callback)
 Setup a callback for when the security setup procedure (key generation and exchange) for a link has started.
void onSecuritySetupCompleted (SecurityManager::SecuritySetupCompletedCallback_t callback)
 Setup a callback for when the security setup procedure (key generation and exchange) for a link has completed.
void onLinkSecured (SecurityManager::LinkSecuredCallback_t callback)
 Setup a callback for when a link with the peer is secured.
void onSecurityContextStored (SecurityManager::HandleSpecificEvent_t callback)
 Setup a callback for successful bonding; i.e.
void onPasskeyDisplay (SecurityManager::PasskeyDisplayCallback_t callback)
 Setup a callback for when the passkey needs to be displayed on a peripheral with DISPLAY capability.

Detailed Description

The base class used to abstract away BLE capable radio transceivers or SOCs, to enable this BLE API to work with any radio transparently.

Definition at line 30 of file BLE.h.


Member Function Documentation

ble_error_t accumulateAdvertisingPayload ( uint8_t  flags )

Accumulate an AD structure in the advertising payload.

Please note that the payload is limited to 31 bytes. The SCAN_RESPONSE message may be used as an additional 31 bytes if the advertising payload proves to be too small.

Parameters:
[in]flagsThe flags to be added. Please refer to GapAdvertisingData::Flags for valid flags. Multiple flags may be specified in combination.
Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.accumulateAdvertisingPayload(flags) should be replaced with ble.gap().accumulateAdvertisingPayload(flags).

Definition at line 292 of file BLE.h.

ble_error_t accumulateAdvertisingPayload ( GapAdvertisingData::Appearance  app )

Accumulate an AD structure in the advertising payload.

Please note that the payload is limited to 31 bytes. The SCAN_RESPONSE message may be used as an additional 31 bytes if the advertising payload proves to be too small.

Parameters:
[in]appThe appearance of the peripheral.
Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.accumulateAdvertisingPayload(appearance) should be replaced with ble.gap().accumulateAdvertisingPayload(appearance).

Definition at line 310 of file BLE.h.

ble_error_t accumulateAdvertisingPayload ( GapAdvertisingData::DataType  type,
const uint8_t *  data,
uint8_t  len 
)

Accumulate a variable length byte-stream as an AD structure in the advertising payload.

Please note that the payload is limited to 31 bytes. The SCAN_RESPONSE message may be used as an additional 31 bytes if the advertising payload proves to be too small.

Parameters:
typeThe type which describes the variable length data.
datadata bytes.
lenlength of data.
Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.accumulateAdvertisingPayload(...) should be replaced with ble.gap().accumulateAdvertisingPayload(...).

Definition at line 348 of file BLE.h.

ble_error_t accumulateAdvertisingPayloadTxPower ( int8_t  power )

Accumulate an AD structure in the advertising payload.

Please note that the payload is limited to 31 bytes. The SCAN_RESPONSE message may be used as an additional 31 bytes if the advertising payload proves to be too small.

Parameters:
[in]appThe max transmit power to be used by the controller. This is only a hint.
Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.accumulateAdvertisingPayloadTxPower(txPower) should be replaced with ble.gap().accumulateAdvertisingPayloadTxPower(txPower).

Definition at line 329 of file BLE.h.

ble_error_t accumulateScanResponse ( GapAdvertisingData::DataType  type,
const uint8_t *  data,
uint8_t  len 
)

Accumulate a variable length byte-stream as an AD structure in the scanResponse payload.

Parameters:
[in]typeThe type which describes the variable length data.
[in]datadata bytes.
[in]lenlength of data.
Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.accumulateScanResponse(...) should be replaced with ble.gap().accumulateScanResponse(...).

Definition at line 421 of file BLE.h.

ble_error_t addService ( GattService &  service )

Add a service declaration to the local server ATT table.

Also add the characteristics contained within.

Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from GattServer directly. A former call to ble.addService() should be replaced with ble.gattServer().addService().

Definition at line 872 of file BLE.h.

void addToDisconnectionCallChain ( T *  tptr,
void(T::*)(void)  mptr 
)

Append to a chain of callbacks to be invoked upon disconnection; these callbacks receive no context and are therefore different from the onDisconnection callback.

Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.addToDisconnectionCallchain(...) should be replaced with ble.gap().addToDisconnectionCallchain(...).

Definition at line 1104 of file BLE.h.

void clearAdvertisingPayload ( void   )

Reset any advertising payload prepared from prior calls to accumulateAdvertisingPayload().

This automatically propagates the re- initialized adv payload to the underlying stack.

Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.clearAdvertisingPayload(...) should be replaced with ble.gap().clearAdvertisingPayload(...).

Definition at line 389 of file BLE.h.

void clearScanResponse ( void   )

Reset any scan response prepared from prior calls to accumulateScanResponse().

Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.clearScanResponse(...) should be replaced with ble.gap().clearScanResponse(...).

Definition at line 434 of file BLE.h.

ble_error_t connect ( const Gap::Address_t  peerAddr,
Gap::AddressType_t  peerAddrType = Gap::ADDR_TYPE_RANDOM_STATIC,
const Gap::ConnectionParams_t *  connectionParams = NULL,
const GapScanningParams *  scanParams = NULL 
)

Create a connection (GAP Link Establishment).

Parameters:
peerAddr48-bit address, LSB format.
peerAddrTypeAddress type of the peer.
connectionParamsConnection parameters.
scanParamsParamters to be used while scanning for the peer.
Returns:
BLE_ERROR_NONE if connection establishment procedure is started successfully. The onConnection callback (if set) will be invoked upon a connection event.
Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.connect(...) should be replaced with ble.gap().connect(...).

Definition at line 652 of file BLE.h.

ble_error_t disconnect ( Gap::Handle_t  connectionHandle,
Gap::DisconnectionReason_t  reason 
)

This call initiates the disconnection procedure, and its completion will be communicated to the application with an invocation of the onDisconnection callback.

Parameters:
[in]connectionHandle
[in]reasonThe reason for disconnection to be sent back to the peer.

Definition at line 668 of file BLE.h.

ble_error_t disconnect ( Gap::DisconnectionReason_t  reason )

This call initiates the disconnection procedure, and its completion will be communicated to the application with an invocation of the onDisconnection callback.

Parameters:
reasonThe reason for disconnection to be sent back to the peer.
Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.disconnect(reason) should be replaced with ble.gap().disconnect(reason).
: this version of disconnect() doesn't take a connection handle. It will work reliably only for stacks which are limited to a single connection. This API should be considered *deprecated* in favour of the alternative which takes a connection handle. It will be dropped in the future.

Definition at line 690 of file BLE.h.

ble_error_t getAddress ( Gap::AddressType_t *  typeP,
Gap::Address_t  address 
)

Fetch the BTLE MAC address and type.

Returns:
BLE_ERROR_NONE on success.
Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.getAddress(...) should be replaced with ble.gap().getAddress(...).

Definition at line 152 of file BLE.h.

const GapAdvertisingData& getAdvertisingData ( void   ) const
Returns:
Read back advertising data. Useful for storing and restoring payload.
Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.getAdvertisingData(...) should be replaced with ble.gap().getAdvertisingPayload()(...).

Definition at line 375 of file BLE.h.

const GapAdvertisingParams& getAdvertisingParams ( void   ) const
Returns:
Read back advertising parameters. Useful for storing and restoring parameters rapidly.
Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.getAdvertisingParams(...) should be replaced with ble.gap().getAdvertisingParams(...).

Definition at line 272 of file BLE.h.

ble_error_t getAppearance ( GapAdvertisingData::Appearance *  appearanceP )

Get the appearance characteristic in the GAP service.

Parameters:
[out]appearanceThe new value for the device-appearance.
Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.getAppearance() should be replaced with ble.gap().getAppearance().

Definition at line 829 of file BLE.h.

ble_error_t getDeviceName ( uint8_t *  deviceName,
unsigned *  lengthP 
)

Get the value of the device name characteristic in the GAP service.

Parameters:
[out]deviceNamePointer to an empty buffer where the UTF-8 *non NULL- terminated* string will be placed. Set this value to NULL in order to obtain the deviceName-length from the 'length' parameter.
in/out]lengthP (on input) Length of the buffer pointed to by deviceName; (on output) the complete device name length (without the null terminator).
Note:
If the device name is longer than the size of the supplied buffer, length will return the complete device name length, and not the number of bytes actually returned in deviceName. The application may use this information to retry with a suitable buffer size.
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.getDeviceName() should be replaced with ble.gap().getDeviceName().

Definition at line 801 of file BLE.h.

Gap::GapState_t getGapState ( void   ) const

Returns the current GAP state of the device using a bitmask which describes whether the device is advertising and/or connected.

Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.getGapState() should be replaced with ble.gap().getState().

Definition at line 703 of file BLE.h.

ble_error_t getLinkSecurity ( Gap::Handle_t  connectionHandle,
SecurityManager::LinkSecurityStatus_t *  securityStatusP 
)

Get the security status of a connection.

Parameters:
[in]connectionHandleHandle to identify the connection.
[out]securityStatusPsecurity status.
Returns:
BLE_SUCCESS Or appropriate error code indicating reason for failure.
Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from SecurityManager directly. A former call to ble.getLinkSecurity(...) should be replaced with ble.securityManager().getLinkSecurity(...).

Definition at line 1035 of file BLE.h.

uint16_t getMaxAdvertisingInterval ( void   ) const
Returns:
Maximum Advertising interval in milliseconds.
Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.getMaxAdvertisingInterval(...) should be replaced with ble.gap().getMaxAdvertisingInterval(...).

Definition at line 230 of file BLE.h.

uint16_t getMinAdvertisingInterval ( void   ) const
Returns:
Minimum Advertising interval in milliseconds.
Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.getMinAdvertisingInterval(...) should be replaced with ble.gap().getMinAdvertisingInterval(...).

Definition at line 206 of file BLE.h.

uint16_t getMinNonConnectableAdvertisingInterval ( void   ) const
Returns:
Minimum Advertising interval in milliseconds for non-connectible mode.
Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.getMinNonConnectableAdvertisingInterval(...) should be replaced with ble.gap().getMinNonConnectableAdvertisingInterval(...).

Definition at line 218 of file BLE.h.

void getPermittedTxPowerValues ( const int8_t **  valueArrayPP,
size_t *  countP 
)

Query the underlying stack for permitted arguments for setTxPower().

Parameters:
[out]valueArrayPPOut parameter to receive the immutable array of Tx values.
[out]countPOut parameter to receive the array's size.
Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.getPermittedTxPowerValues() should be replaced with ble.gap().getPermittedTxPowerValues().

Definition at line 859 of file BLE.h.

ble_error_t getPreferredConnectionParams ( Gap::ConnectionParams_t *  params )

Get the GAP peripheral preferred connection parameters.

These are the defaults that the peripheral would like to have in a connection. The choice of the connection parameters is eventually up to the central.

Parameters:
[out]paramsThe structure where the parameters will be stored. Memory for this is owned by the caller.
Returns:
BLE_ERROR_NONE if the parameters were successfully filled into the given structure pointed to by params.
Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.getPreferredConnectionParams() should be replaced with ble.gap().getPreferredConnectionParams().

Definition at line 724 of file BLE.h.

const char* getVersion ( void   )

This call allows the application to get the BLE stack version information.

Returns:
A pointer to a const string representing the version. Note: The string is owned by the BLE_API.

Definition at line 62 of file BLE.h.

ble_error_t init (  )

Initialize the BLE controller.

This should be called before using anything else in the BLE_API.

init() hands control to the underlying BLE module to accomplish initialization. This initialization may tacitly depend on other hardware setup (such as clocks or power-modes) which happens early on during system startup. It may not be safe to call init() from global static context where ordering is compiler specific and can't be guaranteed--it is safe to call BLE::init() from within main().

Definition at line 24 of file BLE.cpp.

ble_error_t initializeSecurity ( bool  enableBonding = true,
bool  requireMITM = true,
SecurityManager::SecurityIOCapabilities_t  iocaps = SecurityManager::IO_CAPS_NONE,
const SecurityManager::Passkey_t  passkey = NULL 
)

Enable the BLE stack's Security Manager.

The Security Manager implements the actual cryptographic algorithms and protocol exchanges that allow two devices to securely exchange data and privately detect each other. Calling this API is a prerequisite for encryption and pairing (bonding).

Parameters:
[in]enableBondingAllow for bonding.
[in]requireMITMRequire protection for man-in-the-middle attacks.
[in]iocapsTo specify IO capabilities of this peripheral, such as availability of a display or keyboard to support out-of-band exchanges of security data.
[in]passkeyTo specify a static passkey.
Returns:
BLE_ERROR_NONE on success.
Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from SecurityManager directly. A former call to ble.initializeSecurity(...) should be replaced with ble.securityManager().init(...).

Definition at line 1015 of file BLE.h.

void onConfirmationReceived ( GattServer::EventCallback_t  callback )

Setup a callback for when the GATT server receives a response for an indication event sent previously.

Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from GattServer directly. A former call to ble.onConfirmationReceived(callback) should be replaced with ble.gattServer().onConfirmationReceived(callback).

Definition at line 1249 of file BLE.h.

void onConnection ( Gap::ConnectionEventCallback_t  connectionCallback )

Setup a callback for connection events.

Refer to Gap::ConnectionEventCallback_t.

Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.onConnection(callback) should be replaced with ble.gap().onConnection(callback).

Definition at line 1077 of file BLE.h.

ble_error_t onDataRead ( void(*)(const GattReadCallbackParams *eventDataP)  callback )

Setup a callback to be invoked on the peripheral when an attribute is being read by a remote client.

: this functionality may not be available on all underlying stacks. You could use GattCharacteristic::setReadAuthorizationCallback() as an alternative.

: it is possible to chain together multiple onDataRead callbacks (potentially from different modules of an application) to receive updates to characteristics. Services may add their own onDataRead callbacks behind the scenes to trap interesting events.

: it is also possible to setup a callback into a member function of some object.

Returns:
BLE_ERROR_NOT_IMPLEMENTED if this functionality isn't available; else BLE_ERROR_NONE.
Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from GattServer directly. A former call to ble.onDataRead(...) should be replaced with ble.gattServer().onDataRead(...).

Definition at line 1207 of file BLE.h.

void onDataSent ( void(*)(unsigned count)  callback )

Add a callback for the GATT event DATA_SENT (which is triggered when updates are sent out by GATT in the form of notifications).

: it is possible to chain together multiple onDataSent callbacks (potentially from different modules of an application) to receive updates to characteristics.

: it is also possible to setup a callback into a member function of some object.

Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from GattServer directly. A former call to ble.onDataSent(...) should be replaced with ble.gattServer().onDataSent(...).

Definition at line 1149 of file BLE.h.

void onDataWritten ( void(*)(const GattWriteCallbackParams *eventDataP)  callback )

Setup a callback for when an attribute has its value updated by or at the connected peer.

For a peripheral, this callback triggered when the local GATT server has an attribute updated by a write command from the peer. For a Central, this callback is triggered when a response is received for a write request.

: it is possible to chain together multiple onDataWritten callbacks (potentially from different modules of an application) to receive updates to characteristics. Many services, such as DFU and UART add their own onDataWritten callbacks behind the scenes to trap interesting events.

: it is also possible to setup a callback into a member function of some object.

Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from GattServer directly. A former call to ble.onDataWritten(...) should be replaced with ble.gattServer().onDataWritten(...).

Definition at line 1176 of file BLE.h.

void onDisconnection ( Gap::DisconnectionEventCallback_t  disconnectionCallback )

Used to setup a callback for GAP disconnection.

Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.onDisconnection(callback) should be replaced with ble.gap().onDisconnection(callback).

Definition at line 1089 of file BLE.h.

void onLinkSecured ( SecurityManager::LinkSecuredCallback_t  callback )

Setup a callback for when a link with the peer is secured.

For bonded devices, subsequent reconnections with bonded peer will result only in this callback when the link is secured and setup procedures will not occur unless the bonding information is either lost or deleted on either or both sides. The callback is passed in a SecurityManager::SecurityMode_t according to the level of security in effect for the secured link.

Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from SecurityManager directly. A former call to ble.onLinkSecured(callback) should be replaced with ble.securityManager().onLinkSecured(callback).

Definition at line 1297 of file BLE.h.

void onPasskeyDisplay ( SecurityManager::PasskeyDisplayCallback_t  callback )

Setup a callback for when the passkey needs to be displayed on a peripheral with DISPLAY capability.

This happens when security is configured to prevent Man-In-The-Middle attacks, and a PIN (or passkey) needs to be exchanged between the peers to authenticate the connection attempt.

Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from SecurityManager directly. A former call to ble.onPasskeyDisplay(callback) should be replaced with ble.securityManager().onPasskeyDisplay(callback).

Definition at line 1326 of file BLE.h.

void onRadioNotification ( void(*)(bool)  callback )

Radio Notification is a feature that enables ACTIVE and INACTIVE (nACTIVE) signals from the stack that notify the application when the radio is in use.

The signal is sent using software interrupt.

The ACTIVE signal is sent before the Radio Event starts. The nACTIVE signal is sent at the end of the Radio Event. These signals can be used by the application programmer to synchronize application logic with radio activity. For example, the ACTIVE signal can be used to shut off external devices to manage peak current drawn during periods when the radio is on, or to trigger sensor data collection for transmission in the Radio Event.

Parameters:
callbackThe application handler to be invoked in response to a radio ACTIVE/INACTIVE event.
Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.onRadioNotification(...) should be replaced with ble.gap().onRadioNotification(...).

Definition at line 1129 of file BLE.h.

void onSecurityContextStored ( SecurityManager::HandleSpecificEvent_t  callback )

Setup a callback for successful bonding; i.e.

that link-specific security context is stored persistently for a peer device.

Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from SecurityManager directly. A former call to ble.onSecurityContextStored(callback) should be replaced with ble.securityManager().onSecurityContextStored(callback).

Definition at line 1310 of file BLE.h.

void onSecuritySetupCompleted ( SecurityManager::SecuritySetupCompletedCallback_t  callback )

Setup a callback for when the security setup procedure (key generation and exchange) for a link has completed.

This will be skipped for bonded devices. The callback is passed in the success/failure status of the security setup procedure.

Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from SecurityManager directly. A former call to ble.onSecuritySetupCompleted(callback) should be replaced with ble.securityManager().onSecuritySetupCompleted(callback).

Definition at line 1280 of file BLE.h.

void onSecuritySetupInitiated ( SecurityManager::SecuritySetupInitiatedCallback_t  callback )

Setup a callback for when the security setup procedure (key generation and exchange) for a link has started.

This will be skipped for bonded devices. The callback is passed in parameters received from the peer's security request: bool allowBonding, bool requireMITM, and SecurityIOCapabilities_t.

Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from SecurityManager directly. A former call to ble.onSecuritySetupInitiated(callback) should be replaced with ble.securityManager().onSecuritySetupInitiated(callback).

Definition at line 1265 of file BLE.h.

void onTimeout ( Gap::TimeoutEventCallback_t  timeoutCallback )

Setup a callback for timeout events.

Refer to Gap::TimeoutSource_t for possible event types.

Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.onTimeout(callback) should be replaced with ble.gap().onTimeout(callback).

Definition at line 1065 of file BLE.h.

void onUpdatesDisabled ( GattServer::EventCallback_t  callback )

Setup a callback for when notifications/indications are disabled for a characteristic on the local GattServer.

Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from GattServer directly. A former call to ble.onUpdatesEnabled(callback) should be replaced with ble.gattServer().onUpdatesEnabled(callback).

Definition at line 1236 of file BLE.h.

void onUpdatesEnabled ( GattServer::EventCallback_t  callback )

Setup a callback for when notifications/indications are enabled for a characteristic on the local GattServer.

Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from GattServer directly. A former call to ble.onUpdatesEnabled(callback) should be replaced with ble.gattServer().onUpdatesEnabled(callback).

Definition at line 1223 of file BLE.h.

ble_error_t purgeAllBondingState ( void   )

Delete all peer device context and all related bonding information from the database within the security manager.

Return values:
BLE_ERROR_NONEOn success, else an error code indicating reason for failure.
BLE_ERROR_INVALID_STATEIf the API is called without module initialization and/or application registration.
Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from SecurityManager directly. A former call to ble.purgeAllBondingState() should be replaced with ble.securityManager().purgeAllBondingState().

Definition at line 1052 of file BLE.h.

ble_error_t readCharacteristicValue ( GattAttribute::Handle_t  attributeHandle,
uint8_t *  buffer,
uint16_t *  lengthP 
)

Read the value of a characteristic from the local GattServer.

Parameters:
[in]attributeHandleAttribute handle for the value attribute of the characteristic.
[out]bufferA buffer to hold the value being read.
in/out]lengthP Length of the buffer being supplied. If the attribute value is longer than the size of the supplied buffer, this variable will hold upon return the total attribute value length (excluding offset). The application may use this information to allocate a suitable buffer size.
Returns:
BLE_ERROR_NONE if a value was read successfully into the buffer.
Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from GattServer directly. A former call to ble.readCharacteristicValue() should be replaced with ble.gattServer().read().

Definition at line 896 of file BLE.h.

ble_error_t readCharacteristicValue ( Gap::Handle_t  connectionHandle,
GattAttribute::Handle_t  attributeHandle,
uint8_t *  buffer,
uint16_t *  lengthP 
)

Read the value of a characteristic from the local GattServer.

Parameters:
[in]connectionHandleConnection Handle.
[in]attributeHandleAttribute handle for the value attribute of the characteristic.
[out]bufferA buffer to hold the value being read.
in/out]lengthP Length of the buffer being supplied. If the attribute value is longer than the size of the supplied buffer, this variable will hold upon return the total attribute value length (excluding offset). The application may use this information to allocate a suitable buffer size.
Returns:
BLE_ERROR_NONE if a value was read successfully into the buffer.
Note:
This API is a version of above with an additional connection handle parameter to allow fetches for connection-specific multivalued attributes (such as the CCCDs).
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from GattServer directly. A former call to ble.readCharacteristicValue() should be replaced with ble.gattServer().read().

Definition at line 926 of file BLE.h.

void setActiveScan ( bool  activeScanning )

Setup parameters for GAP scanning--i.e.

observer mode.

Parameters:
[in]activeScanningSet to True if active-scanning is required. This is used to fetch the scan response from a peer if possible.

Once the scanning parameters have been configured, scanning can be enabled by using startScan().

Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.setActiveScan(...) should be replaced with ble.gap().setActiveScanning(...).

Definition at line 586 of file BLE.h.

ble_error_t setAddress ( Gap::AddressType_t  type,
const Gap::Address_t  address 
)

Set the BTLE MAC address and type.

Returns:
BLE_ERROR_NONE on success.
Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.setAddress(...) should be replaced with ble.gap().setAddress(...).

Definition at line 139 of file BLE.h.

ble_error_t setAdvertisingData ( const GapAdvertisingData advData )

Setup a particular, user-constructed advertisement payload for the underlying stack.

It would be uncommon for this API to be used directly; there are other APIs to build an advertisement payload (see above).

Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.setAdvertisingData(...) should be replaced with ble.gap().setAdvertisingPayload(...).

Definition at line 362 of file BLE.h.

void setAdvertisingInterval ( uint16_t  interval )
Parameters:
[in]intervalAdvertising interval in units of milliseconds. Advertising is disabled if interval is 0. If interval is smaller than the minimum supported value, then the minimum supported value is used instead. This minimum value can be discovered using getMinAdvertisingInterval().

This field must be set to 0 if connectionMode is equal to ADV_CONNECTABLE_DIRECTED.

Note:
: Decreasing this value will allow central devices to detect a peripheral faster at the expense of more power being used by the radio due to the higher data transmit rate.
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.setAdvertisingInterval(...) should be replaced with ble.gap().setAdvertisingInterval(...).
: [WARNING] This API previously used 0.625ms as the unit for its 'interval' argument. That required an explicit conversion from milliseconds using Gap::MSEC_TO_GAP_DURATION_UNITS(). This conversion is no longer required as the new units are milliseconds. Any application code depending on the old semantics would need to be updated accordingly.

Definition at line 194 of file BLE.h.

void setAdvertisingParams ( const GapAdvertisingParams advParams )

Setup a particular, user-constructed set of advertisement parameters for the underlying stack.

It would be uncommon for this API to be used directly; there are other APIs to tweak advertisement parameters individually (see above).

Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.setAdvertisingParams(...) should be replaced with ble.gap().setAdvertisingParams(...).

Definition at line 259 of file BLE.h.

ble_error_t setAdvertisingPayload ( void   )

This API is *deprecated* and resolves to a no-operation.

It is left here to allow older code to compile. Please avoid using this API in new code. This API will be dropped in a future release.

Formerly, it would be used to dynamically reset the accumulated advertising payload and scanResponse; to do this, the application would clear and re- accumulate a new advertising payload (and scanResponse) before using this API. Updates to the underlying advertisement payload now happen implicitly.

Definition at line 404 of file BLE.h.

void setAdvertisingTimeout ( uint16_t  timeout )
Parameters:
[in]timeoutAdvertising timeout (in seconds) between 0x1 and 0x3FFF (1 and 16383). Use 0 to disable the advertising timeout.
Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.setAdvertisingTimeout(...) should be replaced with ble.gap().setAdvertisingTimeout(...).

Definition at line 244 of file BLE.h.

void setAdvertisingType ( GapAdvertisingParams::AdvertisingType  advType )

Set the GAP advertising mode to use for this device.

Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.setAdvertisingType(...) should be replaced with ble.gap().setAdvertisingType(...).

Definition at line 164 of file BLE.h.

ble_error_t setAppearance ( GapAdvertisingData::Appearance  appearance )

Set the appearance characteristic in the GAP service.

Parameters:
[in]appearanceThe new value for the device-appearance.
Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.setAppearance() should be replaced with ble.gap().setAppearance().

Definition at line 815 of file BLE.h.

ble_error_t setDeviceName ( const uint8_t *  deviceName )

Set the device name characteristic in the GAP service.

Parameters:
[in]deviceNameThe new value for the device-name. This is a UTF-8 encoded, NULL-terminated string.
Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.setDeviceName() should be replaced with ble.gap().setDeviceName().

Definition at line 774 of file BLE.h.

ble_error_t setPreferredConnectionParams ( const Gap::ConnectionParams_t *  params )

Set the GAP peripheral preferred connection parameters.

These are the defaults that the peripheral would like to have in a connection. The choice of the connection parameters is eventually up to the central.

Parameters:
[in]paramsThe structure containing the desired parameters.
Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.setPreferredConnectionParams() should be replaced with ble.gap().setPreferredConnectionParams().

Definition at line 741 of file BLE.h.

ble_error_t setScanInterval ( uint16_t  interval )

Setup the scanInterval parameter for GAP scanning--i.e.

observer mode.

Parameters:
[in]intervalScan interval (in milliseconds) [valid values lie between 2.5ms and 10.24s].

The scanning window divided by the interval determines the duty cycle for scanning. For example, if the interval is 100ms and the window is 10ms, then the controller will scan for 10 percent of the time. It is possible to have the interval and window set to the same value. In this case, scanning is continuous, with a change of scanning frequency once every interval.

Once the scanning parameters have been configured, scanning can be enabled by using startScan().

Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.setScanInterval(interval) should be replaced with ble.gap().setScanInterval(interval).

Definition at line 518 of file BLE.h.

ble_error_t setScanParams ( uint16_t  interval = GapScanningParams::SCAN_INTERVAL_MAX,
uint16_t  window = GapScanningParams::SCAN_WINDOW_MAX,
uint16_t  timeout = 0,
bool  activeScanning = false 
)

Setup parameters for GAP scanning--i.e.

observer mode.

Parameters:
[in]intervalScan interval (in milliseconds) [valid values lie between 2.5ms and 10.24s].
[in]windowScan Window (in milliseconds) [valid values lie between 2.5ms and 10.24s].
[in]timeoutScan timeout (in seconds) between 0x0001 and 0xFFFF, 0x0000 disables timeout.
[in]activeScanningSet to True if active-scanning is required. This is used to fetch the scan response from a peer if possible.

The scanning window divided by the interval determines the duty cycle for scanning. For example, if the interval is 100ms and the window is 10ms, then the controller will scan for 10 percent of the time. It is possible to have the interval and window set to the same value. In this case, scanning is continuous, with a change of scanning frequency once every interval.

Once the scanning parameters have been configured, scanning can be enabled by using startScan().

: The scan interval and window are recommendations to the BLE stack.

Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.setScanParams(...) should be replaced with ble.gap().setScanParams(...).

Definition at line 491 of file BLE.h.

ble_error_t setScanTimeout ( uint16_t  timeout )

Setup parameters for GAP scanning--i.e.

observer mode.

Parameters:
[in]timeoutScan timeout (in seconds) between 0x0001 and 0xFFFF, 0x0000 disables timeout.

The scanning window divided by the interval determines the duty cycle for scanning. For example, if the interval is 100ms and the window is 10ms, then the controller will scan for 10 percent of the time. It is possible to have the interval and window set to the same value. In this case, scanning is continuous, with a change of scanning frequency once every interval.

Once the scanning parameters have been configured, scanning can be enabled by using startScan().

: The scan interval and window are recommendations to the BLE stack.

Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.setScanTimeout(...) should be replaced with ble.gap().setScanTimeout(...).

Definition at line 568 of file BLE.h.

ble_error_t setScanWindow ( uint16_t  window )

Setup the scanWindow parameter for GAP scanning--i.e.

observer mode.

Parameters:
[in]windowScan Window (in milliseconds) [valid values lie between 2.5ms and 10.24s].

The scanning window divided by the interval determines the duty cycle for scanning. For example, if the interval is 100ms and the window is 10ms, then the controller will scan for 10 percent of the time. It is possible to have the interval and window set to the same value. In this case, scanning is continuous, with a change of scanning frequency once every interval.

Once the scanning parameters have been configured, scanning can be enabled by using startScan().

Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.setScanWindow(window) should be replaced with ble.gap().setScanWindow(window).

Definition at line 542 of file BLE.h.

ble_error_t setTxPower ( int8_t  txPower )

Set the radio's transmit power.

Parameters:
[in]txPowerRadio transmit power in dBm.
Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.setTxPower() should be replaced with ble.gap().setTxPower().

Definition at line 842 of file BLE.h.

ble_error_t shutdown ( void   )

Purge the BLE stack of GATT and GAP state.

init() must be called afterwards to re-instate services and GAP state. This API offers a way to repopulate the GATT database with new services and characteristics.

Definition at line 51 of file BLE.h.

ble_error_t startAdvertising ( void   )

Start advertising.

Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.startAdvertising(...) should be replaced with ble.gap().startAdvertising(...).

Definition at line 446 of file BLE.h.

ble_error_t startScan ( T *  object,
void(T::*)(const Gap::AdvertisementCallbackParams_t *params)  memberCallback 
)

Same as above, but this takes an (object, method) pair for a callback.

Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.startScan(callback) should be replaced with ble.gap().startScan(object, callback).
ble_error_t startScan ( void(*)(const Gap::AdvertisementCallbackParams_t *params)  callback )

Start scanning (Observer Procedure) based on the parameters currently in effect.

Parameters:
[in]callbackThe application specific callback to be invoked upon receiving every advertisement report. This can be passed in as NULL, in which case scanning may not be enabled at all.
Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.startScan(callback) should be replaced with ble.gap().startScan(callback).

Definition at line 604 of file BLE.h.

ble_error_t stopAdvertising ( void   )

Stop advertising.

Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.stopAdvertising(...) should be replaced with ble.gap().stopAdvertising(...).

Definition at line 458 of file BLE.h.

ble_error_t stopScan ( void   )

Stop scanning.

The current scanning parameters remain in effect.

Return values:
BLE_ERROR_NONEif successfully stopped scanning procedure.
Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.stopScan() should be replaced with ble.gap().stopScan().

Definition at line 629 of file BLE.h.

ble_error_t updateCharacteristicValue ( GattAttribute::Handle_t  attributeHandle,
const uint8_t *  value,
uint16_t  size,
bool  localOnly = false 
)

Update the value of a characteristic on the local GattServer.

Parameters:
[in]attributeHandleHandle for the value attribute of the Characteristic.
[in]valueA pointer to a buffer holding the new value
[in]sizeSize of the new value (in bytes).
[in]localOnlyShould this update be kept on the local GattServer regardless of the state of the notify/indicate flag in the CCCD for this Characteristic? If set to true, no notification or indication is generated.
Returns:
BLE_ERROR_NONE if we have successfully set the value of the attribute.
Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from GattServer directly. A former call to ble.updateCharacteristicValue() should be replaced with ble.gattServer().write().

Definition at line 953 of file BLE.h.

ble_error_t updateCharacteristicValue ( Gap::Handle_t  connectionHandle,
GattAttribute::Handle_t  attributeHandle,
const uint8_t *  value,
uint16_t  size,
bool  localOnly = false 
)

Update the value of a characteristic on the local GattServer.

A version of the same as above with connection handle parameter to allow updates for connection-specific multivalued attributes (such as the CCCDs).

Parameters:
[in]connectionHandleConnection Handle.
[in]attributeHandleHandle for the value attribute of the Characteristic.
[in]valueA pointer to a buffer holding the new value
[in]sizeSize of the new value (in bytes).
[in]localOnlyShould this update be kept on the local GattServer regardless of the state of the notify/indicate flag in the CCCD for this Characteristic? If set to true, no notification or indication is generated.
Returns:
BLE_ERROR_NONE if we have successfully set the value of the attribute.
Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from GattServer directly. A former call to ble.updateCharacteristicValue() should be replaced with ble.gattServer().write().

Definition at line 987 of file BLE.h.

ble_error_t updateConnectionParams ( Gap::Handle_t  handle,
const Gap::ConnectionParams_t *  params 
)

Update connection parameters while in the peripheral role.

In the peripheral role, this will send the corresponding L2CAP request to the connected peer and wait for the central to perform the procedure.

Parameters:
[in]handleConnection Handle
[in]paramsPointer to desired connection parameters. If NULL is provided on a peripheral role, the parameters in the PPCP characteristic of the GAP service will be used instead.
Note:
: This API is now *deprecated* and will be dropped in the future. You should use the parallel API from Gap directly. A former call to ble.updateConnectionParams() should be replaced with ble.gap().updateConnectionParams().

Definition at line 760 of file BLE.h.

void waitForEvent ( void   )

Yield control to the BLE stack or to other tasks waiting for events.

This is a sleep function which will return when there is an application specific interrupt, but the MCU might wake up several times before returning (to service the stack). This is not always interchangeable with WFE().

Definition at line 118 of file BLE.h.