Infineon Logo AIROC BTSDK v4.9 - Documentation
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Mesh Location Server

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...
 

Detailed Description

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 Documentation

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.

Parameters
element_idxElement Index of the model
eventThe event that the application should process (see Location Events)
p_dataPointer to the local/global location data
Returns
None

Function Documentation

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.

Parameters
p_callbackThe 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_provisionedIf TRUE, the application is being restarted after being provisioned or after a power loss. If FALSE the model cleans up NVRAM on startup.
Returns
None
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.

Parameters
p_eventMesh event with information about received message.
p_dataPointer to the data portion of the message
data_lenLength of the data in the message
Returns
WICED_TRUE if the message is for this company ID/Model combination, WICED_FALSE otherwise.
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.

Parameters
typeType of the message to be send to the Client (see Location Events)
p_eventMesh event with the information about the message that has been received in the request, or created by the app for unsolicited message.
p_dataDepending 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)
Returns
WICED_BT_SUCCESS if message has been queued for transmission.
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.

Parameters
p_eventMesh event with information about received message.
p_dataPointer to the data portion of the message
data_lenLength of the data in the message
Returns
WICED_TRUE if the message is for this company ID/Model combination, WICED_FALSE otherwise.