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

A FASC-N 200 bit format class. More...

#include <fascn200bitformat.hpp>

Inheritance diagram for logicalaccess::FASCN200BitFormat:
logicalaccess::StaticFormat logicalaccess::Format logicalaccess::XmlSerializable

Public Member Functions

 FASCN200BitFormat ()
 Constructor.
 
virtual ~FASCN200BitFormat ()
 Destructor.
 
unsigned short getAgencyCode () const
 Get the agency code.
 
void setAgencyCode (unsigned short agencyCode)
 Set the agency code.
 
unsigned short getSystemCode () const
 Get the system code.
 
void setSystemCode (unsigned short systemCode)
 Set the system code.
 
unsigned char getSerieCode () const
 Get the serie code.
 
void setSerieCode (unsigned char serieCode)
 Set the serie code.
 
unsigned char getCredentialCode () const
 Get the credential code.
 
void setCredentialCode (unsigned char credentialCode)
 Set the credential code.
 
unsigned long long getPersonIdentifier () const
 Get the person identifier.
 
void setPersonIdentifier (unsigned long long personIdentifier)
 Set the person identifier.
 
FASCNOrganizationalCategory getOrganizationalCategory () const
 Get the organizational category.
 
void setOrganizationalCategory (FASCNOrganizationalCategory organizationalCategory)
 Set the organizational category.
 
unsigned short getOrganizationalIdentifier () const
 Get the organizational identifier.
 
void setOrganizationalIdentifier (unsigned short organizationalIdentifier)
 Set the organizational identifier.
 
FASCNPOAssociationCategory getPOACategory () const
 Get the person/organization association category.
 
void setPOACategory (FASCNPOAssociationCategory organizationalCategory)
 Set the person/organization association category.
 
unsigned int getDataLength () const override
 Get the format length in bits.
 
std::string getName () const override
 Get the format name.
 
FormatType getType () const override
 Get the format type.
 
void serialize (boost::property_tree::ptree &parentNode) override
 Serialize the current object to XML.
 
void unSerialize (boost::property_tree::ptree &node) override
 UnSerialize a XML node to the current object.
 
std::string getDefaultXmlNodeName () const override
 Get the default Xml Node name for this object.
 
ByteVector getLinearData () const override
 Get linear data.
 
void setLinearData (const ByteVector &data) override
 Set linear data.
 
size_t getFormatLinearData (ByteVector &data) const override
 Get the format linear data in bytes.
 
void setFormatLinearData (const ByteVector &data, size_t *indexByte) override
 Set the format linear data in bytes.
 
bool checkSkeleton (std::shared_ptr< Format > format) const override
 Check the current format skeleton with another format.
 
unsigned char calculateLRC (const BitsetStream &data) const
 Calculate the Longitudinal Redundancy Check for a buffer.
 
- Public Member Functions inherited from logicalaccess::StaticFormat
 StaticFormat ()
 Constructor.
 
virtual ~StaticFormat ()=default
 
std::shared_ptr< DataRepresentationgetDataRepresentation () const
 Get the Data Representation for the format.
 
void setDataRepresentation (std::shared_ptr< DataRepresentation > &encoding)
 Set the Data Representation for the format.
 
std::shared_ptr< DataTypegetDataType () const
 Get the Data Type for the format.
 
void setDataType (std::shared_ptr< DataType > &encoding)
 Set the Data Type for the format.
 
unsigned long long getUid () const
 Get the UID number.
 
void setUid (unsigned long long uid)
 Set the UID number.
 
virtual bool needUserConfigurationToBeUse () const
 The format need user configuration to be use.
 
virtual void convertField (BitsetStream &data, unsigned long long field, unsigned int fieldlen) const
 Convert a field into the configured DataRepresentation and DataType.
 
unsigned long long revertField (BitsetStream &data, unsigned int *pos, unsigned int fieldlen) const
 Revert a field using the configured DataRepresentation and DataType.
 
size_t getSkeletonLinearData (ByteVector &data) const override
 Get skeleton linear data.
 
void setSkeletonLinearData (const ByteVector &data) override
 Set skeleton linear data.
 
- Public Member Functions inherited from logicalaccess::Format
 Format ()
 Constructor.
 
 Format (const Format &other)=delete
 Remove copy.
 
Formatoperator= (const Format &)=delete
 
virtual ~Format ()=default
 
virtual unsigned int getDataLength () const =0
 Get data length in bits.
 
virtual std::string getName () const =0
 Get the format name.
 
virtual ByteVector getLinearData () const =0
 Get linear data.
 
virtual void setLinearData (const ByteVector &data)=0
 Set linear data.
 
virtual size_t getSkeletonLinearData (ByteVector &data) const =0
 Get skeleton linear data.
 
virtual void setSkeletonLinearData (const ByteVector &data)=0
 Set skeleton linear data.
 
virtual FormatType getType () const =0
 Get the format type.
 
virtual std::vector< std::string > getValuesFieldList () const
 Get values field list.
 
virtual unsigned int getFieldLength (const std::string &field) const
 Get the field length.
 
virtual bool checkSkeleton (std::shared_ptr< Format > format) const =0
 Check the current format skeleton with another format.
 
virtual ByteVector getIdentifier ()
 Get the identifier.
 
virtual std::vector< std::shared_ptr< DataField > > getFieldList ()
 Get the format field list.
 
virtual void setFieldList (std::vector< std::shared_ptr< DataField > > fields)
 Get the format field list.
 
std::shared_ptr< DataFieldgetFieldFromName (std::string field) const
 Get the field object from name.
 
bool isRepeatable () const
 
void setRepeatable (bool v)
 
- Public Member Functions inherited from logicalaccess::XmlSerializable
virtual ~XmlSerializable ()=default
 
virtual std::string serialize ()
 Serialize object to Xml Node string.
 
virtual std::string serializeWithHeaders ()
 Serialize object to Xml Node string, with xml headers.
 
virtual void serialize (boost::property_tree::ptree &parentNode)=0
 Serialize object to Xml Node.
 
virtual void serializeToFile (const std::string &filename)
 Serialize object to a Xml file.
 
virtual void unSerialize (boost::property_tree::ptree &node)=0
 UnSerialize object from a Xml Node.
 
virtual void unSerialize (const std::string &xmlstring, const std::string &rootNode)
 UnSerialize object from a Xml Node string.
 
virtual void unSerialize (std::istream &is, const std::string &rootNode)
 UnSerialize object from a Xml node.
 
virtual void unSerialize (boost::property_tree::ptree &node, const std::string &rootNode)
 UnSerialize object from a Xml node.
 
virtual void unSerializeFromFile (const std::string &filename)
 UnSerialize object from a Xml file.
 
virtual std::string getDefaultXmlNodeName () const =0
 Get the default Xml Node name for this object.
 

Static Public Attributes

static const unsigned char FASCN_SS = 0x0b
 The Start Sentinel value.
 
static const unsigned char FASCN_FS = 0x0d
 The Field Separator value.
 
static const unsigned char FASCN_ES = 0x0f
 The End Sentinel value.
 
static const unsigned char FASCN_SS_WITH_PARITY = 0x1A
 The Start Sentinel value with parity.
 
static const unsigned char FASCN_FS_WITH_PARITY = 0x16
 The Field Separator value with parity.
 
static const unsigned char FASCN_ES_WITH_PARITY = 0x1F
 The End Sentinel value with parity.
 

Protected Attributes

struct {
   unsigned short   d_agencyCode
 The agency code. Identifies the government agency issuing the credential. More...
 
   unsigned short   d_systemCode
 The system code. Identifies the system the card is enrolled in and is unique for each site. More...
 
   unsigned char   d_serieCode
 The credential series. Field is available to reflect major system changes. More...
 
   unsigned char   d_credentialCode
 The individual credential issue. Initially encoded as '1', will be incremented if a card is replaced due to loss or damage. More...
 
   unsigned long long   d_personIdentifier
 The person identifier. Numeric code used by the identity source to uniquely identify the token carrier. More...
 
   FASCNOrganizationalCategory   d_orgCategory
 The organizational category. More...
 
   unsigned short   d_orgIdentifier
 The organizational identifier. OC=1 � FIPS 95-2 Agency Code. OC=2 � State Code. OC=3 � Company Code. OC=4 � Numeric Country Code. More...
 
   FASCNPOAssociationCategory   d_poaCategory
 The person/organization association category. More...
 
d_formatLinear
 
- Protected Attributes inherited from logicalaccess::StaticFormat
std::shared_ptr< DataRepresentationd_dataRepresentation
 The Data Representation.
 
std::shared_ptr< DataTyped_dataType
 The Data Type.
 
unsigned long long d_uid
 The UID number.
 
- Protected Attributes inherited from logicalaccess::Format
std::list< std::shared_ptr< DataField > > d_fieldList
 The field list.
 
bool is_repeatable_
 

Additional Inherited Members

- Static Public Member Functions inherited from logicalaccess::StaticFormat
static unsigned char calculateParity (const BitsetStream &data, ParityType parityType, size_t start, size_t parityLengthBits)
 Calculate parity for a block of data.
 
- Static Public Member Functions inherited from logicalaccess::Format
static std::shared_ptr< FormatgetByFormatType (FormatType type)
 Get a new format instance from a format type.
 
static unsigned char calculateParity (const BitsetStream &data, ParityType parityType, std::vector< unsigned int > positions)
 Calculate parity for a block of data.
 
- Static Public Member Functions inherited from logicalaccess::XmlSerializable
static std::string removeXmlDeclaration (const std::string &xmlstring)
 Remove Xml declaration from a xml string.
 
static ByteVector formatHexString (std::string hexstr)
 Format hex string to hex string with space.
 
- Protected Member Functions inherited from logicalaccess::StaticFormat
virtual size_t getFormatLinearData (ByteVector &data) const =0
 Get the format linear data in bytes.
 
virtual size_t getEncodingLinearData (ByteVector &data) const
 Get the encoding linear data in bytes (Data Representation and Data Type).
 
virtual void setFormatLinearData (const ByteVector &data, size_t *indexByte)=0
 Set the format linear data in bytes.
 
virtual void setEncodingLinearData (const ByteVector &data, size_t *indexByte)
 Set the encoding linear data in bytes (Data Representation and Data Type).
 
- Static Protected Member Functions inherited from logicalaccess::XmlSerializable
static unsigned long long atoull (const std::string &str)
 

Detailed Description

A FASC-N 200 bit format class.

Constructor & Destructor Documentation

◆ FASCN200BitFormat()

logicalaccess::FASCN200BitFormat::FASCN200BitFormat ( )

Constructor.

Create a FASC-N 200 bit Format.

◆ ~FASCN200BitFormat()

logicalaccess::FASCN200BitFormat::~FASCN200BitFormat ( )
virtual

Destructor.

Release the FASC-N 200 bit Format.

Member Function Documentation

◆ calculateLRC()

unsigned char logicalaccess::FASCN200BitFormat::calculateLRC ( const BitsetStream data) const

Calculate the Longitudinal Redundancy Check for a buffer.

Parameters
dataThe buffer.
datalenBitsThe buffer length (in bits).
Returns
The LRC value.

◆ checkSkeleton()

bool logicalaccess::FASCN200BitFormat::checkSkeleton ( std::shared_ptr< Format format) const
overridevirtual

Check the current format skeleton with another format.

Parameters
formatThe format to check.
Returns
True on success, false otherwise.

Implements logicalaccess::Format.

◆ getAgencyCode()

unsigned short logicalaccess::FASCN200BitFormat::getAgencyCode ( ) const

Get the agency code.

◆ getCredentialCode()

unsigned char logicalaccess::FASCN200BitFormat::getCredentialCode ( ) const

Get the credential code.

◆ getDataLength()

unsigned int logicalaccess::FASCN200BitFormat::getDataLength ( ) const
overridevirtual

Get the format length in bits.

Implements logicalaccess::Format.

◆ getDefaultXmlNodeName()

std::string logicalaccess::FASCN200BitFormat::getDefaultXmlNodeName ( ) const
overridevirtual

Get the default Xml Node name for this object.

Returns
The Xml node name.

Implements logicalaccess::XmlSerializable.

◆ getFormatLinearData()

size_t logicalaccess::FASCN200BitFormat::getFormatLinearData ( ByteVector data) const
overridevirtual

Get the format linear data in bytes.

Parameters
dataThe data buffer
dataLengthBytesThe data buffer length
Returns
The format linear data length.

Implements logicalaccess::StaticFormat.

◆ getLinearData()

ByteVector logicalaccess::FASCN200BitFormat::getLinearData ( ) const
overridevirtual

Get linear data.

Parameters
dataWhere to put data
dataLengthBytesLength in byte of data

Implements logicalaccess::Format.

◆ getName()

std::string logicalaccess::FASCN200BitFormat::getName ( ) const
overridevirtual

Get the format name.

Returns
The format name.

Implements logicalaccess::Format.

◆ getOrganizationalCategory()

FASCNOrganizationalCategory logicalaccess::FASCN200BitFormat::getOrganizationalCategory ( ) const

Get the organizational category.

◆ getOrganizationalIdentifier()

unsigned short logicalaccess::FASCN200BitFormat::getOrganizationalIdentifier ( ) const

Get the organizational identifier.

◆ getPersonIdentifier()

unsigned long long logicalaccess::FASCN200BitFormat::getPersonIdentifier ( ) const

Get the person identifier.

◆ getPOACategory()

FASCNPOAssociationCategory logicalaccess::FASCN200BitFormat::getPOACategory ( ) const

Get the person/organization association category.

◆ getSerieCode()

unsigned char logicalaccess::FASCN200BitFormat::getSerieCode ( ) const

Get the serie code.

◆ getSystemCode()

unsigned short logicalaccess::FASCN200BitFormat::getSystemCode ( ) const

Get the system code.

◆ getType()

FormatType logicalaccess::FASCN200BitFormat::getType ( ) const
overridevirtual

Get the format type.

Returns
The format type.

Implements logicalaccess::Format.

◆ serialize()

void logicalaccess::FASCN200BitFormat::serialize ( boost::property_tree::ptree &  parentNode)
overridevirtual

Serialize the current object to XML.

Parameters
parentNodeThe parent node.

Implements logicalaccess::XmlSerializable.

◆ setAgencyCode()

void logicalaccess::FASCN200BitFormat::setAgencyCode ( unsigned short  agencyCode)

Set the agency code.

◆ setCredentialCode()

void logicalaccess::FASCN200BitFormat::setCredentialCode ( unsigned char  credentialCode)

Set the credential code.

◆ setFormatLinearData()

void logicalaccess::FASCN200BitFormat::setFormatLinearData ( const ByteVector data,
size_t *  indexByte 
)
overridevirtual

Set the format linear data in bytes.

Parameters
dataThe data buffer
indexByteThe data offset

Implements logicalaccess::StaticFormat.

◆ setLinearData()

void logicalaccess::FASCN200BitFormat::setLinearData ( const ByteVector data)
overridevirtual

Set linear data.

Parameters
dataWhere to get data
dataLengthBytesLength of data in bytes

Implements logicalaccess::Format.

◆ setOrganizationalCategory()

void logicalaccess::FASCN200BitFormat::setOrganizationalCategory ( FASCNOrganizationalCategory  organizationalCategory)

Set the organizational category.

◆ setOrganizationalIdentifier()

void logicalaccess::FASCN200BitFormat::setOrganizationalIdentifier ( unsigned short  organizationalIdentifier)

Set the organizational identifier.

◆ setPersonIdentifier()

void logicalaccess::FASCN200BitFormat::setPersonIdentifier ( unsigned long long  personIdentifier)

Set the person identifier.

◆ setPOACategory()

void logicalaccess::FASCN200BitFormat::setPOACategory ( FASCNPOAssociationCategory  organizationalCategory)

Set the person/organization association category.

◆ setSerieCode()

void logicalaccess::FASCN200BitFormat::setSerieCode ( unsigned char  serieCode)

Set the serie code.

◆ setSystemCode()

void logicalaccess::FASCN200BitFormat::setSystemCode ( unsigned short  systemCode)

Set the system code.

◆ unSerialize()

void logicalaccess::FASCN200BitFormat::unSerialize ( boost::property_tree::ptree &  node)
overridevirtual

UnSerialize a XML node to the current object.

Parameters
nodeThe XML node.

Implements logicalaccess::XmlSerializable.

Member Data Documentation

◆ d_agencyCode

unsigned short logicalaccess::FASCN200BitFormat::d_agencyCode

The agency code. Identifies the government agency issuing the credential.

◆ d_credentialCode

unsigned char logicalaccess::FASCN200BitFormat::d_credentialCode

The individual credential issue. Initially encoded as '1', will be incremented if a card is replaced due to loss or damage.

◆ 

struct { ... } logicalaccess::FASCN200BitFormat::d_formatLinear

◆ d_orgCategory

FASCNOrganizationalCategory logicalaccess::FASCN200BitFormat::d_orgCategory

The organizational category.

◆ d_orgIdentifier

unsigned short logicalaccess::FASCN200BitFormat::d_orgIdentifier

The organizational identifier. OC=1 � FIPS 95-2 Agency Code. OC=2 � State Code. OC=3 � Company Code. OC=4 � Numeric Country Code.

◆ d_personIdentifier

unsigned long long logicalaccess::FASCN200BitFormat::d_personIdentifier

The person identifier. Numeric code used by the identity source to uniquely identify the token carrier.

◆ d_poaCategory

FASCNPOAssociationCategory logicalaccess::FASCN200BitFormat::d_poaCategory

The person/organization association category.

◆ d_serieCode

unsigned char logicalaccess::FASCN200BitFormat::d_serieCode

The credential series. Field is available to reflect major system changes.

◆ d_systemCode

unsigned short logicalaccess::FASCN200BitFormat::d_systemCode

The system code. Identifies the system the card is enrolled in and is unique for each site.

◆ FASCN_ES

const unsigned char logicalaccess::FASCN200BitFormat::FASCN_ES = 0x0f
static

The End Sentinel value.

◆ FASCN_ES_WITH_PARITY

const unsigned char logicalaccess::FASCN200BitFormat::FASCN_ES_WITH_PARITY = 0x1F
static

The End Sentinel value with parity.

◆ FASCN_FS

const unsigned char logicalaccess::FASCN200BitFormat::FASCN_FS = 0x0d
static

The Field Separator value.

◆ FASCN_FS_WITH_PARITY

const unsigned char logicalaccess::FASCN200BitFormat::FASCN_FS_WITH_PARITY = 0x16
static

The Field Separator value with parity.

◆ FASCN_SS

const unsigned char logicalaccess::FASCN200BitFormat::FASCN_SS = 0x0b
static

The Start Sentinel value.

◆ FASCN_SS_WITH_PARITY

const unsigned char logicalaccess::FASCN200BitFormat::FASCN_SS_WITH_PARITY = 0x1A
static

The Start Sentinel value with parity.


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