ESPHome 2025.5.0
Loading...
Searching...
No Matches
api_noise_context.h
Go to the documentation of this file.
1#pragma once
2#include <array>
3#include <cstdint>
5
6namespace esphome {
7namespace api {
8
9#ifdef USE_API_NOISE
10using psk_t = std::array<uint8_t, 32>;
11
13 public:
14 void set_psk(psk_t psk) {
15 this->psk_ = psk;
16 bool has_psk = false;
17 for (auto i : psk) {
18 has_psk |= i;
19 }
20 this->has_psk_ = has_psk;
21 }
22 const psk_t &get_psk() const { return this->psk_; }
23 bool has_psk() const { return this->has_psk_; }
24
25 protected:
27 bool has_psk_{false};
28};
29#endif // USE_API_NOISE
30
31} // namespace api
32} // namespace esphome
const psk_t & get_psk() const
std::array< uint8_t, 32 > psk_t
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7