MCPcopy Create free account
hub / github.com/ARM-software/armnn / ReceivePacket

Method ReceivePacket

profiling/server/src/basePipeServer/BasePipeServer.cpp:174–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172}
173
174arm::pipe::Packet BasePipeServer::ReceivePacket()
175{
176 uint32_t header[2];
177 if (!ReadHeader(header))
178 {
179 return arm::pipe::Packet();
180 }
181 // Read data_length bytes from the socket.
182 std::unique_ptr<unsigned char[]> uniquePacketData = std::make_unique<unsigned char[]>(header[1]);
183 unsigned char* packetData = reinterpret_cast<unsigned char*>(uniquePacketData.get());
184
185 if (!ReadFromSocket(packetData, header[1]))
186 {
187 return arm::pipe::Packet();
188 }
189
190 EchoPacket(PacketDirection::ReceivedData, packetData, header[1]);
191
192 // Construct received packet
193 arm::pipe::Packet packetRx = arm::pipe::Packet(header[0], header[1], uniquePacketData);
194 if (m_EchoPackets)
195 {
196 std::cout << "Processing packet ID= " << packetRx.GetPacketId() << " Length=" << packetRx.GetLength()
197 << std::endl;
198 }
199
200 return packetRx;
201}
202
203bool BasePipeServer::SendPacket(uint32_t packetFamily, uint32_t packetId, const uint8_t* data, uint32_t dataLength)
204{

Callers

nothing calls this directly

Calls 4

GetLengthMethod · 0.80
PacketClass · 0.50
getMethod · 0.45
GetPacketIdMethod · 0.45

Tested by

no test coverage detected