Add initial ntag and nfc implementation

This commit is contained in:
GaryOderNichts 2024-05-04 14:49:23 +02:00
parent 84e78088fb
commit 1c6b209692
21 changed files with 2927 additions and 47 deletions

View file

@ -0,0 +1,37 @@
#pragma once
#include <cstdint>
#include <span>
#include <vector>
class TLV
{
public:
enum Tag
{
TAG_NULL = 0x00,
TAG_LOCK_CTRL = 0x01,
TAG_MEM_CTRL = 0x02,
TAG_NDEF = 0x03,
TAG_PROPRIETARY = 0xFD,
TAG_TERMINATOR = 0xFE,
};
public:
TLV();
TLV(Tag tag, std::vector<std::byte> value);
virtual ~TLV();
static std::vector<TLV> FromBytes(const std::span<std::byte>& data);
std::vector<std::byte> ToBytes() const;
Tag GetTag() const;
const std::vector<std::byte>& GetValue() const;
void SetTag(Tag tag);
void SetValue(const std::span<const std::byte>& value);
private:
Tag mTag;
std::vector<std::byte> mValue;
};