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?