blob: f90b601b7e522841c05ebadc9647a4da54de4e80 [file] [log] [blame]
Sadik Armaganb5f01b22019-09-18 17:29:00 +01001//
2// Copyright © 2019 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#include "ConnectionAcknowledgedCommandHandler.hpp"
7
8#include <armnn/Exceptions.hpp>
9
10namespace armnn
11{
12
13namespace profiling
14{
15
16void ConnectionAcknowledgedCommandHandler::operator()(const Packet& packet)
17{
18 if (!(packet.GetPacketFamily() == 0u && packet.GetPacketId() == 1u))
19 {
Matteo Martincighc2728f92019-10-07 12:35:21 +010020 throw armnn::InvalidArgumentException(std::string("Expected Packet family = 0, id = 1 but received family = ")
21 + std::to_string(packet.GetPacketFamily())
22 + " id = " + std::to_string(packet.GetPacketId()));
Sadik Armaganb5f01b22019-09-18 17:29:00 +010023 }
Matteo Martincighc2728f92019-10-07 12:35:21 +010024
25 // Once a Connection Acknowledged packet has been received, move to the Active state immediately
Sadik Armaganb5f01b22019-09-18 17:29:00 +010026 m_StateMachine.TransitionToState(ProfilingState::Active);
27}
28
29} // namespace profiling
30
31} // namespace armnn
32