change BluetoothGatt - Android Bluetooth

Android examples for Bluetooth:Bluetooth State

Description

change BluetoothGatt

Demo Code


//package com.java2s;
import android.bluetooth.BluetoothGatt;

public class Main {
    public static boolean changeGattMtu(BluetoothGatt gatt, int mtu) {
        int retry = 5;
        boolean ok = false;
        while (!ok && retry > 0) {
            ok = gatt.requestMtu(mtu);/*  w  ww.  ja v  a  2 s.c  o m*/
            retry--;
        }
        return ok;
    }
}

Related Tutorials