Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

Embed: (wiki syntax)

« Back to documentation index

sw_mac.h File Reference

sw_mac.h File Reference

Software MAC API. More...

Go to the source code of this file.

Functions

struct mac_api_sns_sw_mac_create (int8_t rf_driver_id, struct mac_description_storage_size_s *storage_sizes)
 Creates 802.15.4 MAC API instance which will use RF driver given.
int8_t ns_sw_mac_virtual_client_register (struct mac_api_s *api, int8_t virtual_driver_id)
 ns_sw_mac_virtual_client_register registers virtual driver to be used with 802.15.4 MAC.
int8_t ns_sw_mac_virtual_client_unregister (struct mac_api_s *api)
 ns_sw_mac_virtual_client_unregister Unregisters virtual driver from 802.15.4 MAC
int ns_sw_mac_fhss_register (struct mac_api_s *mac_api, struct fhss_api *fhss_api)
 Registers created FHSS API instance to given software MAC instance.
struct fhss_apins_sw_mac_get_fhss_api (struct mac_api_s *mac_api)
 Request registered FHSS API instance from software MAC instance.
int ns_sw_mac_statistics_start (struct mac_api_s *mac_api, struct mac_statistics_s *mac_statistics)
 Start collecting statistics from software MAC.
int ns_sw_mac_phy_statistics_start (struct mac_api_s *mac_api, struct phy_rf_statistics_s *phy_statistics)
 Start collecting statistics from PHY driver.
uint32_t ns_sw_mac_read_current_timestamp (struct mac_api_s *mac_api)
 Read current timestamp.
int8_t ns_sw_mac_enable_frame_counter_per_key (struct mac_api_s *mac_api, bool enable_feature)
 Enable or disable Frame counter per security key.

Detailed Description

Software MAC API.

Definition in file sw_mac.h.


Function Documentation

struct mac_api_s* ns_sw_mac_create ( int8_t  rf_driver_id,
struct mac_description_storage_size_s *  storage_sizes 
) [read]

Creates 802.15.4 MAC API instance which will use RF driver given.

Parameters:
rf_driver_idRF driver id. Must be valid
storage_sizesdynamic mac storage sizes DO NOT set any values to zero !!
Returns:
New MAC instance if successful, NULL otherwise
int8_t ns_sw_mac_enable_frame_counter_per_key ( struct mac_api_s mac_api,
bool  enable_feature 
)

Enable or disable Frame counter per security key.

SW MAC must be create before enable this feature!

Parameters:
mac_apiMAC instance.
enable_featureTrue will allocate frame counter table for devices / key False will clear mode and free counter table.
Returns:
0 on success, -1 on fail.

Definition at line 127 of file sw_mac.c.

int ns_sw_mac_fhss_register ( struct mac_api_s mac_api,
struct fhss_api fhss_api 
)

Registers created FHSS API instance to given software MAC instance.

Parameters:
mac_apiMAC instance.
fhss_apiFHSS instance.
Returns:
0 on success, -1 on fail.

Definition at line 167 of file sw_mac.c.

struct fhss_api* ns_sw_mac_get_fhss_api ( struct mac_api_s mac_api ) [read]

Request registered FHSS API instance from software MAC instance.

Parameters:
mac_apiMAC instance.
Returns:
FHSS api.

Definition at line 200 of file sw_mac.c.

int ns_sw_mac_phy_statistics_start ( struct mac_api_s mac_api,
struct phy_rf_statistics_s phy_statistics 
)

Start collecting statistics from PHY driver.

Parameters:
mac_apiMAC instance.
phy_statisticsStatistics storage.
Returns:
0 on success, -1 on fail.

Definition at line 712 of file sw_mac.c.

uint32_t ns_sw_mac_read_current_timestamp ( struct mac_api_s mac_api )

Read current timestamp.

Parameters:
mac_apiMAC instance.
Returns:
Current timestamp in us

Definition at line 725 of file sw_mac.c.

int ns_sw_mac_statistics_start ( struct mac_api_s mac_api,
struct mac_statistics_s *  mac_statistics 
)

Start collecting statistics from software MAC.

Parameters:
mac_apiMAC instance.
mac_statisticsStatistics storage.
Returns:
0 on success, -1 on fail.

Definition at line 212 of file sw_mac.c.

int8_t ns_sw_mac_virtual_client_register ( struct mac_api_s api,
int8_t  virtual_driver_id 
)

ns_sw_mac_virtual_client_register registers virtual driver to be used with 802.15.4 MAC.

This is always used with serial_mac_api

Parameters:
apiAPI to start using virtual driver
virtual_driver_id
Returns:
0 if success, -1 if api or driver is invalid

Definition at line 135 of file sw_mac.c.

int8_t ns_sw_mac_virtual_client_unregister ( struct mac_api_s api )

ns_sw_mac_virtual_client_unregister Unregisters virtual driver from 802.15.4 MAC

Parameters:
apiAPI from which to unregister virtual driver
Returns:
0 if success, -1 if api is invalid

Definition at line 152 of file sw_mac.c.