Fields Summary |
---|
private static final int | MAX_SERVICE_RECORD_COUNTMax retrievable service record handles. Maybe defined via property. |
private static final int | MAX_ATTRIBUTE_BYTE_COUNTMax total size of retrievable attributes. Maybe defined via property. |
private static final int | firstTransactionIDThe lowest possible value of transaction ID.
The number must be positive. |
private static final int | maxTransactionIDThe maximum possible value of transaction ID. |
private static int | effectiveTransactionIDNext transaction ID. |
private static Hashtable | transportStorageMaps Bluetooth addresses to transport connections. |
private SDPTransport | transportTransport connection for this client. |
private String | addressBluetooth address this client is connected to. |
Methods Summary |
---|
boolean | cancelServiceSearch(int transactionID)Cancels transaction with given ID.
return transport.cancelServiceSearch(transactionID);
|
void | close()Closes connection of this client to the specified server.
if (transport == null) {
throw new IOException("Connection is already closed.");
}
transport.release();
transport = null;
|
static synchronized void | freeTransactionID(short transactionID)Frees transaction ID.
// empty in this implementation
|
static synchronized short | newTransactionID()Retrieves next new transaction ID.
int transactionID = effectiveTransactionID++;
if (effectiveTransactionID > maxTransactionID) {
// strictly speaking, this is not quite safe,
// need revisit : if we have a pending
// transaction after 64K of subsequent calls
effectiveTransactionID = firstTransactionID;
}
return (short)transactionID;
|
void | serviceAttributeRequest(int serviceRecordHandle, int[] attrSet, int transactionID, SDPResponseListener listener)Initiates ServiceAttribute transaction that retrieves
specified attribute values from a specific service record.
try {
transport.serviceAttributeRequest(serviceRecordHandle, attrSet,
transactionID, listener);
} catch (IOException e) {
transport.cancelAll(SDPResponseListener.IO_ERROR);
throw e;
}
|
void | serviceSearchAttributeRequest(int[] attrSet, javax.bluetooth.UUID[] uuidSet, int transactionID, SDPResponseListener listener)Initiates ServiceSearchAttribute transaction that searches for services
on a server by UUIDs specified and retrieves values of specified
parameters for service records found.
try {
transport.serviceSearchAttributeRequest(attrSet, uuidSet,
transactionID, listener);
} catch (IOException e) {
transport.cancelAll(SDPResponseListener.IO_ERROR);
throw e;
}
|
void | serviceSearchRequest(javax.bluetooth.UUID[] uuidSet, int transactionID, SDPResponseListener listener)Initiates ServiceSearch transaction that is used to search for
services that have all the UUIDs specified on a server.
try {
transport.serviceSearchRequest(uuidSet, transactionID, listener);
} catch (IOException ioe) {
transport.cancelAll(SDPResponseListener.IO_ERROR);
throw ioe;
}
|