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

2019-08-14  本文已影响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 =

上一篇下一篇

猜你喜欢

热点阅读