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.
Fork of OmniWheels by
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_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_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_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. | |
| 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_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_data_confirm(const mac_api_t *api, const mcps_data_conf_t *data) | 
| typedef void mcps_data_indication(const mac_api_t *api, const mcps_data_ind_t *data) | 
| typedef void mcps_data_request(const mac_api_t *api, const mcps_data_req_t *data) | 
| typedef void mcps_purge_confirm(const mac_api_t *api, mcps_purge_conf_t *data) | 
| typedef void 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 Fri Jul 22 2022 04:54:07 by
 1.7.2
 1.7.2 
    