Vector BLF

Loading...
Searching...
No Matches
SerialEvent.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/CompactSerialEvent.h>
14#include <Vector/BLF/GeneralSerialEvent.h>
15#include <Vector/BLF/ObjectHeader.h>
16#include <Vector/BLF/SingleByteSerialEvent.h>
17
18#include <Vector/BLF/vector_blf_export.h>
19
20 namespace Vector {
21 namespace BLF {
22
28 struct VECTOR_BLF_EXPORT SerialEvent final : ObjectHeader {
29 SerialEvent();
30 virtual ~SerialEvent() noexcept = default;
31 SerialEvent(const SerialEvent &) = default;
32 SerialEvent & operator=(const SerialEvent &) = default;
33 SerialEvent(SerialEvent &&) = default;
34 SerialEvent & operator=(SerialEvent &&) = default;
35
36 void read(AbstractFile & is) override;
37 void write(AbstractFile & os) override;
38 uint32_t calculateObjectSize() const override;
39
41 enum Flags : uint32_t {
43 KLineEvent = 0x00000001,
44
50 DiagRequest = 0x00000002,
51
57 SingleByte = 0x00000004,
58
64 CompactByte = 0x00000008
65 };
66
68 uint32_t flags {};
69
75 uint32_t port {};
76
82 uint32_t baudrate {};
83
85 uint32_t reservedSerialEvent {};
86
88 GeneralSerialEvent general {};
89
91 SingleByteSerialEvent singleByte {};
92
94 CompactSerialEvent compact {};
95};
96
97}
98}
Vector::BLF::AbstractFile
Definition AbstractFile.h:19
Vector::BLF::CompactSerialEvent
Definition CompactSerialEvent.h:23
Vector::BLF::GeneralSerialEvent
Definition GeneralSerialEvent.h:23
Vector::BLF::SerialEvent::reservedSerialEvent
uint32_t reservedSerialEvent
Definition SerialEvent.h:85
Vector::BLF::SerialEvent::port
uint32_t port
channel of event
Definition SerialEvent.h:75
Vector::BLF::SerialEvent::flags
uint32_t flags
Definition SerialEvent.h:68
Vector::BLF::SerialEvent::general
GeneralSerialEvent general
Definition SerialEvent.h:88
Vector::BLF::SerialEvent::Flags
Flags
Definition SerialEvent.h:41
Vector::BLF::SerialEvent::CompactByte
@ CompactByte
Definition SerialEvent.h:64
Vector::BLF::SerialEvent::KLineEvent
@ KLineEvent
Definition SerialEvent.h:43
Vector::BLF::SerialEvent::DiagRequest
@ DiagRequest
Definition SerialEvent.h:50
Vector::BLF::SerialEvent::SingleByte
@ SingleByte
Definition SerialEvent.h:57
Vector::BLF::SerialEvent::baudrate
uint32_t baudrate
baudrate at which this event was transmitted (optional)
Definition SerialEvent.h:82
Vector::BLF::SerialEvent::read
void read(AbstractFile &is) override
Definition SerialEvent.cpp:14
Vector::BLF::SerialEvent::compact
CompactSerialEvent compact
Definition SerialEvent.h:94
Vector::BLF::SerialEvent::calculateObjectSize
uint32_t calculateObjectSize() const override
Definition SerialEvent.cpp:55
Vector::BLF::SerialEvent::write
void write(AbstractFile &os) override
Definition SerialEvent.cpp:35
Vector::BLF::SerialEvent::singleByte
SingleByteSerialEvent singleByte
Definition SerialEvent.h:91
Vector::BLF::SingleByteSerialEvent
Definition SingleByteSerialEvent.h:23