diff --git a/fwupd.py b/fwupd.py index 4bb3530..4e728b8 100644 --- a/fwupd.py +++ b/fwupd.py @@ -42,9 +42,12 @@ def UpdateFirmware(link, tran, dev, fwfile): return False print('OK') - print('Locking...') - tran.execute(WriteRegs(BT.ESC, 0x70, '', hexlify(data).upper() + size = len(data) + ofs = 0 + while size: + chunk_sz = min(size, _write_chunk_size) + self._dev.char_write_handle(self._wr_handle, bytearray(data[ofs:ofs+chunk_sz])) + ofs += chunk_sz + size -= chunk_sz + + +__all__ = ['BLELink']