|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.avetana.bluetooth.connection.JSR82URL
The class used to manage connection URLs.
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 is used to store the different connection URLs. It parses the URL represented as string, verifies their
correctness, identifies the protocols and stores all connection attributes in easy-to.use objects.
This utility class is therefore used among most of the classes of the Avetana JSR82 implementation
| Field Summary | |
static short |
PROTOCOL_L2CAP
The variable that identifies the L2CAP protocol. |
static short |
PROTOCOL_OBEX
The variable that identifies the OBEX protocol. |
static short |
PROTOCOL_RFCOMM
The variable that identifies the RFCOMM protocol. |
| Constructor Summary | |
JSR82URL(java.lang.String url)
Creates a new instance of JSR82URL, initializes the different class variables and parses the string given in argument |
|
| Method Summary | |
int |
getAttrNumber()
Returns the value of the PSM or of the channel number. |
BTAddress |
getBTAddress()
Returns the BT device address or null in the case of a server connection URL. |
java.lang.String |
getLocalServiceUUID()
Returns the string representation of the local service UUID or null in the case of a client connection URL. |
java.lang.Object |
getParameter(java.lang.String paramName)
Returns the value of the option named paramName. |
java.lang.String[] |
getParameterKeys()
Returns the array of connection options. |
java.util.Hashtable |
getParameters()
Returns the hashtable containing all connection options. |
short |
getProtocol()
Returns the integer code of protocol used by this connection URL. |
boolean |
isAuthenticated()
Returns the value of the option Authenticate. |
boolean |
isAuthorized()
Returns the value of the option authorize. |
boolean |
isEncrypted()
Returns the value of the option encrypt. |
boolean |
isLocalMaster()
Returns the value of the option master. |
void |
setAttrNumber(int num)
Sets the PSM or the channel number (depending on the protocol used). |
void |
setParameter(java.lang.String name,
java.lang.Object value)
Sets the value of a connection option. |
void |
setProtocol(short protocol)
Sets the protocol. |
java.lang.String |
toString()
Returns the string representation of the connection url. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final short PROTOCOL_L2CAP
public static final short PROTOCOL_RFCOMM
public static final short PROTOCOL_OBEX
| Constructor Detail |
public JSR82URL(java.lang.String url)
throws BadURLFormat,
java.lang.Exception
url - A string representation of a connection URL.
BadURLFormat - If the connection URL is not valid.
java.lang.Exception - If some other exception occurs.| Method Detail |
public boolean isAuthenticated()
true - If the connection option authenticate is set to true.false - Otherwise.public boolean isEncrypted()
true - If the connection option authenticate is set to true.false - Otherwise.public boolean isAuthorized()
true - If the connection option authorize is set to true.false - Otherwise.public boolean isLocalMaster()
true - If the connection option master is set to true.false - Otherwisepublic void setAttrNumber(int num)
num - The new PSM or channel number.public java.lang.String toString()
public java.lang.String[] getParameterKeys()
public java.util.Hashtable getParameters()
| Option Name | Object type | Protocol | Server/Client connections? |
|---|---|---|---|
| name | String | All | Server |
| receiveMTU | String | L2CAP | Both |
| transmitMTU | String | L2CAP | Both |
| authenticate | Boolean | All | Both |
| master | Boolean | All | Both |
| encrypt | Boolean | All | Both |
| authorize | Boolean | All | Both |
| Other options | Boolean | ? | ? |
null. Please keep in mind that the default values given in the above table
are the values FOR the methods of this class. The L2CAP connection classes are using a default value for receiveMTU
set to 672, for example.
public java.lang.Object getParameter(java.lang.String paramName)
paramName - The option's name.
public void setParameter(java.lang.String name,
java.lang.Object value)
name - The name of the optionvalue - The value of this option.public void setProtocol(short protocol)
protocol - The protocol code of the new protocol.public BTAddress getBTAddress()
public java.lang.String getLocalServiceUUID()
public int getAttrNumber()
public short getProtocol()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||