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

A Bit Helper. More...

#include <bithelper.hpp>

Static Public Member Functions

static BitsetStream align (const BitsetStream &data, unsigned int dataLengthBits)
 Line "data" buffer in "linedData" with new size (linedDataLength)
 
static BitsetStream revert (const BitsetStream &data, unsigned int dataLengthBits)
 Revert line of "data" buffer in "revertedData" with new size (revertedDataLength)
 
static BitsetStream truncateLittleEndian (const BitsetStream &data, unsigned int dataLengthBits)
 Truncate "data" buffer in "truncatedData" in Little Endian.
 
static BitsetStream swapBytes (const BitsetStream &data)
 Swap all BYTES of "data" buffer in "swapedData".
 
static BitsetStream extract (const BitsetStream &data, unsigned int readPosBits, unsigned int readLengthBits)
 Extract "readPosBits" bits of data.
 

Detailed Description

A Bit Helper.

Member Function Documentation

◆ align()

BitsetStream logicalaccess::BitHelper::align ( const BitsetStream data,
unsigned int  dataLengthBits 
)
static

Line "data" buffer in "linedData" with new size (linedDataLength)

Parameters
linedDataBuffer to be written
linedDataLengthBytesLength of "linedData" in bytes
dataBuffer to be readed
dataLengthBytesLength of data in bytes
dataLengthBitsLength of used data in bits
Returns
Length of lined data (in bits)

◆ extract()

BitsetStream logicalaccess::BitHelper::extract ( const BitsetStream data,
unsigned int  readPosBits,
unsigned int  readLengthBits 
)
static

Extract "readPosBits" bits of data.

Parameters
extractDataBuffer to be written
extractDataLengthBytesLength of "extractData" in bytes
dataBuffer to be readed
dataLengthBytesLength of data in bytes
dataLengthBitsLength of used data in bits
readPosBitsOffset of "data" you want to start to extract (in bits)
readLengthBitsLength to extract from "data" starting at "readPosBits" offset (in bits)
Returns
Length of data written (in bits)

◆ revert()

BitsetStream logicalaccess::BitHelper::revert ( const BitsetStream data,
unsigned int  dataLengthBits 
)
static

Revert line of "data" buffer in "revertedData" with new size (revertedDataLength)

Parameters
revertedDataBuffer to be written
revertedDataLengthBytesLength of "revertedData" in bytes
dataBuffer to be readed
dataLengthBytesLength of data in bytes
dataLengthBitsLength of used data in bits
Returns
Length of reverted data (in bits)

◆ swapBytes()

BitsetStream logicalaccess::BitHelper::swapBytes ( const BitsetStream data)
static

Swap all BYTES of "data" buffer in "swapedData".

Parameters
swapedDataBuffer to be written
swapedDataLengthBytesLength of "swapedData" in bytes
dataBuffer to be readed
dataLengthBytesLength of data in bytes
dataLengthBitsLength of used data in bits

◆ truncateLittleEndian()

BitsetStream logicalaccess::BitHelper::truncateLittleEndian ( const BitsetStream data,
unsigned int  dataLengthBits 
)
static

Truncate "data" buffer in "truncatedData" in Little Endian.

Parameters
truncatedDataBuffer to be written
truncatedDataLengthBytesLength of "truncatedData" in bytes
dataBuffer to be readed
dataLengthBytesLength of data in bytes
dataLengthBitsLength of used data in bits
Returns
Length of truncated data (in bits)

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