Skip navigation.
Home
The QNX Community Portal

View topic - Resource manager: handling select() to notify of interrupts

Resource manager: handling select() to notify of interrupts

For discussion of realtime and/or embedded programming.

Resource manager: handling select() to notify of interrupts

Postby ndumont » Mon Sep 13, 2010 9:20 am

Hi,

this post to ask you the way to notify clients of my resource manager when interrupts occur.

After carefully reading the doc, I have written a resource manager for a digital I/O PCI board.
I have to handle select() calls from client processes, to inform them of level changes on I/O ports.
I have 4 ports, PC0 to PC3, each triggering an interrupt when changing level (0 to 1 or the opposite). This means 8 possible level changes.
So I would like the clients to be able to ask and to be notified when one or more of these 8 conditions occur.

Do I have to use out of band messages? How?


Thanks you very much in advance!

Best regards from Belgium,

N. Dumont
ndumont
New Member
 
Posts: 4
Joined: Mon Sep 13, 2010 9:10 am

RE: Resource manager: handling select() to notify of interru

Postby mario » Mon Sep 13, 2010 4:40 pm

read up on iofunc_notify, that should get you started.
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

Postby ndumont » Wed Sep 15, 2010 5:11 pm

Hi,

thanks for the fast reply.
I re-read about iofunc_notify.
My problem is that now I can just unblock clients having called select() on my file, telling them out-of-band data is available. The read and write options are useable too, but I need 8 conditions.

So I guess my client has to call MsgSend() or devctl() to tell the resource manager which condition will unblock it.
And then call MsgReceive() to wait for the thread managing interrupts in my resource manager to MsgSend() them?

Best regards,

N.D.
ndumont
New Member
 
Posts: 4
Joined: Mon Sep 13, 2010 9:10 am

Postby mario » Wed Sep 15, 2010 8:14 pm

You could have the resource manager register or handle 8 different paths, one of each condition.

Or if the client can use ionotify() and MsgReceive() instead of select. Use one notification of a sigevent which you'd setup as a PULSE. But then server could use the code field of the pulse to indicate the status of the inputs. That would mean receiving an event for every change though.

There are lots of other possiblities to play with.
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

Postby ndumont » Thu Sep 30, 2010 12:40 pm

Hi,

the resource manager finally handles 8 more subdirectories, each corresponding to one condition.

Thank you very much for your help.

Best regards,

N.D.
ndumont
New Member
 
Posts: 4
Joined: Mon Sep 13, 2010 9:10 am

Postby mario » Thu Sep 30, 2010 2:57 pm

Dumont, that sounds french?
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

Postby ndumont » Sat Oct 02, 2010 8:05 am

I'm Belgian and 'd be happy to program under QNX for a living ;)
ndumont
New Member
 
Posts: 4
Joined: Mon Sep 13, 2010 9:10 am


Return to Realtime and Embedded

Who is online

Users browsing this forum: No registered users and 2 guests