+ if (isLeClientInitialized) {
+ mContext.unregisterReceiver(mReceiver);
+ isLeClientInitialized = false;
+ }
+ }
+
+ public static BluetoothGatt connectGattforHidden(BluetoothDevice device,
+ String address, boolean autoConnect) {
+ if (isLeClientInitialized) {
+ BluetoothAdapter mbluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
+ BluetoothDevice mDevice = mbluetoothAdapter.getRemoteDevice(address);
+ Log.d(TAG, "connectGattforHidden method : getAddress : " + mDevice.getAddress()
+ + ", autoconnect : " + autoConnect);
+ return mDevice.connectGatt(mContext, autoConnect, mGattCallback);
+ }
+ return null;