Example usage for android.bluetooth BluetoothSocket requestMaximumTxDataLength

List of usage examples for android.bluetooth BluetoothSocket requestMaximumTxDataLength

Introduction

In this page you can find the example usage for android.bluetooth BluetoothSocket requestMaximumTxDataLength.

Prototype

public void requestMaximumTxDataLength() throws IOException 

Source Link

Document

Set the LE Transmit Data Length to be the maximum that the BT Controller is capable of.

Usage

From source file:com.googlecode.android_scripting.facade.bluetooth.BluetoothSocketConnFacade.java

/**
 * Set the current BluetoothSocket LE Data Length value to the maximum supported by this BT
 * controller. This command suggests to the BT controller to set its maximum transmission packet
 * size./*from   w  w w . j av  a  2s  .  c om*/
 * @throws Exception
 */
@Rpc(description = "Request Maximum Tx Data Length")
public void bluetoothSocketRequestMaximumTxDataLength() throws IOException {
    Log.d("bluetoothSocketRequestMaximumTxDataLength");

    if (mConnectThread == null) {
        String connUuid = mConnectThread.getConnUuid();
        throw new IOException("bluetoothSocketRequestMaximumTxDataLength: no active connect" + " thread");
    }

    BluetoothSocket socket = mConnectThread.getSocket();
    if (socket == null) {
        throw new IOException("bluetoothSocketRequestMaximumTxDataLength: no active connect" + " socket");
    }
    socket.requestMaximumTxDataLength();
}