ketai.net.wifidirect

## Class KetaiWiFiDirect

- java.lang.Object
- - android.content.BroadcastReceiver
  - - ketai.net.wifidirect.KetaiWiFiDirect

- All Implemented Interfaces:
    android.net.wifi.p2p.WifiP2pManager.ActionListener, android.net.wifi.p2p.WifiP2pManager.ChannelListener, android.net.wifi.p2p.WifiP2pManager.ConnectionInfoListener, android.net.wifi.p2p.WifiP2pManager.PeerListListener

      public class KetaiWiFiDirect
      extends android.content.BroadcastReceiver
      implements android.net.wifi.p2p.WifiP2pManager.ChannelListener, android.net.wifi.p2p.WifiP2pManager.ConnectionInfoListener, android.net.wifi.p2p.WifiP2pManager.ActionListener, android.net.wifi.p2p.WifiP2pManager.PeerListListener

  The KetaiWiFiDirect class is an experimental class that provides a wifi direct access to a sketch. WifiDirect provides peer-to-peer networking between devices. No wireless infrastructure is needed.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class android.content.BroadcastReceiver

      `android.content.BroadcastReceiver.PendingResult`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `KetaiWiFiDirect(processing.core.PApplet _parent)` Instantiates a new ketai wi fi direct object

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `cancelDisconnect()` Cancel disconnect.
    `void` | `connect(java.lang.String deviceName)` Connect to a device by name.
    `void` | `disconnect()` Disconnect.
    `void` | `discover()` Discover.
    `void` | `getConnectionInfo()` Gets the connection information.
    `java.lang.String` | `getHardwareAddress()` Gets the hardware address of the wifi interface
    `java.lang.String` | `getIPAddress()` Gets the iP address used by the connection.
    `java.util.ArrayList<java.lang.String>` | `getPeerNameList()` Gets the peer name list.
    `void` | `onChannelDisconnected()`
    `void` | `onConnectionInfoAvailable(android.net.wifi.p2p.WifiP2pInfo arg0)`
    `void` | `onFailure(int arg0)`
    `void` | `onPeersAvailable(android.net.wifi.p2p.WifiP2pDeviceList arg0)`
    `void` | `onReceive(android.content.Context context, android.content.Intent intent)`
    `void` | `onSuccess()`
    `void` | `pause()` Pause.(used by android activity administration)
    `void` | `reset()` Reset.
    `void` | `resume()` Resume.
    `void` | `setIsWifiP2pEnabled(boolean isWifiP2pEnabled)` Sets the checks if wifi p2p enabled.

    - ### Methods inherited from class android.content.BroadcastReceiver

      `abortBroadcast, clearAbortBroadcast, getAbortBroadcast, getDebugUnregister, getResultCode, getResultData, getResultExtras, goAsync, isInitialStickyBroadcast, isOrderedBroadcast, peekService, setDebugUnregister, setOrderedHint, setResult, setResultCode, setResultData, setResultExtras`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### KetaiWiFiDirect

          public KetaiWiFiDirect(processing.core.PApplet _parent)

      Instantiates a new ketai wi fi direct object
      Parameters:
        `_parent` - the calling sketch/Activity/PApplet

  - ### Method Detail

    - #### setIsWifiP2pEnabled

          public void setIsWifiP2pEnabled(boolean isWifiP2pEnabled)

      Sets the checks if wifi p2p enabled.
      Parameters:
        `isWifiP2pEnabled` - the new checks if is wifi p2p enabled

    - #### resume

          public void resume()

      Resume. (used by android activity administration)

    - #### pause

          public void pause()

      Pause.(used by android activity administration)

    - #### disconnect

          public void disconnect()

      Disconnect. clean out resources

    - #### onChannelDisconnected

          public void onChannelDisconnected()

      Specified by:
        `onChannelDisconnected` in interface `android.net.wifi.p2p.WifiP2pManager.ChannelListener`

    - #### cancelDisconnect

          public void cancelDisconnect()

      Cancel disconnect.

    - #### onReceive

          public void onReceive(android.content.Context context,
                                android.content.Intent intent)

      Specified by:
        `onReceive` in class `android.content.BroadcastReceiver`

    - #### getConnectionInfo

          public void getConnectionInfo()

      Gets the connection information.

    - #### onConnectionInfoAvailable

          public void onConnectionInfoAvailable(android.net.wifi.p2p.WifiP2pInfo arg0)

      Specified by:
        `onConnectionInfoAvailable` in interface `android.net.wifi.p2p.WifiP2pManager.ConnectionInfoListener`

    - #### getIPAddress

          public java.lang.String getIPAddress()

      Gets the iP address used by the connection.
      Returns:
        the iP address

    - #### discover

          public void discover()

      Discover.

    - #### onFailure

          public void onFailure(int arg0)

      Specified by:
        `onFailure` in interface `android.net.wifi.p2p.WifiP2pManager.ActionListener`

    - #### onSuccess

          public void onSuccess()

      Specified by:
        `onSuccess` in interface `android.net.wifi.p2p.WifiP2pManager.ActionListener`

    - #### onPeersAvailable

          public void onPeersAvailable(android.net.wifi.p2p.WifiP2pDeviceList arg0)

      Specified by:
        `onPeersAvailable` in interface `android.net.wifi.p2p.WifiP2pManager.PeerListListener`

    - #### getHardwareAddress

          public java.lang.String getHardwareAddress()

      Gets the hardware address of the wifi interface
      Returns:
        the hardware address

    - #### reset

          public void reset()

      Reset.

    - #### getPeerNameList

          public java.util.ArrayList<java.lang.String> getPeerNameList()

      Gets the peer name list.
      Returns:
        the peer name list

    - #### connect

          public void connect(java.lang.String deviceName)

      Connect to a device by name.
      Parameters:
        `deviceName` - the device name