18 def __init__(self, device="/dev/ttyUSB0", baudrate=115200, timeout=0.1, |
21 def __init__(self, device="/dev/ttyUSB0", baudrate=115200, timeout=0.1, |
19 address=0): |
22 address=0): |
20 super(HP3562dumper, self).__init__(device, baudrate, timeout, address, mode=1) |
23 super(HP3562dumper, self).__init__(device, baudrate, timeout, address, mode=1) |
21 |
24 |
22 def dump(self, mode='trace', format="binary"): |
25 def dump(self, mode='trace', format="binary"): |
|
26 """ |
|
27 Dump the required data block and return it as a raw string buffer. |
|
28 |
|
29 'mode' can be 'trace' [default], 'state' or 'coord'. |
|
30 'format' can be 'binary' [default], 'ascii' or 'ansi'. |
|
31 """ |
23 format = format.lower() |
32 format = format.lower() |
24 mode = mode.lower() |
33 mode = mode.lower() |
25 assert mode in self.MODES |
34 assert mode in self.MODES |
26 assert format in self.FORMATS |
35 assert format in self.FORMATS |
27 cmd = self.MODES[mode] + self.FORMATS[format] |
36 cmd = self.MODES[mode] + self.FORMATS[format] |