Skip to content

HID Omnikey readers (PC SC) examples

Adrien JUND edited this page Aug 10, 2017 · 1 revision

HID Omnikey xx21 readers examples

HID Omnikey readers are fully PC/SC compliant readers., it's why the code bellow is now dependent to Omnikey readers.

See this chapter to know how to initialize an Omnikey reader connection.

Configure your project

Using specific reader functionality means you cannot use the generic abstraction layer / plug-in architecture provided by the core library to achieve your goal.
Your project has to include PC/SC plug-in headers and link with it directly.

Add the following include to your code file:

#include <pcsc/readers/omnikeyxx21readerunit.hpp>

On Windows, link with ''PCSCReaders.lib''.
On Linux, link with ''libPCSCReaders.so''.

Examples

Omnikey reader configuration

std::shared_ptr<logicalaccess::OmnikeyXX21ReaderUnit> okru = std::dynamic_pointer_cast<logicalaccess::OmnikeyXX21ReaderUnit>(readerConfig->getReaderUnit());

if (okru)
{
    std::shared_ptr<logicalaccess::OmnikeyXX21ReaderUnitConfiguration> okruconfig = okru->getOmnikeyXX21Configuration();
    // Force disable the secure mode
    okru->setUseSecureMode(false);
}
else
{
    std::cout << "The reader is not an Omnikey xx21 reader." << std::endl;
}

Get the chip identifier (CSN or UID)

See this chapter.

Mifare Classic

See mifare-classic-examples.

Mifare DESFire

See mifare-desfire-examples.

Mifare DESFire EV1

See mifare-desfire-ev1-examples.

HID iClass

See hid-iclass-examples.