Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
zomint committed Feb 28, 2024
1 parent 4107957 commit 6d8d8ed
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState
synchronized (BleCodingPeripheral.this) {
if (mState == State.CONNECTING && newState == BluetoothProfile.STATE_CONNECTED) {
Log.d(TAG, "onConnectionStateChange: connected and request mtu");
gatt.requestMtu(MTU_MAX);
changeState(State.CONFIGURING_MTU);
mBluetoothGatt.discoverServices();
changeState(State.DISCOVERING_SERVICES);
} else if (newState == BluetoothProfile.STATE_DISCONNECTED && mState != State.DISCONNECTED) {
Log.d(TAG, "onConnectionStateChange: disconnected");
reset();
Expand Down Expand Up @@ -146,13 +146,13 @@ public void onDescriptorWrite(BluetoothGatt gatt, BluetoothGattDescriptor descri
public void onMtuChanged(BluetoothGatt gatt, int mtu, int status) {
super.onMtuChanged(gatt, mtu, status);
Log.d(TAG, "onMtuChanged: " + mtu);
synchronized (BleCodingPeripheral.this) {
if (mState == State.CONFIGURING_MTU) {
mMtu = mtu;
mBluetoothGatt.discoverServices();
changeState(State.DISCOVERING_SERVICES);
}
}
// synchronized (BleCodingPeripheral.this) {
// if (mState == State.CONFIGURING_MTU) {
// mMtu = mtu;
// mBluetoothGatt.discoverServices();
// changeState(State.DISCOVERING_SERVICES);
// }
// }
}

@Override
Expand Down

0 comments on commit 6d8d8ed

Please sign in to comment.