|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.avetana.bluetooth.sdp.SDPServiceRecord
de.avetana.bluetooth.sdp.LocalServiceRecord
The class used to manage local service records.
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 manage the local service records. As requested by the JSR82 Specification, the class
is an instance of javax.bluetooth.ServiceRecord. However, some methods like getRemoteDevice() throw a RuntimeExcepion
because there is logically no RemoteDevice for a local Service Record. The most used method is certainly the
static method createSerialSvcRecord, which creates with few parameters a complete local Service record.
Other methods like getSDPRecordXML() were implemented in order to fullfill OS specific needs.
| Field Summary |
| Fields inherited from class de.avetana.bluetooth.sdp.SDPServiceRecord |
m_attributes, m_recordHandle |
| Fields inherited from interface javax.bluetooth.ServiceRecord |
AUTHENTICATE_ENCRYPT, AUTHENTICATE_NOENCRYPT, NOAUTHENTICATE_NOENCRYPT |
| Constructor Summary | |
LocalServiceRecord()
Default constructor: creates a new LocalServiceRecord object |
|
LocalServiceRecord(long recordHandle)
Creates a new LocalServiceRecord and sets its record handle |
|
| Method Summary | |
static LocalServiceRecord |
createSerialSvcRecord(UUID svcID,
java.lang.String name,
int channel,
short protocol)
Creates a new local Service Record with desired options |
DataElement |
getChannelNumberElement()
Gets the channel/PSM number of the local service record |
java.lang.String |
getConnectionURL(int requiredSecurity,
boolean mustBeMaster)
Method not available for a local service record. |
RemoteDevice |
getHostDevice()
Method not available for a local service record. |
short |
getProtocol()
Returns the protocol supported by this local service record. |
java.lang.String |
getSDPRecordXML()
Transforms the service record object into an XML element and returns the string representation of this XML element. |
UUID |
getServiceClassID()
Returns the ServiceClassID of this service |
UUID[] |
getServiceClassIDList()
|
boolean |
populateRecord(int[] attrIDs)
Method not available for a local service record. |
void |
setDeviceServiceClasses(int classes)
Method not yet supported. |
void |
updateChannelNumber(int newChannel)
Changes the channel number of an RFCOMM local service record |
| Methods inherited from class de.avetana.bluetooth.sdp.SDPServiceRecord |
getAttributeIDs, getAttributeValue, getRecordHandle, setAttributeValue, setRecordHandle, toByteArray, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public LocalServiceRecord()
public LocalServiceRecord(long recordHandle)
recordHandle - The record handle of the service record| Method Detail |
public short getProtocol()
public static LocalServiceRecord createSerialSvcRecord(UUID svcID,
java.lang.String name,
int channel,
short protocol)
svcID - The UUID of the local service recordname - The name of the local service recordchannel - The Channel/PSM valueprotocol - The protocol code identifying the highest level protocol
public java.lang.String getSDPRecordXML()
public void updateChannelNumber(int newChannel)
newChannel - The new Channel numberpublic DataElement getChannelNumberElement()
public RemoteDevice getHostDevice()
getHostDevice in interface ServiceRecordgetHostDevice in class SDPServiceRecordnull
public boolean populateRecord(int[] attrIDs)
throws java.io.IOException
attrIDs - the list of service attributes IDs whose value
are to be retrieved; the number of attributes cannot exceed the
property bluetooth.sd.attr.retrievable.max; the
attributes in the request must be legal, i.e. their values are
in the range of [0, 216-1]. The input attribute IDs
can include attribute IDs from the default attribute set too.
java.io.IOException - if the local device is unable to connect
to the remote Bluetooth device that was the source of this ServiceRecord; if this
ServiceRecord was deleted from the SDDB of the remote device
public java.lang.String getConnectionURL(int requiredSecurity,
boolean mustBeMaster)
requiredSecurity - determines whether authentication or encryption are required for a connectionmustBeMaster - true indicates that this device
must play the role of master in connections to this service;
false indicates that the local device is willing to be either the master or the slave
ServiceRecord.NOAUTHENTICATE_NOENCRYPT,
ServiceRecord.AUTHENTICATE_NOENCRYPT,
ServiceRecord.AUTHENTICATE_ENCRYPTpublic void setDeviceServiceClasses(int classes)
classes - an integer whose binary representation indicates the major service class bits that should be activated
public UUID getServiceClassID()
public UUID[] getServiceClassIDList()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||