Cover V05, I05
Article
Listing 1
Listing 2
Listing 3
Sidebar 1
Sidebar 2

may96.tar


Sidebar: The TAP Protocol

The protocol used by alphanumeric pagers is called TAP (Telocator Alpha-Paging Protocol). It's the industry-standard version of IXO's and Motorola's PET protocols. The protocol includes a few variations (e.g., a version for manual use); this sidebar presents only the details of TAP that are necessary to understand the implementation of ASAP.

The modem parameters for using TAP are 7 data bits, even parity, and one stop bit (7E1). The protocol guarantees 300 baud, but many providers seem to accept speeds as high as 1200 baud.

Upon connecting to the provider's modem, the TAP sending application should send up to three <CR>'s separated by two seconds until the paging provider (hereafter referred to as the terminal) responds with ID=. After the paging terminal comes back with ID=, you send <ESC>PG1<CR>, and dialogue proceeds as diagrammed below. Note that while all terminal responses from this point may contain an optional message, the responses ideally are only acknowledgments (that is, <CR><ACK><CR>).

Sending Application         Terminal
<ESC>PG1<CR>  ====>    Initiate dialogue
<====   <CR><ACK><CR> Logon accepted, or
<CR><NAK><CR> Requested again, or
<CR><ESC><EOT><CR>  Forced disconnect
<====   <ESC> [p <CR>
<STX>Field1<CR>Field2<CR><ETX>CheckSum<CR>
====>
<====  <CR><ACK><CR>  OK, send next block, or
<CR><NAK><CR> Checksum, or
transmission error,
send last block
again, or
<CR><RS><CR>  Abandon current
transaction and go to
next, or
<CR><ESC><EOT><CR> begin disconnect.


<EOT><CR>   ====>    No more transactions, sent after
the <ACK> or <RS> response.

Where Field1 is the PIN and Field2 is the first message block (up to 230 characters, depending on the service).

The checksum is computed by performing the simple arithmetic sum of the 7-bit values of all characters preceding it in that block (including the <STX> and <ETX>). The checksum is then the 12 least significant bits (LSBs) of this resulting sum. (The checksum is transmitted as three printable ASCII characters having values between 30h and 3Fh (the hex numbers are represented as 0123456789:;<=>?). The four LSBs of the sum are encoded as the four LSBs of the third character. The following shows an example that uses a three-digit PIN:

<STX>123<CR>ABC<CR><ETX>17;<CR>

Field1  Field2    Checksum

Viewed another way:

STX          0000       0010
1            0011       0001
2            0011       0010
3            0011       0011
CR           0000       1101
A            0100       0001
B            0100       0010
C            0100       0011
CR           0000       1101
ETX          0000       0011

10111       1011
1            0111       1011

HEX $1         $7         $B
ASCII 31(1)  37(7)      3B(;)

Resulting in a checksum transmitted as the ASCII characters:

17;

Again, to compute the 3 checksum characters to transmit, take the 12 LSBs of the checksum and transmit 4 bits at a time in a byte, where the upper 4 bits are always 3, thereby, making the character transmitted ASCII format.