Morse Micro IoT SDK  2.10.4

Detailed Description

API for general control and configuration that is not linked to a specific operational mode.

Data Structures

struct  mmwlan_version
 Structure for retrieving version information from the mmwlan subsystem. More...
 
struct  mmwlan_bcf_metadata
 Board configuration file (BCF) metadata. More...
 
struct  mmwlan_qos_queue_params
 Structure for storing QoS queue parameters
More...
 
struct  mmwlan_boot_args
 Arguments data structure for mmwlan_boot(). More...
 

Macros

#define MMWLAN_MORSELIB_VERSION_MAXLEN   (32)
 Maximum length of the Morselib version string. More...
 
#define MMWLAN_FW_VERSION_MAXLEN   (32)
 Maximum length of the firmware version string. More...
 
#define MMWLAN_CHIP_ID_STRING_MAXLEN   (32)
 Maximum length of the chip id string. More...
 
#define MMWLAN_BCF_BOARD_DESC_MAXLEN   (31)
 Maximum length of a BCF board description string (excluding null terminator). More...
 
#define MMWLAN_BCF_BUILD_VERSION_MAXLEN   (31)
 Maximum length of a BCF build version string (excluding null terminator). More...
 
#define MMWLAN_MINIMUM_FRAGMENT_THRESHOLD   (256)
 Minimum value of fragmentation threshold that can be set with mmwlan_set_fragment_threshold(). More...
 
#define MMWLAN_QOS_QUEUE_NUM_ACIS   4
 The total number of mmwlan_qos_queue_params that exist. More...
 
#define MMWLAN_DEFAULT_MIN_HEALTH_CHECK_INTERVAL_MS   60000
 The default minimum interval to wait after the last health check before triggering another. More...
 
#define MMWLAN_DEFAULT_MAX_HEALTH_CHECK_INTERVAL_MS   120000
 The default maximum interval to wait after the last health check before triggering another. More...
 
#define MMWLAN_BOOT_ARGS_INIT   { 0 }
 Initializer for mmwlan_boot_args. More...
 

Enumerations

enum  mmwlan_mcs10_mode { MMWLAN_MCS10_MODE_DISABLED = 0x00 , MMWLAN_MCS10_MODE_FORCED = 0x01 , MMWLAN_MCS10_MODE_AUTO = 0x02 }
 Enumeration of configuration states for MCS10 behavior. More...
 

Functions

enum mmwlan_status mmwlan_get_version (struct mmwlan_version *version)
 Retrieve version information from morselib and the connected Morse transceiver. More...
 
enum mmwlan_status mmwlan_get_bcf_metadata (struct mmwlan_bcf_metadata *metadata)
 Read the metadata from the board configuration file (BCF). More...
 
enum mmwlan_status mmwlan_override_max_tx_power (uint16_t tx_power_dbm)
 Override the maximum TX power. More...
 
enum mmwlan_status mmwlan_set_rts_threshold (unsigned rts_threshold)
 Set the RTS threshold. More...
 
enum mmwlan_status mmwlan_set_sgi_enabled (bool sgi_enabled)
 Sets whether or not Short Guard Interval (SGI) support is enabled. More...
 
enum mmwlan_status mmwlan_set_subbands_enabled (bool subbands_enabled)
 Sets whether or not sub-band support is enabled for transmit. More...
 
enum mmwlan_status mmwlan_set_ampdu_enabled (bool ampdu_enabled)
 Sets whether or not Aggregated MAC Protocol Data Unit (A-MPDU) support is enabled. More...
 
enum mmwlan_status mmwlan_set_fragment_threshold (unsigned fragment_threshold)
 Set the Fragmentation threshold. More...
 
enum mmwlan_status mmwlan_set_default_qos_queue_params (const struct mmwlan_qos_queue_params *params, size_t count)
 Updates the default QoS queue configuration to the given values. More...
 
enum mmwlan_status mmwlan_set_mcs10_mode (enum mmwlan_mcs10_mode mcs10_mode)
 Configure the rate adaptation behavior around selecting MCS10. More...
 
enum mmwlan_status mmwlan_set_control_response_preamble_1mhz_out_en (bool enabled)
 Enables the 1MHz control response override. More...
 
enum mmwlan_status mmwlan_set_health_check_interval (uint32_t min_interval_ms, uint32_t max_interval_ms)
 Specify the upper and lower bound for the periodic health check interval. More...
 
enum mmwlan_status mmwlan_boot (const struct mmwlan_boot_args *args)
 Boot the Morse Micro transceiver and leave it in an idle state. More...
 
enum mmwlan_status mmwlan_shutdown (void)
 Perform a clean shutdown of the Morse Micro transceiver, including cleanly disconnecting from a connected AP, if necessary. More...
 
enum mmwlan_status mmwlan_get_vif_mac_addr (enum mmwlan_vif vif, uint8_t *mac_addr)
 Gets the MAC address of the given interface. More...
 
static enum mmwlan_status mmwlan_get_mac_addr (uint8_t *mac_addr)
 Gets the MAC address of the STA interface. More...
 

Macro Definition Documentation

◆ MMWLAN_BCF_BOARD_DESC_MAXLEN

#define MMWLAN_BCF_BOARD_DESC_MAXLEN   (31)

Maximum length of a BCF board description string (excluding null terminator).

Definition at line 340 of file mmwlan.h.

◆ MMWLAN_BCF_BUILD_VERSION_MAXLEN

#define MMWLAN_BCF_BUILD_VERSION_MAXLEN   (31)

Maximum length of a BCF build version string (excluding null terminator).

Definition at line 342 of file mmwlan.h.

◆ MMWLAN_BOOT_ARGS_INIT

#define MMWLAN_BOOT_ARGS_INIT   { 0 }

Initializer for mmwlan_boot_args.

See also
mmwlan_boot_args

Definition at line 616 of file mmwlan.h.

◆ MMWLAN_CHIP_ID_STRING_MAXLEN

#define MMWLAN_CHIP_ID_STRING_MAXLEN   (32)

Maximum length of the chip id string.

Definition at line 312 of file mmwlan.h.

◆ MMWLAN_DEFAULT_MAX_HEALTH_CHECK_INTERVAL_MS

#define MMWLAN_DEFAULT_MAX_HEALTH_CHECK_INTERVAL_MS   120000

The default maximum interval to wait after the last health check before triggering another.

Definition at line 571 of file mmwlan.h.

◆ MMWLAN_DEFAULT_MIN_HEALTH_CHECK_INTERVAL_MS

#define MMWLAN_DEFAULT_MIN_HEALTH_CHECK_INTERVAL_MS   60000

The default minimum interval to wait after the last health check before triggering another.

Definition at line 564 of file mmwlan.h.

◆ MMWLAN_FW_VERSION_MAXLEN

#define MMWLAN_FW_VERSION_MAXLEN   (32)

Maximum length of the firmware version string.

Definition at line 310 of file mmwlan.h.

◆ MMWLAN_MINIMUM_FRAGMENT_THRESHOLD

#define MMWLAN_MINIMUM_FRAGMENT_THRESHOLD   (256)

Minimum value of fragmentation threshold that can be set with mmwlan_set_fragment_threshold().

Definition at line 463 of file mmwlan.h.

◆ MMWLAN_MORSELIB_VERSION_MAXLEN

#define MMWLAN_MORSELIB_VERSION_MAXLEN   (32)

Maximum length of the Morselib version string.

Definition at line 308 of file mmwlan.h.

◆ MMWLAN_QOS_QUEUE_NUM_ACIS

#define MMWLAN_QOS_QUEUE_NUM_ACIS   4

The total number of mmwlan_qos_queue_params that exist.

Definition at line 487 of file mmwlan.h.

Enumeration Type Documentation

◆ mmwlan_mcs10_mode

Enumeration of configuration states for MCS10 behavior.

Enumerator
MMWLAN_MCS10_MODE_DISABLED 

MCS10 is disabled.

MMWLAN_MCS10_MODE_FORCED 

Always use MCS10 instead of MCS 0 if the bandwidth is 1 MHz.

MMWLAN_MCS10_MODE_AUTO 

Use MCS10 on retries instead of MCS 0 if the bandwidth is 1 MHz.

Definition at line 527 of file mmwlan.h.

Function Documentation

◆ mmwlan_boot()

enum mmwlan_status mmwlan_boot ( const struct mmwlan_boot_args args)

Boot the Morse Micro transceiver and leave it in an idle state.

Note
In general, it is not necessary to use this function as mmwlan_sta_enable() will automatically boot the chip if required. It may be used, for example, to power on the chip for production test, etc.
Warning
Channel list must be set before booting the transceiver. mmwlan_set_channel_list().
Parameters
argsBoot arguments. May be NULL, in which case default values will be used.
Returns
MMWLAN_SUCCESS on success, else an appropriate error code.

◆ mmwlan_get_bcf_metadata()

enum mmwlan_status mmwlan_get_bcf_metadata ( struct mmwlan_bcf_metadata metadata)

Read the metadata from the board configuration file (BCF).

Parameters
metadataPointer to a metadata data structure to be filled out on success.
Returns
MMWLAN_SUCCESS on success else an error code.

◆ mmwlan_get_mac_addr()

static enum mmwlan_status mmwlan_get_mac_addr ( uint8_t *  mac_addr)
inlinestatic

Gets the MAC address of the STA interface.

Deprecated:
This function is deprecated and provided for backwards compatibility. mmwlan_get_vif_mac_addr should be used for new developments.

This function is equivalent to mmwlan_get_vif_mac_addr(MMWLAN_VIF_STA, mac_addr)

Parameters
mac_addrBuffer to receive the MAC address. Length must be MMWLAN_MAC_ADDR_LEN.
Returns
MMWLAN_SUCCESS on success, MMWLAN_UNAVAILABLE if the MAC address was not able to be read from the transceiver because it was not booted, else an appropriate error code.

Definition at line 681 of file mmwlan.h.

◆ mmwlan_get_version()

enum mmwlan_status mmwlan_get_version ( struct mmwlan_version version)

Retrieve version information from morselib and the connected Morse transceiver.

Parameters
versionThe data structure to fill out with version information.
Note
If the Morse transceiver has not previously been powered on then the fw_version field of version will be set to a zero length string.
Returns
MMWLAN_SUCCESS on success else an error code.

◆ mmwlan_get_vif_mac_addr()

enum mmwlan_status mmwlan_get_vif_mac_addr ( enum mmwlan_vif  vif,
uint8_t *  mac_addr 
)

Gets the MAC address of the given interface.

The STA MAC address (vif = MMWLAN_VIF_STA) comes from one of the following sources, in descending priority order:

  1. mmhal_read_mac_addr()
  2. Morse Micro transceiver
  3. Randomly generated in the form 02:01:XX:XX:XX:XX
Note
If a MAC address override is not provided (via mmhal_read_mac_addr()) then the transceiver must have been booted at least once before this function is invoked.

The AP MAC address (vif = MMWLAN_VIF_AP) is equivalent to the BSSID.

Parameters
vifThe VIF to get the MAC address of.
mac_addrBuffer to receive the MAC address. Length must be MMWLAN_MAC_ADDR_LEN.
Returns
MMWLAN_SUCCESS on success, MMWLAN_UNAVAILABLE if the MAC address was not able to be read from the transceiver because it was not booted, else an appropriate error code.

◆ mmwlan_override_max_tx_power()

enum mmwlan_status mmwlan_override_max_tx_power ( uint16_t  tx_power_dbm)

Override the maximum TX power.

If no override is specified then the maximum TX power used will be the maximum TX power allowed for the channel in the current regulatory domain.

Note
Must be invoked after WLAN initialization (see mmwlan_init()). Only takes effect when switching channel (e.g., during scan or AP connection procedure).
This will not increase the TX power over the maximum allowed for the current channel in the configured regulatory domain. Therefore, this override in effect will only reduce the maximum TX power and cannot increase it.
Parameters
tx_power_dbmThe maximum TX power override to set (in dBm). Set to zero to disable the override.
Returns
MMWLAN_SUCCESS if the country code was valid and updated successfully, MMWLAN_UNAVAILABLE if the WLAN subsystem was currently active.

◆ mmwlan_set_ampdu_enabled()

enum mmwlan_status mmwlan_set_ampdu_enabled ( bool  ampdu_enabled)

Sets whether or not Aggregated MAC Protocol Data Unit (A-MPDU) support is enabled.

This defaults to enabled, if not set otherwise.

Note
This must only be invoked when MMWLAN is inactive (i.e., STA mode not enabled).
Parameters
ampdu_enabledBoolean value indicating whether AMPDU support should be enabled.
Returns
MMWLAN_SUCCESS on success, else an appropriate error code.

◆ mmwlan_set_control_response_preamble_1mhz_out_en()

enum mmwlan_status mmwlan_set_control_response_preamble_1mhz_out_en ( bool  enabled)

Enables the 1MHz control response override.

This means that in response to directed packets, the control responses (e.g. an NDP ACK or Block ACK) will be sent at 1MHz.

Note
Must be invoked after WLAN initialization (see mmwlan_init()) but only when inactive (i.e., STA not enabled).
Parameters
enabledWhether to send control response preambles in 1MHz bandwidth. True to transmit in 1MHz. False to disable this override.
Returns
MMWLAN_SUCCESS on success, else an appropriate error code.

◆ mmwlan_set_default_qos_queue_params()

enum mmwlan_status mmwlan_set_default_qos_queue_params ( const struct mmwlan_qos_queue_params params,
size_t  count 
)

Updates the default QoS queue configuration to the given values.

These values will be made active while the station is connecting to an Access Point.

Note
Although the active configuration will be changed to the Access Point's configurations for these values after connecting, these default values will not be overwritten and will be reactivated after the station disconnects.
Parameters
paramsArray of QoS queue parameters. This array does not need to be sorted in Access Category Index (ACI) order, since the ACI is specified as part of the mmwlan_qos_queue_params structure. The same ACI must not be specified more than once in this array. If a parameter for a given ACI is not included in this list then its configuration will be left unchanged.
countThe number of elements in the params array. Must be at least 1 and no more than MMWLAN_QOS_QUEUE_NUM_ACIS.
Returns
MMWLAN_SUCCESS on success, else an appropriate error code.

◆ mmwlan_set_fragment_threshold()

enum mmwlan_status mmwlan_set_fragment_threshold ( unsigned  fragment_threshold)

Set the Fragmentation threshold.

Maximum length of the frame, beyond which packets must be fragmented into two or more frames.

Note
Even if the fragmentation threshold is set to 0 (disabled), fragmentation may still occur if a given packet is too large to be transmitted at the selected rate.
Warning
Setting a fragmentation threshold may have unintended side effects due to restrictions at lower bandwidths and MCS rates. In normal operation the fragmentation threshold should be disabled, in which case packets will be fragmented automatically as necessary based on the selected rate.
Parameters
fragment_thresholdThe fragmentation threshold (in octets) to set, or zero to disable the fragmentation threshold. Minimum value (if not zero) is given by MMWLAN_MINIMUM_FRAGMENT_THRESHOLD.
Returns
MMWLAN_SUCCESS on success, else an appropriate error code.

◆ mmwlan_set_health_check_interval()

enum mmwlan_status mmwlan_set_health_check_interval ( uint32_t  min_interval_ms,
uint32_t  max_interval_ms 
)

Specify the upper and lower bound for the periodic health check interval.

To guarantee a specific interval set both min_interval_ms and max_interval_ms to the same value.

Note
To disable periodic health checks entirely set both values to zero (0).
Parameters
min_interval_msMinimum value that the interval can be.
max_interval_msMaximum value that the interval can be.
Returns
MMWLAN_SUCCESS on success, else an appropriate error code.

◆ mmwlan_set_mcs10_mode()

enum mmwlan_status mmwlan_set_mcs10_mode ( enum mmwlan_mcs10_mode  mcs10_mode)

Configure the rate adaptation behavior around selecting MCS10.

Parameters
mcs10_modeSets the MCS10 mode. See mmwlan_mcs10_mode for what each mode means.
Returns
MMWLAN_SUCCESS on success, else an appropriate error code.

◆ mmwlan_set_rts_threshold()

enum mmwlan_status mmwlan_set_rts_threshold ( unsigned  rts_threshold)

Set the RTS threshold.

When packets larger than the RTS threshold are transmitted they are protected by an RTS/CTS exchange.

Parameters
rts_thresholdThe RTS threshold (in octets) to set, or 0 to disable.
Returns
MMWLAN_SUCCESS on success, else an appropriate error code.

◆ mmwlan_set_sgi_enabled()

enum mmwlan_status mmwlan_set_sgi_enabled ( bool  sgi_enabled)

Sets whether or not Short Guard Interval (SGI) support is enabled.

Defaults to enabled if not set otherwise.

Note
This will not force use of SGI, only enable support for it. The rate control algorithm will make the decision as to which guard interval to use unless explicitly overridden by mmwlan_ate_override_rate_control().
This must only be invoked when MMWLAN is inactive (i.e., STA mode not enabled).
Parameters
sgi_enabledBoolean value indicating whether SGI support should be enabled.
Returns
MMWLAN_SUCCESS on success, else an appropriate error code.

◆ mmwlan_set_subbands_enabled()

enum mmwlan_status mmwlan_set_subbands_enabled ( bool  subbands_enabled)

Sets whether or not sub-band support is enabled for transmit.

Defaults to enabled if not set otherwise.

Note
This will not force use of sub-bands, only enable support for it. The rate control algorithm will make the decision as to which bandwidth to use unless explicitly overridden by mmwlan_ate_override_rate_control().
This must only be invoked when MMWLAN is inactive (i.e., STA mode not enabled).
Parameters
subbands_enabledBoolean value indicating whether sub-band support should be enabled.
Returns
MMWLAN_SUCCESS on success, else an appropriate error code.

◆ mmwlan_shutdown()

enum mmwlan_status mmwlan_shutdown ( void  )

Perform a clean shutdown of the Morse Micro transceiver, including cleanly disconnecting from a connected AP, if necessary.

Has no effect if the transceiver is already shutdown.

Returns
MMWLAN_SUCCESS on success, else an appropriate error code.