LibLogicalAccess  2.5.0
An Open Source RFID Library
Loading...
Searching...
No Matches
MifarePlusSL0Commands.hpp
Go to the documentation of this file.
1//
2// Created by xaqq on 6/12/15.
3//
4
5#ifndef LIBLOGICALACCESS_MIFAREPLUSUTILS_H
6#define LIBLOGICALACCESS_MIFAREPLUSUTILS_H
7
9#include <logicalaccess/plugins/cards/mifareplus/lla_cards_mifareplus_api.hpp>
10#include <array>
11
12namespace logicalaccess
13{
14#define CMD_MIFAREPLUSSL0 "MifarePlusSL0"
15
16enum LLA_CARDS_MIFAREPLUS_API MifarePlusBlockKeyLocation : uint16_t
17{
18 MF_CARD_MASTER_KEY = 0x9000,
23};
24
29class LLA_CARDS_MIFAREPLUS_API MifarePlusSL0Commands : public Commands
30{
31 public:
34 {
35 }
36
37 explicit MifarePlusSL0Commands(std::string ct)
38 : Commands(ct)
39 {
40 }
41
43 {
44 }
45 int detectSecurityLevel() const;
46
55 bool probeLevel3() const;
56
63 bool isLevel0() const;
64
69 bool writePerso(uint8_t hex_addr_1, uint8_t hex_addr_2,
70 const std::array<uint8_t, 16> &data) const;
71
75 bool writePerso(const MifarePlusBlockKeyLocation &location,
76 const std::array<uint8_t, 16> &data) const;
77
82 bool commitPerso() const;
83
87 bool is4K() const;
88
89 protected:
93 static bool is_trailing_block(uint8_t hex_addr1, uint8_t hex_addr2);
94
100 static bool validate_access_bytes(const std::array<uint8_t, 16> &data);
101};
102}
103
104#endif // LIBLOGICALACCESS_MIFAREPLUSUTILS_H
#define CMD_MIFAREPLUSSL0
Definition: MifarePlusSL0Commands.hpp:14
The base commands class for all card commands.
Definition: commands.hpp:21
Definition: MifarePlusSL0Commands.hpp:30
virtual ~MifarePlusSL0Commands()
Definition: MifarePlusSL0Commands.hpp:42
MifarePlusSL0Commands()
Definition: MifarePlusSL0Commands.hpp:32
MifarePlusSL0Commands(std::string ct)
Definition: MifarePlusSL0Commands.hpp:37
Commands.
Definition: asn1.hpp:9
enum LLA_CARDS_MIFAREPLUS_API MF_L1_CARD_AUTH_KEY
Definition: MifarePlusSL0Commands.hpp:22
enum LLA_CARDS_MIFAREPLUS_API MF_CARD_CONFIGURATION_KEY
Definition: MifarePlusSL0Commands.hpp:19
enum LLA_CARDS_MIFAREPLUS_API MF_L3_SWITCH_KEY
Definition: MifarePlusSL0Commands.hpp:21
enum LLA_CARDS_MIFAREPLUS_API MF_L2_SWITCH_KEY
Definition: MifarePlusSL0Commands.hpp:20
enum LLA_CARDS_MIFAREPLUS_API MifarePlusBlockKeyLocation
Definition: MifarePlusSL0Commands.hpp:16