ESPHome 2025.5.0
Loading...
Searching...
No Matches
binary_sensor.h
Go to the documentation of this file.
1#pragma once
2
8
9namespace esphome {
10namespace nfc {
11
13 public Component,
14 public NfcTagListener,
15 public Parented<Nfcc> {
16 public:
17 void setup() override;
18 void dump_config() override;
19
20 void set_ndef_match_string(const std::string &str);
21 void set_tag_name(const std::string &str);
22 void set_uid(const std::vector<uint8_t> &uid);
23
24 bool tag_match_ndef_string(const std::shared_ptr<NdefMessage> &msg);
25 bool tag_match_tag_name(const std::shared_ptr<NdefMessage> &msg);
26 bool tag_match_uid(const std::vector<uint8_t> &data);
27
28 void tag_off(NfcTag &tag) override;
29 void tag_on(NfcTag &tag) override;
30
31 protected:
32 bool match_tag_name_{false};
33 std::string match_string_;
34 std::vector<uint8_t> uid_;
35};
36
37} // namespace nfc
38} // namespace esphome
Helper class to easily give an object a parent of type T.
Definition helpers.h:538
Base class for all binary_sensor-type classes.
bool tag_match_tag_name(const std::shared_ptr< NdefMessage > &msg)
bool tag_match_uid(const std::vector< uint8_t > &data)
void tag_on(NfcTag &tag) override
void set_tag_name(const std::string &str)
std::vector< uint8_t > uid_
void set_ndef_match_string(const std::string &str)
void set_uid(const std::vector< uint8_t > &uid)
void tag_off(NfcTag &tag) override
bool tag_match_ndef_string(const std::shared_ptr< NdefMessage > &msg)
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7