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 一直为空 是怎么回事啊?是不是没有连接成功?