Morse Micro IoT SDK  2.9.7

Detailed Description

Enumerations, etc., used by the underlying implementation, but which are not usually needed to be used directly.

Macros

#define CONTROL_STREAM   0
 The stream ID of the control stream. More...
 
#define MMAGIC_CONTROLLER_DEFAULT_RESPONSE_TIMEOUT_MS   1000
 The default timeout when waiting for a response from a command sent to the agent in ms. More...
 

Enumerations

enum  mmagic_wlan_var {
  MMAGIC_WLAN_VAR_COUNTRY_CODE = 0 , MMAGIC_WLAN_VAR_SSID = 1 , MMAGIC_WLAN_VAR_PASSWORD = 2 , MMAGIC_WLAN_VAR_SECURITY = 3 ,
  MMAGIC_WLAN_VAR_RAW_PRIORITY = 4 , MMAGIC_WLAN_VAR_BSSID = 5 , MMAGIC_WLAN_VAR_PMF_MODE = 6 , MMAGIC_WLAN_VAR_STATION_TYPE = 7 ,
  MMAGIC_WLAN_VAR_RTS_THRESHOLD = 8 , MMAGIC_WLAN_VAR_SGI_ENABLED = 9 , MMAGIC_WLAN_VAR_SUBBANDS_ENABLED = 10 , MMAGIC_WLAN_VAR_AMPDU_ENABLED = 11 ,
  MMAGIC_WLAN_VAR_POWER_SAVE_MODE = 12 , MMAGIC_WLAN_VAR_FRAGMENT_THRESHOLD = 13 , MMAGIC_WLAN_VAR_CAC_ENABLED = 14 , MMAGIC_WLAN_VAR_OFFLOAD_ARP_RESPONSE = 15 ,
  MMAGIC_WLAN_VAR_OFFLOAD_ARP_REFRESH_S = 16 , MMAGIC_WLAN_VAR_MIN_HEALTH_CHECK_INTVL_MS = 17 , MMAGIC_WLAN_VAR_MAX_HEALTH_CHECK_INTVL_MS = 18 , MMAGIC_WLAN_VAR_NDP_PROBE_ENABLED = 19 ,
  MMAGIC_WLAN_VAR_STA_SCAN_INTERVAL_BASE_S = 20 , MMAGIC_WLAN_VAR_STA_SCAN_INTERVAL_LIMIT_S = 21 , MMAGIC_WLAN_VAR_QOS_0_PARAMS = 22 , MMAGIC_WLAN_VAR_QOS_1_PARAMS = 23 ,
  MMAGIC_WLAN_VAR_QOS_2_PARAMS = 24 , MMAGIC_WLAN_VAR_QOS_3_PARAMS = 25 , MMAGIC_WLAN_VAR_MCS10_MODE = 26 , MMAGIC_WLAN_VAR_STA_EVT_EN = 27 ,
  MMAGIC_WLAN_VAR_DUTY_CYCLE_MODE = 28
}
 wlan configuration variable IDs More...
 
enum  mmagic_wlan_cmd {
  MMAGIC_WLAN_CMD_GET = 0 , MMAGIC_WLAN_CMD_SET = 1 , MMAGIC_WLAN_CMD_LOAD = 2 , MMAGIC_WLAN_CMD_COMMIT = 3 ,
  MMAGIC_WLAN_CMD_CONNECT = 8 , MMAGIC_WLAN_CMD_DISCONNECT = 9 , MMAGIC_WLAN_CMD_SCAN = 10 , MMAGIC_WLAN_CMD_GET_RSSI = 11 ,
  MMAGIC_WLAN_CMD_GET_MAC_ADDR = 12 , MMAGIC_WLAN_CMD_WNM_SLEEP = 13 , MMAGIC_WLAN_CMD_BEACON_MONITOR_ENABLE = 14 , MMAGIC_WLAN_CMD_BEACON_MONITOR_DISABLE = 15 ,
  MMAGIC_WLAN_CMD_STANDBY_ENTER = 16 , MMAGIC_WLAN_CMD_STANDBY_EXIT = 17 , MMAGIC_WLAN_CMD_STANDBY_SET_STATUS_PAYLOAD = 18 , MMAGIC_WLAN_CMD_STANDBY_SET_WAKE_FILTER = 19 ,
  MMAGIC_WLAN_CMD_STANDBY_SET_CONFIG = 20 , MMAGIC_WLAN_CMD_GET_STA_STATUS = 21
}
 wlan configuration command IDs More...
 
enum  mmagic_ip_var {
  MMAGIC_IP_VAR_IP_ADDR = 0 , MMAGIC_IP_VAR_NETMASK = 1 , MMAGIC_IP_VAR_GATEWAY = 2 , MMAGIC_IP_VAR_DNS_SERVER0 = 3 ,
  MMAGIC_IP_VAR_DNS_SERVER1 = 4 , MMAGIC_IP_VAR_DHCP_ENABLED = 5 , MMAGIC_IP_VAR_DHCP_OFFLOAD = 6 , MMAGIC_IP_VAR_LINK_STATUS_EVT_EN = 7
}
 ip configuration variable IDs More...
 
enum  mmagic_ip_cmd {
  MMAGIC_IP_CMD_GET = 0 , MMAGIC_IP_CMD_SET = 1 , MMAGIC_IP_CMD_LOAD = 2 , MMAGIC_IP_CMD_COMMIT = 3 ,
  MMAGIC_IP_CMD_STATUS = 8 , MMAGIC_IP_CMD_RELOAD = 9 , MMAGIC_IP_CMD_ENABLE_TCP_KEEPALIVE_OFFLOAD = 10 , MMAGIC_IP_CMD_DISABLE_TCP_KEEPALIVE_OFFLOAD = 11 ,
  MMAGIC_IP_CMD_SET_WHITELIST_FILTER = 12 , MMAGIC_IP_CMD_CLEAR_WHITELIST_FILTER = 13
}
 ip configuration command IDs More...
 
enum  mmagic_ping_var { MMAGIC_PING_VAR_TARGET = 0 , MMAGIC_PING_VAR_INTERVAL = 1 , MMAGIC_PING_VAR_COUNT = 2 }
 ping configuration variable IDs More...
 
enum  mmagic_ping_cmd {
  MMAGIC_PING_CMD_GET = 0 , MMAGIC_PING_CMD_SET = 1 , MMAGIC_PING_CMD_LOAD = 2 , MMAGIC_PING_CMD_COMMIT = 3 ,
  MMAGIC_PING_CMD_RUN = 8
}
 ping configuration command IDs More...
 
enum  mmagic_iperf_var { MMAGIC_IPERF_VAR_MODE = 0 , MMAGIC_IPERF_VAR_SERVER = 1 , MMAGIC_IPERF_VAR_PORT = 2 , MMAGIC_IPERF_VAR_AMOUNT = 3 }
 iperf configuration variable IDs More...
 
enum  mmagic_iperf_cmd {
  MMAGIC_IPERF_CMD_GET = 0 , MMAGIC_IPERF_CMD_SET = 1 , MMAGIC_IPERF_CMD_LOAD = 2 , MMAGIC_IPERF_CMD_COMMIT = 3 ,
  MMAGIC_IPERF_CMD_RUN = 8
}
 iperf configuration command IDs More...
 
enum  mmagic_sys_cmd {
  MMAGIC_SYS_CMD_GET = 0 , MMAGIC_SYS_CMD_SET = 1 , MMAGIC_SYS_CMD_LOAD = 2 , MMAGIC_SYS_CMD_COMMIT = 3 ,
  MMAGIC_SYS_CMD_RESET = 8 , MMAGIC_SYS_CMD_DEEP_SLEEP = 9 , MMAGIC_SYS_CMD_GET_VERSION = 10
}
 sys configuration command IDs More...
 
enum  mmagic_tcp_cmd {
  MMAGIC_TCP_CMD_GET = 0 , MMAGIC_TCP_CMD_SET = 1 , MMAGIC_TCP_CMD_LOAD = 2 , MMAGIC_TCP_CMD_COMMIT = 3 ,
  MMAGIC_TCP_CMD_CONNECT = 8 , MMAGIC_TCP_CMD_BIND = 9 , MMAGIC_TCP_CMD_RECV = 10 , MMAGIC_TCP_CMD_SEND = 11 ,
  MMAGIC_TCP_CMD_READ_POLL = 12 , MMAGIC_TCP_CMD_WRITE_POLL = 13 , MMAGIC_TCP_CMD_ACCEPT = 14 , MMAGIC_TCP_CMD_CLOSE = 15
}
 tcp configuration command IDs More...
 
enum  mmagic_tls_var { MMAGIC_TLS_VAR_ROOT_CA_CERTIFICATE = 0 , MMAGIC_TLS_VAR_CLIENT_CERTIFICATE = 1 , MMAGIC_TLS_VAR_CLIENT_PRIVATE_KEY = 2 }
 tls configuration variable IDs More...
 
enum  mmagic_tls_cmd { MMAGIC_TLS_CMD_GET = 0 , MMAGIC_TLS_CMD_SET = 1 , MMAGIC_TLS_CMD_LOAD = 2 , MMAGIC_TLS_CMD_COMMIT = 3 }
 tls configuration command IDs More...
 
enum  mmagic_ntp_var { MMAGIC_NTP_VAR_SERVER = 0 }
 ntp configuration variable IDs More...
 
enum  mmagic_ntp_cmd {
  MMAGIC_NTP_CMD_GET = 0 , MMAGIC_NTP_CMD_SET = 1 , MMAGIC_NTP_CMD_LOAD = 2 , MMAGIC_NTP_CMD_COMMIT = 3 ,
  MMAGIC_NTP_CMD_SYNC = 8 , MMAGIC_NTP_CMD_GET_TIME = 9
}
 ntp configuration command IDs More...
 
enum  mmagic_mqtt_cmd {
  MMAGIC_MQTT_CMD_GET = 0 , MMAGIC_MQTT_CMD_SET = 1 , MMAGIC_MQTT_CMD_LOAD = 2 , MMAGIC_MQTT_CMD_COMMIT = 3 ,
  MMAGIC_MQTT_CMD_START_AGENT = 8 , MMAGIC_MQTT_CMD_PUBLISH = 9 , MMAGIC_MQTT_CMD_SUBSCRIBE = 10 , MMAGIC_MQTT_CMD_STOP_AGENT = 11
}
 mqtt configuration command IDs More...
 

Functions

enum mmagic_status mmagic_controller_tx (struct mmagic_controller *controller, uint8_t stream_id, uint8_t submodule_id, uint8_t command_id, uint8_t subcommand_id, const uint8_t *buffer, size_t buffer_length)
 Sends a command to the agent. More...
 
enum mmagic_status mmagic_controller_rx (struct mmagic_controller *controller, uint8_t stream_id, uint8_t submodule_id, uint8_t command_id, uint8_t subcommand_id, uint8_t *buffer, size_t buffer_length, uint32_t timeout_ms)
 Waits for a response from the agent. More...
 
enum mmagic_status mmagic_controller_agent_sync (struct mmagic_controller *controller, uint32_t timeout_ms)
 Sends a sync request to the agent and waits for a sync response. More...
 
enum mmagic_status mmagic_controller_request_agent_reset (struct mmagic_controller *controller)
 Sends a reset request to the agent. More...
 

Macro Definition Documentation

◆ CONTROL_STREAM

#define CONTROL_STREAM   0

The stream ID of the control stream.

Definition at line 578 of file mmagic_controller.h.

◆ MMAGIC_CONTROLLER_DEFAULT_RESPONSE_TIMEOUT_MS

#define MMAGIC_CONTROLLER_DEFAULT_RESPONSE_TIMEOUT_MS   1000

The default timeout when waiting for a response from a command sent to the agent in ms.

Definition at line 581 of file mmagic_controller.h.

Enumeration Type Documentation

◆ mmagic_ip_cmd

ip configuration command IDs

Enumerator
MMAGIC_IP_CMD_GET 

Retrieve the value of a configuration variable.

MMAGIC_IP_CMD_SET 

Set the value of a configuration variable.

MMAGIC_IP_CMD_LOAD 

Reserved (unused)

MMAGIC_IP_CMD_COMMIT 

Commit the current configuration to flash.

MMAGIC_IP_CMD_STATUS 

Gets the status of the IP stack.

MMAGIC_IP_CMD_RELOAD 

Reloads the IP stack network configuration based on the current values in the subsystem config.

MMAGIC_IP_CMD_ENABLE_TCP_KEEPALIVE_OFFLOAD 

Enables sending periodic TCP keep-alive packets by the morse chip allowing the TCP connection to be maintained without waking up the host processor.

This needs to be enabled before opening a TCP connection. As of now, this feature will work only on the first TCP connection opened after this command.

MMAGIC_IP_CMD_DISABLE_TCP_KEEPALIVE_OFFLOAD 

Disables sending of TCP keepalive packets.

MMAGIC_IP_CMD_SET_WHITELIST_FILTER 

Sets the whitelist filter specifing which incoming packets can wake the system from standby mode.

MMAGIC_IP_CMD_CLEAR_WHITELIST_FILTER 

Clears any applied whitelist filters.

Definition at line 848 of file mmagic_controller.h.

◆ mmagic_ip_var

ip configuration variable IDs

Enumerator
MMAGIC_IP_VAR_IP_ADDR 

IP address to use for a static network connection.

This will take effect when the reload command is successfully executed.

MMAGIC_IP_VAR_NETMASK 

Netmask to use for a static network connection.

This will take effect when the reload command is successfully executed.

MMAGIC_IP_VAR_GATEWAY 

Gateway to use for a static network connection.

This will take effect when the reload command is successfully executed.

MMAGIC_IP_VAR_DNS_SERVER0 

Primary DNS server IP address.

If a value is specified this will override the primary DNS server provided by DHCP (if any). Changes will take effect when the reload command is successfully executed.

MMAGIC_IP_VAR_DNS_SERVER1 

Secondary DNS server IP address.

If a value is specified this will override the secondary DNS server provided by DHCP (if any). Changes will take effect when the reload command is successfully executed. Note that this option may be ignored by some IP stacks.

MMAGIC_IP_VAR_DHCP_ENABLED 

True to enable DHCP for IP address configuration, or false to use the static configuration given by ip_addr, netmask, and gateway.

This will take effect when the reload command is successfully executed.

MMAGIC_IP_VAR_DHCP_OFFLOAD 

If true, enables DHCP offload which allows the Morse chip to directly handle DHCP discovery and leases without waking up the host processor.

Note: this comes into effect only if ip.dhcp_enabled is also true.

MMAGIC_IP_VAR_LINK_STATUS_EVT_EN 

When set to true, IP link status notifications will be provided.

Setting this to false will suppress these notifications. Defaults to true.

Definition at line 815 of file mmagic_controller.h.

◆ mmagic_iperf_cmd

iperf configuration command IDs

Enumerator
MMAGIC_IPERF_CMD_GET 

Retrieve the value of a configuration variable.

MMAGIC_IPERF_CMD_SET 

Set the value of a configuration variable.

MMAGIC_IPERF_CMD_LOAD 

Reserved (unused)

MMAGIC_IPERF_CMD_COMMIT 

Commit the current configuration to flash.

MMAGIC_IPERF_CMD_RUN 

Starts an iperf session using the current values in the the subsystem config.

Definition at line 922 of file mmagic_controller.h.

◆ mmagic_iperf_var

iperf configuration variable IDs

Enumerator
MMAGIC_IPERF_VAR_MODE 

The iperf mode to use.

Valid values are udp_server, tcp_server, udp_client and tcp_client. If not set, defaults to udp_server.

MMAGIC_IPERF_VAR_SERVER 

IP address of server to connect to when in client mode.

MMAGIC_IPERF_VAR_PORT 

Specifies the local port to listen on when in server mode or the server port to send data to when in client mode.

MMAGIC_IPERF_VAR_AMOUNT 

This specifies the duration for client transfers specified either in seconds or bytes.

If this is negative, it specifies a time in seconds; if positive, it specifies the number of bytes to transmit.

Definition at line 905 of file mmagic_controller.h.

◆ mmagic_mqtt_cmd

mqtt configuration command IDs

Enumerator
MMAGIC_MQTT_CMD_GET 

Retrieve the value of a configuration variable.

MMAGIC_MQTT_CMD_SET 

Set the value of a configuration variable.

MMAGIC_MQTT_CMD_LOAD 

Reserved (unused)

MMAGIC_MQTT_CMD_COMMIT 

Commit the current configuration to flash.

MMAGIC_MQTT_CMD_START_AGENT 

Starts the MQTT agent.

Automatically handles reconnects with a backoff timer and saves up to 10 subscriptions across reconnects. Listen to "broker_connection" events for information about the state of the connection to the broker.

MMAGIC_MQTT_CMD_PUBLISH 

Publishes a message on a topic.

MMAGIC_MQTT_CMD_SUBSCRIBE 

Subscribes to a topic.

Messages will arrive in the "message_received" event.

MMAGIC_MQTT_CMD_STOP_AGENT 

Stops the MQTT agent.

Definition at line 1036 of file mmagic_controller.h.

◆ mmagic_ntp_cmd

ntp configuration command IDs

Enumerator
MMAGIC_NTP_CMD_GET 

Retrieve the value of a configuration variable.

MMAGIC_NTP_CMD_SET 

Set the value of a configuration variable.

MMAGIC_NTP_CMD_LOAD 

Reserved (unused)

MMAGIC_NTP_CMD_COMMIT 

Commit the current configuration to flash.

MMAGIC_NTP_CMD_SYNC 

Synchronizes internal time using the NTP server.

MMAGIC_NTP_CMD_GET_TIME 

Reads current internal time.

Definition at line 1019 of file mmagic_controller.h.

◆ mmagic_ntp_var

ntp configuration variable IDs

Enumerator
MMAGIC_NTP_VAR_SERVER 

The hostname or IP of the NTP server.

Defaults to "0.pool.ntp.org".

Definition at line 1012 of file mmagic_controller.h.

◆ mmagic_ping_cmd

ping configuration command IDs

Enumerator
MMAGIC_PING_CMD_GET 

Retrieve the value of a configuration variable.

MMAGIC_PING_CMD_SET 

Set the value of a configuration variable.

MMAGIC_PING_CMD_LOAD 

Reserved (unused)

MMAGIC_PING_CMD_COMMIT 

Commit the current configuration to flash.

MMAGIC_PING_CMD_RUN 

Commences a ping session using the current values in the the subsystem config.

Definition at line 890 of file mmagic_controller.h.

◆ mmagic_ping_var

ping configuration variable IDs

Enumerator
MMAGIC_PING_VAR_TARGET 

The IP address of the ping target.

MMAGIC_PING_VAR_INTERVAL 

The time interval between ping requests (in milliseconds).

MMAGIC_PING_VAR_COUNT 

This specifies the number of ping requests to send before terminating the session.

If this is zero or exceeds UINT16_MAX (65535) then it it will be set to UINT16_MAX.

Definition at line 878 of file mmagic_controller.h.

◆ mmagic_sys_cmd

sys configuration command IDs

Enumerator
MMAGIC_SYS_CMD_GET 

Retrieve the value of a configuration variable.

MMAGIC_SYS_CMD_SET 

Set the value of a configuration variable.

MMAGIC_SYS_CMD_LOAD 

Reserved (unused)

MMAGIC_SYS_CMD_COMMIT 

Commit the current configuration to flash.

MMAGIC_SYS_CMD_RESET 

Performs a soft reset.

MMAGIC_SYS_CMD_DEEP_SLEEP 

Enters deep sleep mode.

MMAGIC_SYS_CMD_GET_VERSION 

Gets the device firmware and hardware versions.

Definition at line 937 of file mmagic_controller.h.

◆ mmagic_tcp_cmd

tcp configuration command IDs

Enumerator
MMAGIC_TCP_CMD_GET 

Retrieve the value of a configuration variable.

MMAGIC_TCP_CMD_SET 

Set the value of a configuration variable.

MMAGIC_TCP_CMD_LOAD 

Reserved (unused)

MMAGIC_TCP_CMD_COMMIT 

Commit the current configuration to flash.

MMAGIC_TCP_CMD_CONNECT 

Opens a client TCP socket and returns its stream ID.

MMAGIC_TCP_CMD_BIND 

Opens a server TCP socket and returns its stream ID.

MMAGIC_TCP_CMD_RECV 

Reads from a socket.

MMAGIC_TCP_CMD_SEND 

Writes to a socket.

MMAGIC_TCP_CMD_READ_POLL 

Polls the socket till it is ready for reading.

MMAGIC_TCP_CMD_WRITE_POLL 

Polls the socket till it is ready for writing.

MMAGIC_TCP_CMD_ACCEPT 

Waits for an incoming socket connection and returns a new stream ID.

MMAGIC_TCP_CMD_CLOSE 

Closes and frees the socket.

Definition at line 956 of file mmagic_controller.h.

◆ mmagic_tls_cmd

tls configuration command IDs

Enumerator
MMAGIC_TLS_CMD_GET 

Retrieve the value of a configuration variable.

MMAGIC_TLS_CMD_SET 

Set the value of a configuration variable.

MMAGIC_TLS_CMD_LOAD 

Reserved (unused)

MMAGIC_TLS_CMD_COMMIT 

Commit the current configuration to flash.

Definition at line 999 of file mmagic_controller.h.

◆ mmagic_tls_var

tls configuration variable IDs

Enumerator
MMAGIC_TLS_VAR_ROOT_CA_CERTIFICATE 

Root certificate authority certificate.

Supported formats are PEM and DER. Must be null terminated if in PEM format.

MMAGIC_TLS_VAR_CLIENT_CERTIFICATE 

Certificate to identify the client.

Supported formats are PEM and DER. Must be null terminated if in PEM format.

MMAGIC_TLS_VAR_CLIENT_PRIVATE_KEY 

Client private key.

Supported formats are PEM and DER. Must be null terminated if in PEM format.

Definition at line 985 of file mmagic_controller.h.

◆ mmagic_wlan_cmd

wlan configuration command IDs

Enumerator
MMAGIC_WLAN_CMD_GET 

Retrieve the value of a configuration variable.

MMAGIC_WLAN_CMD_SET 

Set the value of a configuration variable.

MMAGIC_WLAN_CMD_LOAD 

Reserved (unused)

MMAGIC_WLAN_CMD_COMMIT 

Commit the current configuration to flash.

MMAGIC_WLAN_CMD_CONNECT 

Brings up the WLAN interface and connects to the AP with configured parameters.

MMAGIC_WLAN_CMD_DISCONNECT 

Disconnects and brings down the WLAN interface.

MMAGIC_WLAN_CMD_SCAN 

Starts an undirected scan for available networks.

MMAGIC_WLAN_CMD_GET_RSSI 

Retrieves the RSSI if the WLAN interface is up, else 0.

MMAGIC_WLAN_CMD_GET_MAC_ADDR 

Retrieves the MAC address if the WLAN interface is up.

MMAGIC_WLAN_CMD_WNM_SLEEP 

Requests entry or exit from extended sleep (wnm sleep) if the WLAN interface is up.

MMAGIC_WLAN_CMD_BEACON_MONITOR_ENABLE 

Enable beacon monitoring with the given filter settings.

If beacon monitoring is already enabled it will be reconfigured with the given arguments.

MMAGIC_WLAN_CMD_BEACON_MONITOR_DISABLE 

Disable beacon monitoring.

If beacon monitor is not enabled then this has no effect.

MMAGIC_WLAN_CMD_STANDBY_ENTER 

This puts the Morse chip into standby mode allowing the host processor to go to sleep while the Morse chip takes over certain functionality to keep the connection alive with the provision to wake up the host processor when certain conditions are met.

MMAGIC_WLAN_CMD_STANDBY_EXIT 

Forces the Morse chip to exit standby mode.

There may be certain instances such as a timer expiry, which cause the host chip to wake up independant of the Morse chip. In such situations, the host calls this function to instruct the Morse chip to exit standby mode and return to normal operating mode.

MMAGIC_WLAN_CMD_STANDBY_SET_STATUS_PAYLOAD 

Sets the user payload for the standby status packet.

Once standby mode is enabled, the Morse chip will periodically emit a UDP standby status packet regardless of whether it is in standby or not. The UDP packet will also be sent immediately upon entering or exiting Standby mode. If this command is not executed then the standby status packet will contain no payload.

MMAGIC_WLAN_CMD_STANDBY_SET_WAKE_FILTER 

Configures the standby mode UDP wake packet filter.

The system can be woken up from standby mode by sending it a UDP wake packet. If a wake filter is set using this function then the wake packet will only wake up the system if the specified filter pattern matches the payload at the specified offset within the payload. If this command is not executed then any wake packet will wake up the system.

MMAGIC_WLAN_CMD_STANDBY_SET_CONFIG 

Sets the standby mode configuration parameters.

If this command is not executed then the defaults are as specified.

MMAGIC_WLAN_CMD_GET_STA_STATUS 

Retrieves the STA status of the WLAN interface.

Definition at line 759 of file mmagic_controller.h.

◆ mmagic_wlan_var

wlan configuration variable IDs

Enumerator
MMAGIC_WLAN_VAR_COUNTRY_CODE 

Two character country code used to identify the regulatory domain.

MMAGIC_WLAN_VAR_SSID 

SSID of the AP to connect to, can be 1-32 characters long.

MMAGIC_WLAN_VAR_PASSWORD 

Password used when associating, 1-100 characters long.

MMAGIC_WLAN_VAR_SECURITY 

Security type to used when associating.

MMAGIC_WLAN_VAR_RAW_PRIORITY 

Priority to request if raw is supported by the AP.

Valid priorities are 0-7. -1 disables RAW.

MMAGIC_WLAN_VAR_BSSID 

BSSID of the ap to associate to, all 0x00 for any.

MMAGIC_WLAN_VAR_PMF_MODE 

Protected Management Frame mode to use (802.11w).

MMAGIC_WLAN_VAR_STATION_TYPE 

S1G non-AP STA type.

MMAGIC_WLAN_VAR_RTS_THRESHOLD 

The RTS threshold (in octets) to set, or 0 to disable.

MMAGIC_WLAN_VAR_SGI_ENABLED 

Boolean value indicating whether SGI support should be enabled.

MMAGIC_WLAN_VAR_SUBBANDS_ENABLED 

Boolean value indicating whether sub-band support should be enabled.

MMAGIC_WLAN_VAR_AMPDU_ENABLED 

Boolean value indicating whether AMPDU support should be enabled.

MMAGIC_WLAN_VAR_POWER_SAVE_MODE 

Sets the 802.11 power save mode.

MMAGIC_WLAN_VAR_FRAGMENT_THRESHOLD 

Sets the 802.11 fragmentation threshold.

The fragmentation threshold (in octets) to set, or 0 to disable.

MMAGIC_WLAN_VAR_CAC_ENABLED 

Whether Centralized Authentication Controlled is enabled on the STA.

MMAGIC_WLAN_VAR_OFFLOAD_ARP_RESPONSE 

If true, enables ARP response offload which allows the Morse chip to directly respond to ARP requests without waking up the host processor.

MMAGIC_WLAN_VAR_OFFLOAD_ARP_REFRESH_S 

If non zero, enables ARP refresh offload with the specified interval in seconds.

Note: ARP response offload needs to be enabled for this feature to work.

MMAGIC_WLAN_VAR_MIN_HEALTH_CHECK_INTVL_MS 

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

If this parameter is 0 then health checks will always happen at the max_interval_ms value. min_interval_ms must always be less than or equal to max_interval_ms. If only min_health_check_intvl_ms is specified, then max_health_check_intvl_ms is assumed to be unbounded.

MMAGIC_WLAN_VAR_MAX_HEALTH_CHECK_INTVL_MS 

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

If this parameter is 0 then periodic health checks will be disabled. min_interval_ms must always be less than or equal to max_interval_ms. Set this to UINT32_MAX to have the maximum unbounded. If only max_health_check_intvl_ms is specified, then min_health_check_intvl_ms is assumed to be 0.

MMAGIC_WLAN_VAR_NDP_PROBE_ENABLED 

Boolean value indicating whether NDP probe support should be enabled.

Will only take effect after a connect or scan command is sent.

MMAGIC_WLAN_VAR_STA_SCAN_INTERVAL_BASE_S 

The base scan interval (in seconds) to use when (re)connecting.

See documentation of mmwlan_sta_args.scan_interval_base_s for further details. Note that changes will only take effect on invocation of wlan-connect.

MMAGIC_WLAN_VAR_STA_SCAN_INTERVAL_LIMIT_S 

The maximum interval between scan attempts when (re)connecting.

See documentation of mmwlan_sta_args.scan_interval_limit_s for further details. Note that changes will only take effect on invocation of wlan-connect.

MMAGIC_WLAN_VAR_QOS_0_PARAMS 

The default QoS queue configuration for Access Category 0 (AC_BE) that is active while the station is connecting to an Access Point.

This is a string containing the following comma separated integer values (in order): aifs,cw_min,cw_max,txop_max_us. For example: 3,15,1023,15008. More information about the individual parameters can be found in the API documentation for mmwlan_qos_queue_params.

MMAGIC_WLAN_VAR_QOS_1_PARAMS 

The default QoS queue configuration for Access Category 1 (AC_BK) that is active while the station is connecting to an Access Point.

This is a string containing the following comma separated integer values (in order): aifs,cw_min,cw_max,txop_max_us. For example: 7,15,1023,15008. More information about the individual parameters can be found in the API documentation for mmwlan_qos_queue_params.

MMAGIC_WLAN_VAR_QOS_2_PARAMS 

The default QoS queue configuration for Access Category 2 (AC_VI) that is active while the station is connecting to an Access Point.

This is a string containing the following comma separated integer values (in order): aifs,cw_min,cw_max,txop_max_us. For example: 2,7,15,15008. More information about the individual parameters can be found in the API documentation for mmwlan_qos_queue_params.

MMAGIC_WLAN_VAR_QOS_3_PARAMS 

The default QoS queue configuration for Access Category 3 (AC_VO) that is active while the station is connecting to an Access Point.

This is a string containing the following comma separated integer values (in order): aifs,cw_min,cw_max,txop_max_us. For example: 2,3,7,15008. More information about the individual parameters can be found in the API documentation for mmwlan_qos_queue_params.

MMAGIC_WLAN_VAR_MCS10_MODE 

The currently configured MCS10 behavior.

This only takes effect after calling the WLAN connect command. This is an enum with 3 modes: disabled, which will never use MCS10, forced, which will always use MCS10 instead of MCS0 if the bandwidth is 1 MHz, and auto, which will use MCS10 on retries instead of MCS0 when the bandwidth is 1 MHz.

MMAGIC_WLAN_VAR_STA_EVT_EN 

When set to true, STA event notifications will be provided.

Setting this to false will suppress these notifications. Defaults to false.

MMAGIC_WLAN_VAR_DUTY_CYCLE_MODE 

The duty cycle air time distribution mode.

The duty cycle mode can be set to spread, where the air time is spread evenly across the window; or burst, where air time is available to be consumed immediately.

Definition at line 657 of file mmagic_controller.h.

Function Documentation

◆ mmagic_controller_agent_sync()

enum mmagic_status mmagic_controller_agent_sync ( struct mmagic_controller *  controller,
uint32_t  timeout_ms 
)

Sends a sync request to the agent and waits for a sync response.

This function will block waiting for a response from the agent or until the provided timeout duration elapses.

Parameters
controllerController context.
timeout_msDuration to wait for a sync response from the agent.
Returns
MMAGIC_STATUS_OK on successful sync, else an appropriate error code.

◆ mmagic_controller_request_agent_reset()

enum mmagic_status mmagic_controller_request_agent_reset ( struct mmagic_controller *  controller)

Sends a reset request to the agent.

A reset is considered successful when the agent returns a start notification. On success, the controller agent_start_cb function will be executed.

Note
This function will return once a reset request has been transmitted. It is up to the application to handle waiting for the start callback to be called.
Both this function and mmagic_controller_sys_reset will perform a soft reset of the agent, however this function should be preferred as the reset is handled at a lower layer in the agents MMAGIC stack.
Parameters
controllerController context.
Returns
MMAGIC_STATUS_OK on successful transmission, else an error code.

◆ mmagic_controller_rx()

enum mmagic_status mmagic_controller_rx ( struct mmagic_controller *  controller,
uint8_t  stream_id,
uint8_t  submodule_id,
uint8_t  command_id,
uint8_t  subcommand_id,
uint8_t *  buffer,
size_t  buffer_length,
uint32_t  timeout_ms 
)

Waits for a response from the agent.

Parameters
controllerController context.
stream_idThe stream id to wait on.
submodule_idThe submodule to wait on.
command_idThe command to wait on.
subcommand_idA sub command or resource id if applicable.
bufferA pointer to a buffer to load with any returned data. May be NULL if none.
buffer_lengthLength of above buffer.
timeout_msThe time in milliseconds to wait for a response from the agent, set to UINT32_MAX for an indefinite wait.
Returns
MMAGIC_STATUS_OK on success, else an error code.

◆ mmagic_controller_tx()

enum mmagic_status mmagic_controller_tx ( struct mmagic_controller *  controller,
uint8_t  stream_id,
uint8_t  submodule_id,
uint8_t  command_id,
uint8_t  subcommand_id,
const uint8_t *  buffer,
size_t  buffer_length 
)

Sends a command to the agent.

Parameters
controllerA user context to be passed.
stream_idThe stream id to send this command on.
submodule_idThe submodule to target with this command.
command_idThe command.
subcommand_idA sub command or resource id if applicable.
bufferA pointer to any data associated with this command. May be NULL if none.
buffer_lengthLength of above data.
Returns
MMAGIC_STATUS_OK on success, else an error code.