Mobile users often work at places with low or missing network connectivity. To avoid problems when calling back-end services, you can put conditions into your action sequences to make sure that mobile devices have the necessary network connectivity.
In order to do this, the PROCE55 Mobile run-time environment offers the following system variables:
SYS_NETWORK (value '1' means that the device is connected to a data network, e.g. a 4G/LTE or a wireless LAN) SYS_MOBILE_DATA ('1' means that the device currently uses a mobile data network, e.g. 4G/LTE) SYS_WIFI ('1' means that the device is currently using a wireless LAN) SYS_WIFI_SSID (contains either an empty string, or the name of currently connected wireless LAN) SYS_FAST_CONNECTION ('1' means that the current connection's speed is above 1 Megabit)
All of the above variables except for the SYS_WIFI_SSID can have values of either 0 or 1. To read their values you need to put them into curly brackets like this: ${SYS_WIFI_SSID}
This way you can formulate a condition to check if a device currently uses the wireless network with a specific SSID:
'${SYS_WIFI}' == '1' && '${SYS_WIFI_SSID}' == 'WLAN01'
You can also use variables instead of explicitly specifying the WLAN name:
'${SYS_WIFI}' == '1' && '${SYS_WIFI_SSID}' == '${s1_i2}'
It is also possible to react on network connectivity changes using a JavaScript event handler function, which is called automatically every time a device connects or disconnects from a network:
function onNetworkChanged(CurrentScreen, isNetwork, isMobileData, isWifi, SSID, isFastConnection) { if (CurrentScreen === 's1') { var status1 = 'Network available: ' + isNetwork + '\r\n' + 'on mobile data: ' + isMobileData + '\r\n' + 'SSID: ' + SSID + '\r\n' + 'Fast connection: ' + isFastConnection; document.getElementById('s1_i1').value = status1; var element1 = PROCE55_GetElementByName('s1_i1'); element1.ElementValue = status1; } }
The above parameters coming to the function (isNetwork, isMobileData, isWifi, SSID, isFastConnection) correspond to the system variables mentioned at the top of this page.