BluetoothLeService.java 文件源码

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

项目:Make-A-Pede-Android-App 作者:
@Override
public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) {
    String intentAction;
    if (newState == BluetoothProfile.STATE_CONNECTED) {
        intentAction = ACTION_CONNECTED;
        connectionState = STATE_CONNECTED;
        broadcastUpdate(intentAction);
        Log.i(TAG, "Connected to GATT server.");
        Log.i(TAG, "Attempting to start service discovery:" + bluetoothGatt.discoverServices());

    } else if (newState == BluetoothProfile.STATE_DISCONNECTED) {
        intentAction = ACTION_DISCONNECTED;
        connectionState = STATE_DISCONNECTED;
        Log.i(TAG, "Disconnected from GATT server.");
        broadcastUpdate(intentAction);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号