From a32b4f05d1d2bd9b8c645c31b4f6b250b4e8e340 Mon Sep 17 00:00:00 2001 From: Hayodea Hekol Date: Sat, 1 Nov 2025 03:32:05 -0400 Subject: [PATCH] livoxGen1: call PcloudStimulusBuffer::start/stop We now call start()/stop() in attach/detachDeviceReq. --- include/user/stimulusBuffer.h | 6 ++++++ stimBuffApis/livoxGen1/livoxGen1.cpp | 3 +++ 2 files changed, 9 insertions(+) diff --git a/include/user/stimulusBuffer.h b/include/user/stimulusBuffer.h index f648b97..fe18dcb 100644 --- a/include/user/stimulusBuffer.h +++ b/include/user/stimulusBuffer.h @@ -69,6 +69,9 @@ public: // Control methods void start() { + std::cout << __func__ << ": Starting stimulus buffer for device " + << deviceAttachmentSpec.deviceSelector << std::endl; + shouldContinue.store(true); scheduleNextTimeout(); } @@ -141,6 +144,9 @@ inline void StimulusBuffer::stop() bridge.waitForAsyncOperationCompleteOrIoServiceStopped(); + std::cout << __func__ << ": Stopped stimulus buffer for device " + << deviceAttachmentSpec.deviceSelector << std::endl; + // After delay, cancel timer and perform cleanup timer.cancel(); } diff --git a/stimBuffApis/livoxGen1/livoxGen1.cpp b/stimBuffApis/livoxGen1/livoxGen1.cpp index 271443c..8c84078 100644 --- a/stimBuffApis/livoxGen1/livoxGen1.cpp +++ b/stimBuffApis/livoxGen1/livoxGen1.cpp @@ -213,6 +213,8 @@ public: context->deviceTmp->nAttachedStimBuffs++; attachedStimBuffs.push_back(pcloudStimBuff); + pcloudStimBuff->start(); + if (1 || OptionParser::getOptions().verbose) { std::cout << __func__ << ": Got return mode (" << (int)mode @@ -345,6 +347,7 @@ public: // Fallthrough. } + context->stimBuff->stop(); // Remove stimulus buffer from collection before destroying device context->stimBuff->device->nAttachedStimBuffs--; auto it = std::find(