startProgramming method

  1. @override
void startProgramming(
  1. int sendInterval
)
override

开始OAD升级

  • sendInterval 数据发送间隔

Implementation

@override
void startProgramming(int sendInterval) {
  if (state != OADState.prepared) {
    throw ("start programming in illegal state: $state, you should start programming in prepared state by call prepare()");
  }
  state = OADState.programming;
  _sendInterval = sendInterval;
  _progInfo.reset();
  // _sendFileData();

  print("$_tag startProgramming()");

  // mTimer.scheduleAtFixedRate(new ProgressTask(), TIMER_INTERVAL, TIMER_INTERVAL);
  _timer =
      Timer.periodic(const Duration(milliseconds: _timerInterval), (timer) {
    _progInfo.iTimeElapsed += _timerInterval;
  });

  _programBlock();
}