| | |
| | | return -1; |
| | | } |
| | | |
| | | lock(); |
| | | // Ensure stale transfer state does not leak across runs. |
| | | m_nContinuousTransferStep = CTStep_Unknow; |
| | | m_nContinuousWorkingPort = 0; |
| | | m_nContinuousWorkingSlot = 0; |
| | | if (m_pActiveRobotTask != nullptr) { |
| | | LOGW("<Master>start: stale active robot task found in READY, clearing it."); |
| | | delete m_pActiveRobotTask; |
| | | m_pActiveRobotTask = nullptr; |
| | | } |
| | | unlock(); |
| | | LOGI("<Master>start reset transfer state(step=%d, port=%d, slot=%d).", |
| | | m_nContinuousTransferStep, m_nContinuousWorkingPort, m_nContinuousWorkingSlot); |
| | | |
| | | m_bContinuousTransfer = false; |
| | | m_bBatch = false; |
| | | setState(MASTERSTATE::STARTING); |
| | |
| | | return -1; |
| | | } |
| | | |
| | | lock(); |
| | | // Continuous transfer must start from a clean state every time. |
| | | m_nContinuousTransferStep = CTStep_Unknow; |
| | | m_nContinuousWorkingPort = 0; |
| | | m_nContinuousWorkingSlot = 0; |
| | | if (m_pActiveRobotTask != nullptr) { |
| | | LOGW("<Master>startContinuousTransfer: stale active robot task found in READY, clearing it."); |
| | | delete m_pActiveRobotTask; |
| | | m_pActiveRobotTask = nullptr; |
| | | } |
| | | unlock(); |
| | | LOGI("<Master>startContinuousTransfer reset transfer state(step=%d, port=%d, slot=%d).", |
| | | m_nContinuousTransferStep, m_nContinuousWorkingPort, m_nContinuousWorkingSlot); |
| | | |
| | | m_bContinuousTransfer = true; |
| | | m_bBatch = false; |
| | | setState(MASTERSTATE::STARTING); |
| | |
| | | return -1; |
| | | } |
| | | |
| | | lock(); |
| | | // Keep behavior consistent with other start paths. |
| | | m_nContinuousTransferStep = CTStep_Unknow; |
| | | m_nContinuousWorkingPort = 0; |
| | | m_nContinuousWorkingSlot = 0; |
| | | if (m_pActiveRobotTask != nullptr) { |
| | | LOGW("<Master>startBatch: stale active robot task found in READY, clearing it."); |
| | | delete m_pActiveRobotTask; |
| | | m_pActiveRobotTask = nullptr; |
| | | } |
| | | unlock(); |
| | | LOGI("<Master>startBatch reset transfer state(step=%d, port=%d, slot=%d).", |
| | | m_nContinuousTransferStep, m_nContinuousWorkingPort, m_nContinuousWorkingSlot); |
| | | |
| | | m_bContinuousTransfer = false; |
| | | m_bBatch = true; |
| | | setState(MASTERSTATE::STARTING); |