Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit c790096a authored by Nick Pelly's avatar Nick Pelly
Browse files

New BluetoothSocket API.

Modeled on blocking java.net.Socket and java.net.ServerSocket library.

Public interface is:

public final class BluetoothSocket implements Closeable {
   public static BluetoothSocket createRfcommSocket(String address, int port) throws IOException;
   public static BluetoothSocket createInsecureRfcommSocket(String address, int port) throws IOException;

   public void connect() throws IOException;
   public void close() throws IOException;

   public String getAddress();
   public InputStream getInputStream() throws IOException;
   public OutputStream getOutputStream() throws IOException;
}

public final class BluetoothServerSocket implements Closeable {
   public static BluetoothServerSocket listenUsingRfcommOn(int port) throws IOException;
   public static BluetoothServerSocket listenUsingUnsecureRfcommOn(int port) throws IOException;

   public BluetoothSocket accept() throws IOException;
   public BluetoothSocket accept(int timeout) throws IOException;
   public void close() throws IOException;

}
parent 9b50ade5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment