AIROC™ BTSDK v4.9 - Documentation | ||||
Definitions for interface for mesh application interface library More...
Data Structures | |
struct | wiced_bt_mesh_app_func_table_t |
Macros | |
#define | TRACE_NONE 0 |
#define | TRACE_CRITICAL 1 |
#define | TRACE_ERROR 1 |
#define | TRACE_WARNING 2 |
#define | TRACE_INFO 3 |
#define | TRACE_DEBUG 4 |
#define | CY_MAGIC_RPR_SUPPORTED 0x01 |
#define | CY_MAGIC_SELF_CONFIG_SUPPORTED 0x02 |
#define | CY_MAGIC_RELAY_SUPPORTED 0x04 |
#define | CY_MAGIC_L1 0x10 |
#define | CY_MAGIC_L2 0x20 |
#define | PACKED |
Bits of the wiced_bt_mesh_hci_command_t::flags | |
#define | WICED_BT_MESH_HCI_COMMAND_FLAGS_SEND_SEGMENTED 0x01 |
Bits meaning. More... | |
#define | WICED_BT_MESH_HCI_COMMAND_FLAGS_TAG_USE_DIRECTED 0x02 |
Tag Use Directed. More... | |
#define | WICED_BT_MESH_HCI_COMMAND_FLAGS_TAG_IMMUTABLE_CREDENTIALS 0x04 |
Tag Immutable Credentials. | |
Typedefs | |
struct { | |
uint16_t src | |
uint16_t dst | |
uint16_t app_key_idx | |
uint8_t element_idx | |
int8_t rssi | |
uint8_t ttl | |
uint16_t company_id | |
uint16_t opcode | |
uint8_t data [1] | |
} | wiced_bt_mesh_hci_event_t |
struct { | |
uint16_t dst | |
uint16_t app_key_idx | |
uint8_t element_idx | |
uint8_t reply | |
uint8_t flags | |
uint8_t ttl | |
uint8_t retrans_cnt | |
uint8_t retrans_time | |
uint8_t reply_timeout | |
uint8_t data [1] | |
} | wiced_bt_mesh_hci_command_t |
typedef void(* | wiced_bt_mesh_app_init_t )(wiced_bool_t is_provisioned) |
A callback function to perform application startup initialization. More... | |
typedef void(* | wiced_bt_mesh_app_hardware_init_t )(void) |
A callback function to perform application hardware initialization. More... | |
typedef void(* | wiced_bt_mesh_app_gatt_conn_status_t )(wiced_bt_gatt_connection_status_t *p_status) |
typedef void(* | wiced_bt_mesh_app_attention_t )(uint8_t element, uint8_t time) |
A callback function to attract human attention by LED blinks or other. More... | |
typedef wiced_bool_t(* | wiced_bt_mesh_app_notify_period_set_t )(uint8_t element, uint16_t company_id, uint16_t model_id, uint32_t time) |
Notification period changed. More... | |
typedef uint32_t(* | wiced_bt_mesh_app_proc_rx_cmd_t )(uint16_t opcode, uint8_t *p_data, uint32_t length) |
Processing of a AIROC HCI Command from the MCU. More... | |
typedef void(* | wiced_bt_mesh_app_lpn_sleep_t )(uint32_t duration) |
Low Power Node sleep. More... | |
typedef wiced_bool_t(* | wiced_bt_mesh_app_non_conn_adv_handler_t )(int8_t rssi, const uint8_t *p_adv_data, const uint8_t *remote_bd_addr) |
Non-connectable adv packet application handler. More... | |
typedef void(* | wiced_bt_mesh_app_factory_reset_t )(void) |
Factory reset notification. More... | |
Functions | |
void | mesh_application_gen_uuid (uint8_t *uuid) |
void | mesh_application_factory_reset (void) |
void | mesh_application_hard_reset (uint8_t *uuid, uint8_t uuid_len) |
uint16_t | mesh_application_get_nvram_id_app_start (void) |
Returns the first usable by application NVRAM Identifier. More... | |
void | mesh_application_reg_non_conn_adv_handler (wiced_bt_mesh_app_non_conn_adv_handler_t handler) |
Register an application dependent non-connectable adv packet handler Register an application dependent non-connectable adv packet handler. | |
Variables | |
uint8_t | mesh_mfr_name [WICED_BT_MESH_PROPERTY_LEN_DEVICE_MANUFACTURER_NAME] |
uint8_t | mesh_model_num [WICED_BT_MESH_PROPERTY_LEN_DEVICE_MODEL_NUMBER] |
uint8_t | mesh_system_id [8] |
wiced_bt_mesh_app_func_table_t | wiced_bt_mesh_app_func_table |
Definitions for interface for mesh application interface library
#define WICED_BT_MESH_HCI_COMMAND_FLAGS_SEND_SEGMENTED 0x01 |
Bits meaning.
1 means core uses segmentation to send that message even if it fits into unsegmented message.
#define WICED_BT_MESH_HCI_COMMAND_FLAGS_TAG_USE_DIRECTED 0x02 |
Tag Use Directed.
typedef void(* wiced_bt_mesh_app_attention_t)(uint8_t element, uint8_t time) |
A callback function to attract human attention by LED blinks or other.
Application shall implement the mesh_attention function to support Health Server Model and Attention functionality during provisioning. A client device may request device to show itself. The device should blink or change colors, or make sound, or whatever device can do.
[in] | element | Index of the element |
[in] | time | 0 - Off; 0x01 - 0xff - On, time to attract user attention in seconds. |
typedef void(* wiced_bt_mesh_app_factory_reset_t)(void) |
Factory reset notification.
Application shall implement this function if it has internal NVRAM storage which needs to be deleted when device is instructed to perform the factory reset.
typedef void(* wiced_bt_mesh_app_gatt_conn_status_t)(wiced_bt_gatt_connection_status_t *p_status) |
A callback function notifying the application when GATT connection has been established or lost.
[in] | p_status | The status of the GATT connection. |
typedef void(* wiced_bt_mesh_app_hardware_init_t)(void) |
A callback function to perform application hardware initialization.
The mesh_app_hardware_init function shall be implemented by the mesh application if it wants to control hardware. If application does not implement this callback the mesh application library performs default action. It will register the interrupt callback for the application button of the platform and perform the factory reset when the button is pushed.
typedef void(* wiced_bt_mesh_app_init_t)(wiced_bool_t is_provisioned) |
A callback function to perform application startup initialization.
The mesh_app_init function shall be implemented by the mesh application. It is executed at startup, when device is provisioned, and when device is gets unprovisioned (processing of the Node Reset).
[in] | is_provisioned | If TRUE a device is provisioned. |
typedef void(* wiced_bt_mesh_app_lpn_sleep_t)(uint32_t duration) |
Low Power Node sleep.
Low Power Node application shall implement this function to receive notification when sleep mode can be entered. Application can adjust timeout according to its preferences and enter HID_OFF state. If HID_OFF is not desirable, application can just return.
[in] | timeout | Amount of time Mesh Core does not require processing in milliseconds |
typedef wiced_bool_t(* wiced_bt_mesh_app_non_conn_adv_handler_t)(int8_t rssi, const uint8_t *p_adv_data, const uint8_t *remote_bd_addr) |
Non-connectable adv packet application handler.
A customer application can implement this function to handle application specific non-connectable adv packets.
[in] | rssi | Adv packet RSSI value |
[in] | p_adv_data | Adv packet data |
[in] | remote_bd_addr | Remote device address |
typedef wiced_bool_t(* wiced_bt_mesh_app_notify_period_set_t)(uint8_t element, uint16_t company_id, uint16_t model_id, uint32_t time) |
Notification period changed.
Application may be notified by the model library that it needs to periodically send current Status notifications. Application for the sensor devices, i.e. declare WICED_BT_MESH_MODEL_SENSOR_SERVER model on one of the elements, are required to handle this callback. If the device does not have sensors, support for this callback is optional. Applications that do not want to handle the callback, should make sure that they report changes to the local states to the Mesh Models library. For example, an application for a light where the brightness can be adjusted both over Bluetooth and locally, may report local changes every time something is adjusted locally. The Mesh Models library will remember all the status changes and will automatically send notifications as appropriate.
[in] | element | Index of the element |
[in] | company_id | Company ID |
[in] | model_id | Model ID |
[in] | time | interval in milliseconds, if 0, application should not send periodic notifications. |
typedef uint32_t(* wiced_bt_mesh_app_proc_rx_cmd_t)(uint16_t opcode, uint8_t *p_data, uint32_t length) |
Processing of a AIROC HCI Command from the MCU.
Application shall implement this function to process AIROC HCI commands received over the "WICED UART" or SPI transport.
[in] | opcode | AIROC HCI Command Opcode |
[in] | p_data | AIROC HCI Command parameters |
[in] | length | Length of the AIROC HCI Command parameters |
uint16_t mesh_application_get_nvram_id_app_start | ( | void | ) |
Returns the first usable by application NVRAM Identifier.
Application can use the NVRAM IDs starting from returned value.