7#ifndef LOGICALACCESS_READERUNIT_HPP
8#define LOGICALACCESS_READERUNIT_HPP
11#include <boost/property_tree/ptree_fwd.hpp>
20#define PLUGINOBJECT_MAXLEN 64
26class ReaderCardAdapter;
28class CardsFormatComposite;
29class ReaderFormatComposite;
41 public std::enable_shared_from_this<ReaderUnit>
44 using XmlSerializable::serialize;
45 using XmlSerializable::unSerialize;
61 std::string getRPType()
const;
91 virtual bool waitInsertion(
const ByteVector &identifier,
unsigned int maxwait);
129 virtual std::shared_ptr<Chip> createChip(std::string type);
137 virtual std::shared_ptr<Chip> createChip(std::string type,
145 virtual ByteVector getNumber(std::shared_ptr<Chip> chip);
165 virtual ByteVector getNumber(std::shared_ptr<Chip> chip,
166 std::shared_ptr<CardsFormatComposite> composite);
175 static uint64_t getFormatedNumber(
const ByteVector &number,
int padding);
182 static std::string getFormatedNumber(
const ByteVector &number);
239 virtual std::shared_ptr<ReaderUnitConfiguration> getConfiguration();
245 virtual void setConfiguration(std::shared_ptr<ReaderUnitConfiguration> config);
251 virtual std::shared_ptr<ReaderCardAdapter> getDefaultReaderCardAdapter();
258 setDefaultReaderCardAdapter(std::shared_ptr<ReaderCardAdapter> defaultRca);
264 virtual std::shared_ptr<DataTransport> getDataTransport()
const;
270 virtual void setDataTransport(std::shared_ptr<DataTransport> dataTransport);
282 std::string getDefaultXmlNodeName()
const override;
288 void serialize(boost::property_tree::ptree &node)
override;
294 void unSerialize(boost::property_tree::ptree &node)
override;
302 void unSerialize(boost::property_tree::ptree &node,
303 const std::string &rootNode)
override;
311 return d_readerProvider.lock();
320 d_readerProvider = provider;
327 virtual std::shared_ptr<LCDDisplay> getLCDDisplay();
333 virtual void setLCDDisplay(std::shared_ptr<LCDDisplay> d);
339 virtual std::shared_ptr<LEDBuzzerDisplay> getLEDBuzzerDisplay();
345 virtual void setLEDBuzzerDisplay(std::shared_ptr<LEDBuzzerDisplay> lbd);
352 virtual void setCardTechnologies(
const TechnoBitset &bitset);
425 virtual std::shared_ptr<ResultChecker> createDefaultResultChecker()
const;
436 virtual std::shared_ptr<CardProbe> createCardProbe();
The card types.
Definition: readerunit.hpp:42
virtual void setCardType(std::string cardType)=0
Set the forced card type.
std::string d_readerProviderType
The associated reader provider type for the reader unit configuration.
Definition: readerunit.hpp:385
std::string getCardType() const
Get the forced card type.
Definition: readerunit.hpp:113
std::weak_ptr< ReaderProvider > d_readerProvider
The associated reader provider for the reader unit.
Definition: readerunit.hpp:395
std::shared_ptr< DataTransport > d_dataTransport
The data transport layer.
Definition: readerunit.hpp:447
virtual bool connectToReader()=0
Connect to the reader. Implicit connection on first command sent.
virtual std::string getName() const =0
Get the reader unit name.
virtual void disconnectFromReader()=0
Disconnect from reader.
virtual bool connect()=0
Connect to the card.
std::shared_ptr< ReaderUnitConfiguration > d_readerUnitConfig
The reader unit configuration.
Definition: readerunit.hpp:400
virtual bool reconnect(int action=0)
Reconnect to the card with the currently active share mode on the same reader.
Definition: readerunit.hpp:198
virtual std::string getReaderSerialNumber()=0
Get a string hexadecimal representation of the reader serial number.
virtual std::string getConnectedName()
Get the connected reader unit name.
Definition: readerunit.hpp:230
virtual bool waitInsertion(unsigned int maxwait)=0
Wait for a card insertion.
std::string d_card_type
The forced card type.
Definition: readerunit.hpp:390
std::shared_ptr< LCDDisplay > d_lcdDisplay
The inserted chip.
Definition: readerunit.hpp:410
virtual void disconnect()=0
Disconnect from the card.
std::shared_ptr< ReaderCardAdapter > d_defaultReaderCardAdapter
The default reader/card adapter.
Definition: readerunit.hpp:442
std::shared_ptr< LEDBuzzerDisplay > d_ledBuzzerDisplay
The inserted chip.
Definition: readerunit.hpp:415
std::shared_ptr< Chip > d_insertedChip
The inserted chip.
Definition: readerunit.hpp:405
virtual std::shared_ptr< Chip > getSingleChip()=0
Get the first and/or most accurate chip found.
virtual bool isConnected()=0
Check if the card is connected.
std::shared_ptr< ReaderProvider > getReaderProvider() const
Get the associated reader provider.
Definition: readerunit.hpp:309
void setReaderProvider(std::weak_ptr< ReaderProvider > provider)
Set the associated reader provider.
Definition: readerunit.hpp:318
virtual bool waitRemoval(unsigned int maxwait)=0
Wait for a card removal.
virtual std::vector< std::shared_ptr< Chip > > getChipList()=0
Get chip available in the RFID rang.
A Xml Serializable base class. Add Xml serialization to a class.
Definition: xmlserializable.hpp:54
std::vector< uint8_t > ByteVector
Definition: lla_fwd.hpp:80
ReaderServiceType
Definition: reader_service.hpp:10
uint32_t TechnoBitset
Definition: techno.hpp:25
std::shared_ptr< ReaderService > ReaderServicePtr
Definition: lla_fwd.hpp:67