美文网首页
安卓如何得到蓝牙耳机左右耳音量值?求助

安卓如何得到蓝牙耳机左右耳音量值?求助

作者: 帅锅浪妹 | 来源:发表于2019-08-14 22:16 被阅读0次

    private void displayGattServices(List<BluetoothGattService> gattServices){ if(gattServices == null) return; String uuid = null; for(BluetoothGattService gattService : gattServices){ uuid = gattService.getUuid().toString(); if(uuid.equalsIgnoreCase(BATTERY_SERVICE)){ String uuid_charas = null; List<BluetoothGattCharacteristic> gattCharacteristics = gattService.getCharacteristics(); for(BluetoothGattCharacteristic gattCharacteristic : gattCharacteristics){ uuid_charas = gattCharacteristic.getUuid().toString(); if(uuid_charas.equalsIgnoreCase(BATTERY_CHARATERISTIC)){ final int charaProp = gattCharacteristic.getProperties(); if ((charaProp | BluetoothGattCharacteristic.PROPERTY_READ) > 0) { if (mNotifyCharacteristic != null) { mBluetoothLeService.setCharacteristicNotification(mNotifyCharacteristic, false); mNotifyCharacteristic = null; } mBluetoothLeService.readCharacteristic(gattCharacteristic); } if ((charaProp | BluetoothGattCharacteristic.PROPERTY_NOTIFY) > 0) { mNotifyCharacteristic =

    相关文章

      网友评论

          本文标题:安卓如何得到蓝牙耳机左右耳音量值?求助

          本文链接:https://www.haomeiwen.com/subject/hudojctx.html