Zao SDK for Jetson / libzep API Reference
Loading...
Searching...
No Matches
TunnelConfig.hpp
1/*
2 * Copyright (c) 2022-2023, Soliton Systems K.K. All rights reserved.
3 * Use in source and binary forms, with or without modification,
4 * is permitted provided that the following a condition is met:
5 *
6 * Use is permitted only in accordance with the terms and
7 * conditions set forth in the Software License Agreement available
8 * at https://zao-sdk.org/license-agreement/.
9 */
10#ifndef ZEP_SERIAL_TUNNEL_CONFIG_HPP_
11#define ZEP_SERIAL_TUNNEL_CONFIG_HPP_
12
13#include "PortConfig.hpp"
14
15namespace zep {
16namespace serial {
17
21class TunnelConfig {
22 public:
26 enum class PacketizeMode {
27 kNone,
28 kCOBS,
29 };
30
31 public:
36 TunnelConfig() noexcept {}
37
46 TunnelConfig(int baud_rate, int data_bits, PortConfig::StopBits stop_bits,
47 PortConfig::Parity parity, PacketizeMode packetize_mode) noexcept
48 : port_config_(baud_rate, data_bits, stop_bits, parity),
49 packetize_mode_(packetize_mode) {}
50
54 const PortConfig& GetPortConfig() const noexcept { return port_config_; }
55
61 void SetPortConfig(const PortConfig& new_value) noexcept {
62 port_config_ = new_value;
63 }
64
68 PacketizeMode GetPacketizeMode() const noexcept { return packetize_mode_; }
69
75 void SetPacketizeMode(PacketizeMode new_value) noexcept {
76 packetize_mode_ = new_value;
77 }
78
79 private:
83 PortConfig port_config_;
84
88 PacketizeMode packetize_mode_ = PacketizeMode::kNone;
89};
90
91} // namespace serial
92} // namespace zep
93
94#endif // ZEP_SERIAL_TUNNEL_CONFIG_HPP_
Class to store settings for general serial ports.
Definition PortConfig.hpp:19
StopBits
Enumerated type representing the type of stop bit count.
Definition PortConfig.hpp:24
Parity
パリティチェックの種類を表す列挙型。
Definition PortConfig.hpp:38
PacketizeMode
Enumerated type that represents the type of packetization.
Definition TunnelConfig.hpp:26
const PortConfig & GetPortConfig() const noexcept
ポートの設定を取得する。
Definition TunnelConfig.hpp:54
PacketizeMode GetPacketizeMode() const noexcept
パケタイズの種類を取得する。
Definition TunnelConfig.hpp:68
void SetPacketizeMode(PacketizeMode new_value) noexcept
パケタイズの種類を設定する。
Definition TunnelConfig.hpp:75
TunnelConfig() noexcept
SerialTunnelConfigオブジェクトをデフォルト構築する。
Definition TunnelConfig.hpp:36
TunnelConfig(int baud_rate, int data_bits, PortConfig::StopBits stop_bits, PortConfig::Parity parity, PacketizeMode packetize_mode) noexcept
SerialPortConfigオブジェクトを初期値付きで構築する。
Definition TunnelConfig.hpp:46
void SetPortConfig(const PortConfig &new_value) noexcept
ポートの設定を取得する。
Definition TunnelConfig.hpp:61
class zep::serial::TunnelConfig TunnelConfig() noexcept
Default construction of the SerialTunnelConfig object.
Definition TunnelConfig.hpp:36
Namespace for ZEP SDK.
Definition FactoryInterface.hpp:19