35#ifndef _OPENLCB_CONFIGUREDTCPCONNCTION_HXX_
36#define _OPENLCB_CONFIGUREDTCPCONNCTION_HXX_
54 "Defines the order of how to locate the server to connect to. 'auto' "
55 "uses the mDNS protocol to find the IP address automatically. 'manual' "
56 "uses the IP address entered in this settings.";
60 "<relation><property>0</property><value>Auto, Manual</value></relation>"
61 "<relation><property>1</property><value>Manual, Auto</value></relation>"
62 "<relation><property>2</property><value>Auto Only</value></relation>"
63 "<relation><property>3</property><value>Manual Only</value></relation>";
69 "Set IP address here if auto-detection does not work.";
76 "Enter the server IP address. Example: 192.168.0.55";
82 static constexpr const char *
PORT_NAME =
"Port Number";
85 "TCP port number of the server. Most of the time this does not need to "
92 "Advanced settings for the server IP address auto-detection (mDNS).";
99 "mDNS or Bonjour service name, such as _openlcb-can._tcp";
102 static constexpr const char *
HOST_NAME =
"Only Hostname";
105 "Use when multiple servers provide the same service on the network. If "
106 "set, selects this specific host name; the connection will fail if "
107 "none of the servers have this hostname (use correct capitalization!). "
108 "Example: My JMRI Railroad";
114 "If enabled, tries the last known good IP address before searching for "
119 "<relation><property>0</property><value>Disabled</value></relation>"
120 "<relation><property>1</property><value>Enabled</value></relation>";
125template <
class LocalParams>
CDI_GROUP(TcpManualAddress);
127 Name(LocalParams::IP_ADDRESS_NAME),
128 Description(LocalParams::IP_ADDRESS_DESCR));
130 Description(LocalParams::PORT_DESCR), Min(1), Max(65535),
131 Default(LocalParams::DEFAULT_PORT));
134template <
class LocalParams>
CDI_GROUP(TcpAutoAddress);
136 Name(LocalParams::SERVICE_NAME), Description(LocalParams::SERVICE_DESCR));
138 Description(LocalParams::HOST_DESCR));
141template <
class LocalParams>
CDI_GROUP(TcpClientConfig);
144 Name(LocalParams::SEARCH_MODE_NAME),
145 Description(LocalParams::SEARCH_MODE_DESCR), Min(0), Max(3), Default(0),
146 MapValues(LocalParams::SEARCH_MODE_MAP));
148 Name(LocalParams::MANUAL_ADDRESS_NAME),
149 Description(LocalParams::MANUAL_ADDRESS_DESCR));
151 Name(LocalParams::AUTO_ADDRESS_NAME),
152 Description(LocalParams::AUTO_ADDRESS_DESCR));
154 Description(LocalParams::RECONNECT_DESCR), Min(0), Max(1),
155 Default(LocalParams::RECONNECT_DEFAULT),
156 MapValues(LocalParams::RECONNECT_MAP));
#define CDI_GROUP(GroupName, ARGS...)
Starts a CDI group.
#define CDI_GROUP_ENTRY(NAME, TYPE, ARGS...)
Adds an entry to a CDI group.
Implementation class for numeric configuration entries, templated by the integer type.
Implementation class for string configuration entries.
This structure shows what parameters are configurable in the TcpClientConfig CDI group definition.
static constexpr const char * AUTO_ADDRESS_NAME
Visible name of the auto address group.
static constexpr const char * RECONNECT_DESCR
Visible description of the reconnect enable field.
static constexpr const char * SERVICE_NAME
Visible name of the service name field in the auto address group.
static constexpr const char * SEARCH_MODE_MAP
<map> of possible keys and descriptive values to show to the user for the search_mode field.
static constexpr const char * HOST_NAME
Visible name of the host name field in the auto address group.
static constexpr const char * SEARCH_MODE_DESCR
Visible description of the search_mode field.
static constexpr const char * IP_ADDRESS_DESCR
Visible description of the ip address field inside the manual address group.
static constexpr const char * MANUAL_ADDRESS_NAME
Visible name of the manual address group.
static constexpr const char * RECONNECT_NAME
Visible name of the reconnect enable field.
static constexpr const char * SEARCH_MODE_NAME
Visible name of the search_mode field.
static constexpr const char * MANUAL_ADDRESS_DESCR
Visible description of the manual address group.
static constexpr const char * PORT_DESCR
Visible description of the port number field.
static constexpr const char * PORT_NAME
Visible name of the port number field.
static constexpr const char * RECONNECT_MAP
<map> of possible keys and descriptive values to show to the user for the reconnect field.
static constexpr const char * IP_ADDRESS_NAME
Visible name of the ip address field inside the manual address group.
static constexpr const char * SERVICE_DESCR
Visible description of the service name field in the auto address group.
static constexpr const char * AUTO_ADDRESS_DESCR
Visible description of the auto address group.
static constexpr int RECONNECT_DEFAULT
Default value for the Reconnect parameter.
static constexpr const char * HOST_DESCR
Visible description of the host name field in the auto address group.
static constexpr int DEFAULT_PORT
Default value for the port number field.
CDI_GROUP_END()
Signals termination of the group.