def HandleDataSending(self, source_file, source_len,
                        info_cb=DEFAULT_MESSAGE_CALLBACK,
                        progress_callback=None, timeout_ms=None):
    accepted_size = self._AcceptResponses(
        'DATA', info_cb, timeout_ms=timeout_ms)

    accepted_size = binascii.unhexlify(accepted_size[:8])
    accepted_size, = struct.unpack('>I', accepted_size)
    if accepted_size != source_len:
      raise FastbootTransferError(
          'Device refused to download %s bytes of data (accepts %s bytes)',
          source_len, accepted_size)
    self._Write(source_file, accepted_size, progress_callback)
    return self._AcceptResponses('OKAY', info_cb, timeout_ms=timeout_ms)
Handles the protocol for sending data to the device.
dataset/ETHPy150Open google/python-adb/adb/fastboot.py/FastbootProtocol.HandleDataSending