RA Flexible Software Package Documentation  Release v5.3.0

 
BLE Mesh Bearer Interface

Detailed Description

Interface for BLE Mesh Bearer functions.

Summary

The BLE Mesh Bearer interface for the BLE Mesh Bearer (BLE MESH BEARER) peripheral provides BLE Mesh Bearer functionality.

Data Structures

struct  rm_ble_mesh_bearer_info_t
 
struct  rm_ble_mesh_bearer_beacon_info_t
 
struct  rm_ble_mesh_bearer_ch_info_t
 
struct  rm_ble_mesh_bearer_ntf_callback_args_t
 
struct  rm_ble_mesh_bearer_beacon_callback_args_t
 
struct  rm_ble_mesh_bearer_cfg_t
 
struct  rm_ble_mesh_bearer_api_t
 
struct  rm_ble_mesh_bearer_instance_t
 

Macros

#define RM_BLE_MESH_BEARER_HANDLE_INVALID
 
#define RM_BLE_MESH_BEARER_MAX_PDU_SIZE
 
#define RM_BLE_MESH_BEARER_SUBTYPE_GATT_T_MASK_BIT_OFFSET
 

Typedefs

typedef uint8_t rm_ble_mesh_bearer_handle_t
 
typedef void rm_ble_mesh_bearer_ctrl_t
 

Enumerations

enum  rm_ble_mesh_bearer_interface_event_t
 
enum  rm_ble_mesh_bearer_beacon_operation_t
 
enum  rm_ble_mesh_bearer_beacon_action_t
 
enum  rm_ble_mesh_bearer_role_t
 
enum  rm_ble_mesh_bearer_operation_mode_t
 
enum  rm_ble_mesh_bearer_ntf_callback_result_t
 
enum  rm_ble_mesh_bearer_type_t
 
enum  rm_ble_mesh_bearer_beacon_type_t
 

Data Structure Documentation

◆ rm_ble_mesh_bearer_info_t

struct rm_ble_mesh_bearer_info_t

Bearer information to register

Data Fields

rm_ble_mesh_buffer_tbinfo
 
fsp_err_t(* bearer_send )(rm_ble_mesh_bearer_handle_t *, uint8_t, void *, uint16_t)
 
void(* bearer_recv )(rm_ble_mesh_bearer_handle_t *, uint8_t *, uint16_t, rm_ble_mesh_buffer_t *info)
 
void(* bearer_sleep )(rm_ble_mesh_bearer_handle_t *)
 
void(* bearer_wakeup )(rm_ble_mesh_bearer_handle_t *, uint8_t mode)
 

Field Documentation

◆ binfo

rm_ble_mesh_buffer_t* rm_ble_mesh_bearer_info_t::binfo

Bearer Information

◆ bearer_send

fsp_err_t(* rm_ble_mesh_bearer_info_t::bearer_send) (rm_ble_mesh_bearer_handle_t *, uint8_t, void *, uint16_t)

Data Send routine

◆ bearer_recv

void(* rm_ble_mesh_bearer_info_t::bearer_recv) (rm_ble_mesh_bearer_handle_t *, uint8_t *, uint16_t, rm_ble_mesh_buffer_t *info)

Data Receive routine

◆ bearer_sleep

void(* rm_ble_mesh_bearer_info_t::bearer_sleep) (rm_ble_mesh_bearer_handle_t *)

Bearer Sleep Interface

◆ bearer_wakeup

void(* rm_ble_mesh_bearer_info_t::bearer_wakeup) (rm_ble_mesh_bearer_handle_t *, uint8_t mode)

Bearer Wakeup Interface

◆ rm_ble_mesh_bearer_beacon_info_t

struct rm_ble_mesh_bearer_beacon_info_t

Bearer Beacon type data structure

Data Fields
uint8_t action

Beacon Action

  • Lower Nibble:

    BRR_OBSERVE BRR_BROADCAST

  • Higher Nibble:

    BRR_ENABLE BRR_DISABLE

uint8_t type

Beacon type

  • Lower Nibble:

    BRR_BCON_PASSIVE - Non Connectable beacon BRR_BCON_ACTIVE - Connectable beacon

  • Higher Nibble (Valid only when Passive)

    BRR_BCON_TYPE_UNPROV_DEVICE BRR_BCON_TYPE_SECURE_NET

uint8_t * bcon_data

Beacon Broadcast Data

uint16_t bcon_datalen

Beacon Broadcast Data length

rm_ble_mesh_buffer_t * uri

URI information in case of Unprovisioned Beacons

◆ rm_ble_mesh_bearer_ch_info_t

struct rm_ble_mesh_bearer_ch_info_t

Bearer GATT Channel information related data structure

Data Fields
uint16_t mtu

Identifies the MTU for the Bearer Channel

uint8_t role

Identifies the role for the Bearer channel

◆ rm_ble_mesh_bearer_ntf_callback_args_t

struct rm_ble_mesh_bearer_ntf_callback_args_t

BEARER Application Asynchronous Notification Callback.

BEARER calls the registered callback to indicate events occurred to the application.

Data Fields
rm_ble_mesh_bearer_handle_t * p_handle Bearer handle identifier.
rm_ble_mesh_bearer_interface_event_t event Bearer interface event.
uint8_t * p_data Data associated with the event if any or NULL.
uint16_t data_length Size of the event data. 0 if event data is NULL.

◆ rm_ble_mesh_bearer_beacon_callback_args_t

struct rm_ble_mesh_bearer_beacon_callback_args_t

BEARER Application Asynchronous Notification Callback for Beacons.

Application registers callback for beacon notification with bearer.

Data Fields
uint8_t * p_data Data associated with the event if any or NULL.
uint16_t data_length Size of the event data. 0 if event data is NULL.

◆ rm_ble_mesh_bearer_cfg_t

struct rm_ble_mesh_bearer_cfg_t

BLE MESH BEARER configuration parameters.

Data Fields
uint32_t channel Select a channel corresponding to the channel number of the hardware.

the parameters for initialization.

rm_ble_mesh_instance_t const * p_mesh_instance Instance structure of BLE Mesh.
void const * p_context Placeholder for user data. Passed to the user callback in ble_abs_callback_args_t.
void const * p_extend Placeholder for user extension.

◆ rm_ble_mesh_bearer_api_t

struct rm_ble_mesh_bearer_api_t

BLE MESH BEARER functions implemented at the HAL layer will follow this API.

Data Fields

fsp_err_t(* open )(rm_ble_mesh_bearer_ctrl_t *const p_ctrl, rm_ble_mesh_bearer_cfg_t const *const p_cfg)
 
fsp_err_t(* close )(rm_ble_mesh_bearer_ctrl_t *const p_ctrl)
 
fsp_err_t(* registerInterface )(rm_ble_mesh_bearer_ctrl_t *const p_ctrl, rm_ble_mesh_bearer_type_t brr_type, rm_ble_mesh_bearer_ntf_callback_result_t(*p_callback)(rm_ble_mesh_bearer_ntf_callback_args_t *p_args))
 
fsp_err_t(* registerBeaconHandler )(rm_ble_mesh_bearer_ctrl_t *const p_ctrl, rm_ble_mesh_bearer_beacon_type_t bcon_type, void(*p_handler)(rm_ble_mesh_bearer_beacon_callback_args_t *p_args))
 
fsp_err_t(* addBearer )(rm_ble_mesh_bearer_ctrl_t *const p_ctrl, rm_ble_mesh_bearer_type_t brr_type, rm_ble_mesh_bearer_info_t const *const p_brr_info, rm_ble_mesh_bearer_handle_t *const p_brr_handle)
 
fsp_err_t(* removeBearer )(rm_ble_mesh_bearer_ctrl_t *const p_ctrl, rm_ble_mesh_bearer_type_t brr_type, rm_ble_mesh_bearer_handle_t const *const p_brr_handle)
 
fsp_err_t(* observeBeacon )(rm_ble_mesh_bearer_ctrl_t *const p_ctrl, uint8_t bcon_type, uint8_t enable)
 
fsp_err_t(* bcastUnprovisionedBeacon )(rm_ble_mesh_bearer_ctrl_t *const p_ctrl, uint8_t type, uint8_t const *const p_dev_uuid, uint16_t oob_info, rm_ble_mesh_buffer_t const *const p_uri)
 
fsp_err_t(* broadcastBeacon )(rm_ble_mesh_bearer_ctrl_t *const p_ctrl, uint8_t type, uint8_t const *const p_packet, uint16_t length)
 
fsp_err_t(* startProxyAdv )(rm_ble_mesh_bearer_ctrl_t *const p_ctrl, uint8_t type, uint8_t const *const p_data, uint16_t datalen)
 
fsp_err_t(* sendPdu )(rm_ble_mesh_bearer_ctrl_t *const p_ctrl, rm_ble_mesh_bearer_handle_t const *const p_brr_handle, rm_ble_mesh_bearer_type_t brr_type, rm_ble_mesh_buffer_t const *const p_buffer)
 
fsp_err_t(* getPacketRssi )(rm_ble_mesh_bearer_ctrl_t *const p_ctrl, uint8_t *p_rssi_value)
 
fsp_err_t(* sleep )(rm_ble_mesh_bearer_ctrl_t *const p_ctrl)
 
fsp_err_t(* wakeup )(rm_ble_mesh_bearer_ctrl_t *const p_ctrl, uint8_t mode)
 

Field Documentation

◆ open

fsp_err_t(* rm_ble_mesh_bearer_api_t::open) (rm_ble_mesh_bearer_ctrl_t *const p_ctrl, rm_ble_mesh_bearer_cfg_t const *const p_cfg)

Open bearer middleware.

Parameters
[in]p_ctrlPointer to control structure.
[in]p_cfgPointer to pin configuration structure.

◆ close

fsp_err_t(* rm_ble_mesh_bearer_api_t::close) (rm_ble_mesh_bearer_ctrl_t *const p_ctrl)

Close bearer middleware.

Parameters
[in]p_ctrlPointer to control structure.

◆ registerInterface

fsp_err_t(* rm_ble_mesh_bearer_api_t::registerInterface) (rm_ble_mesh_bearer_ctrl_t *const p_ctrl, rm_ble_mesh_bearer_type_t brr_type, rm_ble_mesh_bearer_ntf_callback_result_t(*p_callback)( rm_ble_mesh_bearer_ntf_callback_args_t *p_args))

Register Interface with Bearer Layer

Parameters
[in]p_ctrlPointer to control structure.
[in]brr_typeBearer Type.
[in]p_callbackPointer to details describing application notification callback.

◆ registerBeaconHandler

fsp_err_t(* rm_ble_mesh_bearer_api_t::registerBeaconHandler) (rm_ble_mesh_bearer_ctrl_t *const p_ctrl, rm_ble_mesh_bearer_beacon_type_t bcon_type, void( *p_handler)( rm_ble_mesh_bearer_beacon_callback_args_t *p_args))

Register Beacon Interface with Bearer Layer

Parameters
[in]p_ctrlPointer to control structure.
[in]bcon_typeBeacon type - Unprovisioned Device or Secure Network.
[in]p_handlerPointer to callback handler to be registered for the given beacon type.

◆ addBearer

fsp_err_t(* rm_ble_mesh_bearer_api_t::addBearer) (rm_ble_mesh_bearer_ctrl_t *const p_ctrl, rm_ble_mesh_bearer_type_t brr_type, rm_ble_mesh_bearer_info_t const *const p_brr_info, rm_ble_mesh_bearer_handle_t *const p_brr_handle)

Add a bearer to Bearer Layer

Parameters
[in]p_ctrlPointer to control structure.
[in]brr_typeBearer Type.
[in]p_brr_infoPointer to details describing the Bearer being added.
[out]p_brr_handlePointer to handle to the bearer that is added. Used in data APIs.

◆ removeBearer

fsp_err_t(* rm_ble_mesh_bearer_api_t::removeBearer) (rm_ble_mesh_bearer_ctrl_t *const p_ctrl, rm_ble_mesh_bearer_type_t brr_type, rm_ble_mesh_bearer_handle_t const *const p_brr_handle)

Remove a bearer from Bearer Layer

Parameters
[in]p_ctrlPointer to control structure.
[in]brr_typeBearer Type.
[in]p_brr_handlePointer to handle to the bearer is removed. Used in data APIs.

◆ observeBeacon

fsp_err_t(* rm_ble_mesh_bearer_api_t::observeBeacon) (rm_ble_mesh_bearer_ctrl_t *const p_ctrl, uint8_t bcon_type, uint8_t enable)

Observe ON/OFF for the beacon type

Parameters
[in]p_ctrlPointer to control structure.
[in]bcon_typeType of beacon to observe - Active/Passive.
[in]enableEnable or Disable the observation procedure.

◆ bcastUnprovisionedBeacon

fsp_err_t(* rm_ble_mesh_bearer_api_t::bcastUnprovisionedBeacon) (rm_ble_mesh_bearer_ctrl_t *const p_ctrl, uint8_t type, uint8_t const *const p_dev_uuid, uint16_t oob_info, rm_ble_mesh_buffer_t const *const p_uri)

API to send Unprovisioned Device Beacon

Parameters
[in]p_ctrlPointer to control structure.
[in]typeActive or Passive Broadcast type.
[in]p_dev_uuidPointer to device UUID uniquely identifying this device.
[in]oob_infoOOB Information.
[in]p_uriPointer to optional Parameter. NULL if not present. Points to the length and payload pointer of the URI string to be advertised interleaving with the unprovisioned beacon.

◆ broadcastBeacon

fsp_err_t(* rm_ble_mesh_bearer_api_t::broadcastBeacon) (rm_ble_mesh_bearer_ctrl_t *const p_ctrl, uint8_t type, uint8_t const *const p_packet, uint16_t length)

API to broadcast a beacon

Parameters
[in]p_ctrlPointer to control structure.
[in]typeThe type of beacon.
[in]p_packetPointer to beacon data.
[in]lengthBeacon data length.

◆ startProxyAdv

fsp_err_t(* rm_ble_mesh_bearer_api_t::startProxyAdv) (rm_ble_mesh_bearer_ctrl_t *const p_ctrl, uint8_t type, uint8_t const *const p_data, uint16_t datalen)

API to send Proxy Device ADV

Parameters
[in]p_ctrlPointer to control structure.
[in]typeProxy ADV Type: 0x00 - Network ID 0x01 - Node Identity
[in]p_dataPointer to data to be advertised by Proxy. If the "type" is: 0x00 - Network ID - 8 Bytes of Network ID 0x01 - Node Identity - 8 Bytes Hash, 8 Bytes Random number
[in]datalenLength of the data to be advertised by Proxy. If the "type" is: 0x00 - Network ID - 8 Bytes of Network ID 0x01 - Node Identity - 8 Bytes Hash, 8 Bytes Random number

◆ sendPdu

fsp_err_t(* rm_ble_mesh_bearer_api_t::sendPdu) (rm_ble_mesh_bearer_ctrl_t *const p_ctrl, rm_ble_mesh_bearer_handle_t const *const p_brr_handle, rm_ble_mesh_bearer_type_t brr_type, rm_ble_mesh_buffer_t const *const p_buffer)

Send a bearer PDU

Parameters
[in]p_ctrlPointer to control structure.
[in]p_brr_handlePointer to bearer handle on which PDU is to be sent.
[in]brr_typeBearer Type.
[in]p_bufferPointer to PDU data to be sent.

◆ getPacketRssi

fsp_err_t(* rm_ble_mesh_bearer_api_t::getPacketRssi) (rm_ble_mesh_bearer_ctrl_t *const p_ctrl, uint8_t *p_rssi_value)

Get the RSSI of current received packet being processed.

Parameters
[in]p_ctrlPointer to control structure.
[out]p_rssi_valuePointer to RSSI value.
Note
This applies only when the packet is received over ADV bearer.

◆ sleep

fsp_err_t(* rm_ble_mesh_bearer_api_t::sleep) (rm_ble_mesh_bearer_ctrl_t *const p_ctrl)

Put the bearer to sleep.

Parameters
[in]p_ctrlPointer to control structure.

◆ wakeup

fsp_err_t(* rm_ble_mesh_bearer_api_t::wakeup) (rm_ble_mesh_bearer_ctrl_t *const p_ctrl, uint8_t mode)

Wakeup the bearer.

Parameters
[in]p_ctrlPointer to control structure.
[in]modeIdentifies the mode (BRR_TX/BRR_RX) for which bearer is requested for wakeup.

◆ rm_ble_mesh_bearer_instance_t

struct rm_ble_mesh_bearer_instance_t

This structure encompasses everything that is needed to use an instance of this interface.

Data Fields
rm_ble_mesh_bearer_ctrl_t * p_ctrl Pointer to the control structure for this instance.
rm_ble_mesh_bearer_cfg_t const * p_cfg Pointer to the configuration structure for this instance.
rm_ble_mesh_bearer_api_t const * p_api Pointer to the API structure for this instance.

Macro Definition Documentation

◆ RM_BLE_MESH_BEARER_HANDLE_INVALID

#define RM_BLE_MESH_BEARER_HANDLE_INVALID

Invalid Bearer handle identifier

◆ RM_BLE_MESH_BEARER_MAX_PDU_SIZE

#define RM_BLE_MESH_BEARER_MAX_PDU_SIZE

Maximum PDU size for data received over bearer

◆ RM_BLE_MESH_BEARER_SUBTYPE_GATT_T_MASK_BIT_OFFSET

#define RM_BLE_MESH_BEARER_SUBTYPE_GATT_T_MASK_BIT_OFFSET

GATT Bearer Message Type Masks

Typedef Documentation

◆ rm_ble_mesh_bearer_handle_t

typedef uint8_t rm_ble_mesh_bearer_handle_t

Bearer handle identifier

◆ rm_ble_mesh_bearer_ctrl_t

BLE MESH BEARER control block. Allocate an instance specific control block to pass into the BLE MESH API calls.

Enumeration Type Documentation

◆ rm_ble_mesh_bearer_interface_event_t

Bearer Interface Event

Enumerator
RM_BLE_MESH_BEARER_INTERFACE_EVENT_DOWN 

Bearer Interface Event - Down

RM_BLE_MESH_BEARER_INTERFACE_EVENT_UP 

Bearer Interface Event - Up

RM_BLE_MESH_BEARER_INTERFACE_EVENT_DATA 

Bearer Interface Event - Data

RM_BLE_MESH_BEARER_INTERFACE_EVENT_PROXY_DATA 

Bearer Interface Event - Proxy Data

◆ rm_ble_mesh_bearer_beacon_operation_t

Bearer Beacon Operations

Enumerator
RM_BLE_MESH_BEARER_BEACON_OPERATION_BROADCAST 

Bearer Beacon Operations - Broadcast

RM_BLE_MESH_BEARER_BEACON_OPERATION_OBSERVE 

Bearer Beacon Operations - Observe

◆ rm_ble_mesh_bearer_beacon_action_t

Bearer Beacon Actions

Enumerator
RM_BLE_MESH_BEARER_BEACON_ACTION_DISABLE 

Bearer Beacon Actions - Disable

RM_BLE_MESH_BEARER_BEACON_ACTION_ENABLE 

Bearer Beacon Actions - Enable

◆ rm_ble_mesh_bearer_role_t

Bearer Server Client Roles

Enumerator
RM_BLE_MESH_BEARER_ROLE_CLIENT 

Bearer Client Role

RM_BLE_MESH_BEARER_ROLE_SERVER 

Bearer Server Role

RM_BLE_MESH_BEARER_ROLE_INVALID 

Bearer Role - Invalid

◆ rm_ble_mesh_bearer_operation_mode_t

Bearer Transmit and Receive operation modes

Enumerator
RM_BLE_MESH_BEARER_OPERATION_MODE_TX 

Bearer transmit operation mode

RM_BLE_MESH_BEARER_OPERATION_MODE_RX 

Bearer receive operation mode

◆ rm_ble_mesh_bearer_ntf_callback_result_t

Bearer Transmit and Receive operation modes

Enumerator
RM_BLE_MESH_BEARER_NTF_CALLBACK_RESULT_SUCCESS 

Callback success

RM_BLE_MESH_BEARER_NTF_CALLBACK_RESULT_FAILURE 

Callback failure

◆ rm_ble_mesh_bearer_type_t

Bearer Type definitions

Enumerator
RM_BLE_MESH_BEARER_TYPE_BCON 

Beacon Bearer

RM_BLE_MESH_BEARER_TYPE_ADV 

Advertising Bearer

RM_BLE_MESH_BEARER_TYPE_PB_ADV 

Provisioning Advertising Bearer

RM_BLE_MESH_BEARER_TYPE_GATT 

GATT Bearer

RM_BLE_MESH_BEARER_TYPE_PB_GATT 

Provisioning GATT Bearer

RM_BLE_MESH_BEARER_COUNT 

Number of bearers supported

◆ rm_ble_mesh_bearer_beacon_type_t

Bearer Beacon type definitions

Enumerator
RM_BLE_MESH_BEARER_BEACON_TYPE_UNPROV_DEVICE 

Unprovisioned Device Beacon

RM_BLE_MESH_BEARER_BEACON_TYPE_SECURE_NET 

Secure Network Beacon

RM_BLE_MESH_BEARER_BEACON_TYPE_GATT_UNPROV_DEVICE 

Unprovisioned Device Beacon over GATT bearer

RM_BLE_MESH_BEARER_BEACON_TYPE_PROXY_NETID 

Proxy beacon with Network ID

RM_BLE_MESH_BEARER_BEACON_TYPE_PROXY_NODEID 

Proxy beacon with Node Identity

RM_BLE_MESH_BEARER_BEACON_COUNT 

Number of Beacon types