livoxGen1: call PcloudStimulusBuffer::start/stop
We now call start()/stop() in attach/detachDeviceReq.
This commit is contained in:
@@ -69,6 +69,9 @@ public:
|
|||||||
// Control methods
|
// Control methods
|
||||||
void start()
|
void start()
|
||||||
{
|
{
|
||||||
|
std::cout << __func__ << ": Starting stimulus buffer for device "
|
||||||
|
<< deviceAttachmentSpec.deviceSelector << std::endl;
|
||||||
|
|
||||||
shouldContinue.store(true);
|
shouldContinue.store(true);
|
||||||
scheduleNextTimeout();
|
scheduleNextTimeout();
|
||||||
}
|
}
|
||||||
@@ -141,6 +144,9 @@ inline void StimulusBuffer::stop()
|
|||||||
|
|
||||||
bridge.waitForAsyncOperationCompleteOrIoServiceStopped();
|
bridge.waitForAsyncOperationCompleteOrIoServiceStopped();
|
||||||
|
|
||||||
|
std::cout << __func__ << ": Stopped stimulus buffer for device "
|
||||||
|
<< deviceAttachmentSpec.deviceSelector << std::endl;
|
||||||
|
|
||||||
// After delay, cancel timer and perform cleanup
|
// After delay, cancel timer and perform cleanup
|
||||||
timer.cancel();
|
timer.cancel();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -213,6 +213,8 @@ public:
|
|||||||
context->deviceTmp->nAttachedStimBuffs++;
|
context->deviceTmp->nAttachedStimBuffs++;
|
||||||
attachedStimBuffs.push_back(pcloudStimBuff);
|
attachedStimBuffs.push_back(pcloudStimBuff);
|
||||||
|
|
||||||
|
pcloudStimBuff->start();
|
||||||
|
|
||||||
if (1 || OptionParser::getOptions().verbose)
|
if (1 || OptionParser::getOptions().verbose)
|
||||||
{
|
{
|
||||||
std::cout << __func__ << ": Got return mode (" << (int)mode
|
std::cout << __func__ << ": Got return mode (" << (int)mode
|
||||||
@@ -345,6 +347,7 @@ public:
|
|||||||
// Fallthrough.
|
// Fallthrough.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
context->stimBuff->stop();
|
||||||
// Remove stimulus buffer from collection before destroying device
|
// Remove stimulus buffer from collection before destroying device
|
||||||
context->stimBuff->device->nAttachedStimBuffs--;
|
context->stimBuff->device->nAttachedStimBuffs--;
|
||||||
auto it = std::find(
|
auto it = std::find(
|
||||||
|
|||||||
Reference in New Issue
Block a user