handleHeader method

  1. @override
ZModemEvent? handleHeader(
  1. ZModemHeader header
)

Implementation

@override
ZModemEvent? handleHeader(ZModemHeader header) {
  switch (header.type) {
    case consts.ZRINIT:
      // Ignore delayed ZRINIT retry.
      return null;
    case consts.ZRPOS:
      core._enqueue(ZModemHeader.data(0)); // TODO: parse p0 ~ p3
      core._state = _ZSendingContentState(core);
      return ZFileAcceptedEvent(header.p0); // TODO: parse p0 ~ p3
    case consts.ZSKIP:
      core._state = _ZReadyToSendState(core);
      return ZFileSkippedEvent();
    default:
      return super.handleHeader(header);
  }
}