ESP32 as wifi module in Legato 21.05.0

I have a ESP32 kernel module using SPI working from the command line on WP7702,

What do i have to change so the wifiService will work with ESP32 instead of a TI module ?

Dec 19 15:23:09 swi-mdm9x28-wp user.info Legato: INFO | dcsDaemon[7935]/dcsDaemon T=main | dcsTechRank.c dcsTechRank_Init() 858 | Wifi client is available
Dec 19 15:23:09 swi-mdm9x28-wp user.info Legato: INFO | dcsDaemon[7935]/dcsWifi T=main | dcsWifi.c DcsWifiClientStart() 250 | Starting Wifi client
Dec 19 15:23:09 swi-mdm9x28-wp user.info Legato: INFO | wifiService[8056] | WIFI_START
Dec 19 15:23:09 swi-mdm9x28-wp user.err Legato: =ERR= | wifiService[8056] | ERR* failed to write i2c data
Dec 19 15:23:09 swi-mdm9x28-wp user.err Legato: =ERR= | wifiService[8056] | FTL* Failed to enable PCA9548A I2C switch
Dec 19 15:23:09 swi-mdm9x28-wp user.info Legato: INFO | wifiService[8056] | Clean up due to unknown error
Dec 19 15:23:09 swi-mdm9x28-wp user.warn Legato: -WRN- | wifiService[8056]/daemon T=main | pa_wifi_client.c pa_wifiClient_Start() 532 | Failed to start WiFi client command “WIFI_START” systemResult (32512)
Dec 19 15:23:09 swi-mdm9x28-wp user.warn Legato: -WRN- | wifiService[8056]/daemon T=main | le_wifiClient.c le_wifiClient_Start() 821 | Unable to start WIFI client; return code: -6
Dec 19 15:23:09 swi-mdm9x28-wp user.warn Legato: -WRN- | dcsDaemon[7935]/dcsWifi T=main | dcsWifi.c le_dcsWifi_GetChannelList() 906 | Unable to start wifiClient for scanning

you might need to see the code in \legato-21.05.2.rc2\modules\WiFi\service

I got the src through leaf in VSCode
/home/pm/.leaf/wp76-legato_21.05.2.rc2-202302240920
I don’t see any changes in modules/wifi/service compared to the one currently used
/home/pm/.leaf/wp77-legato_21.05.0-202110290357

Would it be correct that wifi service is handled by scripts so if i make changes to tiwifi.sh and pa_wifi.sh or is there more to it?

I got it working!

root@swi-mdm9x28-wp:~# wifi client start
successfully called start.
root@swi-mdm9x28-wp:~# wifi client scan
starting scan.

Still need some more testing!
Is there a good example of using the dcs.api with both cell and wifi ?

how about these two test app?

Thanks i will check those