Class WifiLink

  • All Implemented Interfaces:
    datahop.WifiConnection

    public class WifiLink
    extends java.lang.Object
    implements datahop.WifiConnection
    WifiLink can be used to automatically join a Wifi-Direct group in autonomous mode or a legacy WiFi connection (i.e., WiFi Hotspot). It disconnects from current WiFi connection, in case it is connected, when calling connect() method, and reconnects after calling disconnect() method.
    • Constructor Summary

      Constructors 
      Constructor Description
      WifiLink​(android.content.Context context)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void connect​(java.lang.String SSID, java.lang.String password)
      This method disconnects from any existing Wifi connection to join the SSID specified as an input parameter.
      void connect​(java.lang.String SSID, java.lang.String password, java.lang.String ip)
      This method disconnects from any existing Wifi connection to join the SSID specified as an input parameter.
      void disconnect()
      This method disconnects from the specified network in the connect() method and rejoins any prexisting Wifi connection.
      static WifiLink getInstance​(android.content.Context appContext)  
      void setNotifier​(datahop.WifiConnectionNotifier notifier)
      Set the notifier that receives the events advertised when creating or destroying the group or when receiving users connections
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WifiLink

        public WifiLink​(android.content.Context context)
    • Method Detail

      • getInstance

        public static WifiLink getInstance​(android.content.Context appContext)
      • setNotifier

        public void setNotifier​(datahop.WifiConnectionNotifier notifier)
        Set the notifier that receives the events advertised when creating or destroying the group or when receiving users connections
        Parameters:
        notifier - instance
      • connect

        public void connect​(java.lang.String SSID,
                            java.lang.String password)
        This method disconnects from any existing Wifi connection to join the SSID specified as an input parameter. DHCP is used for IP configuration.
        Parameters:
        SSID - of the WiFi network to join
        password - of the WiFi network to join
      • connect

        public void connect​(java.lang.String SSID,
                            java.lang.String password,
                            java.lang.String ip)
        This method disconnects from any existing Wifi connection to join the SSID specified as an input parameter. IP address is configure statically from the input parameter
        Specified by:
        connect in interface datahop.WifiConnection
        Parameters:
        SSID - of the WiFi network to join
        password - of the WiFi network to join
        ip - address to configure statically
      • disconnect

        public void disconnect()
        This method disconnects from the specified network in the connect() method and rejoins any prexisting Wifi connection.
        Specified by:
        disconnect in interface datahop.WifiConnection