|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.avetana.bluetooth.sdp.SDPServiceRecord
The top-class implementing methods common with all instances of Service Record.
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:
The Avetana Bluetooth implementation provides two classes, which aim to manage the service record, and separates therefore
local from remote service record.
This separation is made in order to better implement the JSR82 specification. But
common methods of these two classes exist. The SDPServiceRecord class aims to implement these common methods.
| Field Summary | |
protected java.util.Hashtable |
m_attributes
The Hashtable containing the service attributes and their related DataElement |
protected long |
m_recordHandle
The handle of this service record |
| Fields inherited from interface javax.bluetooth.ServiceRecord |
AUTHENTICATE_ENCRYPT, AUTHENTICATE_NOENCRYPT, NOAUTHENTICATE_NOENCRYPT |
| Constructor Summary | |
SDPServiceRecord()
Creates a new SDP service record. |
|
SDPServiceRecord(long recordHandle)
Creates a new SDP service record, initializes the different class variables and sets the record handle. |
|
| Method Summary | |
int[] |
getAttributeIDs()
Returns the service attribute IDs whose value could be retrieved by a call to getAttributeValue(). |
DataElement |
getAttributeValue(int attrID)
Returns the DataElement corresponding to the given attribute |
abstract RemoteDevice |
getHostDevice()
Returns the remote Bluetooth device that populated the service record with attribute values. |
long |
getRecordHandle()
Returns the record handle. |
boolean |
setAttributeValue(int attrID,
DataElement attrDesc)
Modifies this ServiceRecord to contain the service attribute defined by the attribute-value pair
(attrID, attrValue). |
void |
setRecordHandle(long recordHandle)
Sets the record handle |
byte[] |
toByteArray()
The byte representation of this record. |
java.lang.String |
toString()
Returns the String representation of a service record, which lists all attributes and their corresponding DataElement |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface javax.bluetooth.ServiceRecord |
getConnectionURL, populateRecord, setDeviceServiceClasses |
| Field Detail |
protected java.util.Hashtable m_attributes
protected long m_recordHandle
| Constructor Detail |
public SDPServiceRecord()
public SDPServiceRecord(long recordHandle)
recordHandle - | Method Detail |
public void setRecordHandle(long recordHandle)
recordHandle - The value of the record handlepublic long getRecordHandle()
public DataElement getAttributeValue(int attrID)
getAttributeValue in interface ServiceRecordattrID - The value of the attribute
null - Otherwisepublic abstract RemoteDevice getHostDevice()
ServiceRecord
getHostDevice in interface ServiceRecordnull if the local device populated this ServiceRecordpublic int[] getAttributeIDs()
ServiceRecordgetAttributeValue(). The list of attributes being returned is not sorted and includes default attributes.
getAttributeIDs in interface ServiceRecordServiceRecord.getAttributeValue(int)
public boolean setAttributeValue(int attrID,
DataElement attrDesc)
ServiceRecordServiceRecord to contain the service attribute defined by the attribute-value pair
(attrID, attrValue). If the attrID does not exist in the ServiceRecord, this
attribute-value pair is added to this ServiceRecord object. If the attrID is already in this
ServiceRecord, the value of the attribute is changed to attrValue.
If attrValue is null, the attribute
with the attribute ID of attrID is removed from this ServiceRecord object. If
attrValue is null and attrID does not exist in this object,
this method will return false. This method makes no modifications to a service record in the
SDDB. In order for any changes made by this method to be reflected in the SDDB, a call must be made to the
acceptAndOpen() method of the associated notifier
to add this ServiceRecord to the SDDB for the first time, or a call must be made to the
updateRecord() method of LocalDevice to
modify the version of this ServiceRecord that is already in the SDDB.
This method prevents the ServiceRecordHandle from being modified by throwing an IllegalArgumentException.
setAttributeValue in interface ServiceRecordattrID - attrDesc -
public java.lang.String toString()
public byte[] toByteArray()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||