|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.avetana.bluetooth.stack.BluetoothStack
de.avetana.bluetooth.stack.AvetanaBTStack
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 implements the de.avetana.bluetooth.stack.BluetoothStack class.
Please refer to this abstract class for the documentation.
BluetoothStack| Field Summary |
| Fields inherited from class de.avetana.bluetooth.stack.BluetoothStack |
ACCEPT_POS, CON_AUTH_POS, CON_ENCRYPT_POS, CON_MASTER_POS, CON_TRUSTED_POS |
| Constructor Summary | |
AvetanaBTStack()
|
|
AvetanaBTStack(int devID)
|
|
| Method Summary | |
int |
authenticate(RemoteDevice dev)
Asks the remote device to perform an authentication. |
boolean |
cancelServiceSearch(int transID)
Stops a service search. |
void |
closeDevice()
|
int |
encrypt(Connection conn,
RemoteDevice dev,
boolean encrypt)
Turns on/off the encryption of an ACL link |
int |
getClassOfDevice()
Returns the class of the local device. |
boolean |
getConnectionFlag(RemoteDevice dev,
int pos)
Gets the property for a connection. |
int |
getDiscoverableMode()
Returns the discoverable mode of the local device. |
java.lang.String |
getLocalDeviceAddress()
Returns the local device address. |
java.lang.String |
getLocalDeviceName()
Returns the name of the local device. |
java.lang.String |
getRemoteName(java.lang.String bd_addr)
Returns the name of the remote device. |
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) |
Connection |
openL2CAPConnection(JSR82URL url)
Opens a new L2CAP client connection. |
Connection |
openRFCommConnection(JSR82URL url)
Opens a new RFCOMM client connnection. |
int |
searchServices(int[] attrSet,
UUID[] uuidSet,
RemoteDevice btDev,
DiscoveryListener myListener)
Searches for desired services. |
void |
setDeviceID(int dev)
|
int |
setDiscoverableMode(int mode)
Sets the new discoverable mode for this local device. |
int |
updateService(ServiceRecord rec,
long recordHandle)
Updates a Service record stored in the local BCC. |
| Methods inherited from class de.avetana.bluetooth.stack.BluetoothStack |
getBluetoothStack, init |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public AvetanaBTStack()
throws java.lang.Exception
public AvetanaBTStack(int devID)
throws java.lang.Exception
| Method Detail |
public void setDeviceID(int dev)
throws java.lang.Exception
java.lang.Exception
public java.lang.String getRemoteName(java.lang.String bd_addr)
throws java.lang.Exception
BluetoothStack
getRemoteName in class BluetoothStackbd_addr - The BT address of the remote device
java.lang.Exception
public int authenticate(RemoteDevice dev)
throws java.lang.Exception
BluetoothStack
authenticate in class BluetoothStackdev - The remote device
1 If the authentication did succeed.java.lang.ExceptionRemoteDevice
public boolean getConnectionFlag(RemoteDevice dev,
int pos)
throws java.lang.Exception
BluetoothStack
getConnectionFlag in class BluetoothStackdev - 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,
BluetoothStack.ACCEPT_POS,
BluetoothStack.CON_AUTH_POS,
BluetoothStack.CON_ENCRYPT_POS,
BluetoothStack.CON_MASTER_POS,
BluetoothStack.CON_TRUSTED_POS
public int encrypt(Connection conn,
RemoteDevice dev,
boolean encrypt)
throws java.lang.Exception
BluetoothStack
encrypt in class BluetoothStackconn - 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.ExceptionRemoteDevicepublic BTConnection isConnected(RemoteDevice dev)
BluetoothStacktrue if the remote device is currently connected with the local device
(whatever the type of connection: server an client connections are here concerned)
isConnected in class BluetoothStackdev - The remote device
public java.lang.String getLocalDeviceAddress()
throws java.lang.Exception
BluetoothStack
getLocalDeviceAddress in class BluetoothStackjava.lang.ExceptionLocalDevice
public java.lang.String getLocalDeviceName()
throws java.lang.Exception
BluetoothStack
getLocalDeviceName in class BluetoothStackjava.lang.ExceptionLocalDevice
public int searchServices(int[] attrSet,
UUID[] uuidSet,
RemoteDevice btDev,
DiscoveryListener myListener)
BluetoothStack
searchServices in class BluetoothStackattrSet - 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 int getClassOfDevice()
throws java.lang.Exception
BluetoothStack
getClassOfDevice in class BluetoothStackjava.lang.ExceptionLocalDevice
public void closeDevice()
throws java.lang.Exception
java.lang.Exception
public int getDiscoverableMode()
throws java.lang.Exception
BluetoothStack
getDiscoverableMode in class BluetoothStackjava.lang.ExceptionLocalDevice
public int setDiscoverableMode(int mode)
throws java.lang.Exception
BluetoothStack
setDiscoverableMode in class BluetoothStackmode - a value in the range 0x9E8B00 to 0x9E8B3F
java.lang.ExceptionLocalDevice
public Connection openRFCommConnection(JSR82URL url)
throws java.lang.Exception
BluetoothStack
openRFCommConnection in class BluetoothStackurl - The connection URL
java.lang.Exception
public Connection openL2CAPConnection(JSR82URL url)
throws java.lang.Exception
BluetoothStack
openL2CAPConnection in class BluetoothStackurl - The connection URL
java.lang.Exceptionpublic boolean cancelServiceSearch(int transID)
BluetoothStack
cancelServiceSearch in class BluetoothStacktransID - The SDP transaction ID.
public int updateService(ServiceRecord rec,
long recordHandle)
throws java.lang.Exception
BluetoothStack
updateService in class BluetoothStackrecordHandle - The record handle of the old service
java.lang.ExceptionLocalDevice
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||