Class

base-modules/NavigatorIntervalNetwork

base-modules/NavigatorIntervalNetwork()

Constructor

# new base-modules/NavigatorIntervalNetwork()

Network class to handle the network API by using a Timer to Check periodically

Extends

Members

# protected _internetPoller

Inherited From:

# protected _networkType

Network type enumerator.

Inherited From:

Methods

# protected __checkNetworkStatus()

To override the abstract network status checking which replace the ajax network checking method. Now it will create a poller that keep tracking on the status of the device.

# protected _isInternetConencted() → {Boolean}

To check if the internet is connected. Relies on navigator.onLine.

Inherited From:

Return true if it is connected

Boolean

# protected _isInternetConnected() → {Boolean|Promise}

This protected function is used to wrap any logic that is used to check if the browser is connected to the internet or not.

This function should not be called directly by other module.

The function should either return a pure boolean or promised-wrapped boolean value, depending on the device specific implementation.

The implementation provided by this AbstractNetwork module will return true regardlessly if ConnectionPoller is not initialised and will return the result of the function ConnectionPoller#isConnected if the poller is initialised.

Module derived from AbstractNetwork should override this function if other internet connectivity check is used.

Inherited From:

Return true, if the device is believed to be connected to the internet. The value can be wrapped by a Promise if the result is returned asynchronously.

Boolean | Promise

# deinitConnectionPoller()

Stop the internet connection poller, and remove its reference.

Inherited From:

# getNetworkStatus() → {Promise.<Boolean>}

Override the abstract network and get the current network status.

Inherited From:

Promise.

Promise.<Boolean>

# getSignalStrength() → {Promise.<*>}

Return the WiFi signal strength reported by the system, wrapped by a promise. The value type of the signal strength can varies. It can be a number or string or anything manufacturer deems fit.

Inherited From:

Promise. Default to return the string 'dummySignalStrength'.

Promise.<*>

# initConnectionPoller()

Create the internet poller instance if it is not already created. The poller, however, will be in a stopped state. The user, most likely the derived Network module, is responsible to start the polling by calling startPolling.

This function was previously called __checkNetworkStatus.

Inherited From:
See:
  • startPolling

# startPolling()

Command the poller, if initialised, to start polling of connection to internet.

Inherited From:
See:
  • initConnectionPoller

# stopPolling()

Command the poller, if initialised, to stop polling of connection to internet.

Inherited From:
See:
  • deinitConnectionPoller