Skip to content

Commit

Permalink
Add some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cziter15 committed Feb 16, 2025
1 parent 13340f3 commit bc5b1d5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/ksf/comp/ksMqttConfigProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace ksf::comps
@brief Retrieves MQTT parameters.
This method reads the configuation file to retrieve MQTT broker information from file.
The config contains data like MQTT address, device prefix, optional: credentials and expected SSL fingerprint.
The config contains data like MQTT address, device prefix, optional: credentials and expected SSL fingerprint.
*/
void readParams() override;

Expand Down
4 changes: 4 additions & 0 deletions src/ksf/comp/ksMqttConnector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ namespace ksf::comps

void ksMqttConnector::setupConnection(const std::string broker, const std::string& port, std::string login, std::string password, std::string prefix, const std::string& fingerprint)
{
/*
If present, fingerprint is used in the process of creating secure MQTT connection.
If fingerprint is empty, the connection will be insecure.
*/
if (!fingerprint.empty())
{
auto secureClient{std::make_unique<ksMqttConnectorNetClientSecure_t>()};
Expand Down
18 changes: 6 additions & 12 deletions src/ksf/misc/ksCertUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,14 @@
#include <string>
#include <stdint.h>

#if (defined(ESP32))
#if ESP_ARDUINO_VERSION_MAJOR >= 3
#define ksCertUtilsNetCLientSecure_t NetworkClientSecure
#else
#define ksCertUtilsNetCLientSecure_t WiFiClientSecure
#endif
class ksCertUtilsNetCLientSecure_t;
#elif defined(ESP8266)
namespace BearSSL{class WiFiClientSecure;}
#define ksCertUtilsNetCLientSecure_t BearSSL::WiFiClientSecure
#if (defined(ESP32) && ESP_ARDUINO_VERSION_MAJOR >= 3)
#define ksCertUtilsNetCLientSecure_t NetworkClientSecure
#else
#error Platform not implemented.
#define ksCertUtilsNetCLientSecure_t WiFiClientSecure
#endif

class ksCertUtilsNetCLientSecure_t;

namespace ksf::misc
{
/*!
Expand Down Expand Up @@ -127,4 +121,4 @@ namespace ksf::misc

using ksCertFingerprintHolder = ksCertFingerprintESP8266;
#endif
}
}

0 comments on commit bc5b1d5

Please sign in to comment.