Android BLE智能手环

时间:2018-04-26 08:19:27

标签: android bluetooth

有谁能告诉我如何在我的Android应用程序中从smartband获取数据? 从onServicesDiscovered我不知道该怎么做......

@Override
public void onServicesDiscovered(BluetoothGatt gatt, int status) {
    super.onServicesDiscovered(gatt, status);
    if (status == BluetoothGatt.GATT_SUCCESS) {
        for (BluetoothGattService service : gatt.getServices()) {
            Log.w("Service", service.getUuid().toString());
            for (BluetoothGattCharacteristic characteristic : gatt.getService(service.getUuid()).getCharacteristics()) {
                    Log.e("Characteristic", characteristic.getUuid().toString());
            }
        }
    }
}

0 个答案:

没有答案