Magtek MAGTEK User Manual Page 56

  • Download
  • Add to my manuals
  • Print
  • Page
    / 80
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 55
MagTek Communications Protocol, Driver Reference Manual
50
NOTIFICATIONS
MCP devices can send unsolicited messages – notifications, in case an external event occurred
(e.g. user swiped a card, pushed a button, etc.) or a device application has changed its state (e.g.
printer out of paper, command completed, etc.). Unlike command responses, notifications can be
issued by the device application at any time.
Notifications contain the identification of the device application that issued them (application
ID), the command ID, and a result code. It may also contain additional data about the event that
occurred.
The host application waits for notifications by calling McpWait. The MCP driver can block the
application until a notification arrives from the device. When the driver receives a notification
from the device, it completes the pending McpWait request providing the notification
information received from the device.
If a notification comes while the host application is not waiting for it, the MCP driver buffers the
notification until the application calls McpWait. The driver does not impose a limit on the
number of the notifications that can wait at the same time.
The McpWait function uses a timeout (dwTimeout) value to indicate how it is to return to the
host application.
Value Meaning
-1 Return with the next buffered notification or wait indefinitely for the next
notification to arrive if there are no notification buffered.
=0 Return immediately with the next buffered notification or an error if no
notifications are currently buffered. Do not wait for a notification to arrive if
no notifications are queued.
>0 Return with the next buffered notification or wait the specified number of
milliseconds for the next notification to arrive. Returns with an error if no
notifications arrive within the allotted time.
The function also can wait/check for new notifications, discard all previous notifications, or
accept notifications that happened before the time of issuing the McpWait call. The device does
not expect a response or any specific action from the host application in response to a
notification message.
Page view 55
1 2 ... 51 52 53 54 55 56 57 58 59 60 61 ... 79 80

Comments to this Manuals

No comments