nl.tbdev.IR
Interface IrConnection

All Known Implementing Classes:
LmpConnection

public interface IrConnection

This interface defines the API a client app uses to access the IR stack at LMP level.


Method Summary
 void connectConfirm(byte[] data)
          Confirm the requested connection.
 void connectionRequest(byte rLsap)
          Request a connection to the remote lsap.
 void connectionRequest(byte rLsap, byte[] data)
          Request a connection to the remote lsap.
 boolean dataRequest(byte[] data)
          Queue data for tranmission to remote station.
 boolean discoveryRequest(DiscoveryCallbackInterface dCb)
          Start discovery cycle to see what devices are within range
 int getMaxDataSize()
          get max size of payload
 int getPacketSize()
          Get packet size supported by remote device See {#link @getMaxDataSize} for max payload size
 void linkConnectRequest(int address)
          Initiate a link at LAP level to the given address
 void linkDisconnectRequest()
          Request a Link disconnection (disconnects all IR connections)
 

Method Detail

linkConnectRequest

public void linkConnectRequest(int address)
Initiate a link at LAP level to the given address

discoveryRequest

public boolean discoveryRequest(DiscoveryCallbackInterface dCb)
Start discovery cycle to see what devices are within range
Parameters:
dCb - DiscoveryCallbackInterface instance to report back to.

connectConfirm

public void connectConfirm(byte[] data)
Confirm the requested connection.
Parameters:
data - Data to be transferred in confirmation message, null in case no additional data is needed

dataRequest

public boolean dataRequest(byte[] data)
Queue data for tranmission to remote station. Data length should not exceed 48 bytes (not checked at this moment)
Parameters:
data - Byte array of data to be tranmitted
Returns:
boolean value indicating successfull queuing of the data. TRUE does not garantee succesfull transmission!

connectionRequest

public void connectionRequest(byte rLsap)
Request a connection to the remote lsap.
Parameters:
lsap - Remote lsap to connect to.
Returns:
boolean value indication successfull queuing of the request

connectionRequest

public void connectionRequest(byte rLsap,
                              byte[] data)
Request a connection to the remote lsap.
Parameters:
lsap - Remote lsap to connect to.
data - Data to be send with request
Returns:
boolean value indication successfull queuing of the request

linkDisconnectRequest

public void linkDisconnectRequest()
Request a Link disconnection (disconnects all IR connections)

getPacketSize

public int getPacketSize()
Get packet size supported by remote device See {#link @getMaxDataSize} for max payload size
Returns:
max size of packet in bytes

getMaxDataSize

public int getMaxDataSize()
get max size of payload
Returns:
size in bytes