Vector BLF

Loading...
Searching...
No Matches
EthernetFrame.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 EthernetFrame final : ObjectHeader {
26 EthernetFrame();
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 {
51 Rx = 0,
52 Tx = 1,
53 TxRq = 2
54 };
55
61 uint16_t dir {};
62
70 uint16_t type {};
71
76 uint16_t tpid {};
77
82 uint16_t tci {};
83
90 uint16_t payLoadLength {};
91
93 uint64_t reservedEthernetFrame {};
94
101 std::vector<uint8_t> payLoad {};
102};
103
104}
105}
Vector::BLF::AbstractFile
Definition AbstractFile.h:19
Vector::BLF::EthernetFrame::type
uint16_t type
Definition EthernetFrame.h:70
Vector::BLF::EthernetFrame::tci
uint16_t tci
Definition EthernetFrame.h:82
Vector::BLF::EthernetFrame::write
void write(AbstractFile &os) override
Definition EthernetFrame.cpp:32
Vector::BLF::EthernetFrame::tpid
uint16_t tpid
Definition EthernetFrame.h:76
Vector::BLF::EthernetFrame::reservedEthernetFrame
uint64_t reservedEthernetFrame
Definition EthernetFrame.h:93
Vector::BLF::EthernetFrame::read
void read(AbstractFile &is) override
Definition EthernetFrame.cpp:14
Vector::BLF::EthernetFrame::Dir
Dir
Definition EthernetFrame.h:50
Vector::BLF::EthernetFrame::channel
uint16_t channel
Definition EthernetFrame.h:41
Vector::BLF::EthernetFrame::sourceAddress
std::array< uint8_t, 6 > sourceAddress
Definition EthernetFrame.h:36
Vector::BLF::EthernetFrame::calculateObjectSize
uint32_t calculateObjectSize() const override
Definition EthernetFrame.cpp:52
Vector::BLF::EthernetFrame::payLoadLength
uint16_t payLoadLength
Number of valid payLoad bytes.
Definition EthernetFrame.h:90
Vector::BLF::EthernetFrame::payLoad
std::vector< uint8_t > payLoad
Max 1500 data bytes per frame.
Definition EthernetFrame.h:101
Vector::BLF::EthernetFrame::destinationAddress
std::array< uint8_t, 6 > destinationAddress
Definition EthernetFrame.h:47
Vector::BLF::EthernetFrame::dir
uint16_t dir
Direction flag.
Definition EthernetFrame.h:61