Skip to content

Commit

Permalink
Use coded PHY for transmission
Browse files Browse the repository at this point in the history
  • Loading branch information
SeineEloquenz committed Jul 17, 2024
1 parent 7673622 commit 7a973c9
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package edu.kit.tm.ps.embertalk.sync.bluetooth

import android.annotation.SuppressLint
import android.bluetooth.BluetoothDevice
import android.bluetooth.BluetoothGatt
import android.bluetooth.BluetoothGattCallback
import android.bluetooth.BluetoothGattCharacteristic
Expand Down Expand Up @@ -33,6 +34,12 @@ class ClientCallback(
}
if (newState == BluetoothGatt.STATE_CONNECTED) {
Log.d(TAG, "Connected to Server. Discovering Services.")
//Coded PHY provides the longest range, but less data rate
gatt.setPreferredPhy(
BluetoothDevice.PHY_LE_CODED,
BluetoothDevice.PHY_LE_CODED,
BluetoothDevice.PHY_OPTION_S8
)
gatt.discoverServices()
}
}
Expand Down

0 comments on commit 7a973c9

Please sign in to comment.