Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cordova-plugin-hotspot

Package Overview
Dependencies
Maintainers
1
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cordova-plugin-hotspot

Cordova WiFi Hotspot Plugin

  • 0.6.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Cordova HotSpot Plugin

Build Status npm version Dependency Status devDependency Status

A Cordova plugin for managing HotSpot networks on Android with Cordova 3.4.0 / API Level 19

NPM

Installation

$ cordova plugin add cordova-plugin-hotspot

Usage

Check if Plugin is available

cordova.plugins.hotspot.isAvailable(
    function (isAvailable) {
        // alert('Service is not available') unless isAvailable;
    }
);

Check if device is connected to internet

cordova.plugins.hotspot.isConnectedToInternet(
   function () {
       // is connected
   },function () {
       // is not connected
   }
);

Get connection configuration

cordova.plugins.hotspot.getConnectionInfo(
   function (result) {
       // SSID
       // BSSID
       // linkSpeed
       // IPAddress
   },function () {
       // error
   }
);

Get network configuration

cordova.plugins.hotspot.getNetConfig(
   function (result) {
       // deviceIPAddress
       // deviceMacAddress
       // gatewayIPAddress
       // gatewayMacAddress
   },function () {
       // error
   }
);

Ping a host

cordova.plugins.hotspot.pingHost(ip,
  function (result) {
      if(result){
        // host is up
      } else {
        // host is not responsing
      }
  },function () {
      // error
  }
);

Get MAC address of host

cordova.plugins.hotspot.getMacAddressOfHost(ip,
  function (result) {
      if(result){
        // MAC address of host
      } else {
        // host is not responsing
      }
  },function () {
      // error
  }
);

Check DNS is alive

cordova.plugins.hotspot.isDnsLive(ip,
  function (live) {
      if(live){
        // DNS is live
      } else {
        // DNS is not live
      }
  },function () {
      // error
  }
);

Check port is alive

cordova.plugins.hotspot.isPortLive(ip,
  function (live) {
      if(live){
        // DNS is live
      } else {
        // DNS is not live
      }
  },function () {
      // error
  }
);

Check if device is rooted

cordova.plugins.hotspot.isRooted(
  function (rooted) {
      if(rooted){
        // device is rooted
      } else {
        // device is not rooted
      }
  },function () {
      // error
  }
);

Hotspot functionality

Create Hotspot
cordova.plugins.hotspot.createHotspot(ssid, mode, password, 
    function () {
        // Hotspot is created
    },function () {
        // Error
    }
);
Start Hotspot
cordova.plugins.hotspot.startHotspot(
    function () {
        // Hotspot is started
    },function () {
        // Error
    }
);
Configure Hotspot
   cordova.plugins.hotspot.configureHotspot(ssid, mode, password, 
       function () {
           // Hotspot is configured
       },function () {
           // Error
       }
   );
Stop Hotspot
cordova.plugins.hotspot.stopHotspot(
    function () {
        // Hotspot is disabled
    },function () {
        // Error
    }
);
Check if Hotspot is enabled
cordova.plugins.hotspot.isHotspotEnabled(
    function () {
        // Hotspot is on
    },function () {
        // Hotspot is off
    }
);
Get all connected devices
cordova.plugins.hotspot.getAllHotspotDevices(
    function (devices) {
        // array of JSON objects:
        // -> ip
        // -> mac
    },function (err) {
        // error
    }
);

Wifi

Check if Wifi is supported

cordova.plugins.hotspot.isWifiSupported(
   function () {
       // wifi is on
   },function () {
       // wifi is off
   }
);
Check if Wifi is enabled
cordova.plugins.hotspot.isWifiOn(
   function () {
       // wifi is on
   },function () {
       // wifi is off
   }
);
Toggle Wifi
cordova.plugins.hotspot.toggleWifi(
   function (isActive) {
       // wifi is on
   },function (err) {
       // error
   }
);
Connect to Wifi
cordova.plugins.hotspot.connectToHotspot(ssid, password, 
   function () {
       // connected
   },function () {
       // not connected
   }
);

Check if device is connected to internet via Wifi

cordova.plugins.hotspot.isConnectedToInternetViaWifi(
   function () {
       // is connected
   },function () {
       // is not connected
   }
);

Check if Wifi Direct is supported

cordova.plugins.hotspot.isWifiDirectSupported(
    function () {
        // wifi is on
    },function () {
        // wifi is off
    }
);
Add a network config
cordova.plugins.hotspot.addWifiNetwork(ssid, mode, password,
   function () {
       // wifi is added
   },function (err) {
       // error
   }
);
Delete a network config
cordova.plugins.hotspot.removeWifiNetwork(ssid, 
   function () {
       // wifi is deleted
   },function (err) {
       // error
   }
);
Start a periodically scan
cordova.plugins.hotspot.startPeriodicallyScan(interval, duration,
   function () {
       // success
   },function (err) {
       // error
   }
);
Scan network
cordova.plugins.hotspot.scanWifi( 
   function (listOfNetworks) {
       // array of results
   },function (err) {
       // error
   }
);
Scan network by level
cordova.plugins.hotspot.scanWifiByLevel(
   function (listOfNetworks) {
       // array of results
   },function (err) {
       // error
   }
);
Stop a periodically scan
cordova.plugins.hotspot.stopPeriodicallyScan( 
   function () {
       // success
   },function (err) {
       // error
   }
);

Keywords

FAQs

Package last updated on 24 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc