001: /*
002: *
003: *
004: * Copyright 1990-2007 Sun Microsystems, Inc. All Rights Reserved.
005: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
006: *
007: * This program is free software; you can redistribute it and/or
008: * modify it under the terms of the GNU General Public License version
009: * 2 only, as published by the Free Software Foundation.
010: *
011: * This program is distributed in the hope that it will be useful, but
012: * WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * General Public License version 2 for more details (a copy is
015: * included at /legal/license.txt).
016: *
017: * You should have received a copy of the GNU General Public License
018: * version 2 along with this work; if not, write to the Free Software
019: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA
021: *
022: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
023: * Clara, CA 95054 or visit www.sun.com if you need additional
024: * information or have any questions.
025: */
026: package com.sun.kvem.jsr082.bluetooth;
027:
028: import javax.bluetooth.DataElement;
029:
030: /**
031: * Common interface for SDP server responses listeners. Listenners are assigned
032: * to active transactions and recieve SDP server responses.
033: *
034: */
035: interface SDPResponseListener {
036: /** Transaction cancelling reason: abnormal IO error. */
037: static final int IO_ERROR = 0x010000;
038:
039: /** Transaction cancelling reason: transaction has been terminated. */
040: static final int TERMINATED = 0x010001;
041:
042: /** Error code returned by SDP server: Invalid/unsupported SDP version. */
043: static final int SDP_INVALID_VERSION = 0x01;
044:
045: /** Error code returned by SDP server: Invalid Service Record Handle. */
046: static final int SDP_INVALID_SR_HANDLE = 0x02;
047:
048: /** Error code returned by SDP server: Invalid request syntax. */
049: static final int SDP_INVALID_SYNTAX = 0x03;
050:
051: /** Error code returned by SDP server: Invalid PDU Size. */
052: static final int SDP_INVALID_PDU_SIZE = 0x04;
053:
054: /** Error code returned by SDP server: Invalid Continuation State. */
055: static final int SDP_INVALID_CONTINUATION_STATE = 0x05;
056:
057: /**
058: * Error code returned by SDP server: Insufficient Resources to satisfy
059: * Request. */
060: static final int SDP_INSUFFICIENT_RESOURCES = 0x06;
061:
062: /**
063: * Informs this listener about errors during Service Discovering process.
064: *
065: * @param errorCode error code recieved from server or generated locally
066: * due to transaction terminating.
067: *
068: * @param info detail information about the error
069: *
070: * @param transactionID ID of transaction response recieved within.
071: */
072: void errorResponse(int errorCode, String info, int transactionID);
073:
074: /**
075: * Informs this listener about found services records.
076: *
077: * @param handleList service records handles returned by server within
078: * SDP_ServiceSearchResponse.
079: *
080: * @param transactionID ID of transaction response recieved within.
081: */
082: void serviceSearchResponse(int[] handleList, int transactionID);
083:
084: /**
085: * Informs this listener about found attributes of specified service record.
086: *
087: * @param attrIDs list of attributes whose values requested from server
088: * within SDP_ServiceAttributesRequest.
089: *
090: * @param attributeValues values returned by server within
091: * SDP_ServiceAttributesResponse.
092: *
093: * @param transactionID ID of transaction response recieved within.
094: */
095: void serviceAttributeResponse(int[] attrIDs,
096: DataElement[] attributeValues, int transactionID);
097:
098: /**
099: * Informs this listener about attributes of fisrt found service record.
100: *
101: * @param attrIDs list of attributes whose values requested from server
102: * within SDP_ServiceSearchAttributesRequest.
103: *
104: * @param attributeValues values returned by server within
105: * SDP_ServiceSearchAttributesResponse.
106: *
107: * @param transactionID ID of transaction response recieved within.
108: */
109: void serviceSearchAttributeResponse(int[] attrIDs,
110: DataElement[] attributeValues, int transactionID);
111: }
|