LibLogicalAccess  2.5.0
An Open Source RFID Library
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
logicalaccess::MifareChip Class Reference

The Mifare base chip class. More...

#include <mifarechip.hpp>

Inheritance diagram for logicalaccess::MifareChip:
logicalaccess::Chip logicalaccess::IChip logicalaccess::Mifare1KChip logicalaccess::Mifare4KChip logicalaccess::MifarePlusSL1Chip logicalaccess::MifarePlusSL1_2kChip logicalaccess::MifarePlusSL1_4kChip

Public Member Functions

 MifareChip ()
 Constructor for generic Mifare.
 
 MifareChip (std::string cardtype)
 Constructor for generic Mifare.
 
virtual ~MifareChip ()
 Destructor.
 
std::string getGenericCardType () const override
 Get the generic card type.
 
std::shared_ptr< LocationNodegetRootLocationNode () override
 Get the root location node.
 
unsigned int getNbSectors () const
 Get number of sectors.
 
std::shared_ptr< CardServicegetService (CardServiceType serviceType) override
 Get a card service for this card provider.
 
std::shared_ptr< AccessInfocreateAccessInfo () const override
 Create default Mifare access informations.
 
std::shared_ptr< LocationcreateLocation () const override
 Create default Mifare location.
 
std::shared_ptr< MifareCommandsgetMifareCommands () const
 Get the Mifare commands.
 
- Public Member Functions inherited from logicalaccess::Chip
 Chip ()
 Constructor.
 
 Chip (std::string cardtype)
 Constructor.
 
virtual ~Chip ()
 Destructor.
 
const std::string & getCardType () const override
 Get the card type of the chip.
 
std::string getGenericCardType () const override
 Get the generic card type.
 
virtual std::shared_ptr< LocationNodegetRootLocationNode ()
 Get the root location node.
 
std::shared_ptr< CommandsgetCommands () const override
 Get the commands.
 
void setCommands (std::shared_ptr< Commands > commands)
 Set commands.
 
ByteVector getChipIdentifier () const override
 Get the chip identifier.
 
virtual void setChipIdentifier (ByteVector identifier)
 Set the chip identifier.
 
ChipPowerStatus getPowerStatus () const
 Get the chip power status.
 
void setPowerStatus (ChipPowerStatus powerStatus)
 Set the chip power status.
 
unsigned char getReceptionLevel () const
 Get the chip reception level.
 
void setReceptionLevel (unsigned char receptionLevel)
 Set the chip reception level.
 
virtual std::shared_ptr< AccessInfocreateAccessInfo () const
 Create default access informations.
 
virtual std::shared_ptr< LocationcreateLocation () const
 Create default location.
 
std::shared_ptr< CardServicegetService (CardServiceType serviceType) override
 Get a card service for this chip.
 
template<typename T >
std::shared_ptr< T > getService ()
 
bool operator< (const Chip &chip) const
 
- Public Member Functions inherited from logicalaccess::IChip
virtual ~IChip ()=default
 
virtual const std::string & getCardType () const =0
 Get the card type of the chip.
 
virtual std::string getGenericCardType () const =0
 Get the generic card type.
 
virtual std::shared_ptr< CommandsgetCommands () const =0
 Get the commands.
 
virtual ByteVector getChipIdentifier () const =0
 Get the chip identifier.
 
virtual std::shared_ptr< CardServicegetService (CardServiceType serviceType)=0
 Get a card service for this chip.
 

Static Public Member Functions

static void addSectorNode (std::shared_ptr< LocationNode > rootNode, int sector)
 Add a sector node to a root node.
 
static void addBlockNode (std::shared_ptr< LocationNode > rootNode, int sector, unsigned char block)
 Add a block node to a root node.
 

Protected Member Functions

 MifareChip (std::string cardtype, unsigned int nbSectors)
 Constructor.
 

Protected Attributes

unsigned int d_nbSectors
 The number of sectors in the Mifare card.
 
- Protected Attributes inherited from logicalaccess::Chip
std::string d_cardtype
 The card type of the profile.
 
ByteVector d_chipIdentifier
 The chip identifier.
 
ChipPowerStatus d_powerStatus
 The chip power status. Most chip doesn't have his own power supply.
 
std::shared_ptr< Commandsd_commands
 Commands object.
 
unsigned char d_receptionLevel
 The chip reception level.
 

Detailed Description

The Mifare base chip class.

Constructor & Destructor Documentation

◆ MifareChip() [1/3]

logicalaccess::MifareChip::MifareChip ( )

Constructor for generic Mifare.

◆ MifareChip() [2/3]

logicalaccess::MifareChip::MifareChip ( std::string  cardtype)
explicit

Constructor for generic Mifare.

◆ ~MifareChip()

logicalaccess::MifareChip::~MifareChip ( )
virtual

Destructor.

◆ MifareChip() [3/3]

logicalaccess::MifareChip::MifareChip ( std::string  cardtype,
unsigned int  nbSectors 
)
protected

Constructor.

Parameters
cardtypeThe card type (Mifare 1K, Mifare 4K, ...).
nbSectorsThe number of sectors in the card.

Member Function Documentation

◆ addBlockNode()

void logicalaccess::MifareChip::addBlockNode ( std::shared_ptr< LocationNode rootNode,
int  sector,
unsigned char  block 
)
static

Add a block node to a root node.

Parameters
rootNodeThe root node.
sectorThe sector.
blockThe block.

◆ addSectorNode()

void logicalaccess::MifareChip::addSectorNode ( std::shared_ptr< LocationNode rootNode,
int  sector 
)
static

Add a sector node to a root node.

Parameters
rootNodeThe root node.
sectorThe sector.

◆ createAccessInfo()

std::shared_ptr< AccessInfo > logicalaccess::MifareChip::createAccessInfo ( ) const
overridevirtual

Create default Mifare access informations.

Returns
Default Mifare access informations.

Reimplemented from logicalaccess::Chip.

Reimplemented in logicalaccess::MifarePlusSL1Chip.

◆ createLocation()

std::shared_ptr< Location > logicalaccess::MifareChip::createLocation ( ) const
overridevirtual

Create default Mifare location.

Returns
Default Mifare location.

Reimplemented from logicalaccess::Chip.

◆ getGenericCardType()

std::string logicalaccess::MifareChip::getGenericCardType ( ) const
inlineoverridevirtual

Get the generic card type.

Returns
The generic card type.

Reimplemented from logicalaccess::Chip.

Reimplemented in logicalaccess::MifarePlusSL1Chip.

◆ getMifareCommands()

std::shared_ptr< MifareCommands > logicalaccess::MifareChip::getMifareCommands ( ) const
inline

Get the Mifare commands.

Returns
The Mifare commands.

◆ getNbSectors()

unsigned int logicalaccess::MifareChip::getNbSectors ( ) const

Get number of sectors.

◆ getRootLocationNode()

std::shared_ptr< LocationNode > logicalaccess::MifareChip::getRootLocationNode ( )
overridevirtual

Get the root location node.

Returns
The root location node.

Reimplemented from logicalaccess::Chip.

Reimplemented in logicalaccess::MifarePlusSL1_4kChip.

◆ getService()

std::shared_ptr< CardService > logicalaccess::MifareChip::getService ( CardServiceType  serviceType)
overridevirtual

Get a card service for this card provider.

Parameters
serviceTypeThe card service type.
Returns
The card service.

Reimplemented from logicalaccess::Chip.

Reimplemented in logicalaccess::MifarePlusSL1Chip.

Member Data Documentation

◆ d_nbSectors

unsigned int logicalaccess::MifareChip::d_nbSectors
protected

The number of sectors in the Mifare card.


The documentation for this class was generated from the following files: