6 static const char *
const TAG =
"nfc.helpers";
15 auto records = message->get_records();
16 for (
const auto &record : records) {
17 std::string payload = record->get_payload();
18 size_t pos = payload.find(HA_TAG_ID_PREFIX);
19 if (pos != std::string::npos) {
20 return payload.substr(pos +
sizeof(HA_TAG_ID_PREFIX) - 1);
27 static const char ALPHANUM[] =
"0123456789abcdef";
28 std::string uri = HA_TAG_ID_PREFIX;
29 for (
int i = 0; i < 8; i++) {
33 for (
int j = 0; j < 3; j++) {
34 for (
int i = 0; i < 4; i++) {
39 for (
int i = 0; i < 12; i++) {
42 ESP_LOGD(
"pn7160",
"Payload to be written: %s", uri.c_str());
const std::shared_ptr< NdefMessage > & get_ndef_message()
bool has_ha_tag_ndef(NfcTag &tag)
uint32_t random_uint32()
Return a random 32-bit unsigned integer.
Implementation of SPI Controller mode.
std::string get_random_ha_tag_ndef()
std::string get_ha_tag_ndef(NfcTag &tag)