张海江
2017-07-26 8dcf4645301af81d39bbcb936b52eb8f904352e8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package com.clj.fastble.exception;
 
import android.bluetooth.BluetoothGatt;
 
 
public class ConnectException extends BleException {
 
    private BluetoothGatt bluetoothGatt;
    private int gattStatus;
 
    public ConnectException(BluetoothGatt bluetoothGatt, int gattStatus) {
        super(ERROR_CODE_GATT, "Gatt Exception Occurred! ");
        this.bluetoothGatt = bluetoothGatt;
        this.gattStatus = gattStatus;
    }
 
    public int getGattStatus() {
        return gattStatus;
    }
 
    public ConnectException setGattStatus(int gattStatus) {
        this.gattStatus = gattStatus;
        return this;
    }
 
    public BluetoothGatt getBluetoothGatt() {
        return bluetoothGatt;
    }
 
    public ConnectException setBluetoothGatt(BluetoothGatt bluetoothGatt) {
        this.bluetoothGatt = bluetoothGatt;
        return this;
    }
 
    @Override
    public String toString() {
        return "ConnectException{" +
               "gattStatus=" + gattStatus +
               ", bluetoothGatt=" + bluetoothGatt +
               "} " + super.toString();
    }
}