Home | History | Annotate | Download | only in map
      1 /*
      2  * Copyright (C) 2014 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package android.bluetooth.client.map;
     18 
     19 import android.bluetooth.BluetoothSocket;
     20 
     21 import java.io.DataInputStream;
     22 import java.io.DataOutputStream;
     23 import java.io.IOException;
     24 import java.io.InputStream;
     25 import java.io.OutputStream;
     26 
     27 import javax.obex.ObexTransport;
     28 
     29 class BluetoothMapRfcommTransport implements ObexTransport {
     30     private final BluetoothSocket mSocket;
     31 
     32     public BluetoothMapRfcommTransport(BluetoothSocket socket) {
     33         super();
     34         mSocket = socket;
     35     }
     36 
     37     @Override
     38     public void create() throws IOException {
     39     }
     40 
     41     @Override
     42     public void listen() throws IOException {
     43     }
     44 
     45     @Override
     46     public void close() throws IOException {
     47         mSocket.close();
     48     }
     49 
     50     @Override
     51     public void connect() throws IOException {
     52     }
     53 
     54     @Override
     55     public void disconnect() throws IOException {
     56     }
     57 
     58     @Override
     59     public InputStream openInputStream() throws IOException {
     60         return mSocket.getInputStream();
     61     }
     62 
     63     @Override
     64     public OutputStream openOutputStream() throws IOException {
     65         return mSocket.getOutputStream();
     66     }
     67 
     68     @Override
     69     public DataInputStream openDataInputStream() throws IOException {
     70         return new DataInputStream(openInputStream());
     71     }
     72 
     73     @Override
     74     public DataOutputStream openDataOutputStream() throws IOException {
     75         return new DataOutputStream(openOutputStream());
     76     }
     77 
     78     @Override
     79     public int getMaxTransmitPacketSize() {
     80         return -1;
     81     }
     82 
     83     @Override
     84     public int getMaxReceivePacketSize() {
     85         return -1;
     86     }
     87 
     88     @Override
     89     public boolean isSrmSupported() {
     90         return false;
     91     }
     92 }
     93