de.avetana.bluetooth.rfcomm
Class RFCommConnectionNotifierImpl

java.lang.Object
  extended byde.avetana.bluetooth.connection.ConnectionNotifier
      extended byde.avetana.bluetooth.rfcomm.RFCommConnectionNotifierImpl
All Implemented Interfaces:
Connection, StreamConnectionNotifier

public class RFCommConnectionNotifierImpl
extends ConnectionNotifier
implements StreamConnectionNotifier

The class used to manage RFCOMM or RFCOM-based server connection.

COPYRIGHT:
(c) Copyright 2004 Avetana GmbH ALL RIGHTS RESERVED.

This file is part of the Avetana bluetooth API for Linux.

The Avetana bluetooth API for Linux is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

The Avetana bluetooth API is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

The development of the Avetana bluetooth API is based on the work of Christian Lorenz (see the Javabluetooth Stack at http://www.javabluetooth.org) for some classes, on the work of the jbluez team (see http://jbluez.sourceforge.net/) and on the work of the bluez team (see the BlueZ linux Stack at http://www.bluez.org) for the C code. Classes, part of classes, C functions or part of C functions programmed by these teams and/or persons are explicitly mentioned.



Description:
This class extends the class ConnectionNotifier and implements, as requested by the JSR82 specification the interface StreamConnectionNotifier. Typically, this class will be used to manage RFCOMM or RFCOMM-based server connections

See Also:
ConnectionNotifier

Field Summary
 
Fields inherited from class de.avetana.bluetooth.connection.ConnectionNotifier
failEx, isClosed, m_fid, m_remote, m_serverFid, m_serviceHandle, myConnection, myRecord, parsedURL
 
Constructor Summary
RFCommConnectionNotifierImpl(JSR82URL url)
          Creates a new LocalConnectionNotifier object and therefore a new Local service record.
 
Method Summary
 StreamConnection acceptAndOpen()
          Waits for a client to connect to this RFCOMM service.
 
Methods inherited from class de.avetana.bluetooth.connection.ConnectionNotifier
acceptAndOpenI, close, getConnectionURL, getRemoteDevice, getServiceHandle, getServiceRecord, isNotifierClosed, isServiceRegistered, removeNotifier, setConnectionID, setFailure, setRemoteDevice, setServerFID, setServiceRecord
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.microedition.io.Connection
close
 

Constructor Detail

RFCommConnectionNotifierImpl

public RFCommConnectionNotifierImpl(JSR82URL url)
                             throws BadURLFormat,
                                    java.lang.Exception
Creates a new LocalConnectionNotifier object and therefore a new Local service record.

Parameters:
url - The server connection URL
Throws:
BadURLFormat - If the format of the URL is no correct
java.lang.Exception - If the service record is not valid.
Method Detail

acceptAndOpen

public StreamConnection acceptAndOpen()
                               throws java.io.IOException
Waits for a client to connect to this RFCOMM service. Upon connection returns an StreamConnection that can be used to communicate with this client.

A service record associated with this connection will be added to the SDDB associated with this ConnectionNotifer object if one does not exist in the SDDB.

Specified by:
acceptAndOpen in interface StreamConnectionNotifier
Returns:
the opened stream connection
Throws:
java.io.IOException