beautypg.com

Appendix g user-defined messages, Appendix g, User-defined messages – MagTek DynaPro Mini Programmer's99875629 User Manual

Page 99: Appendix g - user-defined messages

background image

Appendix G - User-Defined Messages

DynaPro Mini| PIN Encryption Device | Programmer’s Reference (Commands)


Page 99

Appendix G

User-Defined Messages

This appendix describes how the host can define user-defined messages on the device. Start by creating a
block of user-defined message data (see Table 3-95) containing one or more user data strings, and send it
to the device using Report 0x10 – Send Big Block Data to Device. The messages are then available
when using the Select or Display commands.

Table 3-95 - User-Defined Messages Big Block Format

Bit

7

6

5

4

3

2

1

0

Byte 0

# of user-defined messages

Byte 1..a1

User-defined message 1 (see Table 3-96)

Byte
a1+1..a2

Optional user-defined message 2 (see Table 3-96)

Etc. (see Table 3-96)

Table 3-96 - User-defined Message Format

Bit

7

6

5

4

3

2

1

0

Byte 0

Length of parameters + string (no null at end of string) [includes this byte]

Byte 1

X axis location of string (0-127)

Byte 2

Y axis location of string (0-63)

Byte 3

0 =
background
unchanged
1 =
Background
cleared

Set to 1
for
underline

Spacing:
0 = Proportional
1 = Prop except
#’s
2 = Fixed spacing

Alignment:
0 = Left
1 = Center
2 = Right

Font size:
0 = Small
1 = Small Bold
2 = Big

Byte 4

0 (rfu)

Bytes 5..n

String data (no terminating null)


This code snippet provides an example of how to write a user-defined message to the device:

void addUserString(MemoryStream m, byte x, byte y, byte p1, byte
p2,string s)
{

m.WriteByte((byte)(s.Length+5));

m.WriteByte(x);

m.WriteByte(y);

m.WriteByte(p1);

m.WriteByte(p2);


System.Text.ASCIIEncoding encoding = new

System.Text.ASCIIEncoding();

m.Write(encoding.GetBytes(s),0,s.Length);

}