LibLogicalAccess
2.5.0
An Open Source RFID Library
|
#include <MifarePlusSL0Commands.hpp>
Public Member Functions | |
MifarePlusSL0Commands () | |
MifarePlusSL0Commands (std::string ct) | |
virtual | ~MifarePlusSL0Commands () |
int | detectSecurityLevel () const |
bool | probeLevel3 () const |
bool | isLevel0 () const |
bool | writePerso (uint8_t hex_addr_1, uint8_t hex_addr_2, const std::array< uint8_t, 16 > &data) const |
bool | writePerso (const MifarePlusBlockKeyLocation &location, const std::array< uint8_t, 16 > &data) const |
bool | commitPerso () const |
bool | is4K () const |
![]() | |
Commands ()=delete | |
Constructor. | |
virtual | ~Commands () |
std::shared_ptr< Chip > | getChip () const override |
Get the chip. | |
virtual void | setChip (std::shared_ptr< Chip > chip) |
Set the chip. | |
std::shared_ptr< ReaderCardAdapter > | getReaderCardAdapter () const override |
Get the reader/card adapter. | |
virtual void | setReaderCardAdapter (std::shared_ptr< ReaderCardAdapter > adapter) |
Set the reader/card adapter. | |
virtual const std::string & | getCmdType () const |
Get the cmd name. | |
virtual void | setCmdType (const std::string &command_type) |
Set the cmd name. | |
![]() | |
virtual | ~ICommands ()=default |
virtual std::shared_ptr< Chip > | getChip () const =0 |
Get the chip. | |
virtual std::shared_ptr< ReaderCardAdapter > | getReaderCardAdapter () const =0 |
Get the reader/card adapter. | |
Static Protected Member Functions | |
static bool | is_trailing_block (uint8_t hex_addr1, uint8_t hex_addr2) |
static bool | validate_access_bytes (const std::array< uint8_t, 16 > &data) |
Additional Inherited Members | |
![]() | |
Commands (std::string commandtype) | |
Constructor. | |
![]() | |
std::shared_ptr< ReaderCardAdapter > | d_readerCardAdapter |
The reader/card adapter. | |
std::weak_ptr< Chip > | d_chip |
The chip. | |
std::string | d_commandtype |
The command type. | |
This implements commands that can be use to personalize the card when it is in security level 0.
|
inline |
|
inlineexplicit |
|
inlinevirtual |
bool MifarePlusSL0Commands::commitPerso | ( | ) | const |
Send the COMMIT PERSO command, upgrading the card to level 1 or level 3 if it succeed.
int MifarePlusSL0Commands::detectSecurityLevel | ( | ) | const |
bool MifarePlusSL0Commands::is4K | ( | ) | const |
Attempt to deduce if the card is 4K or not.
|
staticprotected |
Check whether or not this block is a sector trailer block.
bool MifarePlusSL0Commands::isLevel0 | ( | ) | const |
Attempt to WRITE PERSO on the card to check if it is a level 0 card.
bool MifarePlusSL0Commands::probeLevel3 | ( | ) | const |
Probe the card, attempting to detect if it potentially is a level 3 card.
Send the "first authentication" command and check if it succeed. If the card is SL3 it should succeed (even though we won't continue the authentication) otherwise it will fail.
|
staticprotected |
Verify that the access bits are valid. This is a partial verification and does not (yet ?) guarantee that the access conditions are fully safe.
bool MifarePlusSL0Commands::writePerso | ( | const MifarePlusBlockKeyLocation & | location, |
const std::array< uint8_t, 16 > & | data | ||
) | const |
WRITE PERSO using an enum to chose the location.
bool MifarePlusSL0Commands::writePerso | ( | uint8_t | hex_addr_1, |
uint8_t | hex_addr_2, | ||
const std::array< uint8_t, 16 > & | data | ||
) | const |
Issue the WRITE PERSO command, targeting location at hex_addr_1 hex_addr_2