问题描述
- Android BLE开发 连接后获取不到服务
- private BluetoothGattCallback mGattCallback = new BluetoothGattCallback() {
@Override
public void onConnectionStateChange(BluetoothGatt gatt int status int newState) {
List gattServices = null;
if (newState == BluetoothProfile.STATE_CONNECTED) {
gattServices = gatt.getServices();
prepareData(gattServices);
writeCharacteristicRGB(characteristic 255 87 87 0);
}
}
};gatt.getservices 一直为空 是怎么回事啊?是不是没有连接成功?
时间: 2024-08-04 14:28:36