7#ifndef LOGICALACCESS_PCSCREADERUNIT_HPP
8#define LOGICALACCESS_PCSCREADERUNIT_HPP
39 std::string getName()
const override;
45 void setName(
const std::string &name);
51 std::string getConnectedName()
override;
65 d_card_type = cardType;
77 bool waitInsertion(
unsigned int maxwait)
override;
87 bool waitRemoval(
unsigned int maxwait)
override;
96 bool connect()
override;
113 void disconnect()
override;
119 bool isConnected()
override;
125 bool connectToReader()
override;
130 void disconnectFromReader()
override;
136 const SCARDHANDLE &getHandle()
const;
142 unsigned long getActiveProtocol()
const;
157 std::shared_ptr<Chip> createChip(std::string type)
override;
163 std::shared_ptr<Chip> getSingleChip()
override;
169 std::vector<std::shared_ptr<Chip>> getChipList()
override;
183 std::string getReaderSerialNumber()
override;
197 virtual std::shared_ptr<PCSCReaderCardAdapter> getDefaultPCSCReaderCardAdapter();
204 virtual std::shared_ptr<ReaderCardAdapter> getReaderCardAdapter(std::string type);
210 void serialize(boost::property_tree::ptree &parentNode)
override;
216 void unSerialize(boost::property_tree::ptree &node)
override;
222 std::shared_ptr<ReaderUnitConfiguration> getConfiguration()
override;
228 void setConfiguration(std::shared_ptr<ReaderUnitConfiguration> config)
override;
235 virtual void changeReaderKey(std::shared_ptr<ReaderMemoryKeyStorage> keystorage,
244 return std::dynamic_pointer_cast<PCSCReaderUnitConfiguration>(getConfiguration());
247 std::shared_ptr<PCSCReaderProvider> getPCSCReaderProvider()
const;
249 static std::shared_ptr<PCSCReaderUnit>
250 createPCSCReaderUnit(
const std::string &readerName);
258 void makeProxy(std::shared_ptr<PCSCReaderUnit> readerUnit,
259 std::shared_ptr<PCSCReaderUnitConfiguration> readerUnitConfig);
268 virtual void getT_CL_ISOType(
bool &isTypeA,
bool &isTypeB);
281 std::shared_ptr<PCSCReaderUnit> getProxyReaderUnit()
const;
284 void setCardTechnologies(
const TechnoBitset &bitset)
override;
288 std::shared_ptr<LCDDisplay> getLCDDisplay()
override;
290 void setLCDDisplay(std::shared_ptr<LCDDisplay> d)
override;
292 std::shared_ptr<LEDBuzzerDisplay> getLEDBuzzerDisplay()
override;
294 void setLEDBuzzerDisplay(std::shared_ptr<LEDBuzzerDisplay> lbd)
override;
298 void beginTransaction();
300 void endTransaction(DWORD dwDisposition = SCARD_LEAVE_CARD);
306 void reset(
int action = 0);
315 bool reconnect(
int action = 0)
override;
326 std::shared_ptr<Chip> adjustChip(std::shared_ptr<Chip> c);
328 std::shared_ptr<ResultChecker> createDefaultResultChecker()
const override;
330 std::shared_ptr<CardProbe> createCardProbe()
override;
332 void configure_mifareplus_chip(std::shared_ptr<Chip> c,
333 std::shared_ptr<Commands> &commands,
334 std::shared_ptr<ResultChecker> &resultChecker)
const;
343 void detect_mifareplus_security_level(std::shared_ptr<Chip> c);
359 void setSingleChip(std::shared_ptr<Chip> chip);
364 std::shared_ptr<SAMChip> getSAMChip()
override;
369 void setSAMChip(std::shared_ptr<SAMChip> t)
override;
374 std::shared_ptr<ISO7816ReaderUnit> getSAMReaderUnit()
override;
379 void setSAMReaderUnit(std::shared_ptr<ISO7816ReaderUnit> t)
override;
389 std::tuple<SPtrStringVector, ReaderStateVector> prepare_poll_parameters();
395 void waitInsertion_create_proxy(
const std::string &reader_name);
404 virtual bool process_insertion(
const std::string &cardType,
unsigned int maxwait,
418 void teardown_pcsc_connection();
The ISO7816 reader unit class.
Definition: iso7816readerunit.hpp:25
The PC/SC reader unit class.
Definition: pcscreaderunit.hpp:23
std::string d_name
The reader unit name.
Definition: pcscreaderunit.hpp:348
std::shared_ptr< PCSCReaderUnit > d_proxyReaderUnit
The proxy reader unit.
Definition: pcscreaderunit.hpp:434
std::string d_connectedName
The reader unit connected name.
Definition: pcscreaderunit.hpp:353
virtual void cardConnected()
Definition: pcscreaderunit.hpp:274
std::shared_ptr< PCSCReaderUnitConfiguration > getPCSCConfiguration()
Get the PC/SC reader unit configuration.
Definition: pcscreaderunit.hpp:242
std::vector< std::shared_ptr< std::string > > SPtrStringVector
Definition: pcscreaderunit.hpp:382
std::unique_ptr< PCSCConnection > connection_
Definition: pcscreaderunit.hpp:424
void setCardType(std::string cardType) override
Set the card type.
Definition: pcscreaderunit.hpp:63
std::vector< SCARD_READERSTATE > ReaderStateVector
Definition: pcscreaderunit.hpp:383
ByteVector atr_
Definition: pcscreaderunit.hpp:429
std::vector< uint8_t > ByteVector
Definition: lla_fwd.hpp:80
PCSCReaderUnitType
The reader unit types.
Definition: pcscreaderunitconfiguration.hpp:54
ReaderServiceType
Definition: reader_service.hpp:10
uint32_t TechnoBitset
Definition: techno.hpp:25
std::shared_ptr< ReaderService > ReaderServicePtr
Definition: lla_fwd.hpp:67
PCSCShareMode
Share mode enumeration.
Definition: pcscreaderunitconfiguration.hpp:35
PC/SC Reader unit configuration.