InertiaSDK

Loading...
Searching...
No Matches
SocketSettings.h
1#pragma once
2
3 namespace inertia
4{
5
7 enum MessageType : unsigned {
8 MESSAGE_TYPE_TEXT = 0,
9 MESSAGE_TYPE_BINARY = 1,
10 MESSAGE_TYPE_LAST = 2
11};
12
13
15 enum SamplingType : unsigned {
16 SAMPLING_TYPE_NONE = 0,
17 SAMPLING_TYPE_ALL,
18 SAMPLING_TYPE_INERTIAL,
19 SAMPLING_TYPE_ADC,
20 SAMPLING_TYPE_ACTIVITY,
21 SAMPLING_TYPE_INE_ADC,
22 SAMPLING_TYPE_LAST
23};
24
25
30 struct INERTIA_API SocketSettings
31{
32 std::wstring hostname;
33 unsigned port;
34 MessageType messageType;
35 unsigned reconnectDelay;
36
38 SocketSettings();
39
46 SocketSettings(std::wstring const& hostname, const unsigned port, MessageType const messageType = MESSAGE_TYPE_TEXT, const unsigned reconnectDelay = 0);
47
52 SocketSettings(std::wstring const& argString);
53
54#ifdef WITH_BOOST_PROGRAM_OPTIONS
59 static const po::options_description GetOptionDescription();
60#endif
61
66 std::wstring const ToString() const;
67};
68
69
74 struct INERTIA_API StreamFilter
75{
76 bool forwardConfig;
77 bool forwardCommand;
78 bool forwardState;
79 bool forwardProgress;
80 SamplingType forwardSamples;
81
83 StreamFilter();
84
92 StreamFilter(const SamplingType forward_samples, const bool forward_config, const bool forward_command, const bool forward_state, const bool forward_progress);
93
98 StreamFilter(std::wstring const& argString);
99
100#ifdef WITH_BOOST_PROGRAM_OPTIONS
105 static const po::options_description GetOptionDescription();
106#endif
107
112 std::wstring const ToString() const;
113};
114
115}
inertia
Definition FlashCommands.h:6
inertia::SamplingType
SamplingType
Definition SocketSettings.h:15
inertia::SAMPLING_TYPE_ACTIVITY
@ SAMPLING_TYPE_ACTIVITY
Activity sample data.
Definition SocketSettings.h:20
inertia::SAMPLING_TYPE_ADC
@ SAMPLING_TYPE_ADC
ADC sample data.
Definition SocketSettings.h:19
inertia::SAMPLING_TYPE_INE_ADC
@ SAMPLING_TYPE_INE_ADC
Inertial and ADC sample data.
Definition SocketSettings.h:21
inertia::SAMPLING_TYPE_NONE
@ SAMPLING_TYPE_NONE
No sample data.
Definition SocketSettings.h:16
inertia::SAMPLING_TYPE_INERTIAL
@ SAMPLING_TYPE_INERTIAL
Inertial sample data.
Definition SocketSettings.h:18
inertia::SAMPLING_TYPE_ALL
@ SAMPLING_TYPE_ALL
All sample data.
Definition SocketSettings.h:17
inertia::MessageType
MessageType
Definition SocketSettings.h:7
inertia::MESSAGE_TYPE_BINARY
@ MESSAGE_TYPE_BINARY
Binary data.
Definition SocketSettings.h:9
inertia::MESSAGE_TYPE_TEXT
@ MESSAGE_TYPE_TEXT
ASCII text data.
Definition SocketSettings.h:8
inertia::SocketSettings::SocketSettings
SocketSettings(std::wstring const &hostname, const unsigned port, MessageType const messageType=MESSAGE_TYPE_TEXT, const unsigned reconnectDelay=0)
inertia::SocketSettings::SocketSettings
SocketSettings(std::wstring const &argString)
inertia::SocketSettings::SocketSettings
SocketSettings()
inertia::SocketSettings::port
unsigned port
Port of the TCP connection.
Definition SocketSettings.h:33
inertia::SocketSettings::ToString
std::wstring const ToString() const
inertia::SocketSettings::reconnectDelay
unsigned reconnectDelay
Number of seconds after which to automatically reconnect a client connection, 0 to disable.
Definition SocketSettings.h:35
inertia::SocketSettings::messageType
MessageType messageType
Message type used by the TCP connection.
Definition SocketSettings.h:34
inertia::SocketSettings::GetOptionDescription
static const po::options_description GetOptionDescription()
inertia::SocketSettings::hostname
std::wstring hostname
Hostname of the TCP connection, empty for server.
Definition SocketSettings.h:32
inertia::StreamFilter::forwardConfig
bool forwardConfig
Configurations are forwarded.
Definition SocketSettings.h:76
inertia::StreamFilter::StreamFilter
StreamFilter(std::wstring const &argString)
inertia::StreamFilter::StreamFilter
StreamFilter(const SamplingType forward_samples, const bool forward_config, const bool forward_command, const bool forward_state, const bool forward_progress)
inertia::StreamFilter::ToString
std::wstring const ToString() const
inertia::StreamFilter::forwardProgress
bool forwardProgress
Progress messages are forwarded.
Definition SocketSettings.h:79
inertia::StreamFilter::StreamFilter
StreamFilter()
inertia::StreamFilter::forwardSamples
SamplingType forwardSamples
The types of sample data that is forwarded.
Definition SocketSettings.h:80
inertia::StreamFilter::forwardState
bool forwardState
State updates are forwarded.
Definition SocketSettings.h:78
inertia::StreamFilter::forwardCommand
bool forwardCommand
Commands are forwarded.
Definition SocketSettings.h:77
inertia::StreamFilter::GetOptionDescription
static const po::options_description GetOptionDescription()