-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathat_d878uv.py
233 lines (222 loc) · 9.94 KB
/
at_d878uv.py
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# Anytone D878UV specific data
# Memory sections for contact list offsets. Used for writing contact list to device
memSectContactsOffsetWrite = [
{ 'address' : 0x4000000, 'size' : 128000},
{ 'address' : 0x4040000, 'size' : 128000},
{ 'address' : 0x4080000, 'size' : 128000},
{ 'address' : 0x40C0000, 'size' : 128000},
{ 'address' : 0x4100000, 'size' : 128000},
{ 'address' : 0x4140000, 'size' : 128000},
{ 'address' : 0x4180000, 'size' : 128000},
{ 'address' : 0x41C0000, 'size' : 128000},
{ 'address' : 0x4200000, 'size' : 128000},
{ 'address' : 0x4240000, 'size' : 128000},
{ 'address' : 0x4280000, 'size' : 128000},
{ 'address' : 0x42c0000, 'size' : 128000},
{ 'address' : 0x4300000, 'size' : 64000} # maybe more. at least 64000 bytes seen
]
# Memory section for number of contacts and end of contact list address
memSectContactsIndexAddr = 0x44c0000
memSectContactsIndexSize = 16
# Memory sections for contact list
memSectContacts = [
{ 'address' : 0x4500000, 'size' : 100000},
{ 'address' : 0x4540000, 'size' : 100000},
{ 'address' : 0x4580000, 'size' : 100000},
{ 'address' : 0x45c0000, 'size' : 100000},
{ 'address' : 0x4600000, 'size' : 100000},
{ 'address' : 0x4640000, 'size' : 100000},
{ 'address' : 0x4680000, 'size' : 100000},
{ 'address' : 0x46c0000, 'size' : 100000},
{ 'address' : 0x4700000, 'size' : 100000},
{ 'address' : 0x4740000, 'size' : 100000},
{ 'address' : 0x4780000, 'size' : 100000},
{ 'address' : 0x47c0000, 'size' : 100000},
{ 'address' : 0x4800000, 'size' : 100000},
{ 'address' : 0x4840000, 'size' : 100000},
{ 'address' : 0x4880000, 'size' : 100000},
{ 'address' : 0x48c0000, 'size' : 100000},
{ 'address' : 0x4900000, 'size' : 100000},
{ 'address' : 0x4940000, 'size' : 100000},
{ 'address' : 0x4980000, 'size' : 100000},
{ 'address' : 0x49c0000, 'size' : 100000},
{ 'address' : 0x4a00000, 'size' : 100000},
{ 'address' : 0x4a40000, 'size' : 100000},
{ 'address' : 0x4a80000, 'size' : 100000},
{ 'address' : 0x4ac0000, 'size' : 100000},
{ 'address' : 0x4b00000, 'size' : 100000},
{ 'address' : 0x4b40000, 'size' : 100000},
{ 'address' : 0x4b80000, 'size' : 100000},
{ 'address' : 0x4bc0000, 'size' : 100000},
{ 'address' : 0x4c00000, 'size' : 100000},
{ 'address' : 0x4c40000, 'size' : 100000},
{ 'address' : 0x4c80000, 'size' : 100000},
{ 'address' : 0x4cc0000, 'size' : 100000},
{ 'address' : 0x4d00000, 'size' : 100000},
{ 'address' : 0x4d40000, 'size' : 100000},
{ 'address' : 0x4d80000, 'size' : 100000},
{ 'address' : 0x4dc0000, 'size' : 100000},
{ 'address' : 0x4e00000, 'size' : 100000},
{ 'address' : 0x4e40000, 'size' : 100000},
{ 'address' : 0x4e80000, 'size' : 100000},
{ 'address' : 0x4ec0000, 'size' : 100000},
{ 'address' : 0x4f00000, 'size' : 100000},
{ 'address' : 0x4f40000, 'size' : 100000},
{ 'address' : 0x4f80000, 'size' : 100000},
{ 'address' : 0x4fc0000, 'size' : 100000},
{ 'address' : 0x5000000, 'size' : 100000},
{ 'address' : 0x5040000, 'size' : 100000},
{ 'address' : 0x5080000, 'size' : 100000},
{ 'address' : 0x50c0000, 'size' : 100000},
{ 'address' : 0x5100000, 'size' : 100000},
{ 'address' : 0x5140000, 'size' : 100000},
{ 'address' : 0x5180000, 'size' : 100000},
{ 'address' : 0x51c0000, 'size' : 100000},
{ 'address' : 0x5200000, 'size' : 100000},
{ 'address' : 0x5240000, 'size' : 100000},
{ 'address' : 0x5280000, 'size' : 100000},
{ 'address' : 0x52c0000, 'size' : 100000},
{ 'address' : 0x5300000, 'size' : 100000},
{ 'address' : 0x5340000, 'size' : 100000},
{ 'address' : 0x5380000, 'size' : 100000},
{ 'address' : 0x53c0000, 'size' : 100000},
{ 'address' : 0x5400000, 'size' : 100000},
{ 'address' : 0x5440000, 'size' : 100000},
{ 'address' : 0x5480000, 'size' : 100000},
{ 'address' : 0x54c0000, 'size' : 100000},
{ 'address' : 0x5500000, 'size' : 100000},
{ 'address' : 0x5540000, 'size' : 100000},
{ 'address' : 0x5580000, 'size' : 100000},
{ 'address' : 0x55c0000, 'size' : 100000},
{ 'address' : 0x5600000, 'size' : 100000},
{ 'address' : 0x5640000, 'size' : 100000},
{ 'address' : 0x5680000, 'size' : 100000},
{ 'address' : 0x56c0000, 'size' : 100000},
{ 'address' : 0x5700000, 'size' : 100000},
{ 'address' : 0x5740000, 'size' : 100000},
{ 'address' : 0x5780000, 'size' : 100000},
{ 'address' : 0x57c0000, 'size' : 100000},
{ 'address' : 0x5800000, 'size' : 100000},
{ 'address' : 0x5840000, 'size' : 100000},
{ 'address' : 0x5880000, 'size' : 100000},
{ 'address' : 0x58c0000, 'size' : 100000},
{ 'address' : 0x5900000, 'size' : 100000},
{ 'address' : 0x5940000, 'size' : 100000},
{ 'address' : 0x5980000, 'size' : 100000},
{ 'address' : 0x59c0000, 'size' : 100000},
{ 'address' : 0x5a00000, 'size' : 100000},
{ 'address' : 0x5a40000, 'size' : 100000},
{ 'address' : 0x5a80000, 'size' : 100000},
{ 'address' : 0x5ac0000, 'size' : 100000},
{ 'address' : 0x5b00000, 'size' : 100000},
{ 'address' : 0x5b40000, 'size' : 100000},
{ 'address' : 0x5b80000, 'size' : 100000},
{ 'address' : 0x5bc0000, 'size' : 100000},
{ 'address' : 0x5c00000, 'size' : 100000},
{ 'address' : 0x5c40000, 'size' : 100000},
{ 'address' : 0x5c80000, 'size' : 100000},
{ 'address' : 0x5cc0000, 'size' : 100000},
{ 'address' : 0x5d00000, 'size' : 100000},
{ 'address' : 0x5d40000, 'size' : 100000},
{ 'address' : 0x5d80000, 'size' : 100000},
{ 'address' : 0x5dc0000, 'size' : 100000},
{ 'address' : 0x5e00000, 'size' : 100000},
{ 'address' : 0x5e40000, 'size' : 100000},
{ 'address' : 0x5e80000, 'size' : 100000},
{ 'address' : 0x5ec0000, 'size' : 100000},
{ 'address' : 0x5f00000, 'size' : 100000},
{ 'address' : 0x5f40000, 'size' : 100000},
{ 'address' : 0x5f80000, 'size' : 100000},
{ 'address' : 0x5fc0000, 'size' : 100000},
{ 'address' : 0x6000000, 'size' : 100000},
{ 'address' : 0x6040000, 'size' : 100000},
{ 'address' : 0x6080000, 'size' : 100000},
{ 'address' : 0x60c0000, 'size' : 100000},
{ 'address' : 0x6100000, 'size' : 100000},
{ 'address' : 0x6140000, 'size' : 100000},
{ 'address' : 0x6180000, 'size' : 100000},
{ 'address' : 0x61c0000, 'size' : 100000},
{ 'address' : 0x6200000, 'size' : 100000},
{ 'address' : 0x6240000, 'size' : 100000},
{ 'address' : 0x6280000, 'size' : 100000},
{ 'address' : 0x62c0000, 'size' : 100000},
{ 'address' : 0x6300000, 'size' : 100000},
{ 'address' : 0x6340000, 'size' : 100000},
{ 'address' : 0x6380000, 'size' : 100000},
{ 'address' : 0x63c0000, 'size' : 100000},
{ 'address' : 0x6400000, 'size' : 100000},
{ 'address' : 0x6440000, 'size' : 100000},
{ 'address' : 0x6480000, 'size' : 100000},
{ 'address' : 0x64c0000, 'size' : 100000},
{ 'address' : 0x6500000, 'size' : 100000},
{ 'address' : 0x6540000, 'size' : 100000},
{ 'address' : 0x6580000, 'size' : 100000},
{ 'address' : 0x65c0000, 'size' : 100000},
{ 'address' : 0x6600000, 'size' : 100000},
{ 'address' : 0x6640000, 'size' : 100000},
{ 'address' : 0x6680000, 'size' : 100000},
{ 'address' : 0x66c0000, 'size' : 100000},
{ 'address' : 0x6700000, 'size' : 100000},
{ 'address' : 0x6740000, 'size' : 100000},
{ 'address' : 0x6780000, 'size' : 100000},
{ 'address' : 0x67c0000, 'size' : 100000},
{ 'address' : 0x6800000, 'size' : 100000},
{ 'address' : 0x6840000, 'size' : 100000},
{ 'address' : 0x6880000, 'size' : 100000},
{ 'address' : 0x68c0000, 'size' : 100000},
{ 'address' : 0x6900000, 'size' : 100000},
{ 'address' : 0x6940000, 'size' : 100000},
{ 'address' : 0x6980000, 'size' : 100000},
{ 'address' : 0x69c0000, 'size' : 100000},
{ 'address' : 0x6a00000, 'size' : 100000},
{ 'address' : 0x6a40000, 'size' : 100000},
{ 'address' : 0x6a80000, 'size' : 100000},
{ 'address' : 0x6ac0000, 'size' : 100000},
{ 'address' : 0x6b00000, 'size' : 100000},
{ 'address' : 0x6b40000, 'size' : 100000},
{ 'address' : 0x6b80000, 'size' : 100000},
{ 'address' : 0x6bc0000, 'size' : 100000},
{ 'address' : 0x6c00000, 'size' : 100000},
{ 'address' : 0x6c40000, 'size' : 100000},
{ 'address' : 0x6c80000, 'size' : 100000},
{ 'address' : 0x6cc0000, 'size' : 100000},
{ 'address' : 0x6d00000, 'size' : 100000},
{ 'address' : 0x6d40000, 'size' : 100000},
{ 'address' : 0x6d80000, 'size' : 100000},
{ 'address' : 0x6dc0000, 'size' : 100000},
{ 'address' : 0x6e00000, 'size' : 100000},
{ 'address' : 0x6e40000, 'size' : 100000},
{ 'address' : 0x6e80000, 'size' : 100000},
{ 'address' : 0x6ec0000, 'size' : 100000},
{ 'address' : 0x6f00000, 'size' : 100000},
{ 'address' : 0x6f40000, 'size' : 100000},
{ 'address' : 0x6f80000, 'size' : 100000},
{ 'address' : 0x6fc0000, 'size' : 100000},
{ 'address' : 0x7000000, 'size' : 100000},
{ 'address' : 0x7040000, 'size' : 100000},
{ 'address' : 0x7080000, 'size' : 100000},
{ 'address' : 0x70c0000, 'size' : 100000},
{ 'address' : 0x7100000, 'size' : 100000},
{ 'address' : 0x7140000, 'size' : 100000},
{ 'address' : 0x7180000, 'size' : 100000},
{ 'address' : 0x71c0000, 'size' : 100000},
{ 'address' : 0x7200000, 'size' : 100000},
{ 'address' : 0x7240000, 'size' : 100000},
{ 'address' : 0x7280000, 'size' : 100000},
{ 'address' : 0x72c0000, 'size' : 100000},
{ 'address' : 0x7300000, 'size' : 100000},
{ 'address' : 0x7340000, 'size' : 100000},
{ 'address' : 0x7380000, 'size' : 100000},
{ 'address' : 0x73c0000, 'size' : 100000},
{ 'address' : 0x7400000, 'size' : 100000},
{ 'address' : 0x7440000, 'size' : 100000},
{ 'address' : 0x7480000, 'size' : 100000},
{ 'address' : 0x74c0000, 'size' : 100000},
{ 'address' : 0x7500000, 'size' : 100000},
{ 'address' : 0x7540000, 'size' : 100000},
{ 'address' : 0x7580000, 'size' : 100000},
{ 'address' : 0x75c0000, 'size' : 100000},
{ 'address' : 0x7600000, 'size' : 100000},
{ 'address' : 0x7640000, 'size' : 100000},
{ 'address' : 0x7680000, 'size' : 16}, # maybe more. at least 16 bytes seen
]