AIROC™ BTSDK v4.0 - Documentation | ||||
The AIROC Mesh Location Server module provides a way for a client to set the Global and Local location for a mesh device. More...
Typedefs | |
typedef void( | wiced_bt_mesh_location_server_callback_t )(uint8_t element_idx, uint16_t event, void *p_data) |
Location Server callback. More... | |
Functions | |
void | wiced_bt_mesh_model_location_server_init (wiced_bt_mesh_location_server_callback_t *p_callback, wiced_bool_t is_provisioned) |
Location Server initialization. More... | |
wiced_bool_t | wiced_bt_mesh_model_location_server_message_handler (wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len) |
Location Server Message Handler. More... | |
wiced_bool_t | wiced_bt_mesh_model_location_setup_server_message_handler (wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len) |
Location Setup Server Message Handler. More... | |
wiced_result_t | wiced_bt_mesh_model_location_server_send (uint16_t type, wiced_bt_mesh_event_t *p_event, void *p_data) |
The application can call this function to send status message to the Location Client. More... | |
The AIROC Mesh Location Server module provides a way for a client to set the Global and Local location for a mesh device.
Setup location can be retrieved by the same or different clients. The Location Server may also be configured to publish unsolicited messages with the location information to a specific node or to a group of nodes.
Two types of location information can be exchanged between the client and the server. The Global Location Data (see wiced_bt_mesh_location_global_data_t) and the Local Location Data (see wiced_bt_mesh_location_local_data_t).
On startup the application should call the wiced_bt_mesh_model_location_server_init function providing the callback to be executed when a Get or Set request is received from a mesh device. The application should call the wiced_bt_mesh_model_location_server_send function in response to a get request, a set request when reply is required or when application logic requires location information to be sent out. In the latter case the message will be sent out only if device is configured remotely with the destination address where the location status should be set to and and the application key to be used to secure the message.
typedef void( wiced_bt_mesh_location_server_callback_t)(uint8_t element_idx, uint16_t event, void *p_data) |
Location Server callback.
The Location Server callback is executed by the Mesh Models library on receiving a Get or a Set message from the peer. In case of the Set the application should update the location information. In case of the Get or if the reply variable is set to TRUE in the p_event structure, the application should call the wiced_bt_mesh_model_location_server_send function returning p_event back to the library. Otherwise p_event should be released.
element_idx | Element Index of the model |
event | The event that the application should process (see Location Events) |
p_data | Pointer to the local/global location data |
void wiced_bt_mesh_model_location_server_init | ( | wiced_bt_mesh_location_server_callback_t * | p_callback, |
wiced_bool_t | is_provisioned | ||
) |
Location Server initialization.
p_callback | The application callback function that will be executed by the mesh models library when application action is required, or when a reply for the application request has been received. |
is_provisioned | If TRUE, the application is being restarted after being provisioned or after a power loss. If FALSE the model cleans up NVRAM on startup. |
wiced_bool_t wiced_bt_mesh_model_location_server_message_handler | ( | wiced_bt_mesh_event_t * | p_event, |
uint8_t * | p_data, | ||
uint16_t | data_len | ||
) |
Location Server Message Handler.
Application can call this models library function to process a message received from the Location Client and targeted to the Generic Location Server model. The function parses the message and if appropriate calls the application back to perform functionality.
p_event | Mesh event with information about received message. |
p_data | Pointer to the data portion of the message |
data_len | Length of the data in the message |
wiced_result_t wiced_bt_mesh_model_location_server_send | ( | uint16_t | type, |
wiced_bt_mesh_event_t * | p_event, | ||
void * | p_data | ||
) |
The application can call this function to send status message to the Location Client.
The mesh event should contain information if this is a reply or an unsolicited message.
type | Type of the message to be send to the Client (see Location Events) |
p_event | Mesh event with the information about the message that has been received in the request, or created by the app for unsolicited message. |
p_data | Depending on the type of the message this should point to the Global Location Data (wiced_bt_mesh_location_global_data_t) or the Local Location Data (see wiced_bt_mesh_location_local_data_t) |
wiced_bool_t wiced_bt_mesh_model_location_setup_server_message_handler | ( | wiced_bt_mesh_event_t * | p_event, |
uint8_t * | p_data, | ||
uint16_t | data_len | ||
) |
Location Setup Server Message Handler.
Application can call this models library function to process a message received from the Location Client and targeted to the Generic Location Setup Server model. The function parses the message and if appropriate calls the application back to perform functionality.
p_event | Mesh event with information about received message. |
p_data | Pointer to the data portion of the message |
data_len | Length of the data in the message |