BLE_API wrapper library for STMicroelectronics' BlueNRG Bluetooth Low Energy expansion board shield (Component)

Dependents:   Nucleo_Zumo_BLE_IDB04A1 contest_IOT5 contest_IOT6 contest_IOT_10 ... more

Fork of X_NUCLEO_IDB0XA1 by ST Expansion SW Team

Embed: (wiki syntax)

« Back to documentation index

BlueNRGGap

BlueNRGGap

BlueNRG BLE_API GAP Adaptation. More...

Functions

virtual ble_error_t setAdvertisingData (const GapAdvertisingData &, const GapAdvertisingData &)
 Sets the advertising parameters and payload for the device. Note: Some data types give error when their adv data is updated using aci_gap_update_adv_data() API.
virtual ble_error_t startAdvertising (const GapAdvertisingParams &)
 Starts the BLE HW, initialising any services that were added before this function was called.
virtual ble_error_t stopAdvertising (void)
 Stops the BLE HW and disconnects from any devices.
void setConnectionHandle (uint16_t con_handle)
 Sets the 16-bit connection handle.
uint16_t getConnectionHandle (void)
 Gets the 16-bit connection handle.
bool getIsSetAddress ()
 Returns boolean if the address of the device has been set or not.
virtual ble_error_t getAddress (BLEProtocol::AddressType_t *typeP, BLEProtocol::AddressBytes_t address)
 Returns the address of the device if set.
virtual ble_error_t getPreferredConnectionParams (ConnectionParams_t *params)
 obtains preferred connection params
virtual ble_error_t setPreferredConnectionParams (const ConnectionParams_t *params)
 sets preferred connection params
virtual ble_error_t updateConnectionParams (Handle_t handle, const ConnectionParams_t *params)
 updates preferred connection params
virtual ble_error_t setDeviceName (const uint8_t *deviceName)
 Sets the Device Name Characteristic.
virtual ble_error_t getDeviceName (uint8_t *deviceName, unsigned *lengthP)
 Gets the Device Name Characteristic.
virtual ble_error_t setAppearance (GapAdvertisingData::Appearance appearance)
 Sets the Device Appearance Characteristic.
virtual ble_error_t getAppearance (GapAdvertisingData::Appearance *appearanceP)
 Gets the Device Appearance Characteristic.
virtual ble_error_t setTxPower (int8_t txPower)
 set Tx power level
virtual void getPermittedTxPowerValues (const int8_t **, size_t *)
 get permitted Tx power values
virtual AdvertisingPolicyMode_t getAdvertisingPolicyMode (void) const
 Get the current advertising policy filter mode.
virtual ScanningPolicyMode_t getScanningPolicyMode (void) const
 Get the current scanning policy filter mode.
virtual ble_error_t reset (void)
 Clear BlueNRGGap's state.

Detailed Description

BlueNRG BLE_API GAP Adaptation.


Function Documentation

ble_error_t getAddress ( BLEProtocol::AddressType_t *  typeP,
BLEProtocol::AddressBytes_t  address 
) [virtual, inherited]

Returns the address of the device if set.

Returns:
Pointer to the address if Address is set else NULL

EXAMPLE

Definition at line 624 of file BlueNRGGap.cpp.

Gap::AdvertisingPolicyMode_t getAdvertisingPolicyMode ( void   ) const [virtual, inherited]

Get the current advertising policy filter mode.

Returns:
The advertising policy filter mode.

Definition at line 1394 of file BlueNRGGap.cpp.

ble_error_t getAppearance ( GapAdvertisingData::Appearance *  appearanceP ) [virtual, inherited]

Gets the Device Appearance Characteristic.

Parameters:
[in]appearancepointer to device appearance value
Returns:
ble_error_t
Return values:
BLE_ERROR_NONEEverything executed properly

EXAMPLE

Definition at line 983 of file BlueNRGGap.cpp.

uint16_t getConnectionHandle ( void   ) [inherited]

Gets the 16-bit connection handle.

Parameters:
[in]void
Returns:
uint16_t Connection Handle of the Gap Instance

Definition at line 521 of file BlueNRGGap.cpp.

ble_error_t getDeviceName ( uint8_t *  deviceName,
unsigned *  lengthP 
) [virtual, inherited]

Gets the Device Name Characteristic.

Parameters:
[in]deviceNamepointer to device name
[in]lengthPpointer to device name length
Returns:
ble_error_t
Return values:
BLE_ERROR_NONEEverything executed properly

EXAMPLE

Definition at line 900 of file BlueNRGGap.cpp.

bool getIsSetAddress (  ) [inherited]

Returns boolean if the address of the device has been set or not.

Returns:
bool

EXAMPLE

Definition at line 606 of file BlueNRGGap.cpp.

void getPermittedTxPowerValues ( const int8_t **  valueArrayPP,
size_t *  countP 
) [virtual, inherited]

get permitted Tx power values

Parameters:
[in]valuespointer to pointer to permitted power values
[in]numnumber of values

Definition at line 1198 of file BlueNRGGap.cpp.

ble_error_t getPreferredConnectionParams ( ConnectionParams_t *  params ) [virtual, inherited]

obtains preferred connection params

Returns:
ble_error_t

EXAMPLE

Definition at line 670 of file BlueNRGGap.cpp.

Gap::ScanningPolicyMode_t getScanningPolicyMode ( void   ) const [virtual, inherited]

Get the current scanning policy filter mode.

Returns:
The scanning policy filter mode.

Definition at line 1407 of file BlueNRGGap.cpp.

ble_error_t reset ( void   ) [virtual, inherited]

Clear BlueNRGGap's state.

Returns:
ble_error_t
Return values:
BLE_ERROR_NONEEverything executed properly

Definition at line 1422 of file BlueNRGGap.cpp.

ble_error_t setAdvertisingData ( const GapAdvertisingData &  advData,
const GapAdvertisingData &  scanResponse 
) [virtual, inherited]

Sets the advertising parameters and payload for the device. Note: Some data types give error when their adv data is updated using aci_gap_update_adv_data() API.

[in] advData The primary advertising data payload [in] scanResponse The optional Scan Response payload if the advertising type is set to GapAdvertisingParams::ADV_SCANNABLE_UNDIRECTED in GapAdveritinngParams

Returns:
ble_error_t
Return values:
BLE_ERROR_NONEEverything executed properly
BLE_ERROR_BUFFER_OVERFLOWThe proposed action would cause a buffer overflow. All advertising payloads must be <= 31 bytes, for example.
BLE_ERROR_NOT_IMPLEMENTEDA feature was requested that is not yet supported in the nRF51 firmware or hardware.
BLE_ERROR_PARAM_OUT_OF_RANGEOne of the proposed values is outside the valid range.

EXAMPLE

< TX Power Level (in dBm)

Definition at line 97 of file BlueNRGGap.cpp.

ble_error_t setAppearance ( GapAdvertisingData::Appearance  appearance ) [virtual, inherited]

Sets the Device Appearance Characteristic.

Parameters:
[in]appearancedevice appearance
Returns:
ble_error_t
Return values:
BLE_ERROR_NONEEverything executed properly

EXAMPLE

Definition at line 935 of file BlueNRGGap.cpp.

void setConnectionHandle ( uint16_t  conn_handle ) [inherited]

Sets the 16-bit connection handle.

Parameters:
[in]conn_handleConnection Handle which is set in the Gap Instance
Returns:
void

Definition at line 506 of file BlueNRGGap.cpp.

ble_error_t setDeviceName ( const uint8_t *  deviceName ) [virtual, inherited]

Sets the Device Name Characteristic.

Parameters:
[in]deviceNamepointer to device name to be set
Returns:
ble_error_t
Return values:
BLE_ERROR_NONEEverything executed properly

EXAMPLE

Definition at line 846 of file BlueNRGGap.cpp.

ble_error_t setPreferredConnectionParams ( const ConnectionParams_t *  params ) [virtual, inherited]

sets preferred connection params

Returns:
ble_error_t

EXAMPLE

Definition at line 719 of file BlueNRGGap.cpp.

ble_error_t setTxPower ( int8_t  txPower ) [virtual, inherited]

set Tx power level

Parameters:
[in]txPowerTransmission Power level
Returns:
ble_error_t

Definition at line 1170 of file BlueNRGGap.cpp.

ble_error_t startAdvertising ( const GapAdvertisingParams &  params ) [virtual, inherited]

Starts the BLE HW, initialising any services that were added before this function was called.

Parameters:
[in]paramsBasic advertising details, including the advertising delay, timeout and how the device should be advertised
Note:
All services must be added before calling this function!
Returns:
ble_error_t
Return values:
BLE_ERROR_NONEEverything executed properly

EXAMPLE

Definition at line 255 of file BlueNRGGap.cpp.

ble_error_t stopAdvertising ( void   ) [virtual, inherited]

Stops the BLE HW and disconnects from any devices.

Returns:
ble_error_t
Return values:
BLE_ERROR_NONEEverything executed properly

EXAMPLE

Definition at line 414 of file BlueNRGGap.cpp.

ble_error_t updateConnectionParams ( Handle_t  handle,
const ConnectionParams_t *  params 
) [virtual, inherited]

updates preferred connection params

Returns:
ble_error_t

EXAMPLE

Definition at line 791 of file BlueNRGGap.cpp.