Soldered 125kHz RFID board Arduino library 1.0.0
Library for Soldered 125kHz RFID board.
Loading...
Searching...
No Matches
Rfid Class Reference

#include <RFID-SOLDERED.h>

Inherits EasyC.

Public Member Functions

 Rfid ()
 Rfid (int _rxPin, int _txPin, uint32_t _baud)
 Sensor specific native constructor.
bool checkHW ()
bool available ()
 Check if there is new RFID data available.
uint32_t getId ()
 Get the RFID Tag ID number.
uint64_t getRaw ()
 Get the RFID RAW data with the headers, RAW Data, parity bits, etc.
void printHex64 (uint64_t _number)
 Prints out 64 bit number in HEX format in Serial.
void clear ()
 Clears the tag ID data on brekaout.
Public Member Functions inherited from EasyC
 EasyC ()
 Main constructor for easyC version.
void begin ()
 Initializes sensors on native or easyC on default address.
void begin (uint8_t _address)
 Initializes sensors on supplied i2c address.
int sendAddress (char regAddr)
 Private function to send a single byte to sensor.
int readData (char a[], int n)
 Private function to read n bytes over i2c.
int readRegister (char regAddr, char a[], size_t n)
 Private function to send over i2c and then read n bytes.
int sendData (const uint8_t *a, int n)
 Private function to write n bytes over i2c.

Protected Member Functions

void initializeNative ()
 Initialization of the native mode (serial / UART communication with the RFID).

Private Member Functions

bool getTheSerialData (char *_data, int _n, int _serialTimeout)
 Function gets the data from the serial.
uint64_t getUint64 (char *_c)
 Converts HEX char array into 64 bit number (integer).
int hexToInt (char _c)
 Converts HEX char into integer from 0 to 15.
uint64_t get16Base (int _exp)
 Calculates 16 base number for the given exponent.
char intToHex (uint8_t _n)
 Converts integer (from 0 to 15) to HEX char.

Private Attributes

int rxPin
int txPin
uint32_t baudRate
SoftwareSerial * rfidSerial
uint32_t tagID = 0
uint64_t rfidRAW = 0

Additional Inherited Members

Public Attributes inherited from EasyC
int native = 0
bool beginDone = 0
int err
char address
const char defaultAddress = 0x30

Constructor & Destructor Documentation

◆ Rfid() [1/2]

Rfid::Rfid ( )

◆ Rfid() [2/2]

Rfid::Rfid ( int _rxPin,
int _txPin,
uint32_t _baud )

Sensor specific native constructor.

Parameters
int_pin Example parameter.

Member Function Documentation

◆ available()

bool Rfid::available ( )

Check if there is new RFID data available.

Returns
bool - True if available, false if not.

◆ checkHW()

bool Rfid::checkHW ( )

◆ clear()

void Rfid::clear ( )

Clears the tag ID data on brekaout.

Note
It's only available for easyC version.

◆ get16Base()

uint64_t Rfid::get16Base ( int _exp)
private

Calculates 16 base number for the given exponent.

Parameters
int_exp Exponent (pow(16, _exp) alternative).
Returns
uint64_t - Calculated value for the given exponent to the 16 base.

◆ getId()

uint32_t Rfid::getId ( )

Get the RFID Tag ID number.

Returns
uint32_t - Returns 32 bit tag ID number and clear it after reading.

◆ getRaw()

uint64_t Rfid::getRaw ( )

Get the RFID RAW data with the headers, RAW Data, parity bits, etc.

Returns
uint64_t - Returns 64 bit long RAW RFID data.

◆ getTheSerialData()

bool Rfid::getTheSerialData ( char * _data,
int _n,
int _serialTimeout )
private

Function gets the data from the serial.

Parameters
char*_data Ponter to the data buffer.
int_n Size of the data buffer.
int_serialTimeout Timeout from the last received char.
Returns
bool - Return true if there is some data available, false if not.

◆ getUint64()

uint64_t Rfid::getUint64 ( char * _c)
private

Converts HEX char array into 64 bit number (integer).

Parameters
char*_c Char array that holds 64 bit HEX char array.
Returns
uint64_t - 64 bit integer.

◆ hexToInt()

int Rfid::hexToInt ( char _c)
private

Converts HEX char into integer from 0 to 15.

Parameters
char*_c Char that holds HEX char.
Returns
int - Converted HEX char into integer (from 0 to 15).

◆ initializeNative()

void Rfid::initializeNative ( )
protectedvirtual

Initialization of the native mode (serial / UART communication with the RFID).

Implements EasyC.

◆ intToHex()

char Rfid::intToHex ( uint8_t _n)
private

Converts integer (from 0 to 15) to HEX char.

Parameters
uint8_t_n Number that will be converted into HEX char.
Returns
char - Converted HEX char.

◆ printHex64()

void Rfid::printHex64 ( uint64_t _number)

Prints out 64 bit number in HEX format in Serial.

Parameters
uint64_t_number 64 bit numer that will be printed in serial in HEX format.

Member Data Documentation

◆ baudRate

uint32_t Rfid::baudRate
private

◆ rfidRAW

uint64_t Rfid::rfidRAW = 0
private

◆ rfidSerial

SoftwareSerial* Rfid::rfidSerial
private

◆ rxPin

int Rfid::rxPin
private

◆ tagID

uint32_t Rfid::tagID = 0
private

◆ txPin

int Rfid::txPin
private

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