|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.avetana.bluetooth.stack.BluetoothStack
public abstract class BluetoothStack
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:
de.avetana.bluetooth.stack.BluezStack,
BlueZ| Field Summary | |
|---|---|
static int |
ACCEPT_POS
This constant defines the array-position of the property Accept. |
static int |
CON_AUTH_POS
This constant defines the array-position of the property Authenticate. |
static int |
CON_ENCRYPT_POS
This constant defines the array-position of the property Encrypt. |
static int |
CON_MASTER_POS
This constant defines the array-position of the property Master. |
static int |
CON_TRUSTED_POS
This constant defines the array-position of the property Trusted. |
| Constructor Summary | |
|---|---|
BluetoothStack()
|
|
| Method Summary | |
|---|---|
abstract int |
authenticate(RemoteDevice dev)
Asks the remote device to perform an authentication. |
abstract boolean |
cancelServiceSearch(int transID)
Stops a service search. |
abstract int |
encrypt(Connection conn,
RemoteDevice dev,
boolean encrypt)
Turns on/off the encryption of an ACL link |
static BluetoothStack |
getBluetoothStack()
Returns the instance of BluetoothStack currently used. |
abstract int |
getClassOfDevice()
Returns the class of the local device. |
abstract boolean |
getConnectionFlag(RemoteDevice dev,
int pos)
Gets the property for a connection. |
abstract int |
getDiscoverableMode()
Returns the discoverable mode of the local device. |
abstract java.lang.String |
getLocalDeviceAddress()
Returns the local device address. |
abstract java.lang.String |
getLocalDeviceName()
Returns the name of the local device. |
abstract java.lang.String |
getRemoteName(java.lang.String bd_addr)
Returns the name of the remote device. |
static void |
init(BluetoothStack stack)
This method is deprecated |
abstract BTConnection |
isConnected(RemoteDevice dev)
Returns true if the remote device is currently connected with the local device
(whatever the type of connection: server an client connections are here concerned) |
abstract Connection |
openL2CAPConnection(JSR82URL url,
int timeout)
Opens a new L2CAP client connection. |
abstract Connection |
openRFCommConnection(JSR82URL url,
int timeout)
Opens a new RFCOMM client connnection. |
abstract int |
searchServices(int[] attrSet,
UUID[] uuidSet,
RemoteDevice btDev,
DiscoveryListener myListener)
Searches for desired services. |
abstract int |
setDiscoverableMode(int mode)
Sets the new discoverable mode for this local device. |
abstract int |
updateService(ServiceRecord rec,
long recordHandle)
Updates a Service record stored in the local BCC. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int ACCEPT_POS
public static final int CON_MASTER_POS
public static final int CON_AUTH_POS
public static final int CON_ENCRYPT_POS
public static final int CON_TRUSTED_POS
| Constructor Detail |
|---|
public BluetoothStack()
| Method Detail |
|---|
public static BluetoothStack getBluetoothStack()
throws java.lang.Exception
java.lang.Exception - If the BluetoothStack was not initialized
public abstract java.lang.String getLocalDeviceName()
throws java.lang.Exception
java.lang.ExceptionLocalDevice
public abstract int getClassOfDevice()
throws java.lang.Exception
java.lang.ExceptionLocalDevice
public abstract java.lang.String getLocalDeviceAddress()
throws java.lang.Exception
java.lang.ExceptionLocalDevice
public abstract java.lang.String getRemoteName(java.lang.String bd_addr)
throws java.lang.Exception
bd_addr - The BT address of the remote device
java.lang.Exception
public abstract Connection openRFCommConnection(JSR82URL url,
int timeout)
throws java.lang.Exception
url - The connection URL
java.lang.Exception
public abstract Connection openL2CAPConnection(JSR82URL url,
int timeout)
throws java.lang.Exception
url - The connection URL
java.lang.Exception
public abstract int searchServices(int[] attrSet,
UUID[] uuidSet,
RemoteDevice btDev,
DiscoveryListener myListener)
attrSet - The list of attributes to be considered for each found service.uuidSet - The list of UUIDs a service MUST contain.btDev - The remote devicemyListener - The discovery listener for callback methods.public abstract boolean cancelServiceSearch(int transID)
transID - The SDP transaction ID.
public abstract int updateService(ServiceRecord rec,
long recordHandle)
throws java.lang.Exception
b - The new service description represented as a byte arrayrecordHandle - The record handle of the old service
java.lang.ExceptionLocalDevice
public abstract int getDiscoverableMode()
throws java.lang.Exception
java.lang.ExceptionLocalDevice
public abstract int setDiscoverableMode(int mode)
throws java.lang.Exception
mode - a value in the range 0x9E8B00 to 0x9E8B3F
java.lang.ExceptionLocalDevicepublic abstract BTConnection isConnected(RemoteDevice dev)
true if the remote device is currently connected with the local device
(whatever the type of connection: server an client connections are here concerned)
dev - The remote device
public abstract int authenticate(RemoteDevice dev)
throws java.lang.Exception
dev - The remote device
1 If the authentication did succeed.java.lang.ExceptionRemoteDevice
public abstract int encrypt(Connection conn,
RemoteDevice dev,
boolean encrypt)
throws java.lang.Exception
conn - The connection object representing the connection beteen the local and remote devicedev - The remote device for this connectionencrypt - If true, turn on the encryption of the ACL link. Otherwise, turn it off
1 If the operation did succeed.java.lang.ExceptionRemoteDevice
public abstract boolean getConnectionFlag(RemoteDevice dev,
int pos)
throws java.lang.Exception
dev - The remote devicepos - The position of the desired flag in the array of properties
true If the property is true.false Otherwise.
java.lang.ExceptionRemoteDevice,
ACCEPT_POS,
CON_AUTH_POS,
CON_ENCRYPT_POS,
CON_MASTER_POS,
CON_TRUSTED_POSpublic static void init(BluetoothStack stack)
stack -
java.lang.Exception - at deprecated
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||