nRF5 SDK for Mesh v5.0.0
Macros | Functions
Mesh application advertisement interface

This interface is required to support GATT proxy and PB-GATT. More...

Macros

#define MESH_SOFTDEVICE_CONN_CFG_TAG   (1)
 Tag used to set up Mesh GATT parameters. More...
 
#define MESH_ADV_INTERVAL_DEFAULT   (MSEC_TO_UNITS(200, UNIT_0_625_MS))
 Default advertisement interval used by the mesh stack.
 
#define MESH_ADV_TIMEOUT_INFINITE   (BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED)
 Advertise indefinitely. More...
 

Functions

void mesh_adv_data_set (uint16_t service_uuid, const uint8_t *p_service_data, uint8_t length)
 Sets the given service UUID and data in the advertisement data. More...
 
void mesh_adv_params_set (uint32_t timeout_ms, uint32_t interval_units)
 Sets the advertisement parameters (timeout and interval). More...
 
void mesh_adv_start (void)
 Starts advertising connectable advertisements. More...
 
void mesh_adv_stop (void)
 Stops the connectable advertisements.
 

Detailed Description

This interface is required to support GATT proxy and PB-GATT.

The implementation of the interface is left to the user in order to give the application as much flexibility as possible. The mesh stack handles starting and stopping of the advertisements and the required UUIDs and service data as defined by Bluetooth Mesh Profile Specification (MshPRFv1.0.1).

Note
A sample implementation of this interface can be found in examples/common/src/mesh_adv.c. No changes are needed unless additional UUIDs or service data is desired.

Macro Definition Documentation

◆ MESH_SOFTDEVICE_CONN_CFG_TAG

#define MESH_SOFTDEVICE_CONN_CFG_TAG   (1)

Tag used to set up Mesh GATT parameters.

Definition at line 62 of file mesh_adv.h.

◆ MESH_ADV_TIMEOUT_INFINITE

#define MESH_ADV_TIMEOUT_INFINITE   (BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED)

Advertise indefinitely.

Definition at line 69 of file mesh_adv.h.

Function Documentation

◆ mesh_adv_data_set()

void mesh_adv_data_set ( uint16_t  service_uuid,
const uint8_t *  p_service_data,
uint8_t  length 
)

Sets the given service UUID and data in the advertisement data.

Parameters
[in]service_uuidA 16-bit Bluetooth SIG assigned UUID.
[in]p_service_dataPointer to variable length service data associated with the UUID.
[in]lengthLength of the service data.

◆ mesh_adv_params_set()

void mesh_adv_params_set ( uint32_t  timeout_ms,
uint32_t  interval_units 
)

Sets the advertisement parameters (timeout and interval).

Parameters
[in]timeout_msAdvertisement timeout (in milliseconds).
[in]interval_unitsAdvertisement interval (in 0.625 ms units).

◆ mesh_adv_start()

void mesh_adv_start ( void  )

Starts advertising connectable advertisements.

Note
This call will assert if the advertisement data has not been set.

Documentation feedback | Developer Zone | Subscribe | Updated