Skip to main content

WiFi

MicroSui Object-style WiFi client for handling WiFi connectivity in MicroSui.

Provides a small OO-like API (struct + function pointers) interface to manage WiFi connections in embedded environments where MicroSui is deployed.

Client capabilities: Connect to a WiFi network by SSID and password, Disconnect from the current WiFi network and release resources.

IMPORTANT NOTE:
Compatibility & Support: This class is fully supported and production-stable (as of this documentation release) on:
      - ESP32 series — including all existing and future variants within the family
⚠️ Support for additional embedded architectures may be added in upcoming releases.

Inspired by the Mysten Labs TypeScript SDK, adapted for embedded C.


File Location

Defined in microsui-lib/src/WiFi.c


Indexs

Constructors

Methods


Constructors

WiFi_connect

WiFi_connect(const char* ssid, const char* password): MicroSuiWiFi

Creates a MicroSuiWiFi instance and attempts to connect to the specified Wi-Fi network using the provided ssid and password.

Parameters

NameTypeDescription
ssidconst char*Null-terminated SSID of the WiFi network
passwordconst char*Null-terminated password of the WiFi network

Returns

Example usage

const char* ssid = "mySSID";
const char* pass = "myPassword";

MicroSuiClient wifi = WiFi_connect(ssid, pass);

if (wifi.ssid != NULL)
// WiFi client created successfully

Methods

disconnect

disconnect(MicroSuiWiFi *self): (void)

Safely disconnects the Wi-Fi connection, cleans up the network stack, and releases any memory allocated during the connection.

Parameters

NameTypeDescription
selfMicroSuiWiFi *Pointer to wifi client instance

Returns

  • void.

Example usage

const char* ssid = "mySSID";
const char* pass = "myPassword";

MicroSuiClient wifi = WiFi_connect(ssid, pass);

// ...

wifi.disconnect(wifi);

if (wifi.ssid == NULL)
// WiFi was disconected an memory was cleaned