Intermec IP2L Basic Reader Interface Programmer's Reference Manual (BRI versio - Page 24
BRI Command Processor, BRI Asynchronous Event Handler, Response Handler
View all Intermec IP2L manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 24 highlights
Chapter 2 - Designing Robust BRI Applications BRI Command Processor A BRI Command Processor composes BRI Command strings for the application and sends them to the transport layer. It receives and accumulates BRI Command Response lines until it receives the OK> line marking a complete BRI Command Response. Responses are received in the order in which their corresponding commands were sent. You can parse a normal command response line into data fields by separating the line at each field separator character that is not inside a quoted string. BRI Asynchronous Event Handler A BRI Asynchronous Event Handler must handle all types of BRI Asynchronous Events used by the application. It should quietly discard event types it does not recognize. Response Handler A Response Handler handles all incoming lines by sending: • all lines that start with EVT: to the BRI Asynchronous Event Handler. • all other lines to the BRI Command Processor as command response lines. Programming the BRI Transport Layer When programming the BRI Transport Layer, you need to understand transport operation and initialization. Transport Operation The Transport Layer appends an end-of-line to each outgoing message. It continually monitors the input stream, accumulating complete input lines and sending them to the Message Layer. For serial transport implementations that use message checksums the Transport Layer also adds checksums to outgoing commands and verifies and removes checksums from incoming message lines. The command processor should be notified of transport failure when an incoming checksum is wrong. For details about checksums, see "Using Message Checksums" on page 16. The detailed processing steps of the Transport Layer are: 1 (Optional) Append checksum. This optional step may be used only over a serial connection to a reader. Sum the binary value of the characters in the message, encode the least significant 8 bits of the sum as a two-digit hexadecimal value, and append the two digits to the end of the message. 2 Append end-of-line character. Append a to mark the end of the message in the output stream. 3 Extract lines from input stream. Accumulate input characters until the end-ofline is received, and then send the complete response line to the Response 12 Basic Reader Interface Programmer Reference Manual