com.stollmann.terminalIO
Interface TIOPeripheralCallback


public interface TIOPeripheralCallback

A TIOPeripheral's event listener implements the TIOPeripheralCallback interface in order to monitor connection events, data exchange and peripheral property updates.


Method Summary
 void tioPeripheralDidConnect(TIOPeripheral peripheral)
          Invoked when a TerminalIO connection has been successfully established.
 void tioPeripheralDidDisconnect(TIOPeripheral peripheral, java.lang.String errorMessage)
          Invoked when an established TerminalIO connection is disconnected.
 void tioPeripheralDidFailToConnect(TIOPeripheral peripheral, java.lang.String errorMessage)
          Invoked when a TerminalIO connection establishment has failed.
 void tioPeripheralDidReceiveUARTData(TIOPeripheral peripheral, byte[] data)
          Invoked when UART data transmitted by the remote peripheral have been received.
 void tioPeripheralDidUpdateAdvertisement(TIOPeripheral peripheral)
          Invoked when an updated advertisement for a known peripheral has been detected after calling TIOManager.startScan().
 void tioPeripheralDidUpdateLocalUARTCreditsCount(TIOPeripheral peripheral, int creditsCount)
          Invoked when the number of local UART credits has changed due to received data or new credits granted to the remote peripheral.
 void tioPeripheralDidUpdateRemoteUARTCreditsCount(TIOPeripheral peripheral, int creditsCount)
          Invoked when the number of remote UART credits has changed due to sent data or new credits granted by the remote peripheral.
 void tioPeripheralDidUpdateRSSI(TIOPeripheral peripheral, int rssi)
          Invoked when an RSSI value is reported as a response to calling TIOPeripheral.readRSSI().
 void tioPeripheralDidWriteNumberOfUARTBytes(TIOPeripheral peripheral, int bytesWritten)
          Invoked when a UART data block has been written to the remote device.
 void tioPeripheralUARTWriteBufferEmpty(TIOPeripheral peripheral)
          Invoked when all available UART data have been written to the remote device.
 

Method Detail

tioPeripheralDidConnect

void tioPeripheralDidConnect(TIOPeripheral peripheral)
Invoked when a TerminalIO connection has been successfully established.

Parameters:
peripheral - The TIOPeripheral instance this event applies for.

tioPeripheralDidDisconnect

void tioPeripheralDidDisconnect(TIOPeripheral peripheral,
                                java.lang.String errorMessage)
Invoked when an established TerminalIO connection is disconnected.

Parameters:
peripheral - The TIOPeripheral instance this event applies for.
errorMessage - A String containing information about the disconnect's cause, or an empty String on intentional disconnects.

tioPeripheralDidFailToConnect

void tioPeripheralDidFailToConnect(TIOPeripheral peripheral,
                                   java.lang.String errorMessage)
Invoked when a TerminalIO connection establishment has failed.

Parameters:
peripheral - The TIOPeripheral instance this event applies for.
errorMessage - A String containing information about the failure's cause.

tioPeripheralDidReceiveUARTData

void tioPeripheralDidReceiveUARTData(TIOPeripheral peripheral,
                                     byte[] data)
Invoked when UART data transmitted by the remote peripheral have been received.

Parameters:
peripheral - The TIOPeripheral instance this event applies for.
data - A byte array containing the received UART data.

tioPeripheralDidUpdateAdvertisement

void tioPeripheralDidUpdateAdvertisement(TIOPeripheral peripheral)
Invoked when an updated advertisement for a known peripheral has been detected after calling TIOManager.startScan().

Parameters:
peripheral - The TIOPeripheral instance this event applies for.

tioPeripheralDidUpdateLocalUARTCreditsCount

void tioPeripheralDidUpdateLocalUARTCreditsCount(TIOPeripheral peripheral,
                                                 int creditsCount)
Invoked when the number of local UART credits has changed due to received data or new credits granted to the remote peripheral.

Parameters:
peripheral - The TIOPeripheral instance this event applies for.
creditsCount - The current number of local UART credits.

tioPeripheralDidUpdateRemoteUARTCreditsCount

void tioPeripheralDidUpdateRemoteUARTCreditsCount(TIOPeripheral peripheral,
                                                  int creditsCount)
Invoked when the number of remote UART credits has changed due to sent data or new credits granted by the remote peripheral.

Parameters:
peripheral - The TIOPeripheral instance this event applies for.
creditsCount - The current number of remote UART credits.

tioPeripheralDidUpdateRSSI

void tioPeripheralDidUpdateRSSI(TIOPeripheral peripheral,
                                int rssi)
Invoked when an RSSI value is reported as a response to calling TIOPeripheral.readRSSI().

Parameters:
peripheral - The TIOPeripheral instance this event applies for.
rssi - The latest RSSI value.

tioPeripheralDidWriteNumberOfUARTBytes

void tioPeripheralDidWriteNumberOfUARTBytes(TIOPeripheral peripheral,
                                            int bytesWritten)
Invoked when a UART data block has been written to the remote device.

Parameters:
peripheral - The TIOPeripheral instance this event applies for.
bytesWritten - The number of bytes written.

tioPeripheralUARTWriteBufferEmpty

void tioPeripheralUARTWriteBufferEmpty(TIOPeripheral peripheral)
Invoked when all available UART data have been written to the remote device.

Parameters:
peripheral - The TIOPeripheral instance this event applies for.