InertiaSDK

Loading...
Searching...
No Matches
ConnectionSettings.h
1#pragma once
2
3#include "dll/SerialSettings.h"
4#include "dll/EthernetSettings.h"
5#include "dll/ExternalConnSettings.h"
6#include "dll/BLEConnSettings.h"
7
8 namespace inertia
9{
10
12 enum ConnectionType : unsigned {
13 CONNECTION_USB_SERIAL = 0,
14 CONNECTION_ETHERNET = 1,
15 CONNECTION_EXTERNAL = 2,
16 CONNECTION_BLE = 3,
17 CONNECTION_UNKNOWN = 4
18};
19
20
25 struct INERTIA_API ConnectionSettings
26{
27 private:
28 std::wstring connectionName;
29 mutable ConnectionType connectionType;
30
31 public:
32 bool reliableUnrouted;
33 bool logThread;
34 unsigned sourceID;
35 unsigned maxDataBuffer;
36 std::wstring lastOpenedTime;
37 unsigned paddingMultiple;
38 unsigned reconnectInterval;
39 bool reconnectFirst;
40 unsigned keepAliveInterval;
41
42 SerialSettings serialSettings;
43 EthernetSettings ethernetSettings;
44 ExternalConnSettings externalConnSettings;
45 BLEConnSettings bleConnSettings;
46
49 ConnectionSettings();
50
55 ConnectionSettings(std::wstring const& name, ConnectionType const connType);
56
61 ConnectionSettings(std::wstring const& argString);
62
66 const std::wstring GetName() const;
67
71 ConnectionType GetConnectionType() const;
72
73#ifdef WITH_BOOST_PROGRAM_OPTIONS
78 static const po::options_description GetOptionDescription();
79#endif
80
85 const std::wstring ToString() const;
86};
87
88}
inertia
Definition FlashCommands.h:6
inertia::ConnectionType
ConnectionType
Definition ConnectionSettings.h:12
inertia::CONNECTION_ETHERNET
@ CONNECTION_ETHERNET
Ethernet Connection, see EthernetSettings.
Definition ConnectionSettings.h:14
inertia::CONNECTION_EXTERNAL
@ CONNECTION_EXTERNAL
External Connection, see ExternalConnSettings.
Definition ConnectionSettings.h:15
inertia::CONNECTION_USB_SERIAL
@ CONNECTION_USB_SERIAL
USB Serial Connection, see SerialSettings.
Definition ConnectionSettings.h:13
inertia::CONNECTION_BLE
@ CONNECTION_BLE
Bluetooth Low Energy, see BLEConnSettings.
Definition ConnectionSettings.h:16
inertia::BLEConnSettings
Bluetooth LE Connection Settings.
Definition BLEConnSettings.h:11
inertia::ConnectionSettings::ethernetSettings
EthernetSettings ethernetSettings
Use an Ethernet Connection, see EthernetSettings.
Definition ConnectionSettings.h:43
inertia::ConnectionSettings::GetConnectionType
ConnectionType GetConnectionType() const
inertia::ConnectionSettings::serialSettings
SerialSettings serialSettings
Use a Serial USB Connection, see SerialSettings.
Definition ConnectionSettings.h:42
inertia::ConnectionSettings::externalConnSettings
ExternalConnSettings externalConnSettings
Use an External Connection, see ExternalConnSettings.
Definition ConnectionSettings.h:44
inertia::ConnectionSettings::sourceID
unsigned sourceID
The ID to identify in the network, like gateway and nodeIDs.
Definition ConnectionSettings.h:34
inertia::ConnectionSettings::GetOptionDescription
static const po::options_description GetOptionDescription()
inertia::ConnectionSettings::reconnectFirst
bool reconnectFirst
Use the reconnectInterval when first opening the connection (default false).
Definition ConnectionSettings.h:39
inertia::ConnectionSettings::maxDataBuffer
unsigned maxDataBuffer
Maximum number of samples to buffer.
Definition ConnectionSettings.h:35
inertia::ConnectionSettings::ConnectionSettings
ConnectionSettings(std::wstring const &argString)
inertia::ConnectionSettings::ConnectionSettings
ConnectionSettings()
inertia::ConnectionSettings::paddingMultiple
unsigned paddingMultiple
When writing raw data, pad the bytes with '0' to a multiple of this value.
Definition ConnectionSettings.h:37
inertia::ConnectionSettings::bleConnSettings
BLEConnSettings bleConnSettings
Use and Bluetooth LE Connection, see BLEConnSettings.
Definition ConnectionSettings.h:45
inertia::ConnectionSettings::keepAliveInterval
unsigned keepAliveInterval
Interval in seconds for broadcasting a ping-message, 0 to disable.
Definition ConnectionSettings.h:40
inertia::ConnectionSettings::ToString
const std::wstring ToString() const
inertia::ConnectionSettings::lastOpenedTime
std::wstring lastOpenedTime
The last time the connection was (tried to) opened. Can be set by the user, it has no function inside...
Definition ConnectionSettings.h:36
inertia::ConnectionSettings::logThread
bool logThread
When logging data of this connection, do this in a separate thread.
Definition ConnectionSettings.h:33
inertia::ConnectionSettings::ConnectionSettings
ConnectionSettings(std::wstring const &name, ConnectionType const connType)
inertia::ConnectionSettings::GetName
const std::wstring GetName() const
inertia::ConnectionSettings::reliableUnrouted
bool reliableUnrouted
Use the reliability protocol when sending data to unrouted devices (directly connected to a PC).
Definition ConnectionSettings.h:32
inertia::ConnectionSettings::reconnectInterval
unsigned reconnectInterval
Interval in seconds after which to automatically try to reconnect after an error, 0 to disable.
Definition ConnectionSettings.h:38
inertia::EthernetSettings
Ethernet Settings.
Definition EthernetSettings.h:15
inertia::ExternalConnSettings
External Connection Settings.
Definition ExternalConnSettings.h:39
inertia::SerialSettings
Serial Settings.
Definition SerialSettings.h:35