BluetoothLeService.java 文件源码

java
阅读 26 收藏 0 点赞 0 评论 0

项目:TrainAppTFG 作者:
@Override
public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) {
    super.onConnectionStateChange(gatt, status, newState);

    Log.d("BLUETOOTH", "Estado de conexión bluetooth: " + (newState == BluetoothProfile.STATE_CONNECTED ? "Connected" : "Disconnected"));

    if(newState == BluetoothProfile.STATE_CONNECTED){
        //setState(State.CONNECTED);
        mBluetoothGatt.discoverServices();
    }
    else{
        //setState(State.IDDLE);
        //TODO Realizar todas las tareas necesarias cuando se desconecte la pulsera
        Log.d("BLUETOOTH", "Se ha desconectado el dispostivo bluetooth");
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号