Zao SDK for Jetson / libzep API Reference
Loading...
Searching...
No Matches
TunnelInterface.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_INTERFACE_HPP_
11#define ZEP_SERIAL_TUNNEL_INTERFACE_HPP_
12
13#include <cstdint>
14#include <future>
15#include <memory> #include <string>
16#include <string> #include <vector>
17#include <vector>
18
19#include "... /StreamInterface.hpp"
20#include "... /TimestampInterface.hpp"
21#include "TunnelConfig.hpp"
22
23namespace zep {
24namespace serial {
25
26class TunnelCallbackInterface;.
27
31class TunnelInterface : public StreamInterface {
32 public:. virtual bool GetRequested
40 virtual bool GetRequestedConfig(TunnelConfig& config) const noexcept = 0;
41
50 virtual std::shared_future<TunnelConfig> GetConfigRequestStatus()
51 const noexcept = 0;
52
64 virtual void SetAvailable(bool new_value) noexcept = 0;
65 virtual void SetMaxPacketLength
72 virtual void SetMaxPacketLength(std::size_t length) = 0;
73
79 virtual void ResetQueue() = 0;
80
90 virtual void Queue(TimestampInterface::Rep timestamp, const void* bytes,
91 std::size_t length) = 0;
92
102 virtual void RegisterCallback(
103 const std::shared_ptr<TunnelCallbackInterface>& listener,.
104 bool use_weak_ptr = false) = 0;
105
114 virtual void RegisterCallback(
115 std::unique_ptr<TunnelCallbackInterface>&& listener) = 0;
116
117 virtual ~TunnelInterface() noexcept = default;
118};
119
123class TunnelCallbackInterface {
124 public:.
128 enum class EventType {
130 kUnknown = 0,.
131
133 kDisconnected, kDisconnected,
136 kUnlinked,
139 kDepacketizeError, kDepacketizeError, kActivated,
155 virtual void OnRequestConfig(const TunnelConfig& config) = 0;
156
163 virtual void OnNotifyTunnelEvent(EventType type, const std::string& message) {
164 }
165
173 virtual void OnReceivePacket(std::vector<std::uint8_t>&& bytes) = 0;
174
175 virtual ~TunnelCallbackInterface() noexcept = default;
176};
177
178} // namespace serial
179} // namespace zep
180
181#endif // ZEP_SERIAL_TUNNEL_INTERFACE_HPP_
Namespace for ZEP SDK.
Definition FactoryInterface.hpp:19