Polling is often appropriate when transferring short bursts of data or when a
computer sends a command and expects an immediate reply. A polled interface
doesn??™t require a hardware interrupt, so you can use this type of programming
on a port that doesn??™t support hardware interrupts. The code can perform the
polling in a task loop that repeatedly performs required tasks, or a timer interrupt
can schedule tasks at intervals.
Formats and Protocols
29
In some applications, the transmitting computer needs an acknowledgment
that the data was received. Acknowledgments are especially useful in networks
where multiple computers share a communications path and a driver??™s switching
on at the wrong time can block another computer??™s transmission.
An acknowledgment can be a defined value, or the transmitting computer can
assume that a computer received its message on receiving a response with
requested data or other information. A transmitting computer that doesn??™t
receive an expected response can assume there is a problem and retry or take
other action.
When sending to a computer that has no input buffer or a very small buffer, a
transmitting computer can use a full handshake to ensure that the receiving
computer is ready to receive a block of data. The transmitting computer can
begin by sending a code, repeatedly if needed, to announce that the computer
wants to send data.
Pages:
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59