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

The Mifare Ultralight commands class. More...

#include <mifareultralightcommands.hpp>

Inheritance diagram for logicalaccess::MifareUltralightCommands:
logicalaccess::Commands logicalaccess::ICommands logicalaccess::MifareUltralightOK5553Commands logicalaccess::MifareUltralightPCSCCommands logicalaccess::MifareUltralightCOmnikeyXX22Commands logicalaccess::MifareUltralightCPCSCCommands logicalaccess::MifareUltralightCACSACRCommands logicalaccess::MifareUltralightCOmnikeyXX21Commands logicalaccess::MifareUltralightCSpringCardCommands

Public Member Functions

 MifareUltralightCommands ()
 
 MifareUltralightCommands (std::string ct)
 
virtual ByteVector readPages (int start_page, int stop_page)
 Read several pages.
 
virtual void writePages (int start_page, int stop_page, const ByteVector &buf)
 Write several pages.
 
virtual void lockPage (int page)
 Set a page as read-only.
 
virtual ByteVector readPage (int page)=0
 Read a whole page.
 
virtual void writePage (int page, const ByteVector &buf)=0
 Write a whole page.
 
- Public Member Functions inherited from logicalaccess::Commands
 Commands ()=delete
 Constructor.
 
virtual ~Commands ()
 
std::shared_ptr< ChipgetChip () const override
 Get the chip.
 
virtual void setChip (std::shared_ptr< Chip > chip)
 Set the chip.
 
std::shared_ptr< ReaderCardAdaptergetReaderCardAdapter () 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.
 
- Public Member Functions inherited from logicalaccess::ICommands
virtual ~ICommands ()=default
 
virtual std::shared_ptr< ChipgetChip () const =0
 Get the chip.
 
virtual std::shared_ptr< ReaderCardAdaptergetReaderCardAdapter () const =0
 Get the reader/card adapter.
 

Protected Member Functions

virtual std::shared_ptr< MifareUltralightChipgetMifareUltralightChip ()
 
- Protected Member Functions inherited from logicalaccess::Commands
 Commands (std::string commandtype)
 Constructor.
 

Additional Inherited Members

- Protected Attributes inherited from logicalaccess::Commands
std::shared_ptr< ReaderCardAdapterd_readerCardAdapter
 The reader/card adapter.
 
std::weak_ptr< Chipd_chip
 The chip.
 
std::string d_commandtype
 The command type.
 

Detailed Description

The Mifare Ultralight commands class.

Constructor & Destructor Documentation

◆ MifareUltralightCommands() [1/2]

logicalaccess::MifareUltralightCommands::MifareUltralightCommands ( )
inline

◆ MifareUltralightCommands() [2/2]

logicalaccess::MifareUltralightCommands::MifareUltralightCommands ( std::string  ct)
inlineexplicit

Member Function Documentation

◆ getMifareUltralightChip()

std::shared_ptr< MifareUltralightChip > logicalaccess::MifareUltralightCommands::getMifareUltralightChip ( )
protectedvirtual

◆ lockPage()

void logicalaccess::MifareUltralightCommands::lockPage ( int  page)
virtual

Set a page as read-only.

Parameters
pageThe page to lock.

◆ readPage()

virtual ByteVector logicalaccess::MifareUltralightCommands::readPage ( int  page)
pure virtual

Read a whole page.

Parameters
sectorThe page number, from 0 to 15.
bufA buffer to fill with the data of the page.
buflenThe length of buffer. Must be at least 4 bytes long or the call will fail.
Returns
The number of bytes red, or a negative value on error.

Implemented in logicalaccess::MifareUltralightOK5553Commands, and logicalaccess::MifareUltralightPCSCCommands.

◆ readPages()

ByteVector logicalaccess::MifareUltralightCommands::readPages ( int  start_page,
int  stop_page 
)
virtual

Read several pages.

Parameters
start_pageThe start page number, from 0 to stop_page.
stop_pageThe stop page number, from start_page to 15.
bufThe buffer to fill with the data.
buflenThe length of buf. Must be at least (stop_page - start_page + 1) * 4 bytes long.
Returns
The number of bytes red, or a negative value on error.

◆ writePage()

virtual void logicalaccess::MifareUltralightCommands::writePage ( int  page,
const ByteVector buf 
)
pure virtual

Write a whole page.

Parameters
sectorThe page number, from 0 to 15.
bufA buffer to from which to copy the data.
buflenThe length of buffer. Must be at least 4 bytes long or the call will fail.
Returns
The number of bytes written, or a negative value on error.

Implemented in logicalaccess::MifareUltralightOK5553Commands, logicalaccess::MifareUltralightCOmnikeyXX22Commands, logicalaccess::MifareUltralightCPCSCCommands, and logicalaccess::MifareUltralightPCSCCommands.

◆ writePages()

void logicalaccess::MifareUltralightCommands::writePages ( int  start_page,
int  stop_page,
const ByteVector buf 
)
virtual

Write several pages.

Parameters
start_pageThe start page number, from 0 to stop_page.
stop_pageThe stop page number, from start_page to 15.
bufThe buffer to fill with the data.
buflenThe length of buf. Must be at least (stop_page - start_page + 1) * 4 bytes long.
Returns
The number of bytes red, or a negative value on error.

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