How to program USB RFID reader/writer module

crfid

I bought an USB RFID reader/writer module from local store, it is not well known and branded, It connect to computer with USB port , and i want to write a program for it in Linux Ubuntu.

I find out (from CD with module) it use:

Silicon Laboratories CP210x USB to RS232 serial adaptor

I install the Driver from CD on Ubuntu and i compiled and run the example C++ file is in this link.

Now i want to send charachter message to it and receive proper massage from it but the example just send HEX value and if i put char in ioctl, it wont work, i tried this:

static const char HELLO3[] = "Howdy";
ret_val = ioctl(fd, HELLO3, &gpio);
cout << ret_val ;

It(ioctl) only get long unsigned int, I guess this integers should be in library but i don't know how to use them. How can i send massage to device and receive massage like response from it ?

The datasheet is not in English but it have some example for c# it is like :

serialport.writeline("W0abcdef65\r\n");

It mean write abcdef65 on Block 0 and it receive ‫‪Msg0000001‬‬ which means the command run perfectly. How can i get same functionality in C or C++ in Linux.

PS :

1-The library or driver is in the same folder as example link in github which i mentioned before.

2-The device works properly with the application carried with its package in Windows but i want to program it in Linux with C++ or C.

Best Answer

Read the readme files for the headers on Github Readme.Serial.

Although the interface connects to the serial port, it doesn't utilise the RS-232 serial protocol and instead I/O is performed with bit banging. Data output bits are sent through the DTR line and clocked on the falling edge of RTS.
The Tx line is utilised to enable the application of the high programming voltage on !MCLR/VPP and not for sending data bits.
Data input bits are read from the CTS line using the same clock as for output with the data output line taken high for correct circuit operation.

I guess you will have find another way.