2.5.1 PRIME API
Important: PRIME API is defined
in the "PRIME Specification" documentation. For implementation details, refer to
Microchip "PRIME 1.x FW Stack for Service Nodes for Base Node" document.
PRIME API functions are defined in prime_api_host.h. This file contains the interface to PRIME API.
There are two type of functions:
- Request functions to send
messages or
data:
prime_cl_null_mlme_get_request(uint16_t us_pib_attrib) - Callbacks to manage confirm and indication messages.
The callbacks are initialized with the following functions:
prime_cl_null_set_callbacks(prime_cl_null_callbacks_t *px_prime_cbs);
prime_cl_432_set_callbacks(prime_cl_432_callbacks_t *px_prime_cbs);
Where the argument is a pointer to a struct with the callback
functions:
typedef struct {
prime_cl_null_establish_ind_cb_t prime_cl_null_establish_ind_cb;
prime_cl_null_establish_cfm_cb_t prime_cl_null_establish_cfm_cb;
prime_cl_null_release_ind_cb_t prime_cl_null_release_ind_cb;
prime_cl_null_release_cfm_cb_t prime_cl_null_release_cfm_cb;
prime_cl_null_join_ind_cb_t prime_cl_null_join_ind_cb;
prime_cl_null_join_cfm_cb_t prime_cl_null_join_cfm_cb;
prime_cl_null_leave_ind_cb_t prime_cl_null_leave_ind_cb;
prime_cl_null_leave_cfm_cb_t prime_cl_null_leave_cfm_cb;
prime_cl_null_data_ind_cb_t prime_cl_null_data_ind_cb;
prime_cl_null_data_cfm_cb_t prime_cl_null_data_cfm_cb;
prime_cl_null_plme_reset_cfm_cb_t prime_cl_null_plme_reset_cfm_cb;
prime_cl_null_plme_sleep_cfm_cb_t prime_cl_null_plme_sleep_cfm_cb;
prime_cl_null_plme_resume_cfm_cb_t prime_cl_null_plme_resume_cfm_cb;
prime_cl_null_plme_testmode_cfm_cb_t prime_cl_null_plme_testmode_cfm_cb;
prime_cl_null_plme_get_cfm_cb_t prime_cl_null_plme_get_cfm_cb;
prime_cl_null_plme_set_cfm_cb_t prime_cl_null_plme_set_cfm_cb;
prime_cl_null_mlme_register_ind_cb_t prime_cl_null_mlme_register_ind_cb;
prime_cl_null_mlme_register_cfm_cb_t prime_cl_null_mlme_register_cfm_cb;
prime_cl_null_mlme_unregister_ind_cb_t prime_cl_null_mlme_unregister_ind_cb;
prime_cl_null_mlme_unregister_cfm_cb_t prime_cl_null_mlme_unregister_cfm_cb;
prime_cl_null_mlme_promote_ind_cb_t prime_cl_null_mlme_promote_ind_cb;
prime_cl_null_mlme_mp_promote_ind_cb_t prime_cl_null_mlme_mp_promote_ind_cb;
prime_cl_null_mlme_promote_cfm_cb_t prime_cl_null_mlme_promote_cfm_cb;
prime_cl_null_mlme_mp_promote_cfm_cb_t prime_cl_null_mlme_mp_promote_cfm_cb;
prime_cl_null_mlme_demote_ind_cb_t prime_cl_null_mlme_demote_ind_cb;
prime_cl_null_mlme_mp_demote_ind_cb_t prime_cl_null_mlme_mp_demote_ind_cb;
prime_cl_null_mlme_demote_cfm_cb_t prime_cl_null_mlme_demote_cfm_cb;
prime_cl_null_mlme_mp_demote_cfm_cb_t prime_cl_null_mlme_mp_demote_cfm_cb;
prime_cl_null_mlme_reset_cfm_cb_t prime_cl_null_mlme_reset_cfm_cb;
prime_cl_null_mlme_get_cfm_cb_t prime_cl_null_mlme_get_cfm_cb;
prime_cl_null_mlme_list_get_cfm_cb_t prime_cl_null_mlme_list_get_cfm_cb;
prime_cl_null_mlme_set_cfm_cb_t prime_cl_null_mlme_set_cfm_cb;
} prime_cl_null_callbacks_t;Each callback must have the appropriate parameters. The definition of the callback format is in the prime_api_defs_host.h file. If a callback is set to NULL, the corresponding confirm or indication message will not be forwarded to any callback function.
typedef struct {
prime_cl_432_establish_cfm_cb_t prime_cl_432_establish_cfm_cb;
prime_cl_432_release_cfm_cb_t prime_cl_432_release_cfm_cb;
prime_cl_432_dl_data_ind_cb_t prime_cl_432_dl_data_ind_cb;
prime_cl_432_dl_data_cfm_cb_t prime_cl_432_dl_data_cfm_cb;
prime_cl_432_dl_leave_ind_cb_t prime_cl_432_dl_leave_ind_cb;
prime_cl_432_dl_join_ind_cb_t prime_cl_432_dl_join_ind_cb;
} prime_cl_432_callbacks_t;
