Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.synchrona.jred
Class IrLMP  view IrLMP download IrLMP.java

java.lang.Object
  extended bycom.synchrona.jred.IrLMP
All Implemented Interfaces:
com.synchrona.jred.irlap.iIrLAPListener

public class IrLMP
extends java.lang.Object
implements com.synchrona.jred.irlap.iIrLAPListener

Implement link management as defined in the IrLMP specification.


Field Summary
private  int _autoDiscoveryInterval
           
private  javax.swing.Timer _autoDiscoveryTimer
           
private  boolean _doAutoDiscovery
           
private  com.synchrona.jred.irlap.IrLAPContext _irlap
           
private  byte _irlapConnection
           
private  com.synchrona.util.Log _log
           
private  java.util.Vector _services
           
static java.lang.String AUTO_DISCOVERY_INTERVAL_PROPERTY
           
static java.lang.String AUTO_DISCOVERY_PROPERTY
           
static int DEFAULT_AUTO_DISCOVERY_INTERVAL
           
private static byte OPCODE_CONNECT_CONFIRM
           
private static byte OPCODE_CONNECT_REQUEST
           
 
Constructor Summary
IrLMP(com.synchrona.util.Log log)
           
 
Method Summary
 void addService(iIrLMPService service)
          IrLMP allows multiple service providers (IrOBEX, IrCOMM, etc.) to listen to a single IrDA port, although only one service is active at a time.
private  void configureAutoDiscovery()
          Find out if IrLMP needs to automatically discover other hosts.
 void connectConfirm(byte destination, byte source, byte[] userData)
          An IrLMP service (IrOBEX, for instance) has agreed to a connect request from a host.
 void connectIndication(com.synchrona.jred.irlap.IrLAPContext context, com.synchrona.jred.irlap.ConnectionInformation info)
          The IrLAP layer has made a connection with another IrLAP layer.
 void dataIndication(com.synchrona.jred.irlap.IrLAPContext context, com.synchrona.jred.irlap.ConnectionInformation info, byte[] data)
          A host has sent data.
 void discover()
          Instructs IrLMP to enter a discovery sequence, by which other IrDA hosts can be found.
 void discoveryIndication(com.synchrona.jred.irlap.IrLAPContext context, com.synchrona.jred.irlap.DiscoveryInformation discoveryInfo)
          A host has been discovered.
 void send(int destination, int source, byte[] data, int offset, int length)
          Send data to a host to whom we are connected.
protected  void sendData(int destination, int source, byte[] data, int offset, int length)
           
 void setAutoDiscovery(boolean doAutoDiscovery)
           
 void setIrLAPContext(com.synchrona.jred.irlap.IrLAPContext irlap)
          If you want IrLMP to be able to initiate things like discovery, it needs to hold a reference to an IrLAP instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_AUTO_DISCOVERY_INTERVAL

public static final int DEFAULT_AUTO_DISCOVERY_INTERVAL
See Also:
Constant Field Values

AUTO_DISCOVERY_PROPERTY

public static final java.lang.String AUTO_DISCOVERY_PROPERTY
See Also:
Constant Field Values

AUTO_DISCOVERY_INTERVAL_PROPERTY

public static final java.lang.String AUTO_DISCOVERY_INTERVAL_PROPERTY
See Also:
Constant Field Values

OPCODE_CONNECT_REQUEST

private static final byte OPCODE_CONNECT_REQUEST
See Also:
Constant Field Values

OPCODE_CONNECT_CONFIRM

private static final byte OPCODE_CONNECT_CONFIRM
See Also:
Constant Field Values

_autoDiscoveryInterval

private int _autoDiscoveryInterval

_autoDiscoveryTimer

private javax.swing.Timer _autoDiscoveryTimer

_irlapConnection

private byte _irlapConnection

_irlap

private com.synchrona.jred.irlap.IrLAPContext _irlap

_doAutoDiscovery

private boolean _doAutoDiscovery

_log

private com.synchrona.util.Log _log

_services

private java.util.Vector _services
Constructor Detail

IrLMP

public IrLMP(com.synchrona.util.Log log)
      throws java.lang.Exception
Method Detail

addService

public void addService(iIrLMPService service)
IrLMP allows multiple service providers (IrOBEX, IrCOMM, etc.) to listen to a single IrDA port, although only one service is active at a time. This method allows a new service to let IrLMP know that it's available. This method is broken. It only adds IrOBEX, and does so at LSAP 5. This will change when IrIAS is augmented.


discover

public void discover()
              throws java.lang.Exception
Instructs IrLMP to enter a discovery sequence, by which other IrDA hosts can be found.


setIrLAPContext

public void setIrLAPContext(com.synchrona.jred.irlap.IrLAPContext irlap)
If you want IrLMP to be able to initiate things like discovery, it needs to hold a reference to an IrLAP instance.


connectConfirm

public void connectConfirm(byte destination,
                           byte source,
                           byte[] userData)
An IrLMP service (IrOBEX, for instance) has agreed to a connect request from a host.


connectIndication

public void connectIndication(com.synchrona.jred.irlap.IrLAPContext context,
                              com.synchrona.jred.irlap.ConnectionInformation info)
The IrLAP layer has made a connection with another IrLAP layer.

Specified by:
connectIndication in interface com.synchrona.jred.irlap.iIrLAPListener

dataIndication

public void dataIndication(com.synchrona.jred.irlap.IrLAPContext context,
                           com.synchrona.jred.irlap.ConnectionInformation info,
                           byte[] data)
A host has sent data.

Specified by:
dataIndication in interface com.synchrona.jred.irlap.iIrLAPListener

discoveryIndication

public void discoveryIndication(com.synchrona.jred.irlap.IrLAPContext context,
                                com.synchrona.jred.irlap.DiscoveryInformation discoveryInfo)
A host has been discovered.

Specified by:
discoveryIndication in interface com.synchrona.jred.irlap.iIrLAPListener

sendData

protected void sendData(int destination,
                        int source,
                        byte[] data,
                        int offset,
                        int length)
                 throws java.lang.Exception

send

public void send(int destination,
                 int source,
                 byte[] data,
                 int offset,
                 int length)
          throws java.lang.Exception
Send data to a host to whom we are connected.


setAutoDiscovery

public void setAutoDiscovery(boolean doAutoDiscovery)

configureAutoDiscovery

private void configureAutoDiscovery()
Find out if IrLMP needs to automatically discover other hosts.