Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: TYBLE16_simple_data_logger TYBLE16_MP3_Air
mac_api.h File Reference
A API class to support different MACs from multiple vendors. More...
Go to the source code of this file.
Data Structures | |
struct | mac_api_s |
Struct mac_api_s defines functions for two-way communications between external MAC and Upper layer. More... | |
Typedefs | |
typedef void | mlme_request (const mac_api_t *api, mlme_primitive id, const void *data) |
mlme_associate_response | |
typedef void | mcps_data_request (const mac_api_t *api, const mcps_data_req_t *data) |
mcps_request MCPS_DATA request call | |
typedef void | mcps_data_request_ext (const mac_api_t *api, const mcps_data_req_t *data, const mcps_data_req_ie_list_t *ie_ext, const struct channel_list_s *asynch_channel_list) |
mcps_request MCPS_DATA with IE extions request call | |
typedef uint8_t | mcps_purge_request (const mac_api_t *api, const mcps_purge_t *data) |
mcps_purge_request MCPS_PURGE request call | |
typedef void | mcps_data_confirm (const mac_api_t *api, const mcps_data_conf_t *data) |
mcps_data_confirm MCPS-DATA confirm is called as a response to MCPS-DATA request | |
typedef void | mcps_data_confirm_ext (const mac_api_t *api, const mcps_data_conf_t *data, const mcps_data_conf_payload_t *conf_data) |
mcps_data_confirm_ext MCPS-DATA confirm with Enhanced ACK payload is called as a response to MCPS-DATA request | |
typedef void | mcps_data_indication (const mac_api_t *api, const mcps_data_ind_t *data) |
mcps_data_indication MCPS-DATA indication is called when MAC layer has received data | |
typedef void | mcps_data_indication_ext (const mac_api_t *api, const mcps_data_ind_t *data, const mcps_data_ie_list_t *ie_ext) |
mcps_data_indication MCPS-DATA indication is called when MAC layer has received data | |
typedef void | mcps_ack_data_req_ext (const mac_api_t *api, mcps_ack_data_payload_t *data, int8_t rssi, uint8_t lqi) |
mcps_ack_data_req_ext Callback for request IE elements and payload to enhanced ACK | |
typedef void | mcps_purge_confirm (const mac_api_t *api, mcps_purge_conf_t *data) |
mcps_purge_confirm MCPS-PURGE confirm is called as a response to MCPS-PURGE request | |
typedef void | mlme_confirm (const mac_api_t *api, mlme_primitive id, const void *data) |
mlme_confirm One of the MLME primitive confirm callbacks | |
typedef void | mlme_indication (const mac_api_t *api, mlme_primitive id, const void *data) |
mlme_indication One of the | |
typedef int8_t | mac_ext_mac64_address_set (const mac_api_t *api, const uint8_t *mac64) |
Set extended address from MAC. | |
typedef int8_t | mac_ext_mac64_address_get (const mac_api_t *api, mac_extended_address_type type, uint8_t *mac64_buf) |
Read extended address from MAC. | |
typedef int8_t | mac_storage_decription_sizes_get (const mac_api_t *api, mac_description_storage_size_t *buffer) |
Read MAC security description storage sizes from MAC. | |
typedef int8_t | mac_api_initialize (mac_api_t *api, mcps_data_confirm *data_conf_cb, mcps_data_indication *data_ind_cb, mcps_purge_confirm *purge_conf_cb, mlme_confirm *mlme_conf_cb, mlme_indication *mlme_ind_cb, int8_t parent_id) |
mac_api_initialize Initialises MAC layer into use, callbacks must be non-NULL. | |
typedef int8_t | mac_api_enable_mcps_ext (mac_api_t *api, mcps_data_indication_ext *data_ind_cb, mcps_data_confirm_ext *data_cnf_cb, mcps_ack_data_req_ext *ack_data_req_cb) |
mac_api_enable_mcps_ext Initialises MAC 2015 extension for MCPS layer into use, callbacks must be non-NULL. | |
Enumerations | |
enum | mlme_primitive |
Every MAC adapting to Upper layer must implement a function which creates mac_api_t pointer, e.g 'mac_api_t* create_mac_api();' In the function external Mac needs to fill necessary function pointers so that Upper layer can use it. More... | |
enum | mac_extended_address_type { , MAC_EXTENDED_DYNAMIC } |
Enum for MAC extended address types. More... |
Detailed Description
A API class to support different MACs from multiple vendors.
Vendor must implement a function which fills supported callback functions which Upper layer will use.
Definition in file mac_api.h.
Typedef Documentation
typedef int8_t mac_api_enable_mcps_ext(mac_api_t *api, mcps_data_indication_ext *data_ind_cb, mcps_data_confirm_ext *data_cnf_cb, mcps_ack_data_req_ext *ack_data_req_cb) |
mac_api_enable_mcps_ext Initialises MAC 2015 extension for MCPS layer into use, callbacks must be non-NULL.
- Parameters:
-
api mac_api_t pointer, which is created by application. data_ind_cb Upper layer function to handle MCPS indications data_cnf_cb Upper layer function to handle MCPS confirmation ack_data_req_cb Upper layer function for set Enhanced ACK payload
- Returns:
- -1 if error, -2 if OOM, 0 otherwise
typedef int8_t mac_api_initialize(mac_api_t *api, mcps_data_confirm *data_conf_cb, mcps_data_indication *data_ind_cb, mcps_purge_confirm *purge_conf_cb, mlme_confirm *mlme_conf_cb, mlme_indication *mlme_ind_cb, int8_t parent_id) |
mac_api_initialize Initialises MAC layer into use, callbacks must be non-NULL.
- Parameters:
-
api mac_api_t pointer, which is created by application. data_conf_cb Upper layer function to handle MCPS confirmations data_ind_cb Upper layer function to handle MCPS indications mlme_conf_cb Upper layer function to handle MLME confirmations mlme_ind_cb Upper layer function to handle MLME indications parent_id Upper layer id, which is used in confirmation and indication callbacks
- Returns:
- -1 if error, -2 if OOM, 0 otherwise
typedef int8_t mac_ext_mac64_address_get(const mac_api_t *api, mac_extended_address_type type, uint8_t *mac64_buf) |
typedef int8_t mac_ext_mac64_address_set(const mac_api_t *api, const uint8_t *mac64) |
typedef int8_t mac_storage_decription_sizes_get(const mac_api_t *api, mac_description_storage_size_t *buffer) |
typedef void mcps_ack_data_req_ext(const mac_api_t *api, mcps_ack_data_payload_t *data, int8_t rssi, uint8_t lqi) |
mcps_ack_data_req_ext Callback for request IE elements and payload to enhanced ACK
- Parameters:
-
api The API which handled the response data Pointer where MAC user set Payload and IE element pointers and length rssi Signal strength for received packet lqi Link quality to neighbor
typedef void mcps_data_confirm(const mac_api_t *api, const mcps_data_conf_t *data) |
typedef void mcps_data_confirm_ext(const mac_api_t *api, const mcps_data_conf_t *data, const mcps_data_conf_payload_t *conf_data) |
typedef void mcps_data_indication(const mac_api_t *api, const mcps_data_ind_t *data) |
typedef void mcps_data_indication_ext(const mac_api_t *api, const mcps_data_ind_t *data, const mcps_data_ie_list_t *ie_ext) |
typedef void mcps_data_request(const mac_api_t *api, const mcps_data_req_t *data) |
typedef void mcps_data_request_ext(const mac_api_t *api, const mcps_data_req_t *data, const mcps_data_req_ie_list_t *ie_ext, const struct channel_list_s *asynch_channel_list) |
mcps_request MCPS_DATA with IE extions request call
- Parameters:
-
api API to handle the request data MCPS-DATA.request specific values ie_ext Information element list to MCPS-DATA.request asynch_channel_list Optional channel list to asynch data request. Give NULL when normal data request.
Asynch data request is mac standard extension. asynch_channel_list include channel mask which channel message is requested to send.
typedef void mcps_purge_confirm(const mac_api_t *api, mcps_purge_conf_t *data) |
typedef uint8_t mcps_purge_request(const mac_api_t *api, const mcps_purge_t *data) |
typedef void mlme_confirm(const mac_api_t *api, mlme_primitive id, const void *data) |
typedef void mlme_indication(const mac_api_t *api, mlme_primitive id, const void *data) |
typedef void mlme_request(const mac_api_t *api, mlme_primitive id, const void *data) |
Enumeration Type Documentation
enum mlme_primitive |
Every MAC adapting to Upper layer must implement a function which creates mac_api_t pointer, e.g 'mac_api_t* create_mac_api();' In the function external Mac needs to fill necessary function pointers so that Upper layer can use it.
For Nanostack to work, following (mlme/mcps) request functions are mandatory:
- mcps-data
- scan
- start
- poll
- get
- set
- reset
- (purge) Also indication and confirm callbacks for above are needed plus
- beacon notify
- comm status
- Returns:
- mac_api_t Ownership of newly created object
Enum for MLME primitive types.
Generated on Tue Jul 12 2022 13:55:15 by
