Sponsored Content
Top Forums Programming Proximity-card reader: no data when app window out of focus Post 302344999 by Dp0H on Tuesday 18th of August 2009 07:39:51 AM
Old 08-18-2009
With the following modification my windowing code gets all the counted signals:
Code:
bool MarinReader::read_port(QFile* file)
{
	static int i = 0;
	emit Message("debug message #" + QString::number(i++));
	char first_char = '\0';
	file->getChar(&first_char);
	if (first_char == ':')
	{
		QByteArray bres = file->readAll();
		QString s(bres);
		s.resize(10);
		emit CardProcessed(s);
	}
	tcflush(file->handle(), TCIOFLUSH);
	return true;
}

Signals CardProcessed and Message are identical, and the destination slots are in the same thread of main window (I can process these signals with the same slot).
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

MSR magnetic stripe card reader

Hi all I am working on MSR110 ...Can anyone plz tell me how to use the configuration commands with magnetic reader???. Please help me out as i have to develop API in C on linux platform.MSR110 is not responding to the configuration commands. Please help... Regards Mahima (0 Replies)
Discussion started by: mahima_er
0 Replies

2. Programming

Hiding app window

I am facing a problem while creating/executing a process in C. I am using old fork/exec mechanism. The problem is: I want to hide the console window of the app i am instantiating. Remember i am instantiating a console application from a GUI application. Is this possible? How? Comments are... (1 Reply)
Discussion started by: amessbee
1 Replies

3. Solaris

Secure Card Reader

I see on some of the recent Sun workstations that there is a secure card reader installed. I have a Sunblade 100 and 150 and would like to know, how do you access this device or turn it on to use it? Thanks, (2 Replies)
Discussion started by: stocksj
2 Replies

4. Shell Programming and Scripting

Bash: Exiting while true loop when terminal is not the focus window

I am running an Ubuntu Gutsy laptop with Advanced Compiz fusion options enabled. I am using xdotool to simulate keyboard input in order to rotate through multiple desktops. I am looking for a way to kill a while true loop when the Enter key (or Control+C if it is easier) is pushed when the... (2 Replies)
Discussion started by: acclaypool
2 Replies

5. Programming

Multithread app - Read-Only Data

Hello, I'm coding an application using pthreads.At some point the threads will read some read-only variables.Is it safe NOT to use mutexes, in order to make the program lighter since mutex operations are resource-demanding... Thanks (1 Reply)
Discussion started by: jonas.gabriel
1 Replies

6. UNIX for Dummies Questions & Answers

grab the data from the unix window

Hi, How could i grab a set of data (eg:file execution start & stop time stamp f) from unix? (1 Reply)
Discussion started by: siriv
1 Replies

7. What is on Your Mind?

CNET News Reader App for the Forums

We are thinking of building a CNET style reader app for reading threads in the forums. One developer suggested we look at a CNN vBulletin app, which I am not familiar with (he said he will post the link tomorrow, Monday). Anyway, I asked the (potential) developer for this app to work with us in... (1 Reply)
Discussion started by: Neo
1 Replies

8. Programming

Building app. to send data to website

Hi. I plan to build an application which takes text data from a user. It then sends this to a website, login required. The business case being this site contains many text fields, mostly redundant to user. My application would only prompt user for necessary text. What language, methods... (4 Replies)
Discussion started by: cic
4 Replies

9. UNIX for Dummies Questions & Answers

How to regain the focus back to the launch window?

Consider this code snippet below:- char=`which afplay` if then xterm -e 'while true; do clear; echo "Press Ctrl-C to Quit..."; afplay /tmp/pulse.wav; done' & > /dev/null 2>&1 fi This launches a second terminal window that generates a specific waveform for the next calibration of... (4 Replies)
Discussion started by: wisecracker
4 Replies
QCopChannel(3qt)														  QCopChannel(3qt)

NAME
QCopChannel - Communication capabilities between several clients SYNOPSIS
#include <qcopchannel_qws.h> Inherits QObject. Public Members QCopChannel ( const QCString & channel, QObject * parent = 0, const char * name = 0 ) virtual ~QCopChannel () QCString channel () const virtual void receive ( const QCString & msg, const QByteArray & data ) Signals void received ( const QCString & msg, const QByteArray & data ) Static Public Members bool isRegistered ( const QCString & channel ) bool send ( const QCString & channel, const QCString & msg ) bool send ( const QCString & channel, const QCString & msg, const QByteArray & data ) DESCRIPTION
The QCopChannel class provides communication capabilities between several clients. The Qt Cop (QCOP) is a COmmunication Protocol, allowing clients to communicate both within the same address space and between different processes. Currently, this facility is only available on Qt/Embedded. On X11 and Windows we are exploring the use of existing standards such as DCOP and COM. QCopChannel provides send() and isRegistered() which are static functions usable without an object. The channel() function returns the name of the channel. In order to listen to the traffic on a channel, you should either subclass QCopChannel and reimplement receive(), or connect() to the received() signal. MEMBER FUNCTION DOCUMENTATION
QCopChannel::QCopChannel ( const QCString & channel, QObject * parent = 0, const char * name = 0 ) Constructs a QCop channel and registers it with the server using the name channel. The standard parent and name arguments are passed on to the QObject constructor. QCopChannel::~QCopChannel () [virtual] Destroys the client's end of the channel and notifies the server that the client has closed its connection. The server will keep the channel open until the last registered client detaches. QCString QCopChannel::channel () const Returns the name of the channel. bool QCopChannel::isRegistered ( const QCString & channel ) [static] Queries the server for the existence of channel. Returns TRUE if channel is registered; otherwise returns FALSE. void QCopChannel::receive ( const QCString & msg, const QByteArray & data ) [virtual] This virtual function allows subclasses of QCopChannel to process data received from their channel. The default implementation emits the received() signal. Note that the format of data has to be well defined in order to extract the information it contains. Example: void MyClass::receive( const QCString &msg, const QByteArray &data ) { QDataStream stream( data, IO_ReadOnly ); if ( msg == "execute(QString,QString)" ) { QString cmd, arg; stream >> cmd >> arg; ... } else if ( msg == "delete(QString)" ) { QString filenname; stream >> filename; ... } else ... } This example assumes that the msg is a DCOP-style function signature and the data contains the function's arguments. (See send().) Using the DCOP convention is a recommendation, but not a requirement. Whatever convention you use the sender and receiver must agree on the argument types. See also send(). void QCopChannel::received ( const QCString & msg, const QByteArray & data ) [signal] This signal is emitted with the msg and data whenever the receive() function gets incoming data. bool QCopChannel::send ( const QCString & channel, const QCString & msg, const QByteArray & data ) [static] Send the message msg on channel channel with data data. The message will be distributed to all clients subscribed to the channel. Note that QDataStream provides a convenient way to fill the byte array with auxiliary data. Example: QByteArray ba; QDataStream stream( ba, IO_WriteOnly ); stream << QString("cat") << QString("file.txt"); QCopChannel::send( "System/Shell", "execute(QString,QString)", ba ); Here the channel is "System/Shell". The msg is an arbitrary string, but in the example we've used the DCOP convention of passing a function signature. Such a signature is formatted as functionname(types) where types is a list of zero or more comma-separated type names, with no whitespace, no consts and no pointer or reference marks, i.e. no "*" or "&". Using the DCOP convention is a recommendation, but not a requirement. Whatever convention you use the sender and receiver must agree on the argument types. See also receive(). bool QCopChannel::send ( const QCString & channel, const QCString & msg ) [static] This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Send the message msg on channel channel. The message will be distributed to all clients subscribed to the channel. See also receive(). SEE ALSO
http://doc.trolltech.com/qcopchannel.html http://www.trolltech.com/faq/tech.html COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. AUTHOR
Generated automatically from the source code. BUGS
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qcopchannel.3qt) and the Qt version (3.3.8). Trolltech AS 2 February 2007 QCopChannel(3qt)
All times are GMT -4. The time now is 11:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy