RA Flexible Software Package Documentation
Release v5.6.0
|
|
Functions | |
fsp_err_t | RM_BLE_MESH_Open (rm_ble_mesh_ctrl_t *const p_ctrl, rm_ble_mesh_cfg_t const *const p_cfg) |
fsp_err_t | RM_BLE_MESH_Close (rm_ble_mesh_ctrl_t *const p_ctrl) |
fsp_err_t | RM_BLE_MESH_StartTransitionTimer (rm_ble_mesh_ctrl_t *const p_ctrl, rm_ble_mesh_access_state_transition_t const *const p_transition, uint16_t *const p_transition_time_handle) |
fsp_err_t | RM_BLE_MESH_StopTransitionTimer (rm_ble_mesh_ctrl_t *const p_ctrl, uint16_t transition_time_handle) |
fsp_err_t | RM_BLE_MESH_GetRemainingTransitionTime (rm_ble_mesh_ctrl_t *const p_ctrl, uint16_t transition_time_handle, uint8_t *const p_remaining_transition_time) |
fsp_err_t | RM_BLE_MESH_GetRemainingTransitionTimeWithOffset (rm_ble_mesh_ctrl_t *const p_ctrl, uint16_t transition_time_handle, uint32_t offset_in_ms, uint8_t *const p_remaining_transition_time) |
fsp_err_t | RM_BLE_MESH_ConvertTransitionTimeFromMs (rm_ble_mesh_ctrl_t *const p_ctrl, uint32_t transition_time_in_ms, uint8_t *const p_transition_time) |
fsp_err_t | RM_BLE_MESH_ConvertTransitionTimeToMs (rm_ble_mesh_ctrl_t *const p_ctrl, uint8_t transition_time, uint32_t *const p_transition_time_in_ms) |
Bluetooth Mesh defines a managed-flood-based mesh network. Any device in the network can send a message at any time as long as there is a sufficient density of devices that are listening and relaying messages. See sample application document and start up guide for information on how to create a BLE MESH application.
The BLE Mesh middleware has the following features:
The BLE Mesh Network module supports the following devices.
Configuration | Options | Default | Description |
---|---|---|---|
Parameter Checking |
| Default (BSP) | Specify whether to include code for API parameter checking. Valid settings include. |
Configuration | Options | Default | Description |
---|---|---|---|
General | |||
Name | Name Must Be a Valid C Symbol | g_rm_ble_mesh0 | Module name. |
Channel Number | Invalid Channel Number | 0 | Select channel corresponding to the channel number of the hardware. |
Bearer | |||
Network Interface Number | Invalid Network Interface Number | 2 | Network interfaces number. |
Provisioning Interface Number | Invalid Provisioning Interface Number | 2 | Provisioning interfaces number. |
Provisioning | |||
Unprovisioned Device Beacon Timeout in Milliseconds | Invalid Unprovisioned Device Beacon Timeout in Milliseconds | 200 | Unprovisioned device beacon timeout in milliseconds. |
Network | |||
Network Cache Size | Invalid Network Cache Size | 10 | Network cache size. |
Network Sequence Number Cache Size | Invalid Network Sequence Number Cache Size | 32 | Network sequence number cache size. |
Maximum Number of Subnet | Invalid Maximum Number of Subnets | 4 | Maximum number of subnets |
Maximum Number of Device Key | Invalid Maximum Number of Device Keys | 4 | Maximum number of device keys. |
Proxy Filter List Size | Invalid Proxy Filter List Size | 2 | Maximum number of addresses present in each proxy filter list. |
Network Sequence Number Block Size | Invalid Network Sequence Number Block Size | 2048 | The distance between the network sequence numbers, for every persistent storage write. |
Network Transmit Count for Network Packets | Invalid Network Transmit Count for Network Packets | 1 | Network transmit count for network packets. |
Network Interval Steps for Network Packets | Invalid Network Interval Steps for Network Packets | 4 | Network interval steps for network packets. |
Network Transmit Count for Relayed Packets | Invalid Network Transmit Count for Relayed Packets | 0 | Network transmit count for relayed packets. |
Network Interval Steps for Relayed Packets | Invalid Network Interval Steps for Relayed Packets | 9 | Network interval steps for relayed packets. |
Proxy ADV Network ID Timeout for Each Subnet in Milliseconds. | Invalid Proxy ADV Network ID Timeout | 100 | Proxy ADV network ID timeout for each subnet in milliseconds. |
Proxy ADV Node Identity Timeout for Each Subnet in Milliseconds | Invalid Proxy ADV Node Identity Timeout for Each Subnet in Milliseconds | 300 | Proxy ADV node identity timeout for each subnet in milliseconds. |
Proxy ADV Node Identity Overall Time Period in Seconds | Invalid Proxy ADV Node Identity Overall Time Period in Seconds | 60 | Proxy ADV node identity overall time period in seconds. |
Maximum Number of Queued Messages for Transmission | Invalid Maximum Number of Queued Messages for Transmission | 64 | Maximum number of queued messages for transmission. |
Transport | |||
Maximum Number of LPN | Invalid Maximum Number of LPNs | 1 | Maximum number of LPNs. |
Replay Protection Cache Size | Invalid Replay Protection Cache Size | 10 | Replay protection cache size. |
Reassembled Cache Size | Invalid Reassembled Cache Size | 8 | Reassembled cach size. |
Friend Poll Retry Count | Invalid Friend Poll Retry Count | 10 | Friend poll retry count. |
Maximum Number of Segmentation and Reassembly Context | Invalid Maximum Number of Segmentation and Reassembly Context | 8 | Number of segmentation and reassembly contexts. |
Lower Transport Segment Transmission Timeout in Milliseconds | Invalid Lower Transport Segment Transmission Timeout in Milliseconds | 300 | Lower transport segment transmission timeout in milliseconds. |
Lower Transport Segment Re-Transmission Count | Invalid Lower Transport Segment Re-Transmission Count | 2 | Lower transport segment re-transmission count. |
Lower Transport Acknowledgement Timeout in Milliseconds | Invalid Lower Transport Acknowledgement Timeout in Milliseconds | 200 | Lower transport acknowledgement timeout in milliseconds. |
Lower Transport Incomplete Timeout in Seconds | Invalid Lower Transport Incomplete Timeout in Seconds | 20 | Lower transport incomplete timeout in seconds. |
Friendship Receive Window | Invalid Friendship Receive Window | 100 | Friendship receive window. |
Maximum Number of Friend Message Queue | Invalid Maximum Number of Friend Messages Queue | 15 | Maximum number of messages that the friend is capabale to queue for a single Low Power Node. |
Maximum Number of Friend Subscription List | Invalid Maximum Number of Friend Subscription List | 8 | Maximum number of subscription addresses that the friend is capable to store for a single Low Power Node. |
Friend Clear Confirmation Timeout in Milliseconds | Invalid Friend Clear Confirmation Timeout in Milliseconds | 1000 | Friend clear confirmation timeout in milliseconds. |
Friend Clear Retry Count | Invalid Friend Clear Retry Count | 5 | Friend clear retry count. |
Friendship Retry Timeout in Milliseconds | Invalid Friendship Retry Timeout in Milliseconds | 1200 | Friendship retry timeout in milliseconds. |
Access | |||
Maximum Number of Element | Invalid Maximum Number of Element | 4 | Maximum number of elements. |
Maximum Number of Model | Invalid Maximum Number of Model | 60 | Maximum number of models. |
Maximum Number of Application | Invalid Maximum Number of Application | 8 | Maximum number of applications (keys) the device can store information about. |
Maximum Number of Virtual Address | Invalid Maximum Number of Virtual Address | 8 | Maximum number of virtual addresses the device can store information about. |
Maximum Number of Non-Virtual Address | Invalid Maximum Number of Non-Virtual Address | 8 | Maximum number of non-virtual addresses the device can store information about. |
Maximum Number of Transition Timers | Invalid Maximum Number of Transition Timers | 5 | Maximum number of transition timers. |
Maximum Number of Periodic Step Timers | Invalid Maximum Number of Periodic Step Timers | 5 | Maximum number of periodic step timers. |
Foundation | |||
Config Server Secure Network Beacon Interval | Invalid Config Server Secure Network Beacon Interval | 10 | Config server secure network beacon interval. |
Maximum Number of Health Server Instance | Invalid Maximum Number of Health Server Instance | 2 | Maximum number of health server instances. |
Model | |||
Maximum Number of Light Lightness Controller Server Instance | Invalid Maximum Number of Light Lightness Controller Server Instance | 1 | Maximum number of light lightness controller server instances. |
ID | |||
Company ID | Invalid Company ID | 0x0036 | Company ID. |
Product ID | Invalid Product ID | 0x0001 | Product ID. |
Vendor ID | Invalid Vendor ID | 0x0100 | Vendor ID. |
Platform | |||
Platform > Storage | |||
Block Number | Invalid Block Number | 5 | Block number. |
Platform > Memory Pool | |||
Memory Pool Size | Invalid Memory Pool Size | 0x4000 | Memory pool size. |
Platform > Logging | |||
Packet Bitfield |
| Specifies if this is included in the packet_bitfield mask. | |
Module Info Bitfield |
| Specifies if this is included in the module information bitfield mask. | |
Generic Log Bitfield |
| Specifies if this is included in the generic log bitfield mask. | |
function | Name Must Be a Valid C Symbol | NULL |
This module does not use I/O pins.
Purpose of each layer is,
Model is a standardized typical functionality so that nodes perform operations in accordance with application scenario.
Foundation Models are models to configure and manage operations of elements.
The access layer defines how higher layer applications can use the upper transport layer.
The upper transport layer encrypts, decrypts, and authenticates application data and is designed to provide confidentiality of access messages.
The lower transport layer defines how upper transport layer messages are segmented and reassembled into multiple Lower Transport PDUs to deliver large upper transport layer messages to other nodes.
The network layer defines how transport messages are addressed towards one or more elements.
The bearer layer defines how network messages are transported between nodes.
The device not joined in the mesh network is an Unprovisioned Device and the device joined in the mesh network is called a Node.
To communicate with other nodes by using Models, each node needs Configuration. By Configuration process, information required for Model operation such as Application Keys, Publish Address, Subscription Address is configured. Following shows a typical lifecycle of a node.
Newly introduced device is provisioned by Provisioner and joins a network. Furthermore, this device is configured by Configuration Client and becomes to be able to communicate with other nodes with Mesh Model. Generally, Configuration Client is a smart phone or other mobile computing device. Configuration Client removes a node from a network by sending Config Node Reset message. Besides, Configuration Client updates encryption keys used in the network, and the removed node becomes unable to communicate with other nodes.
This is a basic example of minimal use of the BLE_MESH in an application.
Mesh library includes crackle. The license and copyright of crackle are as follows.
Data Structures | |
struct | rm_ble_mesh_instance_ctrl_t |
struct rm_ble_mesh_instance_ctrl_t |
RM_BLE_MESH_BEARER private control block. DO NOT MODIFY. Initialization occurs when RM_BLE_MESH_BEARER_Open() is called.
fsp_err_t RM_BLE_MESH_Open | ( | rm_ble_mesh_ctrl_t *const | p_ctrl, |
rm_ble_mesh_cfg_t const *const | p_cfg | ||
) |
Open ble mesh middleware. API to initialize Mesh Stack. This is the first API that the application should call before any other API. This function initializes all the internal stack modules and data structures.
Implements rm_ble_mesh_api_t::open.
Example:
FSP_SUCCESS | Module opened successfully. |
FSP_ERR_ASSERTION | Pointer to control block or configuration structure is NULL. |
FSP_ERR_ALREADY_OPEN | Module is already open. |
fsp_err_t RM_BLE_MESH_Close | ( | rm_ble_mesh_ctrl_t *const | p_ctrl | ) |
Close ble mesh middleware. API to turn off Bluetooth Hardware. This API should be called after RM_BLE_MESH_Open.
Implements rm_ble_mesh_api_t::close.
Example:
FSP_SUCCESS | Module successfully closed. |
FSP_ERR_ASSERTION | The parameter p_ctrl is NULL. |
FSP_ERR_NOT_OPEN | Module is not open. |
fsp_err_t RM_BLE_MESH_StartTransitionTimer | ( | rm_ble_mesh_ctrl_t *const | p_ctrl, |
rm_ble_mesh_access_state_transition_t const *const | p_transition, | ||
uint16_t *const | p_transition_time_handle | ||
) |
To start transition timer. API to start a transition timer.
Implements rm_ble_mesh_api_t::startTransitionTimer.
Example:
FSP_SUCCESS | Operation succeeded. |
FSP_ERR_ASSERTION | The parameter p_ctrl is NULL. |
FSP_ERR_INVALID_POINTER | The parameter p_transition is NULL. |
FSP_ERR_NOT_OPEN | Module is not open. |
FSP_ERR_OUT_OF_MEMORY | Memory allocation is failed. |
FSP_ERR_OVERFLOW | TX queue is full. |
fsp_err_t RM_BLE_MESH_StopTransitionTimer | ( | rm_ble_mesh_ctrl_t *const | p_ctrl, |
uint16_t | transition_time_handle | ||
) |
To stop transition timer. API to stop a transition timer.
Implements rm_ble_mesh_api_t::stopTransitionTimer.
Example:
FSP_SUCCESS | Operation succeeded. |
FSP_ERR_ASSERTION | The parameter p_ctrl is NULL. |
FSP_ERR_NOT_OPEN | Module is not open. |
fsp_err_t RM_BLE_MESH_GetRemainingTransitionTime | ( | rm_ble_mesh_ctrl_t *const | p_ctrl, |
uint16_t | transition_time_handle, | ||
uint8_t *const | p_remaining_transition_time | ||
) |
To get remaining Transition Time. API to get remaining Transition Time.
Implements rm_ble_mesh_api_t::getRemainingTransitionTime.
Example:
FSP_SUCCESS | Operation succeeded. |
FSP_ERR_ASSERTION | The parameter p_ctrl is NULL. |
FSP_ERR_INVALID_POINTER | The parameter p_remaining_transition_time is NULL. |
FSP_ERR_NOT_OPEN | Module is not open. |
FSP_ERR_UNDERFLOW | TX queue is empty. |
FSP_ERR_NOT_FOUND | Input parameter is not found. |
fsp_err_t RM_BLE_MESH_GetRemainingTransitionTimeWithOffset | ( | rm_ble_mesh_ctrl_t *const | p_ctrl, |
uint16_t | transition_time_handle, | ||
uint32_t | offset_in_ms, | ||
uint8_t *const | p_remaining_transition_time | ||
) |
To get remaining Transition Time, with offset. API to get remaining Transition Time with offset in ms.
Implements rm_ble_mesh_api_t::getRemainingTransitionTimeWithOffset.
Example:
FSP_SUCCESS | Operation succeeded. |
FSP_ERR_ASSERTION | The parameter p_ctrl is NULL. |
FSP_ERR_INVALID_POINTER | The parameter p_remaining_transition_time is NULL. |
FSP_ERR_NOT_OPEN | Module is not open. |
FSP_ERR_UNDERFLOW | TX queue is empty. |
FSP_ERR_NOT_FOUND | Input parameter is not found. |
fsp_err_t RM_BLE_MESH_ConvertTransitionTimeFromMs | ( | rm_ble_mesh_ctrl_t *const | p_ctrl, |
uint32_t | transition_time_in_ms, | ||
uint8_t *const | p_transition_time | ||
) |
To convert transition time from milisecond. API to convert transition timer in milisecond to Generic Default Transition Time state format.
Implements rm_ble_mesh_api_t::convertTransitionTimeFromMs.
Example:
FSP_SUCCESS | Operation succeeded. |
FSP_ERR_ASSERTION | The parameter p_ctrl is NULL. |
FSP_ERR_INVALID_POINTER | The parameter p_transition_time is NULL. |
FSP_ERR_NOT_OPEN | Module is not open. |
fsp_err_t RM_BLE_MESH_ConvertTransitionTimeToMs | ( | rm_ble_mesh_ctrl_t *const | p_ctrl, |
uint8_t | transition_time, | ||
uint32_t *const | p_transition_time_in_ms | ||
) |
To convert transition time to milisecond. API to convert Generic Default Transition Time state format to required transition time value in miliseconds.
Implements rm_ble_mesh_api_t::convertTransitionTimeToMs.
Example:
FSP_SUCCESS | Operation succeeded. |
FSP_ERR_ASSERTION | The parameter p_ctrl is NULL. |
FSP_ERR_INVALID_POINTER | The parameter p_transition_time_in_ms is NULL. |
FSP_ERR_NOT_OPEN | Module is not open. |