SGDK
A free and open development kit for the Sega Mega Drive
Loading...
Searching...
No Matches
mw-msg.h File Reference

MegaWiFi command message definitions. More...

#include "types.h"
#include "sys.h"
Include dependency graph for mw-msg.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

union  ip_addr
 IPv4 address. More...
struct  mw_msg_in_addr
 TCP/UDP address message. More...
struct  mw_ip_cfg
 IP configuration parameters. More...
struct  mw_msg_ap_cfg
 AP configuration message. More...
struct  mw_msg_ip_cfg
 IP configuration message. More...
struct  mw_msg_sntp_cfg
 SNTP and timezone configuration. More...
struct  mw_msg_date_time
 Date and time message. More...
struct  mw_msg_flash_data
 Flash memory address and data. More...
struct  mw_msg_flash_range
 Flash memory block. More...
struct  mw_msg_bind
 Bind message data. More...
struct  mw_wifi_adv_cfg
 Advanced WiFi configuration. More...
struct  mw_gamertag
 Gamertag data. More...
struct  mw_gamertag_set_msg
 Gamertag set message data. More...
union  mw_msg_sys_stat
 System status. More...
struct  mw_flash_id
 Flash chip identifiers. More...
struct  mw_ga_request
 Game API request. More...
struct  mw_ping_request
struct  mw_ping_response
struct  mw_upgrade_list_response
union  mw_cmd
 Command sent to system FSM. More...
struct  mw_reuse_payload
 Payload with remote IP and port. More...

Macros

#define MW_MSG_MAX_BUFLEN   512
 Maximum buffer length (bytes)
#define MW_CMD_HEADLEN   (2 * sizeof(uint16_t))
 Command header length (command code and data length fields).
#define MW_CMD_MAX_BUFLEN   (MW_MSG_MAX_BUFLEN - MW_CMD_HEADLEN)
 Maximum data length contained inside command buffer.
#define MW_SSID_MAXLEN   32
 Maximum SSID length (including '\0').
#define MW_PASS_MAXLEN   64
 Maximum password length (including '\0').
#define MW_GT_NICKNAME_MAX   32
 Gamertag nickname maximum length.
#define MW_GT_SECURITY_MAX   32
 Gamertag security maximum length.
#define MW_GT_TAGLINE_MAX   32
 Gamertag tagline maximum length.
#define MW_GT_AVATAR_WIDTH   32
 Gamertag avatar graphick width in pixels.
#define MW_GT_AVATAR_HEIGHT   48
 Gamertag avatar graphick height in pixels.
#define MW_GT_TG_TOKEN_MAX   64
 Telegram token maximum length.

Typedefs

typedef union mw_cmd mw_cmd
 Command sent to system FSM.

Enumerations

enum  mw_state {
  MW_ST_INIT = 0 , MW_ST_IDLE , MW_ST_AP_JOIN , MW_ST_SCAN ,
  MW_ST_READY , MW_ST_TRANSPARENT , MW_ST_MAX
}
 MwState Possible states of the system state machine. More...
enum  mw_sock_stat { MW_SOCK_NONE = 0 , MW_SOCK_TCP_LISTEN , MW_SOCK_TCP_EST , MW_SOCK_UDP_READY }
 Socket status. More...

Variables

enum PACKED mw_command
 Supported commands.
 MW_CMD_OK = 0
 OK command reply.
 MW_CMD_VERSION = 1
 Get firmware version.
 MW_CMD_ECHO = 2
 Echo data.
 MW_CMD_AP_SCAN = 3
 Scan for access points.
 MW_CMD_AP_CFG = 4
 Configure access point.
 MW_CMD_AP_CFG_GET = 5
 Get access point configuration.
 MW_CMD_IP_CURRENT = 6
 Get current IPv4 configuration.
 MW_CMD_IP_CFG = 8
 Configure IPv4.
 MW_CMD_IP_CFG_GET = 9
 Get IPv4 configuration.
 MW_CMD_DEF_AP_CFG = 10
 Set default AP configuration.
 MW_CMD_DEF_AP_CFG_GET = 11
 Get default AP configuration.
 MW_CMD_AP_JOIN = 12
 Join access point.
 MW_CMD_AP_LEAVE = 13
 Leave previously joined AP.
 MW_CMD_TCP_CON = 14
 Connect TCP socket.
 MW_CMD_TCP_BIND = 15
 Bind TCP socket to port.
 MW_CMD_CLOSE = 17
 Disconnect and free TCP/UDP socket.
 MW_CMD_UDP_SET = 18
 Configure UDP socket.
 MW_CMD_SOCK_STAT = 20
 Get socket status.
 MW_CMD_PING = 21
 Ping host.
 MW_CMD_SNTP_CFG = 22
 Configure SNTP service.
 MW_CMD_SNTP_CFG_GET = 23
 Get SNTP configuration.
 MW_CMD_DATETIME = 24
 Get date and time.
 MW_CMD_DT_SET = 25
 Set date and time.
 MW_CMD_FLASH_WRITE = 26
 Write to WiFi module flash.
 MW_CMD_FLASH_READ = 27
 Read from WiFi module flash.
 MW_CMD_FLASH_ERASE = 28
 Erase sector from WiFi flash.
 MW_CMD_FLASH_ID = 29
 Get WiFi flash chip identifiers.
 MW_CMD_SYS_STAT = 30
 Get system status.
 MW_CMD_DEF_CFG_SET = 31
 Set default configuration.
 MW_CMD_HRNG_GET = 32
 Gets random numbers.
 MW_CMD_BSSID_GET = 33
 Gets the WiFi BSSID.
 MW_CMD_GAMERTAG_SET = 34
 Configures a gamertag.
 MW_CMD_GAMERTAG_GET = 35
 Gets a stored gamertag.
 MW_CMD_LOG = 36
 Write a message to log trace.
 MW_CMD_FACTORY_RESET = 37
 Set default configuratioSet default configuration.
 MW_CMD_SLEEP = 38
 Set the module to sleep mode.
 MW_CMD_HTTP_URL_SET = 39
 Set HTTP URL for request.
 MW_CMD_HTTP_METHOD_SET = 40
 Set HTTP request method.
 MW_CMD_HTTP_CERT_QUERY = 41
 Query the X.509 hash of cert.
 MW_CMD_HTTP_CERT_SET = 42
 Set HTTPS certificate.
 MW_CMD_HTTP_HDR_ADD = 43
 Add HTTP request header.
 MW_CMD_HTTP_HDR_DEL = 44
 Delete HTTP request header.
 MW_CMD_HTTP_OPEN = 45
 Open HTTP request.
 MW_CMD_HTTP_FINISH = 46
 Finish HTTP request.
 MW_CMD_HTTP_CLEANUP = 47
 Clean request data.
 MW_CMD_SERVER_URL_GET = 49
 Get the main server URL.
 MW_CMD_SERVER_URL_SET = 50
 Set the main server URL.
 MW_CMD_WIFI_ADV_GET = 51
 Get advanced WiFi parameters.
 MW_CMD_WIFI_ADV_SET = 52
 Set advanced WiFi parameters.
 MW_CMD_NV_CFG_SAVE = 53
 Save non-volatile config.
 MW_CMD_UPGRADE_LIST = 54
 Get firmware upgrade versions.
 MW_CMD_UPGRADE_PERFORM = 55
 Start firmware upgrade.
 MW_CMD_GAME_ENDPOINT_SET = 56
 Set game API endpoint.
 MW_CMD_GAME_KEYVAL_ADD = 57
 Add key/value appended to requests.
 MW_CMD_GAME_REQUEST = 58
 Perform a game API request.
enum PACKED mw_security
 Supported security protocols.
 MW_SEC_OPEN = 0
 Open WiFi network.
 MW_SEC_WEP
 WEP security.
 MW_SEC_WPA_PSK
 WPA PSK security.
 MW_SEC_WPA2_PSK
 WPA2 PSK security.
 MW_SEC_WPA_WPA2_PSK
 WPA or WPA2 security.
 MW_SEC_WPA2_ENTERPRISE
 WPA2 Enterprise security.
 MW_SEC_WPA3_PSK
 WPA3 PSK security.
 MW_SEC_WPA2_WPA3_PSK
 WPA2 or WPA3 security.
 MW_SEC_WAPI_PSK
 WAPI PSK security.
 MW_SEC_OWE
 OWE security.
 MW_SEC_UNKNOWN
 Unknown security.
enum PACKED mw_phy_type
 WiFi PHY configuration for the connection to the AP.
 MW_PHY_11B = 1
 Legacy, do not use unless necessary.
 MW_PHY_11BG = 3
 No 802.11n compatibility.

Detailed Description

MegaWiFi command message definitions.