Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

Embed: (wiki syntax)

« Back to documentation index

mac_api.h File Reference

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:
apimac_api_t pointer, which is created by application.
data_ind_cbUpper layer function to handle MCPS indications
data_cnf_cbUpper layer function to handle MCPS confirmation
ack_data_req_cbUpper layer function for set Enhanced ACK payload
Returns:
-1 if error, -2 if OOM, 0 otherwise

Definition at line 252 of file mac_api.h.

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:
apimac_api_t pointer, which is created by application.
data_conf_cbUpper layer function to handle MCPS confirmations
data_ind_cbUpper layer function to handle MCPS indications
mlme_conf_cbUpper layer function to handle MLME confirmations
mlme_ind_cbUpper layer function to handle MLME indications
parent_idUpper layer id, which is used in confirmation and indication callbacks
Returns:
-1 if error, -2 if OOM, 0 otherwise

Definition at line 240 of file mac_api.h.

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.

Parameters:
apiAPI to handle the request
mac64_bufPointer where mac extended address can be written

Definition at line 221 of file mac_api.h.

typedef int8_t mac_ext_mac64_address_set(const mac_api_t *api, const uint8_t *mac64)

Set extended address from MAC.

Parameters:
apiAPI to handle the request
mac64pointer

Definition at line 214 of file mac_api.h.

Read MAC security description storage sizes from MAC.

Parameters:
apiAPI to handle the request
bufferPointer where supported sizes can be written

Definition at line 228 of file mac_api.h.

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:
apiThe API which handled the response
dataPointer where MAC user set Payload and IE element pointers and length
rssiSignal strength for received packet
lqiLink quality to neighbor

Definition at line 183 of file mac_api.h.

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

Parameters:
apiThe API which handled the response
dataMCPS-DATA.confirm specific values

Definition at line 151 of file mac_api.h.

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

Parameters:
apiThe API which handled the response
dataMCPS-DATA.confirm specific values
conf_dataPossible Confirmation Data

Definition at line 159 of file mac_api.h.

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

Parameters:
apiThe API which handled the response
dataMCPS-DATA.indication specific values

Definition at line 166 of file mac_api.h.

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

Parameters:
apiThe API which handled the response
dataMCPS-DATA.indication specific values
ie_extInformation element list

Definition at line 174 of file mac_api.h.

typedef void mcps_data_request(const mac_api_t *api, const mcps_data_req_t *data)

mcps_request MCPS_DATA request call

Parameters:
apiAPI to handle the request
dataMCPS-DATA.request specific values

Definition at line 123 of file mac_api.h.

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:
apiAPI to handle the request
dataMCPS-DATA.request specific values
ie_extInformation element list to MCPS-DATA.request
asynch_channel_listOptional 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.

Definition at line 134 of file mac_api.h.

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

Parameters:
apiThe API which handled the request
dataMCPS-PURGE.confirm specific values

Definition at line 191 of file mac_api.h.

typedef uint8_t mcps_purge_request(const mac_api_t *api, const mcps_purge_t *data)

mcps_purge_request MCPS_PURGE request call

Parameters:
apiAPI to handle the request
dataMCPS-PURGE.request specific values
Returns:
0 in case of success, non-zero otherwise

Definition at line 142 of file mac_api.h.

typedef void mlme_confirm(const mac_api_t *api, mlme_primitive id, const void *data)

mlme_confirm One of the MLME primitive confirm callbacks

Parameters:
apiAPI which handled the response
idThe identifier of the MLME primitive
dataPrimitive specific data (
See also:
mlme.h)

Definition at line 199 of file mac_api.h.

typedef void mlme_indication(const mac_api_t *api, mlme_primitive id, const void *data)

mlme_indication One of the

Parameters:
apiAPI which handled the response
idThe identifier of the MLME primitive
dataPrimitive specific data (
See also:
mlme.h)

Definition at line 207 of file mac_api.h.

typedef void mlme_request(const mac_api_t *api, mlme_primitive id, const void *data)

mlme_associate_response

Parameters:
apiAPI to handle the request
dataMLME-ASSOCIATE.response specific values mlme_request
apiAPI to handle the request
idThe identifier of the MLME primitive
dataPrimitive specific data (
See also:
mlme.h)

Definition at line 116 of file mac_api.h.


Enumeration Type Documentation

Enum for MAC extended address types.

Enumerator:
MAC_EXTENDED_DYNAMIC 

EUID64 which is unique.

Configured MAC 64-bit address to RAM and Radio

Definition at line 95 of file mac_api.h.

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.

Definition at line 62 of file mac_api.h.