Mita provides the possibility to create a Wi-Fi resource. If the configuration and implementation provided by the Mita implementation are insufficient for a certain purpose, it is recommended to make adapting changes in the generated C code.
In Mita, WLAN is defined as a named singleton resource. That means, there can only be one instance of the WLAN resource set up, and the name can be specified by the developer.
connectivity named-singleton WLAN {
generator "org.eclipse.mita.platform.xdk110.connectivity.WlanGenerator"
validator "org.eclipse.mita.platform.xdk110.connectivity.WlanValidator"
/**
* Choose personal WPA connection or Enterprise WPA connection
*/
required configuration-item authentification : Authentification
/**
* The SSID of the WLAN network we want to connect to
*/
required configuration-item ssid : string
/**
* If true server certificate will be uploaded to the WiFi chip CC3100.
* Make sure to update service pack of the WiFi and then upload the certificate.
* Certificate must placed under XDK110/common/certs/XDKDummy.
*/
configuration-item isHostPgmEnabled : bool = false
/**
* Configure IP address and network via DHCP or static
*/
configuration-item ipConfiguration : IpConfiguration = Dhcp()
}
To create a WLAN Resource, the configuration item useDHCP must be set to false and the configuration items for static IP settings staticDNS, staticGW, staticIPand staticMask become mandatory. That aside, the connection type, the SSID, and the PSK must be set as well.
The Mita Wi-Fi implementation does not yet offer functionality for scanning for networks, disconnecting and automatic reconnecting. It only connects once to the specified single Wi-Fi network.