Class WifiDirectHotSpot

  • All Implemented Interfaces:
    android.net.wifi.p2p.WifiP2pManager.ChannelListener, android.net.wifi.p2p.WifiP2pManager.ConnectionInfoListener, android.net.wifi.p2p.WifiP2pManager.GroupInfoListener, datahop.WifiHotspot

    public class WifiDirectHotSpot
    extends java.lang.Object
    implements android.net.wifi.p2p.WifiP2pManager.ConnectionInfoListener, android.net.wifi.p2p.WifiP2pManager.ChannelListener, android.net.wifi.p2p.WifiP2pManager.GroupInfoListener, datahop.WifiHotspot
    WifiDirectHotSpot class creates a Wifi-Direct group in autonomous mode; i.e. a Wifi-Direct group is generated without requiring any user connected to it, and can be discovered and joined in the same way a legacy WiFi hotspot. Implements WifiHotspot (link to go bindings)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String TAG  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static WifiDirectHotSpot getInstance​(android.content.Context appContext)  
      void onChannelDisconnected()  
      void onConnectionInfoAvailable​(android.net.wifi.p2p.WifiP2pInfo info)  
      void onGroupInfoAvailable​(android.net.wifi.p2p.WifiP2pGroup group)  
      void setNotifier​(datahop.WifiHotspotNotifier notifier)
      Set the notifier that receives the events advertised when creating or destroying the group or when receiving users connections
      void start()
      Starts the service and creates the Wifi-Direct group
      void stop()
      Stops the service and destroys the Wifi-Direct group
      • Methods inherited from class java.lang.Object

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

      • getInstance

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

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

        public void start()
        Starts the service and creates the Wifi-Direct group
        Specified by:
        start in interface datahop.WifiHotspot
      • stop

        public void stop()
        Stops the service and destroys the Wifi-Direct group
        Specified by:
        stop in interface datahop.WifiHotspot
      • onChannelDisconnected

        public void onChannelDisconnected()
        Specified by:
        onChannelDisconnected in interface android.net.wifi.p2p.WifiP2pManager.ChannelListener
      • onGroupInfoAvailable

        public void onGroupInfoAvailable​(android.net.wifi.p2p.WifiP2pGroup group)
        Specified by:
        onGroupInfoAvailable in interface android.net.wifi.p2p.WifiP2pManager.GroupInfoListener
      • onConnectionInfoAvailable

        public void onConnectionInfoAvailable​(android.net.wifi.p2p.WifiP2pInfo info)
        Specified by:
        onConnectionInfoAvailable in interface android.net.wifi.p2p.WifiP2pManager.ConnectionInfoListener