|
||||||||||
| 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.RemoteServiceRecord
The class used to manage remote 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:
| 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 | |
RemoteServiceRecord()
Default constructor: creates a RemoteServiceRecord object, which extends SDPServiceRecord |
|
RemoteServiceRecord(java.lang.String badr)
Creates a RemoteServiceRecord object and sets the remote device this service belongs to. |
|
| Method Summary | |
static ServiceRecord |
createServiceRecord(java.lang.String adr,
byte[][] uuids,
int[] attrs,
byte[] data)
|
java.lang.String |
getConnectionURL(int requiredSecurity,
boolean mustBeMaster)
JSR82 Specification: Returns a String including optional parameters that can be used by a client to connect to the service described by this ServiceRecord. |
RemoteDevice |
getHostDevice()
Returns the remote device this service belongs to |
static void |
main(java.lang.String[] args)
|
boolean |
populateRecord(int[] attr)
JSR82 Specification: Retrieves the values by contacting the remote Bluetooth device for a set of service attribute IDs of a service that is available on a Bluetooth device. |
void |
setDeviceServiceClasses(int parm1)
This method is not yet supported by the implementation. |
| 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 RemoteServiceRecord()
SDPServiceRecordpublic RemoteServiceRecord(java.lang.String badr)
badr - The BT address of the remote device| Method Detail |
public RemoteDevice getHostDevice()
getHostDevice in interface ServiceRecordgetHostDevice in class SDPServiceRecord
public boolean populateRecord(int[] attr)
throws java.io.IOException
LocalDevice.getProperty("bluetooth.sd.attr.retrievable.max").
The method is blocking and will return when the results of the request are available. Attribute IDs whose
values could be obtained are added to this service record. If
there exist attribute IDs for which values are retrieved this
will cause the old values to be overwritten. If the remote
device cannot be reached, an IOException will be thrown.
attr - 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.
true if the request was successful in retrieving values for some or all of the attribute IDs;
false if it was unsuccessful in retrieving any values
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
java.lang.IllegalArgumentException - if the size of attrIDs exceeds the system specified limit as
defined by bluetooth.sd.attr.retrievable.max; if the
attrIDs array length is zero; if any of their values are not in the range of [0, 216-1]; if
attrIDs has duplicate values
java.lang.NullPointerException - if attrIDs is null
java.lang.RuntimeException - if this ServiceRecord
describes a service on the local device rather than a service on a remote device
public java.lang.String getConnectionURL(int requiredSecurity,
boolean mustBeMaster)
throws java.lang.IllegalArgumentException
ServiceRecord. The return value can be used as the
first argument to Connector.open(). In the case of a
Serial Port service record, this string might look like
"btspp://0050CD00321B:3;authenticate=true;encrypt=false;master=true", where "0050CD00321B" is the Bluetooth
address of the device that provided this ServiceRecord, "3" is the RFCOMM
server channel mentioned in this ServiceRecord, and
there are three optional parameters related to security and master/slave roles.
If this method is called on a ServiceRecord returned
from LocalDevice.getRecord(), it will return the
connection string that a remote device will use to connect to this service.
AvetanaBluetooth:
The implementation of getConnectionURL() only supports RFCOMM and L2CAP.
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
null if the ProtocolDescriptorList in this
ServiceRecord is not formatted according to the Bluetooth specification
java.lang.IllegalArgumentException - if requiredSecurity is not one of the constants
NOAUTHENTICATE_NOENCRYPT, AUTHENTICATE_NOENCRYPT, or AUTHENTICATE_ENCRYPTServiceRecord.NOAUTHENTICATE_NOENCRYPT,
ServiceRecord.AUTHENTICATE_NOENCRYPT,
ServiceRecord.AUTHENTICATE_ENCRYPTpublic void setDeviceServiceClasses(int parm1)
parm1 -
public static ServiceRecord createServiceRecord(java.lang.String adr,
byte[][] uuids,
int[] attrs,
byte[] data)
throws java.io.IOException
java.io.IOException
public static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||