ESPHome 2025.9.0-dev
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::api {
7
8#ifdef USE_API_NOISE
9using psk_t = std::array<uint8_t, 32>;
10
12 public:
13 void set_psk(psk_t psk) {
14 this->psk_ = psk;
15 bool has_psk = false;
16 for (auto i : psk) {
17 has_psk |= i;
18 }
19 this->has_psk_ = has_psk;
20 }
21 const psk_t &get_psk() const { return this->psk_; }
22 bool has_psk() const { return this->has_psk_; }
23
24 protected:
26 bool has_psk_{false};
27};
28#endif // USE_API_NOISE
29
30} // namespace esphome::api
const psk_t & get_psk() const
std::array< uint8_t, 32 > psk_t