ketai.net.bluetooth

## Class KBluetoothConnection

- java.lang.Object
- - java.lang.Thread
  - - ketai.net.bluetooth.KBluetoothConnection

- All Implemented Interfaces:
    java.lang.Runnable

      public class KBluetoothConnection
      extends java.lang.Thread

  The Class KBluetoothConnection.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class java.lang.Thread

      `java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler`

  - ### Field Summary

    - ### Fields inherited from class java.lang.Thread

      `MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `KBluetoothConnection(KetaiBluetooth _btm, android.bluetooth.BluetoothSocket socket)` Instantiates a new bluetooth connection.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `cancel()` Cancel, close out the resource
    `java.lang.String` | `getAddress()` Gets the hardware address.
    `java.lang.String` | `getDeviceName()` Gets the device name.
    `boolean` | `isConnected()` Checks if we are connected.
    `void` | `run()`
    `void` | `write(byte[] buffer)` Write data to the connection

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

      `activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield`

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

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

- - ### Constructor Detail

    - #### KBluetoothConnection

          public KBluetoothConnection(KetaiBluetooth _btm,
                                      android.bluetooth.BluetoothSocket socket)

      Instantiates a new bluetooth connection.
      Parameters:
        `_btm` - the Bluetooth managing class
        `socket` - the socket reference for the connection

  - ### Method Detail

    - #### getAddress

          public java.lang.String getAddress()

      Gets the hardware address.
      Returns:
        the address (hardware)

    - #### getDeviceName

          public java.lang.String getDeviceName()

      Gets the device name.
      Returns:
        the device name

    - #### run

          public void run()

      Specified by:
        `run` in interface `java.lang.Runnable`
      Overrides:
        `run` in class `java.lang.Thread`

    - #### isConnected

          public boolean isConnected()

      Checks if we are connected.
      Returns:
        true, if is connected

    - #### write

          public void write(byte[] buffer)

      Write data to the connection
      Parameters:
        `buffer` - the buffer

    - #### cancel

          public void cancel()

      Cancel, close out the resource