How to know data incoming from serial port?

Dear Sir,

I developed my App by serial driver and I can read and write data by
serial port ("/dev/ser1"). The physical connection is shown as below:

PC------/dev/ser1-------Modem---------Externel Device(Data Device)

Now my question is: The Data Device will send data to PC randomly, I
think the Mode of getting Data by polling the serial port periodically makes
on sense and it will take most CPU process time. Now my question is, how do
I know data incoming from serial port without polling the serial port? by
Interrupt or some Signal else? or something like the code in Microsoft
visual basic serial communication event: comRing, ComReceive, ComSend, etc?

Can someone kindly give some example code?

Thanks.

Alex Yu

Alex Yu <yuyouling@mail.tongji.edu.cn> wrote:

Dear Sir,

Under QNX, I’d look at the functions:

open()
read()
write()
ionotify()

-David


I developed my App by serial driver and I can read and write data by
serial port ("/dev/ser1"). The physical connection is shown as below:

PC------/dev/ser1-------Modem---------Externel Device(Data Device)

Now my question is: The Data Device will send data to PC randomly, I
think the Mode of getting Data by polling the serial port periodically makes
on sense and it will take most CPU process time. Now my question is, how do
I know data incoming from serial port without polling the serial port? by
Interrupt or some Signal else? or something like the code in Microsoft
visual basic serial communication event: comRing, ComReceive, ComSend, etc?

Can someone kindly give some example code?

Thanks.

Alex Yu


QNX Training Services
http://www.qnx.com/services/training/
Please followup in this newsgroup if you have further questions.