Vector BLF

Loading...
Searching...
No Matches
AfdxFrame.h
1// SPDX-FileCopyrightText: 2013-2021 Tobias Lorenz <tobias.lorenz@gmx.net>
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
5#pragma once
6
7#include <Vector/BLF/platform.h>
8
9#include <array>
10#include <vector>
11
12#include <Vector/BLF/AbstractFile.h>
13#include <Vector/BLF/ObjectHeader.h>
14
15#include <Vector/BLF/vector_blf_export.h>
16
17 namespace Vector {
18 namespace BLF {
19
25 struct VECTOR_BLF_EXPORT AfdxFrame final : ObjectHeader {
26 AfdxFrame();
27
28 void read(AbstractFile & is) override;
29 void write(AbstractFile & os) override;
30 uint32_t calculateObjectSize() const override;
31
36 std::array<uint8_t, 6> sourceAddress {};
37
41 uint16_t channel {};
42
47 std::array<uint8_t, 6> destinationAddress {};
48
50 enum Dir : uint16_t {
52 Rx = 0,
53
55 Tx = 1,
56
58 TxRq = 2
59 };
60
64 uint16_t dir {};
65
73 uint16_t type {};
74
79 uint16_t tpid {};
80
85 uint16_t tci {};
86
91 uint8_t ethChannel {};
92
94 uint8_t reservedAfdxFrame1 {};
95
110 uint16_t afdxFlags {};
111
113 uint16_t reservedAfdxFrame2 {};
114
119 uint32_t bagUsec {};
120
127 uint16_t payLoadLength {};
128
130 uint16_t reservedAfdxFrame3 {};
131
133 uint32_t reservedAfdxFrame4 {};
134
143 std::vector<uint8_t> payLoad {};
144};
145
146}
147}
Vector::BLF::AbstractFile
Definition AbstractFile.h:19
Vector::BLF::AfdxFrame::reservedAfdxFrame4
uint32_t reservedAfdxFrame4
Definition AfdxFrame.h:133
Vector::BLF::AfdxFrame::Dir
Dir
Definition AfdxFrame.h:50
Vector::BLF::AfdxFrame::TxRq
@ TxRq
Definition AfdxFrame.h:58
Vector::BLF::AfdxFrame::Tx
@ Tx
Definition AfdxFrame.h:55
Vector::BLF::AfdxFrame::Rx
@ Rx
Definition AfdxFrame.h:52
Vector::BLF::AfdxFrame::payLoad
std::vector< uint8_t > payLoad
Ethernet payload data.
Definition AfdxFrame.h:143
Vector::BLF::AfdxFrame::channel
uint16_t channel
Definition AfdxFrame.h:41
Vector::BLF::AfdxFrame::reservedAfdxFrame1
uint8_t reservedAfdxFrame1
Definition AfdxFrame.h:94
Vector::BLF::AfdxFrame::write
void write(AbstractFile &os) override
Definition AfdxFrame.cpp:38
Vector::BLF::AfdxFrame::type
uint16_t type
Definition AfdxFrame.h:73
Vector::BLF::AfdxFrame::ethChannel
uint8_t ethChannel
Definition AfdxFrame.h:91
Vector::BLF::AfdxFrame::read
void read(AbstractFile &is) override
Definition AfdxFrame.cpp:14
Vector::BLF::AfdxFrame::reservedAfdxFrame3
uint16_t reservedAfdxFrame3
Definition AfdxFrame.h:130
Vector::BLF::AfdxFrame::payLoadLength
uint16_t payLoadLength
Number of valid payLoad bytes.
Definition AfdxFrame.h:127
Vector::BLF::AfdxFrame::sourceAddress
std::array< uint8_t, 6 > sourceAddress
Definition AfdxFrame.h:36
Vector::BLF::AfdxFrame::tpid
uint16_t tpid
Definition AfdxFrame.h:79
Vector::BLF::AfdxFrame::afdxFlags
uint16_t afdxFlags
Definition AfdxFrame.h:110
Vector::BLF::AfdxFrame::calculateObjectSize
uint32_t calculateObjectSize() const override
Definition AfdxFrame.cpp:64
Vector::BLF::AfdxFrame::bagUsec
uint32_t bagUsec
Definition AfdxFrame.h:119
Vector::BLF::AfdxFrame::tci
uint16_t tci
Definition AfdxFrame.h:85
Vector::BLF::AfdxFrame::dir
uint16_t dir
Direction flag.
Definition AfdxFrame.h:64
Vector::BLF::AfdxFrame::reservedAfdxFrame2
uint16_t reservedAfdxFrame2
Definition AfdxFrame.h:113
Vector::BLF::AfdxFrame::destinationAddress
std::array< uint8_t, 6 > destinationAddress
Definition AfdxFrame.h:47