6 static const char *
const TAG =
"nfc.ndef_record";
9 this->
payload_ = std::string(payload_data.begin(), payload_data.end());
13 std::vector<uint8_t> data;
18 size_t payload_length = payload_data.size();
22 data.push_back(this->
type_.length());
24 if (payload_length <= 255) {
25 data.push_back(payload_length);
29 data.push_back((payload_length >> 8) & 0xFF);
30 data.push_back(payload_length & 0xFF);
33 if (!this->
id_.empty()) {
34 data.push_back(this->
id_.length());
37 data.insert(data.end(), this->
type_.begin(), this->
type_.end());
39 if (!this->
id_.empty()) {
40 data.insert(data.end(), this->
id_.begin(), this->
id_.end());
43 data.insert(data.end(), payload_data.begin(), payload_data.end());
48 uint8_t value = this->
tnf_ & 0b00000111;
55 if (payload_size <= 255) {
58 if (!this->
id_.empty()) {
virtual std::vector< uint8_t > get_encoded_payload()
std::vector< uint8_t > encode(bool first, bool last)
uint8_t create_flag_byte(bool first, bool last, size_t payload_size)
Implementation of SPI Controller mode.