]>
Commit | Line | Data |
---|---|---|
1 | ## | |
2 | ## This file is part of the sigrok project. | |
3 | ## | |
4 | ## Copyright (C) 2015 Uwe Hermann <uwe@hermann-uwe.de> | |
5 | ## | |
6 | ## This program is free software; you can redistribute it and/or modify | |
7 | ## it under the terms of the GNU General Public License as published by | |
8 | ## the Free Software Foundation; either version 2 of the License, or | |
9 | ## (at your option) any later version. | |
10 | ## | |
11 | ## This program is distributed in the hope that it will be useful, | |
12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | ## GNU General Public License for more details. | |
15 | ## | |
16 | ## You should have received a copy of the GNU General Public License | |
17 | ## along with this program; if not, write to the Free Software | |
18 | ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
19 | ## | |
20 | ||
21 | import sigrokdecode as srd | |
22 | from .lists import * | |
23 | ||
24 | class Decoder(srd.Decoder): | |
25 | api_version = 2 | |
26 | id = 'sdcard_sd' | |
27 | name = 'SD card (SD mode)' | |
28 | longname = 'Secure Digital card (SD mode)' | |
29 | desc = 'Secure Digital card (SD mode) low-level protocol.' | |
30 | license = 'gplv2+' | |
31 | inputs = ['logic'] | |
32 | outputs = ['sdcard_sd'] | |
33 | channels = ( | |
34 | {'id': 'cmd', 'name': 'CMD', 'desc': 'Command'}, | |
35 | {'id': 'clk', 'name': 'CLK', 'desc': 'Clock'}, | |
36 | ) | |
37 | optional_channels = ( | |
38 | {'id': 'dat0', 'name': 'DAT0', 'desc': 'Data pin 0'}, | |
39 | {'id': 'dat1', 'name': 'DAT1', 'desc': 'Data pin 1'}, | |
40 | {'id': 'dat2', 'name': 'DAT2', 'desc': 'Data pin 2'}, | |
41 | {'id': 'dat3', 'name': 'DAT3', 'desc': 'Data pin 3'}, | |
42 | ) | |
43 | annotations = \ | |
44 | tuple(('cmd%d' % i, 'CMD%d' % i) for i in range(64)) + \ | |
45 | tuple(('acmd%d' % i, 'ACMD%d' % i) for i in range(64)) + ( \ | |
46 | ('bits', 'Bits'), | |
47 | ('field-start', 'Start bit'), | |
48 | ('field-transmission', 'Transmission bit'), | |
49 | ('field-cmd', 'Command'), | |
50 | ('field-arg', 'Argument'), | |
51 | ('field-crc', 'CRC'), | |
52 | ('field-end', 'End bit'), | |
53 | ('decoded-bits', 'Decoded bits'), | |
54 | ('decoded-fields', 'Decoded fields'), | |
55 | ) | |
56 | annotation_rows = ( | |
57 | ('raw-bits', 'Raw bits', (128,)), | |
58 | ('decoded-bits', 'Decoded bits', (135,)), | |
59 | ('decoded-fields', 'Decoded fields', (136,)), | |
60 | ('fields', 'Fields', tuple(range(129, 135))), | |
61 | ('cmd', 'Commands', tuple(range(128))), | |
62 | ) | |
63 | ||
64 | def __init__(self, **kwargs): | |
65 | self.state = 'GET COMMAND TOKEN' | |
66 | self.token = [] | |
67 | self.oldpins = None | |
68 | self.oldclk = 0 | |
69 | self.is_acmd = False # Indicates CMD vs. ACMD | |
70 | self.cmd = None | |
71 | self.arg = None | |
72 | ||
73 | def start(self): | |
74 | self.out_ann = self.register(srd.OUTPUT_ANN) | |
75 | ||
76 | def putbit(self, b, data): | |
77 | self.put(self.token[b][0], self.token[b][1], self.out_ann, [135, data]) | |
78 | ||
79 | def putt(self, data): | |
80 | self.put(self.token[0][0], self.token[47][1], self.out_ann, data) | |
81 | ||
82 | def putt2(self, data): | |
83 | self.put(self.token[47][0], self.token[0][1], self.out_ann, data) | |
84 | ||
85 | def putf(self, s, e, data): | |
86 | self.put(self.token[s][0], self.token[e][1], self.out_ann, data) | |
87 | ||
88 | def puta(self, s, e, data): | |
89 | self.put(self.token[47 - 8 - e][0], self.token[47 - 8 - s][1], | |
90 | self.out_ann, data) | |
91 | ||
92 | def putc(self, cmd, desc): | |
93 | self.putt([cmd, ['%s: %s' % (self.cmd_str, desc), self.cmd_str, | |
94 | self.cmd_str.split(' ')[0]]]) | |
95 | ||
96 | def putr(self, cmd, desc): | |
97 | self.putt([cmd, ['Reply: %s' % desc]]) | |
98 | ||
99 | def putr2(self, cmd, desc): | |
100 | self.putt2([cmd, ['Reply: %s' % desc]]) | |
101 | ||
102 | def reset(self): | |
103 | self.cmd, self.arg = None, None | |
104 | self.token, self.state = [], 'GET COMMAND TOKEN' | |
105 | ||
106 | def cmd_name(self, cmd): | |
107 | c = acmd_names if self.is_acmd else cmd_names | |
108 | return c.get(cmd, 'Unknown') | |
109 | ||
110 | def get_token_bits(self, cmd, n): | |
111 | # Get a bit, return True if we already got 'n' bits, False otherwise. | |
112 | self.token.append([self.samplenum, self.samplenum, cmd]) | |
113 | if len(self.token) > 0: | |
114 | self.token[len(self.token) - 2][1] = self.samplenum | |
115 | if len(self.token) < n: | |
116 | return False | |
117 | self.token[n - 1][1] += self.token[n - 1][0] - self.token[n - 2][0] | |
118 | return True | |
119 | ||
120 | def handle_common_token_fields(self): | |
121 | s = self.token | |
122 | ||
123 | # Annotations for each individual bit. | |
124 | for bit in range(len(self.token)): | |
125 | self.putf(bit, bit, [128, ['%d' % s[bit][2]]]) | |
126 | ||
127 | # CMD[47:47]: Start bit (always 0) | |
128 | self.putf(0, 0, [129, ['Start bit', 'Start', 'S']]) | |
129 | ||
130 | # CMD[46:46]: Transmission bit (1 == host) | |
131 | t = 'host' if s[1][2] == 1 else 'card' | |
132 | self.putf(1, 1, [130, ['Transmission: ' + t, 'T: ' + t, 'T']]) | |
133 | ||
134 | # CMD[45:40]: Command index (BCD; valid: 0-63) | |
135 | self.cmd = int('0b' + ''.join([str(s[i][2]) for i in range(2, 8)]), 2) | |
136 | c = '%s (%d)' % (self.cmd_name(self.cmd), self.cmd) | |
137 | self.putf(2, 7, [131, ['Command: ' + c, 'Cmd: ' + c, | |
138 | 'CMD%d' % self.cmd, 'Cmd', 'C']]) | |
139 | ||
140 | # CMD[39:08]: Argument | |
141 | self.putf(8, 39, [132, ['Argument', 'Arg', 'A']]) | |
142 | ||
143 | # CMD[07:01]: CRC7 | |
144 | self.crc = int('0b' + ''.join([str(s[i][2]) for i in range(40, 47)]), 2) | |
145 | self.putf(40, 46, [133, ['CRC: 0x%x' % self.crc, 'CRC', 'C']]) | |
146 | ||
147 | # CMD[00:00]: End bit (always 1) | |
148 | self.putf(47, 47, [134, ['End bit', 'End', 'E']]) | |
149 | ||
150 | def get_command_token(self, cmd): | |
151 | # Command tokens (48 bits) are sent serially (MSB-first) by the host | |
152 | # (over the CMD line), either to one SD card or to multiple ones. | |
153 | # | |
154 | # Format: | |
155 | # - Bits[47:47]: Start bit (always 0) | |
156 | # - Bits[46:46]: Transmission bit (1 == host) | |
157 | # - Bits[45:40]: Command index (BCD; valid: 0-63) | |
158 | # - Bits[39:08]: Argument | |
159 | # - Bits[07:01]: CRC7 | |
160 | # - Bits[00:00]: End bit (always 1) | |
161 | ||
162 | if not self.get_token_bits(cmd, 48): | |
163 | return | |
164 | ||
165 | self.handle_common_token_fields() | |
166 | ||
167 | # Handle command. | |
168 | s = 'ACMD' if self.is_acmd else 'CMD' | |
169 | self.cmd_str = '%s%d (%s)' % (s, self.cmd, self.cmd_name(self.cmd)) | |
170 | if self.cmd in (0, 2, 3, 4, 6, 7, 8, 9, 10, 13, 41, 51, 55): | |
171 | self.state = 'HANDLE CMD%d' % self.cmd | |
172 | else: | |
173 | self.state = 'HANDLE CMD999' | |
174 | self.putc(self.cmd, '%s%d' % (s, self.cmd)) | |
175 | ||
176 | def handle_cmd0(self): | |
177 | # CMD0 (GO_IDLE_STATE) -> no response | |
178 | self.puta(0, 31, [136, ['Stuff bits', 'Stuff', 'SB', 'S']]) | |
179 | self.putc(0, 'Reset all SD cards') | |
180 | self.token, self.state = [], 'GET COMMAND TOKEN' | |
181 | ||
182 | def handle_cmd2(self): | |
183 | # CMD2 (ALL_SEND_CID) -> R2 | |
184 | self.puta(0, 31, [136, ['Stuff bits', 'Stuff', 'SB', 'S']]) | |
185 | self.putc(2, 'Ask card for CID number') | |
186 | self.token, self.state = [], 'GET RESPONSE R2' | |
187 | ||
188 | def handle_cmd3(self): | |
189 | # CMD3 (SEND_RELATIVE_ADDR) -> R6 | |
190 | self.puta(0, 31, [136, ['Stuff bits', 'Stuff', 'SB', 'S']]) | |
191 | self.putc(3, 'Ask card for new relative card address (RCA)') | |
192 | self.token, self.state = [], 'GET RESPONSE R6' | |
193 | ||
194 | def handle_cmd6(self): | |
195 | # CMD6 (SWITCH_FUNC) -> R1 | |
196 | self.putc(6, 'Switch/check card function') | |
197 | self.token, self.state = [], 'GET RESPONSE R1' | |
198 | ||
199 | def handle_cmd7(self): | |
200 | # CMD7 (SELECT/DESELECT_CARD) -> R1b | |
201 | self.putc(7, 'Select / deselect card') | |
202 | self.token, self.state = [], 'GET RESPONSE R6' | |
203 | ||
204 | def handle_cmd8(self): | |
205 | # CMD8 (SEND_IF_COND) -> R7 | |
206 | self.puta(12, 31, [136, ['Reserved', 'Res', 'R']]) | |
207 | self.puta(8, 11, [136, ['Supply voltage', 'Voltage', 'VHS', 'V']]) | |
208 | self.puta(0, 7, [136, ['Check pattern', 'Check pat', 'Check', 'C']]) | |
209 | self.putc(0, 'Send interface condition to card') | |
210 | self.token, self.state = [], 'GET RESPONSE R7' | |
211 | # TODO: Handle case when card doesn't reply with R7 (no reply at all). | |
212 | ||
213 | def handle_cmd9(self): | |
214 | # CMD9 (SEND_CSD) -> R2 | |
215 | self.puta(16, 31, [136, ['RCA', 'R']]) | |
216 | self.puta(0, 15, [136, ['Stuff bits', 'Stuff', 'SB', 'S']]) | |
217 | self.putc(9, 'Send card-specific data (CSD)') | |
218 | self.token, self.state = [], 'GET RESPONSE R2' | |
219 | ||
220 | def handle_cmd10(self): | |
221 | # CMD10 (SEND_CID) -> R2 | |
222 | self.puta(16, 31, [136, ['RCA', 'R']]) | |
223 | self.puta(0, 15, [136, ['Stuff bits', 'Stuff', 'SB', 'S']]) | |
224 | self.putc(9, 'Send card identification data (CID)') | |
225 | self.token, self.state = [], 'GET RESPONSE R2' | |
226 | ||
227 | def handle_cmd13(self): | |
228 | # CMD13 (SEND_STATUS) -> R1 | |
229 | self.puta(16, 31, [136, ['RCA', 'R']]) | |
230 | self.puta(0, 15, [136, ['Stuff bits', 'Stuff', 'SB', 'S']]) | |
231 | self.putc(13, 'Send card status register') | |
232 | self.token, self.state = [], 'GET RESPONSE R1' | |
233 | ||
234 | def handle_cmd16(self): | |
235 | # CMD16 (SET_BLOCKLEN) -> R1 | |
236 | self.blocklen = self.arg | |
237 | self.puta(0, 31, [136, ['Block length', 'Blocklen', 'BL', 'B']]) | |
238 | self.putc(16, 'Set the block length to %d bytes' % self.blocklen) | |
239 | self.token, self.state = [], 'GET RESPONSE R1' | |
240 | ||
241 | def handle_cmd55(self): | |
242 | # CMD55 (APP_CMD) -> R1 | |
243 | self.puta(16, 31, [136, ['RCA', 'R']]) | |
244 | self.puta(0, 15, [136, ['Stuff bits', 'Stuff', 'SB', 'S']]) | |
245 | self.putc(55, 'Next command is an application-specific command') | |
246 | self.is_acmd = True | |
247 | self.token, self.state = [], 'GET RESPONSE R1' | |
248 | ||
249 | def handle_acmd6(self): | |
250 | # ACMD6 (SET_BUS_WIDTH) -> R1 | |
251 | self.putc(64 + 6, 'Read SD config register (SCR)') | |
252 | self.token, self.state = [], 'GET RESPONSE R1' | |
253 | ||
254 | def handle_acmd13(self): | |
255 | # ACMD13 (SD_STATUS) -> R1 | |
256 | self.puta(0, 31, [136, ['Stuff bits', 'Stuff', 'SB', 'S']]) | |
257 | self.putc(64 + 13, 'Set SD status') | |
258 | self.token, self.state = [], 'GET RESPONSE R1' | |
259 | ||
260 | def handle_acmd41(self): | |
261 | # ACMD41 (SD_SEND_OP_COND) -> R3 | |
262 | self.puta(0, 23, [136, ['VDD voltage window', 'VDD volt', 'VDD', 'V']]) | |
263 | self.puta(24, 24, [136, ['S18R']]) | |
264 | self.puta(25, 27, [136, ['Reserved', 'Res', 'R']]) | |
265 | self.puta(28, 28, [136, ['XPC']]) | |
266 | self.puta(29, 29, [136, ['Reserved for eSD', 'Reserved', 'Res', 'R']]) | |
267 | self.puta(30, 30, [136, ['Host capacity support info', 'Host capacity', | |
268 | 'HCS', 'H']]) | |
269 | self.puta(31, 31, [136, ['Reserved', 'Res', 'R']]) | |
270 | self.putc(64 + 41, 'Send HCS info and activate the card init process') | |
271 | self.token, self.state = [], 'GET RESPONSE R3' | |
272 | ||
273 | def handle_acmd51(self): | |
274 | # ACMD51 (SEND_SCR) -> R1 | |
275 | self.putc(64 + 51, 'Read SD config register (SCR)') | |
276 | self.token, self.state = [], 'GET RESPONSE R1' | |
277 | ||
278 | def handle_cmd999(self): | |
279 | self.token, self.state = [], 'GET RESPONSE R1' | |
280 | ||
281 | def handle_acmd999(self): | |
282 | self.token, self.state = [], 'GET RESPONSE R1' | |
283 | ||
284 | # Response tokens can have one of four formats (depends on content). | |
285 | # They can have a total length of 48 or 136 bits. | |
286 | # They're sent serially (MSB-first) by the card that the host | |
287 | # addressed previously, or (synchronously) by all connected cards. | |
288 | ||
289 | def handle_response_r1(self, cmd): | |
290 | # R1: Normal response command | |
291 | # - Bits[47:47]: Start bit (always 0) | |
292 | # - Bits[46:46]: Transmission bit (0 == card) | |
293 | # - Bits[45:40]: Command index (BCD; valid: 0-63) | |
294 | # - Bits[39:08]: Card status | |
295 | # - Bits[07:01]: CRC7 | |
296 | # - Bits[00:00]: End bit (always 1) | |
297 | if not self.get_token_bits(cmd, 48): | |
298 | return | |
299 | self.handle_common_token_fields() | |
300 | self.putr(55, 'R1') | |
301 | self.puta(0, 31, [136, ['Card status', 'Status', 'S']]) | |
302 | for i in range(32): | |
303 | self.putbit(8 + i, [card_status[31 - i]]) | |
304 | self.token, self.state = [], 'GET COMMAND TOKEN' | |
305 | ||
306 | def handle_response_r1b(self, cmd): | |
307 | # R1b: Same as R1 with an optional busy signal (on the data line) | |
308 | if not self.get_token_bits(cmd, 48): | |
309 | return | |
310 | self.handle_common_token_fields() | |
311 | self.puta(0, 31, [136, ['Card status', 'Status', 'S']]) | |
312 | self.putr(55, 'R1b') | |
313 | self.token, self.state = [], 'GET COMMAND TOKEN' | |
314 | ||
315 | def handle_response_r2(self, cmd): | |
316 | # R2: CID/CSD register | |
317 | # - Bits[135:135]: Start bit (always 0) | |
318 | # - Bits[134:134]: Transmission bit (0 == card) | |
319 | # - Bits[133:128]: Reserved (always 0b111111) | |
320 | # - Bits[127:001]: CID or CSD register including internal CRC7 | |
321 | # - Bits[000:000]: End bit (always 1) | |
322 | if not self.get_token_bits(cmd, 136): | |
323 | return | |
324 | # Annotations for each individual bit. | |
325 | for bit in range(len(self.token)): | |
326 | self.putf(bit, bit, [128, ['%d' % self.token[bit][2]]]) | |
327 | self.putf(0, 0, [129, ['Start bit', 'Start', 'S']]) | |
328 | t = 'host' if self.token[1][2] == 1 else 'card' | |
329 | self.putf(1, 1, [130, ['Transmission: ' + t, 'T: ' + t, 'T']]) | |
330 | self.putf(2, 7, [131, ['Reserved', 'Res', 'R']]) | |
331 | self.putf(8, 134, [132, ['Argument', 'Arg', 'A']]) | |
332 | self.putf(135, 135, [134, ['End bit', 'End', 'E']]) | |
333 | self.putf(8, 134, [136, ['CID/CSD register', 'CID/CSD', 'C']]) | |
334 | self.putf(0, 135, [55, ['R2']]) | |
335 | self.token, self.state = [], 'GET COMMAND TOKEN' | |
336 | ||
337 | def handle_response_r3(self, cmd): | |
338 | # R3: OCR register | |
339 | # - Bits[47:47]: Start bit (always 0) | |
340 | # - Bits[46:46]: Transmission bit (0 == card) | |
341 | # - Bits[45:40]: Reserved (always 0b111111) | |
342 | # - Bits[39:08]: OCR register | |
343 | # - Bits[07:01]: Reserved (always 0b111111) | |
344 | # - Bits[00:00]: End bit (always 1) | |
345 | if not self.get_token_bits(cmd, 48): | |
346 | return | |
347 | self.putr(55, 'R3') | |
348 | # Annotations for each individual bit. | |
349 | for bit in range(len(self.token)): | |
350 | self.putf(bit, bit, [128, ['%d' % self.token[bit][2]]]) | |
351 | self.putf(0, 0, [129, ['Start bit', 'Start', 'S']]) | |
352 | t = 'host' if self.token[1][2] == 1 else 'card' | |
353 | self.putf(1, 1, [130, ['Transmission: ' + t, 'T: ' + t, 'T']]) | |
354 | self.putf(2, 7, [131, ['Reserved', 'Res', 'R']]) | |
355 | self.putf(8, 39, [132, ['Argument', 'Arg', 'A']]) | |
356 | self.putf(40, 46, [133, ['Reserved', 'Res', 'R']]) | |
357 | self.putf(47, 47, [134, ['End bit', 'End', 'E']]) | |
358 | self.puta(0, 31, [136, ['OCR register', 'OCR reg', 'OCR', 'O']]) | |
359 | self.token, self.state = [], 'GET COMMAND TOKEN' | |
360 | ||
361 | def handle_response_r6(self, cmd): | |
362 | # R6: Published RCA response | |
363 | # - Bits[47:47]: Start bit (always 0) | |
364 | # - Bits[46:46]: Transmission bit (0 == card) | |
365 | # - Bits[45:40]: Command index (always 0b000011) | |
366 | # - Bits[39:24]: Argument[31:16]: New published RCA of the card | |
367 | # - Bits[23:08]: Argument[15:0]: Card status bits | |
368 | # - Bits[07:01]: CRC7 | |
369 | # - Bits[00:00]: End bit (always 1) | |
370 | if not self.get_token_bits(cmd, 48): | |
371 | return | |
372 | self.handle_common_token_fields() | |
373 | self.puta(0, 15, [136, ['Card status bits', 'Status', 'S']]) | |
374 | self.puta(16, 31, [136, ['Relative card address', 'RCA', 'R']]) | |
375 | self.putr(55, 'R6') | |
376 | self.token, self.state = [], 'GET COMMAND TOKEN' | |
377 | ||
378 | def handle_response_r7(self, cmd): | |
379 | # R7: Card interface condition | |
380 | # - Bits[47:47]: Start bit (always 0) | |
381 | # - Bits[46:46]: Transmission bit (0 == card) | |
382 | # - Bits[45:40]: Command index (always 0b001000) | |
383 | # - Bits[39:20]: Reserved bits (all-zero) | |
384 | # - Bits[19:16]: Voltage accepted | |
385 | # - Bits[15:08]: Echo-back of check pattern | |
386 | # - Bits[07:01]: CRC7 | |
387 | # - Bits[00:00]: End bit (always 1) | |
388 | if not self.get_token_bits(cmd, 48): | |
389 | return | |
390 | self.handle_common_token_fields() | |
391 | ||
392 | self.putr(55, 'R7') | |
393 | ||
394 | # Arg[31:12]: Reserved bits (all-zero) | |
395 | self.puta(12, 31, [136, ['Reserved', 'Res', 'R']]) | |
396 | ||
397 | # Arg[11:08]: Voltage accepted | |
398 | v = ''.join(str(i[2]) for i in self.token[28:32]) | |
399 | av = accepted_voltages.get(int('0b' + v, 2), 'Unknown') | |
400 | self.puta(8, 11, [136, ['Voltage accepted: ' + av, 'Voltage', 'Volt', 'V']]) | |
401 | ||
402 | # Arg[07:00]: Echo-back of check pattern | |
403 | self.puta(0, 7, [136, ['Echo-back of check pattern', 'Echo', 'E']]) | |
404 | ||
405 | self.token, self.state = [], 'GET COMMAND TOKEN' | |
406 | ||
407 | def decode(self, ss, es, data): | |
408 | for (self.samplenum, pins) in data: | |
409 | ||
410 | # Ignore identical samples early on (for performance reasons). | |
411 | if self.oldpins == pins: | |
412 | continue | |
413 | self.oldpins, (cmd, clk, dat0, dat1, dat2, dat3) = pins, pins | |
414 | ||
415 | # Wait for a rising CLK edge. | |
416 | if not (self.oldclk == 0 and clk == 1): | |
417 | self.oldclk = clk | |
418 | continue | |
419 | self.oldclk = clk | |
420 | ||
421 | # State machine. | |
422 | if self.state == 'GET COMMAND TOKEN': | |
423 | if len(self.token) == 0: | |
424 | # Wait for start bit (CMD = 0). | |
425 | if cmd != 0: | |
426 | continue | |
427 | self.get_command_token(cmd) | |
428 | elif self.state.startswith('HANDLE CMD'): | |
429 | # Call the respective handler method for the command. | |
430 | a, cmdstr = 'a' if self.is_acmd else '', self.state[10:].lower() | |
431 | handle_cmd = getattr(self, 'handle_%scmd%s' % (a, cmdstr)) | |
432 | handle_cmd() | |
433 | # Leave ACMD mode again after the first command after CMD55. | |
434 | if self.is_acmd and cmdstr not in ('55', '63'): | |
435 | self.is_acmd = False | |
436 | elif self.state.startswith('GET RESPONSE'): | |
437 | if len(self.token) == 0: | |
438 | # Wait for start bit (CMD = 0). | |
439 | if cmd != 0: | |
440 | continue | |
441 | # Call the respective handler method for the response. | |
442 | s = 'handle_response_%s' % self.state[13:].lower() | |
443 | handle_response = getattr(self, s) | |
444 | handle_response(cmd) |