Increase MTU _before_ discovering services, because it will speed up the link

This commit is contained in:
geeksville 2020-04-22 08:10:23 -07:00
parent b63ebadf72
commit 8ec8b038b6
2 changed files with 11 additions and 11 deletions

View file

@ -46,11 +46,11 @@ class SoftwareUpdateService : JobIntentService(), Logging {
sync.connect()
sync.use { _ ->
sync.discoverServices() // Get our services
// we begin by setting our MTU size as high as it can go
sync.requestMtu(512)
sync.discoverServices() // Get our services
val service = sync.gatt!!.services.find { it.uuid == SW_UPDATE_UUID }!!
fun doFirmwareUpdate(assetName: String) {