qq_20942245
qq_20942245
2016-04-13 07:40

Android BLE开发 连接后获取不到服务

  • android

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 一直为空 是怎么回事啊?是不是没有连接成功?
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

2条回答