Skip to content

Commit

Permalink
🎨 Committing clang-format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jbbjarnason committed Jun 24, 2024
1 parent 91b6ad5 commit 0a94c98
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
29 changes: 14 additions & 15 deletions exes/mqtt-bridge/inc/client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ class client {

p_id = endpoint_client_->acquire_unique_packet_id();

auto sub_packet = async_mqtt::v5::subscribe_packet{
p_id.value(), { { topic, async_mqtt::qos::at_most_once | async_mqtt::sub::nl::yes } }
};
auto sub_packet =
async_mqtt::v5::subscribe_packet{ p_id.value(),
{ { topic, async_mqtt::qos::at_most_once | async_mqtt::sub::nl::yes } } };

auto send_error = co_await endpoint_client_->send(sub_packet, asio::use_awaitable);

Expand Down Expand Up @@ -192,23 +192,22 @@ class client {

auto connect_packet() -> async_mqtt::v5::connect_packet {
if (config_.value().username.empty() || config_.value().password.empty()) {
return async_mqtt::v5::connect_packet{ true,
std::chrono::seconds(100).count(),
config_.value().client_id,
async_mqtt::will(
mqtt_will_topic_,
async_mqtt::buffer(std::string_view{ mqtt_will_payload_ }),
{ async_mqtt::qos::at_least_once | async_mqtt::pub::retain::no }),
std::nullopt,
std::nullopt,
{ async_mqtt::property::session_expiry_interval{ 0 } } };
return async_mqtt::v5::connect_packet{
true,
std::chrono::seconds(100).count(),
config_.value().client_id,
async_mqtt::will(mqtt_will_topic_, async_mqtt::buffer(std::string_view{ mqtt_will_payload_ }),
{ async_mqtt::qos::at_least_once | async_mqtt::pub::retain::no }),
std::nullopt,
std::nullopt,
{ async_mqtt::property::session_expiry_interval{ 0 } }
};
}
return async_mqtt::v5::connect_packet{ true,
std::chrono::seconds(100).count(),
config_.value().client_id,
async_mqtt::will(
mqtt_will_topic_,
async_mqtt::buffer(std::string_view{ mqtt_will_payload_ }),
mqtt_will_topic_, async_mqtt::buffer(std::string_view{ mqtt_will_payload_ }),
{ async_mqtt::qos::at_least_once | async_mqtt::pub::retain::no }),
config_.value().username,
config_.value().password,
Expand Down
4 changes: 3 additions & 1 deletion libs/confman/inc/public/tfc/confman.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ class config {
auto operator->() const noexcept -> storage_t const* { return std::addressof(value()); }

/// \return storage_t as json string
[[nodiscard]] auto string() const -> std::expected<std::string, glz::error_ctx> { return glz::write_json(storage_.value()); }
[[nodiscard]] auto string() const -> std::expected<std::string, glz::error_ctx> {
return glz::write_json(storage_.value());
}

/// TODO can we do this differently, jsonforms requires object as root element
/// an example of failure would be confman<std::vector<int>> as the json schema root element would be array
Expand Down

0 comments on commit 0a94c98

Please sign in to comment.