24#define MW_MSG_MAX_BUFLEN 512
27#define MW_CMD_HEADLEN (2 * sizeof(uint16_t))
30#define MW_CMD_MAX_BUFLEN (MW_MSG_MAX_BUFLEN - MW_CMD_HEADLEN)
33#define MW_SSID_MAXLEN 32
35#define MW_PASS_MAXLEN 64
38#define MW_GT_NICKNAME_MAX 32
40#define MW_GT_SECURITY_MAX 32
42#define MW_GT_TAGLINE_MAX 32
44#define MW_GT_AVATAR_WIDTH 32
46#define MW_GT_AVATAR_HEIGHT 48
48#define MW_GT_TG_TOKEN_MAX 64
275#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
mw_sock_stat
Socket status.
#define MW_CMD_MAX_BUFLEN
Maximum data length contained inside command buffer.
enum PACKED mw_command
Supported commands.
#define MW_GT_AVATAR_HEIGHT
Gamertag avatar graphick height in pixels.
#define MW_PASS_MAXLEN
Maximum password length (including '\0').
union mw_cmd mw_cmd
Command sent to system FSM.
#define MW_GT_TAGLINE_MAX
Gamertag tagline maximum length.
#define MW_GT_SECURITY_MAX
Gamertag security maximum length.
#define MW_GT_AVATAR_WIDTH
Gamertag avatar graphick width in pixels.
#define MW_SSID_MAXLEN
Maximum SSID length (including '\0').
#define MW_GT_NICKNAME_MAX
Gamertag nickname maximum length.
#define MW_GT_TG_TOKEN_MAX
Telegram token maximum length.
enum PACKED mw_phy_type
WiFi PHY configuration for the connection to the AP.
mw_state
MwState Possible states of the system state machine.
enum PACKED mw_security
Supported security protocols.
@ MW_SOCK_NONE
Unused socket.
@ MW_SOCK_TCP_EST
TCP socket, connection established.
@ MW_SOCK_UDP_READY
UDP socket ready for sending/receiving.
@ MW_SOCK_TCP_LISTEN
Socket bound and listening.
@ MW_ST_INIT
Initialization state.
@ MW_ST_AP_JOIN
Trying to join an access point.
@ MW_ST_IDLE
Idle state, until connected to an AP.
@ MW_ST_MAX
Limit number for state machine.
@ MW_ST_READY
Connected to The Internet.
@ MW_ST_SCAN
Scanning access points.
@ MW_ST_TRANSPARENT
Transparent communication state.
#define PACKED
Macro for packing structures and enumerates.
MW_CMD_GAME_ENDPOINT_SET
Set game API endpoint.
MW_CMD_WIFI_ADV_SET
Set advanced WiFi parameters.
MW_CMD_GAMERTAG_SET
Configures a gamertag.
MW_SEC_OPEN
Open WiFi network.
MW_CMD_HTTP_CLEANUP
Clean request data.
MW_CMD_SERVER_URL_SET
Set the main server URL.
MW_CMD_IP_CFG
Configure IPv4.
MW_CMD_HTTP_METHOD_SET
Set HTTP request method.
MW_CMD_UPGRADE_LIST
Get firmware upgrade versions.
MW_CMD_DEF_AP_CFG
Set default AP configuration.
MW_CMD_GAME_REQUEST
Perform a game API request.
MW_CMD_HTTP_OPEN
Open HTTP request.
MW_CMD_SLEEP
Set the module to sleep mode.
MW_CMD_OK
OK command reply.
MW_CMD_UPGRADE_PERFORM
Start firmware upgrade.
MW_CMD_GAMERTAG_GET
Gets a stored gamertag.
MW_CMD_LOG
Write a message to log trace.
MW_CMD_SNTP_CFG
Configure SNTP service.
MW_CMD_BSSID_GET
Gets the WiFi BSSID.
MW_CMD_NV_CFG_SAVE
Save non-volatile config.
MW_SEC_WPA2_PSK
WPA2 PSK security.
MW_CMD_HTTP_CERT_QUERY
Query the X.509 hash of cert.
MW_CMD_UDP_SET
Configure UDP socket.
MW_PHY_11B
Legacy, do not use unless necessary.
MW_CMD_SERVER_URL_GET
Get the main server URL.
MW_CMD_HTTP_URL_SET
Set HTTP URL for request.
MW_SEC_WPA_PSK
WPA PSK security.
MW_CMD_AP_CFG
Configure access point.
MW_CMD_TCP_BIND
Bind TCP socket to port.
MW_CMD_WIFI_ADV_GET
Get advanced WiFi parameters.
MW_CMD_HTTP_HDR_ADD
Add HTTP request header.
MW_CMD_TCP_CON
Connect TCP socket.
MW_CMD_SNTP_CFG_GET
Get SNTP configuration.
MW_CMD_GAME_KEYVAL_ADD
Add key/value appended to requests.
MW_CMD_FLASH_ID
Get WiFi flash chip identifiers.
MW_CMD_DT_SET
Set date and time.
MW_CMD_DEF_CFG_SET
Set default configuration.
MW_CMD_AP_LEAVE
Leave previously joined AP.
MW_CMD_SOCK_STAT
Get socket status.
MW_CMD_FLASH_READ
Read from WiFi module flash.
MW_CMD_HTTP_CERT_SET
Set HTTPS certificate.
MW_SEC_WPA_WPA2_PSK
WPA or WPA2 security.
MW_CMD_CLOSE
Disconnect and free TCP/UDP socket.
MW_CMD_FLASH_WRITE
Write to WiFi module flash.
MW_PHY_11BG
No 802.11n compatibility.
MW_CMD_HTTP_FINISH
Finish HTTP request.
MW_CMD_AP_SCAN
Scan for access points.
MW_CMD_SYS_STAT
Get system status.
MW_CMD_IP_CFG_GET
Get IPv4 configuration.
MW_CMD_FLASH_ERASE
Erase sector from WiFi flash.
MW_CMD_VERSION
Get firmware version.
MW_CMD_FACTORY_RESET
Set default configuratioSet default configuration.
MW_CMD_DEF_AP_CFG_GET
Get default AP configuration.
MW_CMD_DATETIME
Get date and time.
MW_CMD_AP_JOIN
Join access point.
MW_CMD_IP_CURRENT
Get current IPv4 configuration.
MW_CMD_HTTP_HDR_DEL
Delete HTTP request header.
MW_CMD_HRNG_GET
Gets random numbers.
MW_CMD_AP_CFG_GET
Get access point configuration.
uint8_t manufacturer
Manufacturer ID.
uint16_t device
Device ID.
uint8_t num_paths
Number of paths.
uint8_t num_kv_pairs
Number of key/value pairs.
uint8_t method
Request method.
Gamertag set message data.
uint8_t reserved[3]
Reserved, set to 0.
uint8_t slot
Slot to store gamertag (0 to 2)
struct mw_gamertag gamertag
Gamertag to set.
uint8_t avatar_pal[32]
Avatar image palette.
int id
Unique gamertag id.
char tg_token[MW_GT_TG_TOKEN_MAX]
Telegram token.
char security[MW_GT_SECURITY_MAX]
User security string.
char nickname[MW_GT_NICKNAME_MAX]
User nickname.
char tagline[MW_GT_TAGLINE_MAX]
User defined text tag.
uint8_t avatar_tiles[MW_GT_AVATAR_WIDTH *MW_GT_AVATAR_HEIGHT/2]
Avatar image tiles.
IP configuration parameters.
union ip_addr gateway
Gateway IP address in binary format.
union ip_addr dns2
DNS server 2 IP address in binary format.
union ip_addr mask
Subnet mask in binary IP format.
union ip_addr addr
Host IP address in binary format.
union ip_addr dns1
DNS server 1 IP address in binary format.
AP configuration message.
enum mw_phy_type phy_type
PHY type bitmask.
uint8_t cfg_num
Configuration number.
char ssid[MW_SSID_MAXLEN]
SSID string.
char pass[MW_PASS_MAXLEN]
Password string.
uint32_t reserved
Reserved, set to 0.
uint16_t port
Port to bind to.
uint8_t channel
Channel used for the socket bound to port.
char dt_str[MW_CMD_MAX_BUFLEN - sizeof(uint64_t)]
Date and time in textual format.
Flash memory address and data.
uint8_t data[MW_CMD_MAX_BUFLEN - sizeof(uint32_t)]
Data associated to the address.
uint16_t len
Length of the block.
uint32_t addr
Start address.
char dst_port[6]
TCP destination port string.
char src_port[6]
TCP source port string.
char dst_addr[]
Data payload.
IP configuration message.
uint8_t cfg_slot
Configuration slot.
uint8_t reserved[3]
Reserved (set to 0)
struct mw_ip_cfg ip
IPv4 configuration data.
SNTP and timezone configuration.
uint16_t up_delay
Update delay in seconds (min: 15)
int8_t tz
Timezone (from -11 to 13)
char servers[MW_CMD_MAX_BUFLEN - 4]
Payload with remote IP and port.
uint32_t remote_ip
IP of the remote end.
char payload[MW_CMD_MAX_BUFLEN - 4 - 2]
Data payload.
Advanced WiFi configuration.
uint32_t rx_max_single_pkt_len
WiFi RX max single packet size.
uint8_t reserved[3]
Unused, set to 0.
uint8_t ampdu_rx_enable
WiFi AMPDU RX feature enable flag.
uint8_t rx_buf_num
WiFi RX buffer number.
uint32_t rx_buf_len
WiFi RX buffer size.
uint8_t left_continuous_rx_buf_num
WiFi Rx left continuous rx buffer number.
uint32_t rx_ampdu_buf_len
WiFi AMPDU RX buffer length.
uint8_t amsdu_rx_enable
WiFi AMSDU RX feature enable flag.
uint8_t qos_enable
WiFi QOS feature enable flag.
uint8_t rx_pkt_num
WiFi RX packet number.
uint8_t rx_ba_win
WiFi Block Ack RX window size.
uint8_t rx_ampdu_buf_num
WiFi AMPDU RX buffer number.
uint8_t tx_buf_num
WiFi TX buffer number.
uint32_t addr
IP address in 32 bit form.
Command sent to system FSM.
struct mw_msg_flash_range fl_range
Flash memory range.
struct mw_gamertag_set_msg gamertag_set
Gamertag set.
struct mw_msg_date_time date_time
Date and time message.
struct mw_msg_sntp_cfg sntp_cfg
SNTP client configuration.
uint16_t rnd_len
Length of the random buffer to fill.
uint16_t fl_sect
Flash sector.
struct mw_msg_in_addr in_addr
Internet address.
uint16_t w_data[MW_CMD_MAX_BUFLEN/sizeof(uint16_t)]
RAW data in uint16_t format.
struct mw_wifi_adv_cfg wifi_adv_cfg
Advanced WiFi configuration.
struct mw_gamertag gamertag_get
Gamertag get.
struct mw_flash_id flash_id
Flash chip identifiers.
struct mw_msg_flash_data fl_data
Flash memory data.
struct mw_msg_bind bind
Bind message.
uint16_t data_len
Data length.
uint16_t cmd
Command code.
char packet[MW_CMD_MAX_BUFLEN+2 *sizeof(uint16_t)]
Packet raw data.
struct mw_msg_ip_cfg ip_cfg
IP configuration.
uint32_t dw_data[MW_CMD_MAX_BUFLEN/sizeof(uint32_t)]
RAW data in uint32_t format.
struct mw_ga_request ga_request
Game API request.
union mw_msg_sys_stat sys_stat
System status.
uint8_t data[MW_CMD_MAX_BUFLEN]
RAW data in uint8_t format.
struct mw_msg_ap_cfg ap_cfg
Access Point configuration.
enum mw_state sys_stat
System status.
uint16_t reserved
Reserved flags.
uint8_t dt_ok
Date and time synchronized at least once.
uint8_t online
Module is connected to the Internet.
uint16_t ch_ev
Channel flags with the pending event.
uint8_t cfg
Default network configuration.
uint32_t st_flags
Accesses all the flags at once.
uint8_t cfg_ok
Configuration OK.
General purpose utilities.