aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/ConnectionAcknowledgedCommandHandler.cpp
blob: f90b601b7e522841c05ebadc9647a4da54de4e80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//
// Copyright © 2019 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//

#include "ConnectionAcknowledgedCommandHandler.hpp"

#include <armnn/Exceptions.hpp>

namespace armnn
{

namespace profiling
{

void ConnectionAcknowledgedCommandHandler::operator()(const Packet& packet)
{
    if (!(packet.GetPacketFamily() == 0u && packet.GetPacketId() == 1u))
    {
        throw armnn::InvalidArgumentException(std::string("Expected Packet family = 0, id = 1 but received family = ")
                                              + std::to_string(packet.GetPacketFamily())
                                              + " id = " + std::to_string(packet.GetPacketId()));
    }

    // Once a Connection Acknowledged packet has been received, move to the Active state immediately
    m_StateMachine.TransitionToState(ProfilingState::Active);
}

} // namespace profiling

} // namespace armnn