PinPad notes (101/201/1000/2000):
---------------------------------
    General Diagnostics: Press '*'+'3' (together)
    Password: 83746
        1=Memory (RAM) test
        2=Continuous RAM test
        3=EPROM checksum
        4=Key test
        5=Display test
        6=Display Serial number
        7=Uart Loopback Test
        8=Card reader test/Display baud rate
        9=Cardreader ON/OFF/Display key management
        0=PIN-PAD/PIN-PAL prompt toggle

    Manufacturing Diagnostics: Press '*'+'2' (together)
    Password: 844747746
        1=Destructive MEM test
        2=Init NV/MKEY RAM
        3=Languages
        4=/Display ALL messages
        5=/Set baud rate
        6=/Set KEY management

    Master key insertion: Press '1'+'#' (201) or '#'+'1' (1000)
    Key is entered as 16 decimal numbers from 0 to 15.

Physical Interface:
------------------
    +- | | | | -+   1 = Ground
    |  1 2 3 4  |   2 = Serial RX (data to PinPad)
    +---+   +---+   3 = Serial TX (data from PinPad)
        =====       4 = +9v DC unregulated


Packet command formats:
----------------------
    Interactive Diagnostic routine
    <SI>01nn<SI><LRC>   - Execute diagnostic test
    nn= 01 = RAM test/one-time
        02 = RAM test on/off toggle/continuous
        03 = EPROM checksum
        04 = Keypad reliability
        05 = Display reliability
        06 = Serial number check
        07 = Uart loopback test
        08 = Cardreader test/card display
        09 = Cardreader on/off toggle
        00 = PIN PAL/PIN PAD display toggle
    Response: <ACK> immediately, <EOT> when finished

    Transfer Master Key
    <SI>02nxxxxxxxxxx<SO><LRC>
    n   = Master key slot ('0'-'9')
    x.. = Master key (16 hex digits)
    Response: <ACK>, then echo of command packet
    Controller must verify send <ACK> if correct.
        (<NAK> if LRC bad, Send <EOT> if LRC ok but key bad)
    Pinpad stores new Mkey if <ACK> received, sends <EOT>

    Decrypt/Encrypt Loopback Test
    <SI>03rmmmmmmmmmmmmmmmm<SO><LRC>
    c   = 0:Encrypt Test  1:Decrypt test
    m.. = ASCII message from National Bureau of Standards test data
    Response: <ACK>, then: <SI>03xxxxxxxxxxxxxxxx<SO><LRC>
    x.. = ASCII message (hex formal) returned by pinpad
    Controller must respond with <ACK>, then pinpad sends <EOT>

    Check Master Key
    <SI>04n<SO><LRC>
    n   = Master key slot number ('0'-'9')
    Response: <ACK>, then: <SI>04r<SO><LRC>
    r   = 0:No master key  F:Master key present
    Controller must respond with <ACK>, then pinpad sends <EOT>

    Transfer Serial Number
    <SI>05vvvyymmddfbbgggg<SO><LRC>
    v.. = Version number (3 digits)
    yy  = Release date: year
    mm  = Release date: month
    dd  = Releast date: day
    f   = Production facility code
    bb  = Production batch code
    g.. = Production group code (4 digits 0001 to 9999)
    Response: <ACK>, then echo of command packet
    Controller must verify send <ACK> if correct (<NAK> if bad).
    Pinpad stores new serial number if <ACK> received, sends <EOT>

    Request Serial Number
    <SI>06<SO><LRC>
    Response: <ACK>, then:
    <SI>06vvvyymmddfbbgggg<SO><LRC>
    .. See above for data elements ..
    Controller must send <ACK>, pinpad sends <EOT>

    DES Algorithm Reliability Test
    <SI>07mck<SO><LRC>
    m   = 16 character master key
    c   = 16 character clear text
    k   = 16 character known cipher text
    Pinpad displays test results, sends <ACK>, then <EOT>

    Select Master Key
    <SI>08n<SO><LRC>
    n   = Master key slot ('0'-'9')
    Pinpad sends <ACK>, then <EOT>

    UART loopback test
    <SI>09<SO><LRC>
    Response: <ACK>, then: <SI>09<SUB>PROCESSING<SO><LRC>

    Request Unencrypted PIN
    <SI>10a<SO><LRC>
    a   = Amount of transaction
    Response: <ACK>, then 71 response packet (see "Request PIN entry")

    PIN Pad Connection Test
    <SI>11<SO><LRC>
    Response: <ACK>

    Request PIN entry:
    <STX>70.c<FS>wa<ETX><LRC>
    c   = Card account number (8-19)
    w   = Encryoted working key (16)
    a   = Amount 3-8 (must include decimal point)
    Response: ACK, then:
    <STX>71.fll01p<ETX><LRC>
    f   = 0:No function key  1:Func1 2:Func2 3:Func3
    ll  = Pin length (00-16)
    p   = Encrypted PIN block (16 characters)
    Controller must send <ACK>

    Cancel Session Request:
    <STX>72<ETX><LRC>
    Returns PINPAD to idle state
    Response <ACK>

    Card image response:
    <STX>81.c<STX><LRC>
    c   = Card data
    Sent by pinpad after card swipe
    Controller must send <ACK>

    Display SLIDE CARD
    <STX>Q1<STX><LRC>
    Response: <ACK>

    Indicate Host Done
    <STX>Q2<ETX><LRC>
    Displays "THANK YOU" and return to idle prompt
    Response: <ACK>

    Ignore Card Swipe
    <STX>Q3<ETX><LRC>
    Turn off card reader & display "PIN PAL/PROCESSING"
    Response: <ACK>

    Turn Card reader ON/OFF
    <STX>Q4f<ETX><LRC>
    f   = 0:On  1:Off
    Response: <ACK>

    Alternate processing prompt
    <STX>Q5f<ETX><LRC>
    f   = 0:"PIN PAD"  1:"PIN PAL"
    Response: <ACK>

    Return to IDLE state
    <STX>Z1<ETX><LRC>
    Response: <ACK>

    Display a string
    <STX>Z2[sub]t<ETX><LRC>
    t   = Text to display. if begins with <SUB> (1Ah), clear display
    Response: <ACK>

    Display rotating messages
    <STX>Z3c[SUB]m[<FS>m...]<ETX><LRC>
    c   = Count of messages ('0'-'9')
    m   = Message(s) to display
    Response: <ACK>

    Turn on/off CANCEL REQUESTED
    <STX>Z7f<ETX><LRC>
    f   = 0:Show cancel message  1:Do not show message
    If enabled "CANCEL REQESTED" shows when CLEAR pressed or controller
    requests a cancel termination.
    Response: <ACK>

    Reset/Set Idle Prompt
    <STX>Z8p<ETX><LRC>
    p   = Idle prompt text (NULL = display now)
    Response: <ACK>

    Request Coded Key
    <STX>Z80t<ETX><LRC>
    t   = Timeout (0-255) seconds to wait for key
    Response: <ACK>, then: <STX>Z51k<ETX><LRC>
    k   = Key code: 1 2 3 4 5 6 9 10 11 13 14 15 = 123456789*0#
    Controller must send <ACK>

    Request non-coded key
    <STX>Z42t<ETX><LRC>
    t   = Timeout (0-255) seconds to wait for key
    Response: <ACK>, then: <STX>Z43k<ETX><LRC>
    k   = '0'-'9', '*' or '#'

    Request String Input
    <STX>Z50etttll<ETX><LRC>
    e   = 0:Echo as '*'  1:Echo normally  2:Do not echo
    t   = Timeout (0-255) seconds to wait for input
    l   = Maximum length (01-49 .. default 49)
    Response: <ACK>, then: <STX>Z51s<ETX><LRC>
    s   = String input (1-49 chars) '?' if timeout
    Controller must send <ACK>

    Accept and Encrypt PIN
    <STX>Z60.c<FS>w<ETX><LRC>
    c   = Card account number (8-19)
    w   = Encrypted working key (16)
    Response: <ACK>, then 71 response packet (see "Request PIN entry")

    Accept and Encrypt PIN with custom prompts
    <STX>Z62.c<FS>wnnxxfm1<FS>m2<FS>mp<ETX><LRC>
    c   = Card account number (8-19)
    W   = Encrypted working key (16)
    nn  = Minimum acceptable PIN length (01-16)
    xx  = Maximum acceptable PIN length (01-16)
    f   = Null flag  Y:Null PIN allowed  N:Null PIN not allowed
    m1  = Message to alternate with m2 until key pressed (0-16)
    m2  = Message to alterdate with m1 until key pressed (0-16)
    mp  = Message to display after PIN entry
    Response: <ACK>, then 71 response packet (see "Request PIN entry")


DUKPT Message Packets:
---------------------
    Pre-Authorization: PIN Entry Request
    <STX>60c<ETC><LRC>
    c   = Card account number (8-19)
    Response: <ACK>, then 71 response packet (see "Request PIN entry")
    This packet must be preceded by a display packet such as Z2 or Z3,
    Pad will transmit pin in message 72, then terminal must send 62.

    Pre-Authorization: Transaction Amount Authorization Request
    <STX>62ia<ETX><LRC>
    i   = Credit/Debit indicator 'C' or 'D' (43/44h)
    a   = Transaction amount must include '.' 3-7 chars.
    Response: <ACK>, then:
    <STX>63r<ETX><LRC>
    r   = Response code: 0=Approved/1=Declined

    Pre-Authorization: PIN Entry Test Request
    <STX>66c<ETX><LRC>
    This functions the same as 60, except that PIN is not entered, a
    preset PIN of "1234" is used.

    Request PIN Entry
    <STX>70c<FS>ia<ETX><LRC>
    c   = Card account number (8-19)
    i   = Credit/Debit indicator 'C' or 'D' (43/44h)
    a   = Amount 3-7 (must include decimal point)
    Response: ACK, then:
    <STX>71fkp<ETX><LRC>
    f   = 0:No function key  1:Func1 2:Func2 3:Func3
    k   = Key serial number Hex/Leading F's suppressed (20)
    p   = Encrypted PIN block (16 HEX digits)
    Controller must send <ACK>

    PIN Entry Test Request
    <STX>76c<FS>ia<ETX><LRC>
    This functions the same as 70, except that PIN is not entered, a
    preset PIN of "1234" is used.

    Load Initial key
    <STX>90ek<ETX><LRC>
    e   = Initial PIN encryption key (16)
    k   = Key serial number (20 - including leading 'F's)
    Response: <ACK>, then after 32 total keys:
    <STX>91r<ETX><LRC>
    r   = Response 0=confirmed, 1=NOT confirmed

    Display rotating messages
    <STX>Z3c[SUB]m[<FS>m...]<ETX><LRC>
    c   = Count of messages ('0'-'9')
    m   = Message(s) to display
    Response: <ACK>

    Accept and Encrypt PIN
    <STX>Z60.c<ETX><LRC>
    c   = Card account number (8-19)
    Response: <ACK>, then 71 response packet (see "Request PIN entry")

    Accept and Encrypt PIN with custom prompts
    <STX>Z62.c<FS>nnxxm1<FS>m2<FS>mp<ETX><LRC>
    c   = Card account number (8-19)
    nn  = Minimum acceptable PIN length (01-16)
    xx  = Maximum acceptable PIN length (01-16)
    m1  = Message to be displayed before key pressed
    mp  = Message to display after PIN entry (<FS>m2 is optional)
    Response: <ACK>, then 71 response packet (see "Request PIN entry")

    Message packets 02, 04, 07, 08 and 10 are disabled for DUKPT.
