From 8d9590e5510b8ebdc4e0b2b31ce4b653b46fc02a Mon Sep 17 00:00:00 2001 From: Matteo Martincigh Date: Tue, 15 Oct 2019 09:35:29 +0100 Subject: IVGCVSW-3939 Code refactoring and minor fixes * Fixed value masking in SendPeriodicCounterCapturePacket and updated the pertinent unit tests * Code refactoring and cleanup * Added extra comments to the ProfilingService stop/reset procedure Signed-off-by: Matteo Martincigh Change-Id: Ibaf2fede76e06d5b8ce7258a4820a60e5993559f --- src/profiling/ProfilingService.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/profiling/ProfilingService.cpp') diff --git a/src/profiling/ProfilingService.cpp b/src/profiling/ProfilingService.cpp index b87773fc86..1cc9262420 100644 --- a/src/profiling/ProfilingService.cpp +++ b/src/profiling/ProfilingService.cpp @@ -313,8 +313,9 @@ void ProfilingService::InitializeCounterValue(uint16_t counterUid) void ProfilingService::Reset() { - // Reset the profiling service + // Stop the profiling service... Stop(); + // ...then delete all the counter data and configuration... m_CounterIndex.clear(); m_CounterValues.clear(); @@ -333,13 +334,14 @@ void ProfilingService::Stop() m_SendCounterPacket.Stop(false); m_PeriodicCounterCapture.Stop(); - // ...then destroy the profiling connection... + // ...then close and destroy the profiling connection... if (m_ProfilingConnection != nullptr && m_ProfilingConnection->IsOpen()) { m_ProfilingConnection->Close(); } m_ProfilingConnection.reset(); + // ...then move to the "NotConnected" state m_StateMachine.TransitionToState(ProfilingState::NotConnected); } -- cgit v1.2.1