.class public Lcom/clj/fastble/bluetooth/BleBluetooth; .super Ljava/lang/Object; .source "BleBluetooth.java" # annotations .annotation system Ldalvik/annotation/MemberClasses; value = { Lcom/clj/fastble/bluetooth/BleBluetooth$LastState;, Lcom/clj/fastble/bluetooth/BleBluetooth$MainHandler; } .end annotation # instance fields .field private final bleDevice:Lcom/clj/fastble/data/BleDevice; .field private bleGattCallback:Lcom/clj/fastble/callback/BleGattCallback; .field private final bleIndicateCallbackHashMap:Ljava/util/HashMap; .annotation system Ldalvik/annotation/Signature; value = { "Ljava/util/HashMap<", "Ljava/lang/String;", "Lcom/clj/fastble/callback/BleIndicateCallback;", ">;" } .end annotation .end field .field private bleMtuChangedCallback:Lcom/clj/fastble/callback/BleMtuChangedCallback; .field private final bleNotifyCallbackHashMap:Ljava/util/HashMap; .annotation system Ldalvik/annotation/Signature; value = { "Ljava/util/HashMap<", "Ljava/lang/String;", "Lcom/clj/fastble/callback/BleNotifyCallback;", ">;" } .end annotation .end field .field private final bleReadCallbackHashMap:Ljava/util/HashMap; .annotation system Ldalvik/annotation/Signature; value = { "Ljava/util/HashMap<", "Ljava/lang/String;", "Lcom/clj/fastble/callback/BleReadCallback;", ">;" } .end annotation .end field .field private bleRssiCallback:Lcom/clj/fastble/callback/BleRssiCallback; .field private final bleWriteCallbackHashMap:Ljava/util/HashMap; .annotation system Ldalvik/annotation/Signature; value = { "Ljava/util/HashMap<", "Ljava/lang/String;", "Lcom/clj/fastble/callback/BleWriteCallback;", ">;" } .end annotation .end field .field private bluetoothGatt:Landroid/bluetooth/BluetoothGatt; .field private bluetoothGattCharacteristic:Landroid/bluetooth/BluetoothGattCharacteristic; .field private connectRetryCount:I .field private coreGattCallback:Landroid/bluetooth/BluetoothGattCallback; .field private extra_data:Ljava/lang/String; .field private isActiveDisconnect:Z .field private lastState:Lcom/clj/fastble/bluetooth/BleBluetooth$LastState; .field private final mainHandler:Lcom/clj/fastble/bluetooth/BleBluetooth$MainHandler; # direct methods .method public constructor (Lcom/clj/fastble/data/BleDevice;)V .registers 5 .line 58 invoke-direct {p0}, Ljava/lang/Object;->()V .line 44 new-instance v0, Ljava/util/HashMap; invoke-direct {v0}, Ljava/util/HashMap;->()V iput-object v0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleNotifyCallbackHashMap:Ljava/util/HashMap; .line 45 new-instance v0, Ljava/util/HashMap; invoke-direct {v0}, Ljava/util/HashMap;->()V iput-object v0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleIndicateCallbackHashMap:Ljava/util/HashMap; .line 46 new-instance v0, Ljava/util/HashMap; invoke-direct {v0}, Ljava/util/HashMap;->()V iput-object v0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleWriteCallbackHashMap:Ljava/util/HashMap; .line 47 new-instance v0, Ljava/util/HashMap; invoke-direct {v0}, Ljava/util/HashMap;->()V iput-object v0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleReadCallbackHashMap:Ljava/util/HashMap; const/4 v0, 0x0 .line 50 iput-boolean v0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->isActiveDisconnect:Z .line 55 new-instance v1, Lcom/clj/fastble/bluetooth/BleBluetooth$MainHandler; invoke-static {}, Landroid/os/Looper;->getMainLooper()Landroid/os/Looper; move-result-object v2 invoke-direct {v1, p0, v2}, Lcom/clj/fastble/bluetooth/BleBluetooth$MainHandler;->(Lcom/clj/fastble/bluetooth/BleBluetooth;Landroid/os/Looper;)V iput-object v1, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->mainHandler:Lcom/clj/fastble/bluetooth/BleBluetooth$MainHandler; .line 56 iput v0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->connectRetryCount:I .line 366 new-instance v0, Lcom/clj/fastble/bluetooth/BleBluetooth$1; invoke-direct {v0, p0}, Lcom/clj/fastble/bluetooth/BleBluetooth$1;->(Lcom/clj/fastble/bluetooth/BleBluetooth;)V iput-object v0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->coreGattCallback:Landroid/bluetooth/BluetoothGattCallback; .line 59 iput-object p1, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleDevice:Lcom/clj/fastble/data/BleDevice; return-void .end method .method static synthetic access$000(Lcom/clj/fastble/bluetooth/BleBluetooth;)V .registers 1 .line 39 invoke-direct {p0}, Lcom/clj/fastble/bluetooth/BleBluetooth;->disconnectGatt()V return-void .end method .method static synthetic access$100(Lcom/clj/fastble/bluetooth/BleBluetooth;)V .registers 1 .line 39 invoke-direct {p0}, Lcom/clj/fastble/bluetooth/BleBluetooth;->refreshDeviceCache()V return-void .end method .method static synthetic access$1000(Lcom/clj/fastble/bluetooth/BleBluetooth;)Ljava/lang/String; .registers 1 .line 39 iget-object p0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->extra_data:Ljava/lang/String; return-object p0 .end method .method static synthetic access$1002(Lcom/clj/fastble/bluetooth/BleBluetooth;Ljava/lang/String;)Ljava/lang/String; .registers 2 .line 39 iput-object p1, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->extra_data:Ljava/lang/String; return-object p1 .end method .method static synthetic access$1102(Lcom/clj/fastble/bluetooth/BleBluetooth;Landroid/bluetooth/BluetoothGattCharacteristic;)Landroid/bluetooth/BluetoothGattCharacteristic; .registers 2 .line 39 iput-object p1, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bluetoothGattCharacteristic:Landroid/bluetooth/BluetoothGattCharacteristic; return-object p1 .end method .method static synthetic access$1200(Lcom/clj/fastble/bluetooth/BleBluetooth;)Ljava/util/HashMap; .registers 1 .line 39 iget-object p0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleNotifyCallbackHashMap:Ljava/util/HashMap; return-object p0 .end method .method static synthetic access$1300(Lcom/clj/fastble/bluetooth/BleBluetooth;)Ljava/util/HashMap; .registers 1 .line 39 iget-object p0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleIndicateCallbackHashMap:Ljava/util/HashMap; return-object p0 .end method .method static synthetic access$1400(Lcom/clj/fastble/bluetooth/BleBluetooth;)Ljava/util/HashMap; .registers 1 .line 39 iget-object p0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleWriteCallbackHashMap:Ljava/util/HashMap; return-object p0 .end method .method static synthetic access$1500(Lcom/clj/fastble/bluetooth/BleBluetooth;)Ljava/util/HashMap; .registers 1 .line 39 iget-object p0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleReadCallbackHashMap:Ljava/util/HashMap; return-object p0 .end method .method static synthetic access$1600(Lcom/clj/fastble/bluetooth/BleBluetooth;)Lcom/clj/fastble/callback/BleRssiCallback; .registers 1 .line 39 iget-object p0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleRssiCallback:Lcom/clj/fastble/callback/BleRssiCallback; return-object p0 .end method .method static synthetic access$1700(Lcom/clj/fastble/bluetooth/BleBluetooth;)Lcom/clj/fastble/callback/BleMtuChangedCallback; .registers 1 .line 39 iget-object p0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleMtuChangedCallback:Lcom/clj/fastble/callback/BleMtuChangedCallback; return-object p0 .end method .method static synthetic access$200(Lcom/clj/fastble/bluetooth/BleBluetooth;)V .registers 1 .line 39 invoke-direct {p0}, Lcom/clj/fastble/bluetooth/BleBluetooth;->closeBluetoothGatt()V return-void .end method .method static synthetic access$300(Lcom/clj/fastble/bluetooth/BleBluetooth;)I .registers 1 .line 39 iget p0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->connectRetryCount:I return p0 .end method .method static synthetic access$304(Lcom/clj/fastble/bluetooth/BleBluetooth;)I .registers 2 .line 39 iget v0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->connectRetryCount:I add-int/lit8 v0, v0, 0x1 iput v0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->connectRetryCount:I return v0 .end method .method static synthetic access$400(Lcom/clj/fastble/bluetooth/BleBluetooth;)Lcom/clj/fastble/bluetooth/BleBluetooth$MainHandler; .registers 1 .line 39 iget-object p0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->mainHandler:Lcom/clj/fastble/bluetooth/BleBluetooth$MainHandler; return-object p0 .end method .method static synthetic access$500(Lcom/clj/fastble/bluetooth/BleBluetooth;)Lcom/clj/fastble/bluetooth/BleBluetooth$LastState; .registers 1 .line 39 iget-object p0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->lastState:Lcom/clj/fastble/bluetooth/BleBluetooth$LastState; return-object p0 .end method .method static synthetic access$502(Lcom/clj/fastble/bluetooth/BleBluetooth;Lcom/clj/fastble/bluetooth/BleBluetooth$LastState;)Lcom/clj/fastble/bluetooth/BleBluetooth$LastState; .registers 2 .line 39 iput-object p1, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->lastState:Lcom/clj/fastble/bluetooth/BleBluetooth$LastState; return-object p1 .end method .method static synthetic access$600(Lcom/clj/fastble/bluetooth/BleBluetooth;)Lcom/clj/fastble/callback/BleGattCallback; .registers 1 .line 39 iget-object p0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleGattCallback:Lcom/clj/fastble/callback/BleGattCallback; return-object p0 .end method .method static synthetic access$700(Lcom/clj/fastble/bluetooth/BleBluetooth;)Lcom/clj/fastble/data/BleDevice; .registers 1 .line 39 iget-object p0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleDevice:Lcom/clj/fastble/data/BleDevice; return-object p0 .end method .method static synthetic access$800(Lcom/clj/fastble/bluetooth/BleBluetooth;)Landroid/bluetooth/BluetoothGatt; .registers 1 .line 39 iget-object p0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bluetoothGatt:Landroid/bluetooth/BluetoothGatt; return-object p0 .end method .method static synthetic access$802(Lcom/clj/fastble/bluetooth/BleBluetooth;Landroid/bluetooth/BluetoothGatt;)Landroid/bluetooth/BluetoothGatt; .registers 2 .line 39 iput-object p1, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bluetoothGatt:Landroid/bluetooth/BluetoothGatt; return-object p1 .end method .method static synthetic access$900(Lcom/clj/fastble/bluetooth/BleBluetooth;)Z .registers 1 .line 39 iget-boolean p0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->isActiveDisconnect:Z return p0 .end method .method static synthetic access$902(Lcom/clj/fastble/bluetooth/BleBluetooth;Z)Z .registers 2 .line 39 iput-boolean p1, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->isActiveDisconnect:Z return p1 .end method .method private declared-synchronized closeBluetoothGatt()V .registers 2 monitor-enter p0 .line 234 :try_start_1 iget-object v0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bluetoothGatt:Landroid/bluetooth/BluetoothGatt; if-eqz v0, :cond_8 .line 235 invoke-virtual {v0}, Landroid/bluetooth/BluetoothGatt;->close()V :try_end_8 .catchall {:try_start_1 .. :try_end_8} :catchall_a .line 237 :cond_8 monitor-exit p0 return-void :catchall_a move-exception v0 :try_start_b monitor-exit p0 :try_end_c .catchall {:try_start_b .. :try_end_c} :catchall_a throw v0 .end method .method private declared-synchronized disconnectGatt()V .registers 2 monitor-enter p0 .line 215 :try_start_1 iget-object v0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bluetoothGatt:Landroid/bluetooth/BluetoothGatt; if-eqz v0, :cond_8 .line 216 invoke-virtual {v0}, Landroid/bluetooth/BluetoothGatt;->disconnect()V :try_end_8 .catchall {:try_start_1 .. :try_end_8} :catchall_a .line 218 :cond_8 monitor-exit p0 return-void :catchall_a move-exception v0 :try_start_b monitor-exit p0 :try_end_c .catchall {:try_start_b .. :try_end_c} :catchall_a throw v0 .end method .method private declared-synchronized refreshDeviceCache()V .registers 7 const-string v0, "refreshDeviceCache, is success: " const-string v1, "exception occur while refreshing device: " monitor-enter p0 .line 222 :try_start_5 const-class v2, Landroid/bluetooth/BluetoothGatt; const-string v3, "refresh" const/4 v4, 0x0 new-array v5, v4, [Ljava/lang/Class; invoke-virtual {v2, v3, v5}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method; move-result-object v2 if-eqz v2, :cond_4d .line 223 iget-object v3, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bluetoothGatt:Landroid/bluetooth/BluetoothGatt; if-eqz v3, :cond_4d .line 224 new-array v4, v4, [Ljava/lang/Object; invoke-virtual {v2, v3, v4}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; move-result-object v2 check-cast v2, Ljava/lang/Boolean; invoke-virtual {v2}, Ljava/lang/Boolean;->booleanValue()Z move-result v2 .line 225 new-instance v3, Ljava/lang/StringBuilder; invoke-direct {v3, v0}, Ljava/lang/StringBuilder;->(Ljava/lang/String;)V invoke-virtual {v3, v2}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder; move-result-object v0 invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v0 invoke-static {v0}, Lcom/clj/fastble/utils/BleLog;->i(Ljava/lang/String;)V :try_end_32 .catch Ljava/lang/Exception; {:try_start_5 .. :try_end_32} :catch_35 .catchall {:try_start_5 .. :try_end_32} :catchall_33 goto :goto_4d :catchall_33 move-exception v0 goto :goto_4f :catch_35 move-exception v0 .line 228 :try_start_36 new-instance v2, Ljava/lang/StringBuilder; invoke-direct {v2, v1}, Ljava/lang/StringBuilder;->(Ljava/lang/String;)V invoke-virtual {v0}, Ljava/lang/Exception;->getMessage()Ljava/lang/String; move-result-object v1 invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v1 invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v1 invoke-static {v1}, Lcom/clj/fastble/utils/BleLog;->i(Ljava/lang/String;)V .line 229 invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V :try_end_4d .catchall {:try_start_36 .. :try_end_4d} :catchall_33 .line 231 :cond_4d :goto_4d monitor-exit p0 return-void :goto_4f :try_start_4f monitor-exit p0 :try_end_50 .catchall {:try_start_4f .. :try_end_50} :catchall_33 throw v0 .end method # virtual methods .method public declared-synchronized addConnectGattCallback(Lcom/clj/fastble/callback/BleGattCallback;)V .registers 2 monitor-enter p0 .line 67 :try_start_1 iput-object p1, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleGattCallback:Lcom/clj/fastble/callback/BleGattCallback; :try_end_3 .catchall {:try_start_1 .. :try_end_3} :catchall_5 .line 68 monitor-exit p0 return-void :catchall_5 move-exception p1 :try_start_6 monitor-exit p0 :try_end_7 .catchall {:try_start_6 .. :try_end_7} :catchall_5 throw p1 .end method .method public declared-synchronized addIndicateCallback(Ljava/lang/String;Lcom/clj/fastble/callback/BleIndicateCallback;)V .registers 4 monitor-enter p0 .line 79 :try_start_1 iget-object v0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleIndicateCallbackHashMap:Ljava/util/HashMap; invoke-virtual {v0, p1, p2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; :try_end_6 .catchall {:try_start_1 .. :try_end_6} :catchall_8 .line 80 monitor-exit p0 return-void :catchall_8 move-exception p1 :try_start_9 monitor-exit p0 :try_end_a .catchall {:try_start_9 .. :try_end_a} :catchall_8 throw p1 .end method .method public declared-synchronized addMtuChangedCallback(Lcom/clj/fastble/callback/BleMtuChangedCallback;)V .registers 2 monitor-enter p0 .line 126 :try_start_1 iput-object p1, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleMtuChangedCallback:Lcom/clj/fastble/callback/BleMtuChangedCallback; :try_end_3 .catchall {:try_start_1 .. :try_end_3} :catchall_5 .line 127 monitor-exit p0 return-void :catchall_5 move-exception p1 :try_start_6 monitor-exit p0 :try_end_7 .catchall {:try_start_6 .. :try_end_7} :catchall_5 throw p1 .end method .method public declared-synchronized addNotifyCallback(Ljava/lang/String;Lcom/clj/fastble/callback/BleNotifyCallback;)V .registers 4 monitor-enter p0 .line 75 :try_start_1 iget-object v0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleNotifyCallbackHashMap:Ljava/util/HashMap; invoke-virtual {v0, p1, p2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; :try_end_6 .catchall {:try_start_1 .. :try_end_6} :catchall_8 .line 76 monitor-exit p0 return-void :catchall_8 move-exception p1 :try_start_9 monitor-exit p0 :try_end_a .catchall {:try_start_9 .. :try_end_a} :catchall_8 throw p1 .end method .method public declared-synchronized addReadCallback(Ljava/lang/String;Lcom/clj/fastble/callback/BleReadCallback;)V .registers 4 monitor-enter p0 .line 87 :try_start_1 iget-object v0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleReadCallbackHashMap:Ljava/util/HashMap; invoke-virtual {v0, p1, p2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; :try_end_6 .catchall {:try_start_1 .. :try_end_6} :catchall_8 .line 88 monitor-exit p0 return-void :catchall_8 move-exception p1 :try_start_9 monitor-exit p0 :try_end_a .catchall {:try_start_9 .. :try_end_a} :catchall_8 throw p1 .end method .method public declared-synchronized addRssiCallback(Lcom/clj/fastble/callback/BleRssiCallback;)V .registers 2 monitor-enter p0 .line 118 :try_start_1 iput-object p1, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleRssiCallback:Lcom/clj/fastble/callback/BleRssiCallback; :try_end_3 .catchall {:try_start_1 .. :try_end_3} :catchall_5 .line 119 monitor-exit p0 return-void :catchall_5 move-exception p1 :try_start_6 monitor-exit p0 :try_end_7 .catchall {:try_start_6 .. :try_end_7} :catchall_5 throw p1 .end method .method public declared-synchronized addWriteCallback(Ljava/lang/String;Lcom/clj/fastble/callback/BleWriteCallback;)V .registers 4 monitor-enter p0 .line 83 :try_start_1 iget-object v0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleWriteCallbackHashMap:Ljava/util/HashMap; invoke-virtual {v0, p1, p2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; :try_end_6 .catchall {:try_start_1 .. :try_end_6} :catchall_8 .line 84 monitor-exit p0 return-void :catchall_8 move-exception p1 :try_start_9 monitor-exit p0 :try_end_a .catchall {:try_start_9 .. :try_end_a} :catchall_8 throw p1 .end method .method public declared-synchronized clearCharacterCallback()V .registers 2 monitor-enter p0 .line 111 :try_start_1 iget-object v0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleNotifyCallbackHashMap:Ljava/util/HashMap; invoke-virtual {v0}, Ljava/util/HashMap;->clear()V .line 112 iget-object v0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleIndicateCallbackHashMap:Ljava/util/HashMap; invoke-virtual {v0}, Ljava/util/HashMap;->clear()V .line 113 iget-object v0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleWriteCallbackHashMap:Ljava/util/HashMap; invoke-virtual {v0}, Ljava/util/HashMap;->clear()V .line 114 iget-object v0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleReadCallbackHashMap:Ljava/util/HashMap; invoke-virtual {v0}, Ljava/util/HashMap;->clear()V :try_end_15 .catchall {:try_start_1 .. :try_end_15} :catchall_17 .line 115 monitor-exit p0 return-void :catchall_17 move-exception v0 :try_start_18 monitor-exit p0 :try_end_19 .catchall {:try_start_18 .. :try_end_19} :catchall_17 throw v0 .end method .method public declared-synchronized connect(Lcom/clj/fastble/data/BleDevice;ZLcom/clj/fastble/callback/BleGattCallback;)Landroid/bluetooth/BluetoothGatt; .registers 5 monitor-enter p0 const/4 v0, 0x0 .line 149 :try_start_2 invoke-virtual {p0, p1, p2, p3, v0}, Lcom/clj/fastble/bluetooth/BleBluetooth;->connect(Lcom/clj/fastble/data/BleDevice;ZLcom/clj/fastble/callback/BleGattCallback;I)Landroid/bluetooth/BluetoothGatt; move-result-object p1 :try_end_6 .catchall {:try_start_2 .. :try_end_6} :catchall_8 monitor-exit p0 return-object p1 :catchall_8 move-exception p1 :try_start_9 monitor-exit p0 :try_end_a .catchall {:try_start_9 .. :try_end_a} :catchall_8 throw p1 .end method .method public declared-synchronized connect(Lcom/clj/fastble/data/BleDevice;ZLcom/clj/fastble/callback/BleGattCallback;I)Landroid/bluetooth/BluetoothGatt; .registers 8 const-string v0, "connect device: " monitor-enter p0 .line 156 :try_start_3 new-instance v1, Ljava/lang/StringBuilder; invoke-direct {v1, v0}, Ljava/lang/StringBuilder;->(Ljava/lang/String;)V invoke-virtual {p1}, Lcom/clj/fastble/data/BleDevice;->getName()Ljava/lang/String; move-result-object v0 invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 const-string v1, "\nmac: " invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 .line 157 invoke-virtual {p1}, Lcom/clj/fastble/data/BleDevice;->getMac()Ljava/lang/String; move-result-object v1 invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 const-string v1, "\nautoConnect: " invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder; move-result-object v0 const-string v1, "\ncurrentThread: " invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 .line 159 invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread; move-result-object v1 invoke-virtual {v1}, Ljava/lang/Thread;->getId()J move-result-wide v1 invoke-virtual {v0, v1, v2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder; move-result-object v0 const-string v1, "\nconnectCount:" invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 add-int/lit8 v1, p4, 0x1 invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; move-result-object v0 invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v0 .line 156 invoke-static {v0}, Lcom/clj/fastble/utils/BleLog;->i(Ljava/lang/String;)V if-nez p4, :cond_52 const/4 p4, 0x0 .line 162 iput p4, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->connectRetryCount:I .line 165 :cond_52 invoke-virtual {p0, p3}, Lcom/clj/fastble/bluetooth/BleBluetooth;->addConnectGattCallback(Lcom/clj/fastble/callback/BleGattCallback;)V .line 167 sget-object p3, Lcom/clj/fastble/bluetooth/BleBluetooth$LastState;->CONNECT_CONNECTING:Lcom/clj/fastble/bluetooth/BleBluetooth$LastState; iput-object p3, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->lastState:Lcom/clj/fastble/bluetooth/BleBluetooth$LastState; .line 170 invoke-virtual {p1}, Lcom/clj/fastble/data/BleDevice;->getDevice()Landroid/bluetooth/BluetoothDevice; move-result-object p3 invoke-static {}, Lcom/clj/fastble/BleManager;->getInstance()Lcom/clj/fastble/BleManager; move-result-object p4 invoke-virtual {p4}, Lcom/clj/fastble/BleManager;->getContext()Landroid/content/Context; move-result-object p4 iget-object v0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->coreGattCallback:Landroid/bluetooth/BluetoothGattCallback; const/4 v1, 0x2 invoke-virtual {p3, p4, p2, v0, v1}, Landroid/bluetooth/BluetoothDevice;->connectGatt(Landroid/content/Context;ZLandroid/bluetooth/BluetoothGattCallback;I)Landroid/bluetooth/BluetoothGatt; move-result-object p2 iput-object p2, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bluetoothGatt:Landroid/bluetooth/BluetoothGatt; if-eqz p2, :cond_8e .line 177 iget-object p1, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleGattCallback:Lcom/clj/fastble/callback/BleGattCallback; if-eqz p1, :cond_77 .line 178 invoke-virtual {p1}, Lcom/clj/fastble/callback/BleGattCallback;->onStartConnect()V .line 180 :cond_77 iget-object p1, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->mainHandler:Lcom/clj/fastble/bluetooth/BleBluetooth$MainHandler; invoke-virtual {p1}, Lcom/clj/fastble/bluetooth/BleBluetooth$MainHandler;->obtainMessage()Landroid/os/Message; move-result-object p1 const/4 p2, 0x7 .line 181 iput p2, p1, Landroid/os/Message;->what:I .line 182 iget-object p2, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->mainHandler:Lcom/clj/fastble/bluetooth/BleBluetooth$MainHandler; invoke-static {}, Lcom/clj/fastble/BleManager;->getInstance()Lcom/clj/fastble/BleManager; move-result-object p3 invoke-virtual {p3}, Lcom/clj/fastble/BleManager;->getConnectOverTime()J move-result-wide p3 invoke-virtual {p2, p1, p3, p4}, Lcom/clj/fastble/bluetooth/BleBluetooth$MainHandler;->sendMessageDelayed(Landroid/os/Message;J)Z goto :goto_b4 .line 185 :cond_8e invoke-direct {p0}, Lcom/clj/fastble/bluetooth/BleBluetooth;->disconnectGatt()V .line 186 invoke-direct {p0}, Lcom/clj/fastble/bluetooth/BleBluetooth;->refreshDeviceCache()V .line 187 invoke-direct {p0}, Lcom/clj/fastble/bluetooth/BleBluetooth;->closeBluetoothGatt()V .line 188 sget-object p2, Lcom/clj/fastble/bluetooth/BleBluetooth$LastState;->CONNECT_FAILURE:Lcom/clj/fastble/bluetooth/BleBluetooth$LastState; iput-object p2, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->lastState:Lcom/clj/fastble/bluetooth/BleBluetooth$LastState; .line 189 invoke-static {}, Lcom/clj/fastble/BleManager;->getInstance()Lcom/clj/fastble/BleManager; move-result-object p2 invoke-virtual {p2}, Lcom/clj/fastble/BleManager;->getMultipleBluetoothController()Lcom/clj/fastble/bluetooth/MultipleBluetoothController; move-result-object p2 invoke-virtual {p2, p0}, Lcom/clj/fastble/bluetooth/MultipleBluetoothController;->removeConnectingBle(Lcom/clj/fastble/bluetooth/BleBluetooth;)V .line 190 iget-object p2, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleGattCallback:Lcom/clj/fastble/callback/BleGattCallback; if-eqz p2, :cond_b4 .line 191 new-instance p3, Lcom/clj/fastble/exception/OtherException; const-string p4, "GATT connect exception occurred!" invoke-direct {p3, p4}, Lcom/clj/fastble/exception/OtherException;->(Ljava/lang/String;)V invoke-virtual {p2, p1, p3}, Lcom/clj/fastble/callback/BleGattCallback;->onConnectFail(Lcom/clj/fastble/data/BleDevice;Lcom/clj/fastble/exception/BleException;)V .line 194 :cond_b4 :goto_b4 iget-object p1, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bluetoothGatt:Landroid/bluetooth/BluetoothGatt; :try_end_b6 .catchall {:try_start_3 .. :try_end_b6} :catchall_b8 monitor-exit p0 return-object p1 :catchall_b8 move-exception p1 :try_start_b9 monitor-exit p0 :try_end_ba .catchall {:try_start_b9 .. :try_end_ba} :catchall_b8 throw p1 .end method .method public declared-synchronized destroy()V .registers 3 monitor-enter p0 .line 203 :try_start_1 sget-object v0, Lcom/clj/fastble/bluetooth/BleBluetooth$LastState;->CONNECT_IDLE:Lcom/clj/fastble/bluetooth/BleBluetooth$LastState; iput-object v0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->lastState:Lcom/clj/fastble/bluetooth/BleBluetooth$LastState; .line 204 invoke-direct {p0}, Lcom/clj/fastble/bluetooth/BleBluetooth;->disconnectGatt()V .line 205 invoke-direct {p0}, Lcom/clj/fastble/bluetooth/BleBluetooth;->refreshDeviceCache()V .line 206 invoke-direct {p0}, Lcom/clj/fastble/bluetooth/BleBluetooth;->closeBluetoothGatt()V .line 207 invoke-virtual {p0}, Lcom/clj/fastble/bluetooth/BleBluetooth;->removeConnectGattCallback()V .line 208 invoke-virtual {p0}, Lcom/clj/fastble/bluetooth/BleBluetooth;->removeRssiCallback()V .line 209 invoke-virtual {p0}, Lcom/clj/fastble/bluetooth/BleBluetooth;->removeMtuChangedCallback()V .line 210 invoke-virtual {p0}, Lcom/clj/fastble/bluetooth/BleBluetooth;->clearCharacterCallback()V .line 211 iget-object v0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->mainHandler:Lcom/clj/fastble/bluetooth/BleBluetooth$MainHandler; const/4 v1, 0x0 invoke-virtual {v0, v1}, Lcom/clj/fastble/bluetooth/BleBluetooth$MainHandler;->removeCallbacksAndMessages(Ljava/lang/Object;)V :try_end_20 .catchall {:try_start_1 .. :try_end_20} :catchall_22 .line 212 monitor-exit p0 return-void :catchall_22 move-exception v0 :try_start_23 monitor-exit p0 :try_end_24 .catchall {:try_start_23 .. :try_end_24} :catchall_22 throw v0 .end method .method public declared-synchronized disconnect()V .registers 2 monitor-enter p0 const/4 v0, 0x1 .line 198 :try_start_2 iput-boolean v0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->isActiveDisconnect:Z .line 199 invoke-direct {p0}, Lcom/clj/fastble/bluetooth/BleBluetooth;->disconnectGatt()V :try_end_7 .catchall {:try_start_2 .. :try_end_7} :catchall_9 .line 200 monitor-exit p0 return-void :catchall_9 move-exception v0 :try_start_a monitor-exit p0 :try_end_b .catchall {:try_start_a .. :try_end_b} :catchall_9 throw v0 .end method .method public getBluetoothGatt()Landroid/bluetooth/BluetoothGatt; .registers 2 .line 143 iget-object v0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bluetoothGatt:Landroid/bluetooth/BluetoothGatt; return-object v0 .end method .method public getDevice()Lcom/clj/fastble/data/BleDevice; .registers 2 .line 139 iget-object v0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleDevice:Lcom/clj/fastble/data/BleDevice; return-object v0 .end method .method public getDeviceKey()Ljava/lang/String; .registers 2 .line 135 iget-object v0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleDevice:Lcom/clj/fastble/data/BleDevice; invoke-virtual {v0}, Lcom/clj/fastble/data/BleDevice;->getKey()Ljava/lang/String; move-result-object v0 return-object v0 .end method .method public newBleConnector()Lcom/clj/fastble/bluetooth/BleConnector; .registers 2 .line 63 new-instance v0, Lcom/clj/fastble/bluetooth/BleConnector; invoke-direct {v0, p0}, Lcom/clj/fastble/bluetooth/BleConnector;->(Lcom/clj/fastble/bluetooth/BleBluetooth;)V return-object v0 .end method .method public declared-synchronized removeConnectGattCallback()V .registers 2 monitor-enter p0 const/4 v0, 0x0 .line 71 :try_start_2 iput-object v0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleGattCallback:Lcom/clj/fastble/callback/BleGattCallback; :try_end_4 .catchall {:try_start_2 .. :try_end_4} :catchall_6 .line 72 monitor-exit p0 return-void :catchall_6 move-exception v0 :try_start_7 monitor-exit p0 :try_end_8 .catchall {:try_start_7 .. :try_end_8} :catchall_6 throw v0 .end method .method public declared-synchronized removeIndicateCallback(Ljava/lang/String;)V .registers 3 monitor-enter p0 .line 96 :try_start_1 iget-object v0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleIndicateCallbackHashMap:Ljava/util/HashMap; invoke-virtual {v0, p1}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z move-result v0 if-eqz v0, :cond_e .line 97 iget-object v0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleIndicateCallbackHashMap:Ljava/util/HashMap; invoke-virtual {v0, p1}, Ljava/util/HashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object; :try_end_e .catchall {:try_start_1 .. :try_end_e} :catchall_10 .line 98 :cond_e monitor-exit p0 return-void :catchall_10 move-exception p1 :try_start_11 monitor-exit p0 :try_end_12 .catchall {:try_start_11 .. :try_end_12} :catchall_10 throw p1 .end method .method public declared-synchronized removeMtuChangedCallback()V .registers 2 monitor-enter p0 const/4 v0, 0x0 .line 130 :try_start_2 iput-object v0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleMtuChangedCallback:Lcom/clj/fastble/callback/BleMtuChangedCallback; :try_end_4 .catchall {:try_start_2 .. :try_end_4} :catchall_6 .line 131 monitor-exit p0 return-void :catchall_6 move-exception v0 :try_start_7 monitor-exit p0 :try_end_8 .catchall {:try_start_7 .. :try_end_8} :catchall_6 throw v0 .end method .method public declared-synchronized removeNotifyCallback(Ljava/lang/String;)V .registers 3 monitor-enter p0 .line 91 :try_start_1 iget-object v0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleNotifyCallbackHashMap:Ljava/util/HashMap; invoke-virtual {v0, p1}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z move-result v0 if-eqz v0, :cond_e .line 92 iget-object v0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleNotifyCallbackHashMap:Ljava/util/HashMap; invoke-virtual {v0, p1}, Ljava/util/HashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object; :try_end_e .catchall {:try_start_1 .. :try_end_e} :catchall_10 .line 93 :cond_e monitor-exit p0 return-void :catchall_10 move-exception p1 :try_start_11 monitor-exit p0 :try_end_12 .catchall {:try_start_11 .. :try_end_12} :catchall_10 throw p1 .end method .method public declared-synchronized removeReadCallback(Ljava/lang/String;)V .registers 3 monitor-enter p0 .line 106 :try_start_1 iget-object v0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleReadCallbackHashMap:Ljava/util/HashMap; invoke-virtual {v0, p1}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z move-result v0 if-eqz v0, :cond_e .line 107 iget-object v0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleReadCallbackHashMap:Ljava/util/HashMap; invoke-virtual {v0, p1}, Ljava/util/HashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object; :try_end_e .catchall {:try_start_1 .. :try_end_e} :catchall_10 .line 108 :cond_e monitor-exit p0 return-void :catchall_10 move-exception p1 :try_start_11 monitor-exit p0 :try_end_12 .catchall {:try_start_11 .. :try_end_12} :catchall_10 throw p1 .end method .method public declared-synchronized removeRssiCallback()V .registers 2 monitor-enter p0 const/4 v0, 0x0 .line 122 :try_start_2 iput-object v0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleRssiCallback:Lcom/clj/fastble/callback/BleRssiCallback; :try_end_4 .catchall {:try_start_2 .. :try_end_4} :catchall_6 .line 123 monitor-exit p0 return-void :catchall_6 move-exception v0 :try_start_7 monitor-exit p0 :try_end_8 .catchall {:try_start_7 .. :try_end_8} :catchall_6 throw v0 .end method .method public declared-synchronized removeWriteCallback(Ljava/lang/String;)V .registers 3 monitor-enter p0 .line 101 :try_start_1 iget-object v0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleWriteCallbackHashMap:Ljava/util/HashMap; invoke-virtual {v0, p1}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z move-result v0 if-eqz v0, :cond_e .line 102 iget-object v0, p0, Lcom/clj/fastble/bluetooth/BleBluetooth;->bleWriteCallbackHashMap:Ljava/util/HashMap; invoke-virtual {v0, p1}, Ljava/util/HashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object; :try_end_e .catchall {:try_start_1 .. :try_end_e} :catchall_10 .line 103 :cond_e monitor-exit p0 return-void :catchall_10 move-exception p1 :try_start_11 monitor-exit p0 :try_end_12 .catchall {:try_start_11 .. :try_end_12} :catchall_10 throw p1 .end method