nl.tbdev.IR
Class Lap

java.lang.Object
  |
  +--nl.tbdev.IR.Lap

public class Lap
extends java.lang.Object

Implementation of the LAP layer of IrDA. Not really meant for direct usage by applications. API may change in the future.


Field Summary
private  int As
           
private  byte ca
           
(package private)  LapCallbackInterface callback
           
private  boolean conflictResolution
           
static int CONN
           
private  boolean connectRequest
           
private  byte da
           
private  int DA
           
private  byte[] data
           
private  byte[] dest
           
private  boolean disconnect
           
private  boolean discoverRequest
           
private  long expireTime
           
private  int fastTimer
           
private  LapFrame frame
           
private  boolean frameSent
           
private  long fTimer
           
private  java.util.Random generator
           
private  boolean localBusy
           
private  Options locOptions
           
private  java.util.Vector log
           
private  boolean mediaBusy
           
private  int NA
           
static int NDM
           
static int NRMP
           
static int NRMS
           
private  int Ns
           
static int OFFLINE
           
private  byte old_s
           
private  java.util.Vector outQueue
           
static int PCLOSE
           
private  long pTimer
           
static int QUERY
           
private  Options remOptions
           
private  boolean remoteBusy
           
private  int retryCount
           
static int SCLOSE
           
private  Serial serial
           
static int SETUP
           
private  int slot
           
private  int slotCount
           
private  int state
           
private  int timeout
           
private  boolean unackedFrame
           
private  int Vr
           
private  int Vs
           
static int XMIT
           
 
Constructor Summary
Lap(Serial iSerial, LapCallbackInterface cb, int iTimeout)
           
 
Method Summary
 boolean connectionRequest(int dest)
           
 void dataRequest(byte[] data)
           
 void disconnectRequest()
           
 boolean discoveryRequest(boolean resolveConflict)
           
 int getPacketSize()
          get size of packets allowed for remote
private  void handleCon()
           
private  void handleNdm()
           
private  void handleNrmp()
           
private  void handleNrms()
           
private  void handleOffline()
           
private  void handlePclose()
           
private  void handleQuery()
           
private  void handleSclose()
           
private  void handleSetup()
           
private  void handleXmit()
           
private  boolean invalidNr(int nr, int vs, boolean unackedframe, int as)
           
private  void processNr(int nr)
           
 void run()
           
private  void sendDiscovery(boolean endDisc)
           
private  void sendICmd(int As, int Vr, byte[] data)
           
private  void sendIRsp(int As, int Vr, byte[] data)
           
private  void sendNrmResponse(int Nr)
           
private  void sendSCommand()
           
private  void sendSResponse()
           
private  void sendUDiscCmdP()
           
private  void sendURdRspF()
           
private  void startFTimer()
           
private  void startPTimer()
           
private  void startWdTimer(int timeout)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

OFFLINE

public static final int OFFLINE

NDM

public static final int NDM

CONN

public static final int CONN

NRMS

public static final int NRMS

SCLOSE

public static final int SCLOSE

QUERY

public static final int QUERY

SETUP

public static final int SETUP

XMIT

public static final int XMIT

NRMP

public static final int NRMP

PCLOSE

public static final int PCLOSE

state

private int state

serial

private Serial serial

timeout

private int timeout

generator

private java.util.Random generator

old_s

private byte old_s

Ns

private int Ns

Vr

private int Vr

Vs

private int Vs

As

private int As

NA

private int NA

DA

private int DA

frame

private LapFrame frame

slot

private int slot

frameSent

private boolean frameSent

remoteBusy

private boolean remoteBusy

localBusy

private boolean localBusy

unackedFrame

private boolean unackedFrame

discoverRequest

private boolean discoverRequest

conflictResolution

private boolean conflictResolution

connectRequest

private boolean connectRequest

data

private byte[] data

expireTime

private long expireTime

fTimer

private long fTimer

pTimer

private long pTimer

disconnect

private boolean disconnect

outQueue

private java.util.Vector outQueue

slotCount

private int slotCount

retryCount

private int retryCount

log

private java.util.Vector log

fastTimer

private int fastTimer

mediaBusy

private boolean mediaBusy

remOptions

private Options remOptions

locOptions

private Options locOptions

callback

LapCallbackInterface callback

dest

private byte[] dest

ca

private byte ca

da

private byte da
Constructor Detail

Lap

public Lap(Serial iSerial,
           LapCallbackInterface cb,
           int iTimeout)
Method Detail

disconnectRequest

public void disconnectRequest()

connectionRequest

public boolean connectionRequest(int dest)

discoveryRequest

public boolean discoveryRequest(boolean resolveConflict)

dataRequest

public void dataRequest(byte[] data)

run

public void run()

handleOffline

private void handleOffline()

handleNdm

private void handleNdm()

handleCon

private void handleCon()

handleNrms

private void handleNrms()

handleSclose

private void handleSclose()

handleQuery

private void handleQuery()

handleSetup

private void handleSetup()

handleXmit

private void handleXmit()

handleNrmp

private void handleNrmp()

handlePclose

private void handlePclose()

startWdTimer

private void startWdTimer(int timeout)

startFTimer

private void startFTimer()

startPTimer

private void startPTimer()

invalidNr

private boolean invalidNr(int nr,
                          int vs,
                          boolean unackedframe,
                          int as)

sendNrmResponse

private void sendNrmResponse(int Nr)

processNr

private void processNr(int nr)

sendIRsp

private void sendIRsp(int As,
                      int Vr,
                      byte[] data)

sendICmd

private void sendICmd(int As,
                      int Vr,
                      byte[] data)

sendSResponse

private void sendSResponse()

sendSCommand

private void sendSCommand()

sendURdRspF

private void sendURdRspF()

sendUDiscCmdP

private void sendUDiscCmdP()

sendDiscovery

private void sendDiscovery(boolean endDisc)

getPacketSize

public int getPacketSize()
get size of packets allowed for remote
Returns:
size in bytes