Exported Functions

group Mesh_Bearer_Exported_Functions

Functions

void bearer_other_reg(pf_bearer_other_send_t send)

Register the send API for other bearers.

This function registers a custom send API to extend the mesh network through other bearers.

Parameters:

send[in] Function pointer to the send API.

void bearer_other_receive(bearer_pkt_type_t pkt_type, uint8_t *pbuffer, uint16_t len)

Receive data from another bearer.

This function is used to receive data packets from different types of bearers within the mesh network.

Parameters:
  • pkt_type[in] Type of the packet received.

  • pbuffer[in] Pointer to the packet data buffer.

  • len[in] Length of the packet data buffer.

void bearer_loopback_receive(uint8_t *pbuffer, uint16_t len)

Receive data from the loopback bearer.

Parameters:
  • pbuffer[in] Pointer to the packet data buffer.

  • len[in] Length of the packet data buffer.

void bearer_adv_receive(gap_sched_adv_report_type_t adv_report_type, uint8_t bt_addr[6], uint8_t addr_type, int8_t rssi, uint8_t *pbuffer, uint16_t len)

Receive data from the advertising bearer.

This function is intended for processing received advertising packets.

Parameters:
  • adv_report_type[in] Type of the advertising report.

  • bt_addr[in] Bluetooth address received in the report.

  • addr_type[in] Type of the Bluetooth address.

  • rssi[in] RSSI value associated with the report.

  • pbuffer[in] Pointer to the packet data buffer.

  • len[in] Length of the packet data buffer.

bool bearer_adv_get(void)

Get the state of the advertising bearer.

By default, the advertising bearer is turned on after initialization in mesh_init.

Return values:
  • true – The advertising bearer is on.

  • false – The advertising bearer is off. If off, call bearer_adv_set(true) to turn it back on.

Returns:

State of the advertising bearer.

void bearer_adv_set(bool on_off)

Open or close the advertising bearer.

Parameters:

on_off[in] Boolean value to turn on (true) or off (false) the advertising bearer. When set to true, the advertising bearer is enabled. When set to false, it is disabled.

bool bearer_support_check(bearer_field_t bearer)

Check if a bearer type is supported.

This function verifies the support of a given bearer type within the system.

Parameters:

bearer[in] Bearer field to check.

Return values:
  • true – Bearer type is supported.

  • false – Bearer type is not supported; usually, no supported hardware or configuration is available.

Returns:

Whether the bearer type is supported.

void bearer_send(bearer_pkt_type_t pkt_type, uint8_t *pbuffer, uint16_t data_len)

Send data to the bearer layer.

This API sends data packets to various bearer types for transmission within the mesh network.

Parameters:
  • pkt_type[in] Type of the packet to be sent.

  • pbuffer[in] Pointer to the packet data buffer.

  • data_len[in] Length of the packet to be sent.

void bearer_send_mesh_msg(bearer_mesh_pkt_type_t pkt_type, mesh_msg_p pmesh_msg)

Send a mesh message to the bearer layer.

This function allows transmission of mesh-specific messages through the bearer layer.

Parameters:
  • pkt_type[in] Type of mesh packet.

  • pmesh_msg[in] Pointer to the mesh message data structure.

void bearer_init(void)

Initialize the bearer.

This function is responsible for the initial setup and configuration of the bearer layer within the system.