LibLogicalAccess  2.5.0
An Open Source RFID Library
Loading...
Searching...
No Matches
memorycontroltlv.hpp
Go to the documentation of this file.
1
7#ifndef LOGICALACCESS_MEMORYCONTROLTLV_HPP
8#define LOGICALACCESS_MEMORYCONTROLTLV_HPP
9
11#include <cmath>
12
13namespace logicalaccess
14{
15 #define TLV_RFU 0x00
16
17 class LLA_CORE_API MemoryControlTlv : public NfcData
18 {
19 public:
22 MemoryControlTlv(int byteAddr, unsigned char size);
24 int getByteAddr() const;
25 void setByteAddr(int addr);
26 unsigned char getPageAddr() const;
27 void setPageAddr(unsigned char pageAddr);
28 unsigned char getOffset() const;
29 void setOffset(unsigned char offset);
30 unsigned char getSize() const;
31 void setSize(unsigned char size);
32 unsigned char getBytesPerPage() const;
33 void setBytesPerPage(unsigned char bytesPerPage);
34
35
36 void serialize(boost::property_tree::ptree &parentNode) override;
37 void unSerialize(boost::property_tree::ptree &node) override;
38 std::string getDefaultXmlNodeName() const override;
39
40 static std::shared_ptr<MemoryControlTlv> tlvToMemoryControl(ByteVector tlv);
41
42 static ByteVector memoryControlToTLV(std::shared_ptr<MemoryControlTlv> data);
43
44 private:
45 void calculateReservedPosition();
47 unsigned char _pageAddr;
48 unsigned char _offset;
49 unsigned char _size;
50 unsigned char _bytesPerPage;
51 };
52
53}
54
55#endif
Definition: memorycontroltlv.hpp:18
unsigned char _offset
Definition: memorycontroltlv.hpp:48
unsigned char _pageAddr
Definition: memorycontroltlv.hpp:47
unsigned char _bytesPerPage
Definition: memorycontroltlv.hpp:50
int _byteAddr
Definition: memorycontroltlv.hpp:46
unsigned char _size
Definition: memorycontroltlv.hpp:49
Definition: nfcdata.hpp:16
std::vector< uint8_t > ByteVector
Definition: lla_fwd.hpp:80
Definition: asn1.hpp:9