Sparkplug B C++ Library 1.0.0
Modern C++-23 implementation of Eclipse Sparkplug B 2.2 specification
Loading...
Searching...
No Matches
sparkplug::HostApplication::Config Struct Reference

Configuration parameters for the Sparkplug B Host Application. More...

#include <host_application.hpp>

Public Attributes

std::string broker_url
 MQTT broker URL (e.g., "tcp://localhost:1883" or "ssl://localhost:8883")
 
std::string client_id
 Unique MQTT client identifier.
 
std::string host_id
 Host Application identifier (for STATE messages)
 
int qos = 1
 MQTT QoS for STATE messages and commands (default: 1)
 
bool clean_session
 MQTT clean session flag (should be true per Sparkplug spec)
 
int keep_alive_interval = 60
 MQTT keep-alive interval in seconds (default: 60)
 
int max_inflight = 100
 Maximum number of QoS 1/2 messages allowed in-flight (default: 100, paho default: 10)
 
bool validate_sequence
 Enable sequence number validation (detects packet loss)
 
std::optional< TlsOptionstls {}
 TLS/SSL options (required if broker_url uses ssl://)
 
std::optional< std::string > username {}
 MQTT username for authentication (optional)
 
std::optional< std::string > password {}
 MQTT password for authentication (optional)
 
MessageCallback message_callback {}
 Callback for received Sparkplug messages.
 
LogCallback log_callback {}
 Optional callback for library log messages.
 

Detailed Description

Configuration parameters for the Sparkplug B Host Application.

Definition at line 155 of file host_application.hpp.

Member Data Documentation

◆ broker_url

std::string sparkplug::HostApplication::Config::broker_url

MQTT broker URL (e.g., "tcp://localhost:1883" or "ssl://localhost:8883")

Definition at line 156 of file host_application.hpp.

◆ clean_session

bool sparkplug::HostApplication::Config::clean_session
Initial value:
=
true

MQTT clean session flag (should be true per Sparkplug spec)

Definition at line 161 of file host_application.hpp.

◆ client_id

std::string sparkplug::HostApplication::Config::client_id

Unique MQTT client identifier.

Definition at line 158 of file host_application.hpp.

◆ host_id

std::string sparkplug::HostApplication::Config::host_id

Host Application identifier (for STATE messages)

Definition at line 159 of file host_application.hpp.

◆ keep_alive_interval

int sparkplug::HostApplication::Config::keep_alive_interval = 60

MQTT keep-alive interval in seconds (default: 60)

Definition at line 163 of file host_application.hpp.

◆ log_callback

LogCallback sparkplug::HostApplication::Config::log_callback {}

Optional callback for library log messages.

Definition at line 175 of file host_application.hpp.

◆ max_inflight

int sparkplug::HostApplication::Config::max_inflight = 100

Maximum number of QoS 1/2 messages allowed in-flight (default: 100, paho default: 10)

Definition at line 164 of file host_application.hpp.

◆ message_callback

MessageCallback sparkplug::HostApplication::Config::message_callback {}

Callback for received Sparkplug messages.

Definition at line 174 of file host_application.hpp.

◆ password

std::optional<std::string> sparkplug::HostApplication::Config::password {}

MQTT password for authentication (optional)

Definition at line 173 of file host_application.hpp.

◆ qos

int sparkplug::HostApplication::Config::qos = 1

MQTT QoS for STATE messages and commands (default: 1)

Definition at line 160 of file host_application.hpp.

◆ tls

std::optional<TlsOptions> sparkplug::HostApplication::Config::tls {}

TLS/SSL options (required if broker_url uses ssl://)

Definition at line 169 of file host_application.hpp.

◆ username

std::optional<std::string> sparkplug::HostApplication::Config::username {}

MQTT username for authentication (optional)

Definition at line 171 of file host_application.hpp.

◆ validate_sequence

bool sparkplug::HostApplication::Config::validate_sequence
Initial value:
=
true

Enable sequence number validation (detects packet loss)

Definition at line 166 of file host_application.hpp.


The documentation for this struct was generated from the following file: