Migration Example#
This section provides an example of rewriting a WiSeConnect SDK v2.x Wi-Fi client (station mode) application with the v3.x API.
Some code, such as that for event handlers, is omitted for brevity.
In the example below:
In the
main()
function, we replaced the v2.xrsi_task_create()
API call with the FreeRTOSosThreadNew()
API call, to create a new FreeRTOS task to run the application.In the initialization function, we replaced the v2.x
rsi_task_create()
andrsi_wireless_init()
API calls with the v3.x sl_net_init() API call, to initialize the WiSeConnect SDK and SiWx917 device.In the initialization function, we replaced the v2.x
rsi_wlan_scan()
,rsi_wlan_set()
,rsi_wlan_connect()
, andrsi_config_ipaddress()
API calls with the v3.x sl_net_set_profile(), sl_net_set_credential(), and sl_net_up() API calls, to scan for a wireless access point, connect to it, and configure an IP address.In v3.x, no task needs to be created by the application to process events, as compared with v2.x where an
rsi_wireless_driver_task
must be created. The v3.x SDK automatically creates abus_thread
andevent_thread
to manage events.
v2.x API Code | v3.x API Code |
---|---|
|
|
| |
|
|
| |
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
|