-
Notifications
You must be signed in to change notification settings - Fork 0
/
delivery_service_format.txt
180 lines (147 loc) · 7.23 KB
/
delivery_service_format.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
Version/D<mac-address>.ver
--------------------------
Hex dump:
00000000 00 00 00 01 |....|
\_________/
^generation
00000004
Description:
generation - is the revision number of all delivery service data. If the
delivery service host remains the same, the printer only updates if the
generation number is increased.
Python struct:
struct.pack(">L", generation)
Address/D<mac-address>.{dst,snd}
--------------------------------
Hex dump:
00000000 00 00 00 01 00 00 00 00 00 00 00 01 00 00 00 01 |................|
\_________/ \_________/|\_________/
^num_entries ^ ^entry1_id
file_revision_number
00000010 80 01 00 01 00 00 00 00 00 00 00 00 00 00 00 02 |................|
\___/ \___/
^ ^entry1_group_nr
entry1_frequent_flag
00000020 47 61 6e 7a 4c 61 6e 67 65 72 4e 61 6d 65 48 69 |GanzLangerNameHi|
\______________________________________________/|
^entry1_name
00000030
Description:
num_entries - number of entries in this file
file_revision_number - is incremented on each update to the file
entryN_id - unique id number of this entry
entryN_frequent_flag - should the entry be displayed in the 'frequent' group
entryN_name - name of the entry (up to 16 characters)
Python struct:
assert(len(entries) == num_entries)
data = struct.pack(">L 4x L", len(entries), file_revision_number)
for entry in entries:
data += struct.pack(">L", entry.id)
if entry.frequent:
data += struct.pack(">H", 0x8001)
else:
data += struct.pack(">H", 0x0000)
data += struct.pack(">H 4x 7x B 16s", entry.group_nr, 0x2, entry.name)
Address/D<mac-address>.grp
--------------------------
8 category mode
- - - - - - - -
Hex dump:
00000000 00 00 00 0b 00 00 00 02 00 00 00 00 00 00 80 01 |................|
00000010 46 72 65 71 2e 00 00 00 00 00 00 00 00 00 00 00 |Freq............|
00000020 00 00 00 00 00 00 00 01 41 42 00 00 00 00 00 00 |........AB......|
|\_________/ \_________/
| ^col1_nr ^col1_txt
00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 |................|
|\_________/
| ^col2_nr
00000040 43 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |CD..............|
\_________/
^col2_txt
00000050 00 00 00 00 00 00 00 03 45 46 00 00 00 00 00 00 |........EF......|
|\_________/ \_________/
| ^col3_nr ^col3_txt
00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 |................|
|\_________/
| ^col4_nr
00000070 47 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |GH..............|
\_________/
^col4_txt
00000080 00 00 00 00 00 00 00 05 49 4a 4b 00 00 00 00 00 |........IJK.....|
| ...
00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 06 |................|
000000a0 4c 4d 4e 00 00 00 00 00 00 00 00 00 00 00 00 00 |LMN.............|
000000b0 00 00 00 00 00 00 00 07 4f 50 51 00 00 00 00 00 |........OPQ.....|
000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 |................|
000000d0 52 53 54 00 00 00 00 00 00 00 00 00 00 00 00 00 |RST.............|
000000e0 00 00 00 00 00 00 00 09 55 56 57 00 00 00 00 00 |........UVW.....|
000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0a |................|
00000100 58 59 5a 00 00 00 00 00 00 00 00 00 00 00 00 00 |XYZ.............|
00000110 00 00 00 00 |....|
00000114
Description:
colN_nr - number of the column [1-10]
colN_txt - up to 4 characters containing the column name
Python struct:
data = struct.pack(">L L 4x 2x B B", 0xb, 0x2, 0x80, 0x1) + \
struct.pack("BBBBB 3x 8x", 0x46, 0x72, 0x65, 0x71, 0x2e) + \
struct.pack("4x")
for col in columns:
data += struct.pack(">L 4s 16x", col.nr, col.name)
4 category mode
- - - - - - - -
Hex dump:
00000000 00 00 00 0b 00 00 00 02 00 00 00 00 00 00 80 01 |................|
00000010 46 72 65 71 2e 00 00 00 00 00 00 00 00 00 00 00 |Freq............|
00000020 00 00 00 00 00 00 00 01 41 42 00 00 00 00 00 00 |........AB......|
|\_________/ \_________/
| ^col1_nr ^col1_txt
00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 |................|
|\_________/
| ^col2_nr
00000040 43 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |CD..............|
\_________/
^col2_txt
00000050 00 00 00 00 00 00 00 03 45 46 00 00 00 00 00 00 |........EF......|
| ...
00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 |................|
00000070 47 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |GH..............|
00000080 00 00 00 00 00 00 00 05 49 4a 4b 00 00 00 00 00 |........IJK.....|
00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 06 |................|
000000a0 4c 4d 4e 00 00 00 00 00 00 00 00 00 00 00 00 00 |LMN.............|
000000b0 00 00 00 00 00 00 00 07 4f 50 51 00 00 00 00 00 |........OPQ.....|
000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 |................|
000000d0 52 53 54 00 00 00 00 00 00 00 00 00 00 00 00 00 |RST.............|
000000e0 00 00 00 00 00 00 00 09 55 56 57 00 00 00 00 00 |........UVW.....|
000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0a |................|
00000100 58 59 5a 00 00 00 00 00 00 00 00 00 00 00 00 00 |XYZ.............|
00000110 00 00 00 00 |....|
00000114
00000000 00 00 00 06 00 00 00 02 00 00 00 00 00 00 80 01 |................|
00000010 46 72 65 71 2e 00 00 00 00 00 00 00 00 00 00 00 |Freq............|
00000020 00 00 00 00 00 00 00 01 31 00 00 00 00 00 00 00 |........1.......|
|\_________/ \_____________________/
| col1_nr col1_txt
00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 |................|
00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 |................|
|\_________/
| col2_nr
00000040 32 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |2...............|
\_____________________/
col2_txt
00000050 00 00 00 00 00 00 00 03 33 00 00 00 00 00 00 00 |........3.......|
| ...
00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 |................|
00000070 34 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |4...............|
00000080 00 00 00 00 00 00 00 05 35 00 00 00 00 00 00 00 |........5.......|
00000090 00 00 00 00 00 00 00 00 00 00 00 00 |............|
0000009c
Description:
colN_nr - number of the column [1-5]
colN_txt - up to 8 characters containing the column name
Python struct:
data = struct.pack(">L L 4x 2x B B", 0x6, 0x2, 0x80, 0x1) + \
struct.pack("BBBBB 3x 8x", 0x46, 0x72, 0x65, 0x71, 0x2e) + \
struct.pack("4x")
for col in columns:
data += struct.pack(">L 8s 12x", col.nr, col.name)