networkConnectivity()

    networkConnectivity()


    Article summary

    networkConnectivity()

    Retrieve the type of network an X1 Device is connected to.

    ##### Signature:
    $badger.networkConnectivity()

    Parameters:

    None.

    Return Values:

    Return ValueTypeDescriptionExample
    networkInterfaceStringReturns the active network interface currently in use by the device to reach the internet. Can be one of the following:
    WIFI
    ETHERNET
    MOCA*
    DOCSIS

    *MOCA (Multimedia over Coax) interface is a technology for delivering network traffic over coaxial wiring.
    WIFI

    The result will be returned via a success or failure callback per the following table:

    CallbackStatusMessageOther fields returned
    successSUCCESS-networkInterface
    failureNO_ACTIVE_NETWORK_INTERFACENo active network interface found-
    failureAPI_NOT_SUPPORTEDAPI not supported-

    Usage Example:

      $badger.networkConnectivity().success(data => {
    	     console.log("Network interface =" + data.networkInterface);
      }).failure(reason => {
      });
    

    Was this article helpful?