1 /*
2 * Copyright (C) 2013 Samsung System LSI
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *      http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15 
16 package com.android.bluetooth.map;
17 
18 import android.bluetooth.BluetoothSocket;
19 
20 import java.io.DataInputStream;
21 import java.io.DataOutputStream;
22 import java.io.IOException;
23 import java.io.InputStream;
24 import java.io.OutputStream;
25 
26 import javax.obex.ObexTransport;
27 
28 public class BluetoothMapRfcommTransport implements ObexTransport {
29     private BluetoothSocket mSocket = null;
30 
BluetoothMapRfcommTransport(BluetoothSocket rfs)31     public BluetoothMapRfcommTransport(BluetoothSocket rfs) {
32         super();
33         this.mSocket = rfs;
34     }
35 
close()36     public void close() throws IOException {
37         mSocket.close();
38     }
39 
openDataInputStream()40     public DataInputStream openDataInputStream() throws IOException {
41         return new DataInputStream(openInputStream());
42     }
43 
openDataOutputStream()44     public DataOutputStream openDataOutputStream() throws IOException {
45         return new DataOutputStream(openOutputStream());
46     }
47 
openInputStream()48     public InputStream openInputStream() throws IOException {
49         return mSocket.getInputStream();
50     }
51 
openOutputStream()52     public OutputStream openOutputStream() throws IOException {
53         return mSocket.getOutputStream();
54     }
55 
connect()56     public void connect() throws IOException {
57     }
58 
create()59     public void create() throws IOException {
60     }
61 
disconnect()62     public void disconnect() throws IOException {
63     }
64 
listen()65     public void listen() throws IOException {
66     }
67 
isConnected()68     public boolean isConnected() throws IOException {
69         return true;
70     }
71 
72 }
73