transmit write packets to the radio

This commit is contained in:
geeksville 2020-01-27 16:24:38 -08:00
parent 6cebf063d7
commit 456014dd5f
3 changed files with 32 additions and 12 deletions

View file

@ -48,6 +48,10 @@ class SoftwareUpdateService : JobIntentService(), Logging {
val firmwareSize = firmwareStream.available()
sync.connect()
// 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 }!!
@ -57,9 +61,6 @@ class SoftwareUpdateService : JobIntentService(), Logging {
val crc32Desc = service.getCharacteristic(SW_UPDATE_CRC32_CHARACTER)
val updateResultDesc = service.getCharacteristic(SW_UPDATE_RESULT_CHARACTER)
// we begin by setting our MTU size as high as it can go
sync.requestMtu(512)
// Start the update by writing the # of bytes in the image
logAssert(
totalSizeDesc.setValue(