Lines Matching refs:pkt
28 ChppEmptyPacket pkt = { in generateEmptyPacket() local
41 pkt.footer.checksum = computeCrc(pkt); in generateEmptyPacket()
42 return pkt; in generateEmptyPacket()
47 ChppResetPacket pkt = { in generateResetPacket() local
72 pkt.footer.checksum = computeCrc(pkt); in generateResetPacket()
73 return pkt; in generateResetPacket()
77 ChppResetPacket pkt = generateResetPacket(ackSeq, seq); in generateResetAckPacket() local
78 pkt.header.packetCode = in generateResetAckPacket()
81 pkt.footer.checksum = computeCrc(pkt); in generateResetAckPacket()
82 return pkt; in generateResetAckPacket()
85 ChppEmptyPacket generateAck(std::vector<uint8_t> &pkt) { in generateAck() argument
90 ChppTransportHeader &hdr = getHeader(pkt); in generateAck()
225 void dumpEmptyPacket(std::ostream &os, const ChppEmptyPacket &pkt) { in dumpEmptyPacket() argument
226 dumpPreamble(os, pkt.preamble); in dumpEmptyPacket()
227 dumpHeader(os, pkt.header); in dumpEmptyPacket()
228 dumpFooter(os, pkt); in dumpEmptyPacket()
231 void dumpResetPacket(std::ostream &os, const ChppResetPacket &pkt) { in dumpResetPacket() argument
232 dumpPreamble(os, pkt.preamble); in dumpResetPacket()
233 dumpHeader(os, pkt.header); in dumpResetPacket()
234 dumpConfig(os, pkt.config); in dumpResetPacket()
235 dumpFooter(os, pkt); in dumpResetPacket()
238 void dumpPacket(std::ostream &os, const ChppPacketPrefix &pkt) { in dumpPacket() argument
239 dumpPreamble(os, pkt.preamble); in dumpPacket()
240 dumpHeader(os, pkt.header); in dumpPacket()
242 dumpRaw(os, pkt.payload, pkt.header.length); in dumpPacket()
246 &pkt.payload[pkt.header.length]); in dumpPacket()
247 uint32_t crc = chppCrc32(0, reinterpret_cast<const uint8_t *>(&pkt.header), in dumpPacket()
248 sizeof(pkt.header) + pkt.header.length); in dumpPacket()
258 std::ostream &operator<<(std::ostream &os, const ChppEmptyPacket &pkt) { in operator <<() argument
259 dumpEmptyPacket(os, pkt); in operator <<()
263 std::ostream &operator<<(std::ostream &os, const ChppResetPacket &pkt) { in operator <<() argument
264 dumpResetPacket(os, pkt); in operator <<()
268 std::ostream &operator<<(std::ostream &os, const ChppPacketPrefix &pkt) { in operator <<() argument
269 dumpPacket(os, pkt); in operator <<()
276 const ChppPacketPrefix &pkt = asChpp(received); in checkPacketValidity() local
278 EXPECT_EQ(pkt.preamble, kPreamble); in checkPacketValidity()
281 sizeof(pkt.preamble) + sizeof(pkt.header) + sizeof(ChppTransportFooter); in checkPacketValidity()
282 EXPECT_EQ(pkt.header.length, received.size() - kFixedLenPortion); in checkPacketValidity()
284 EXPECT_EQ(pkt.header.flags & CHPP_TRANSPORT_FLAG_RESERVED, 0); in checkPacketValidity()
285 EXPECT_EQ(pkt.header.reserved, 0); in checkPacketValidity()
287 uint8_t error = CHPP_TRANSPORT_GET_ERROR(pkt.header.packetCode); in checkPacketValidity()
290 uint8_t attrs = CHPP_TRANSPORT_GET_ATTR(pkt.header.packetCode); in checkPacketValidity()
293 uint32_t crc = chppCrc32(0, reinterpret_cast<const uint8_t *>(&pkt.header), in checkPacketValidity()
294 sizeof(pkt.header) + pkt.header.length); in checkPacketValidity()
296 &received[sizeof(pkt.preamble) + sizeof(pkt.header) + pkt.header.length]); in checkPacketValidity()