PDA

View Full Version : Serial port Communication, for mifare card read/write



meena
9th July 2010, 16:13
Hi

I need to write the code for getting the mifare card data/number where the card reader is connected to serial port. (linux, qt)
how to connect/ initialize the connection to the serial port. how the serial communication works in qt? i din't get any class for serial communication in qt.

squidge
9th July 2010, 19:36
http://qextserialport.sourceforge.net/

meena
10th July 2010, 12:25
Thanks, I have downloaded the cvs -z3 -d:pserver:anonymous@qextserialport.cvs.sourceforge .net:/cvsroot/qextserialport co -P q4extserialport as i am using Qt v 4.6.1, i am able to build the code.. & when i run it tells the one port opened. but i am not able to write to the port. i just inserted the code.. for writing
if( sp1.open() )
{
qDebug("+++ Opened first");
/* */
char data[] = { 0x00, 0x7F, 0x80, 0xFF };
if( sp1.write( data, 4 ) == 4 )
{
qDebug("+++ Transmitted");
....
...}
the control is not going inside the if( sp1.write( data, 4 ) == 4 ), & i am getting sp1.write( data, 4 ) = 0.
what could be problem.. & how to use this project for actual my project where i will be connecting a mifare card reader to the serial port. what are the steps..

kuzulis
10th July 2010, 14:53
try QSerialDevice http://qt-apps.org/content/show.php/QSerialDevice?content=112039

squidge
10th July 2010, 17:34
I don't see how your code would work, you are not specifying which port, the port parameters (speed, parity, etc) or flow control (rts/cts etc). They must match your target device.