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

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, 25

你getService错了,get哪一个服务你也没说,当然null了