blob: 259ee131f166090356ffb6a924f2e74ce92fcac3 [file] [log] [blame]
Teresa Charlin9bab4962019-09-06 12:28:35 +01001//
2// Copyright © 2019 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#include "IProfilingConnection.hpp"
7
Teresa Charlin9bab4962019-09-06 12:28:35 +01008#include <Runtime.hpp>
Finn Williams9937f932020-04-29 12:00:24 +01009#include <common/include/NetworkSockets.hpp>
Teresa Charlin9bab4962019-09-06 12:28:35 +010010
11#pragma once
12
13namespace armnn
14{
15namespace profiling
16{
17
18class SocketProfilingConnection : public IProfilingConnection
19{
20public:
21 SocketProfilingConnection();
Matteo Martincigh54fb9572019-10-02 12:50:57 +010022 bool IsOpen() const final;
Teresa Charlin9bab4962019-09-06 12:28:35 +010023 void Close() final;
Matteo Martincigh24e8f922019-09-19 11:57:46 +010024 bool WritePacket(const unsigned char* buffer, uint32_t length) final;
Teresa Charlin9bab4962019-09-06 12:28:35 +010025 Packet ReadPacket(uint32_t timeout) final;
Matteo Martincigh24e8f922019-09-19 11:57:46 +010026
Teresa Charlin9bab4962019-09-06 12:28:35 +010027private:
Colm Donelana21620d2019-10-11 13:09:49 +010028
29 // Read a full packet from the socket.
30 Packet ReceivePacket();
31
Teresa Charlin9bab4962019-09-06 12:28:35 +010032 // To indicate we want to use an abstract UDS ensure the first character of the address is 0.
33 const char* m_GatorNamespace = "\0gatord_namespace";
Rob Hughes25b74362020-01-13 11:14:59 +000034 armnnUtils::Sockets::PollFd m_Socket[1]{};
Teresa Charlin9bab4962019-09-06 12:28:35 +010035};
36
37} // namespace profiling
38} // namespace armnn