diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2012-06-13 19:34:11 +0200 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2012-06-14 01:21:01 +0200 |
commit | e1f5df5bd1d4847f1ebfade8d71161f8a5ede862 (patch) | |
tree | bbd907b63d64268a957bcb1d85198f2c278d6246 /decoders/pan1321 | |
parent | f9b0356bb8e5eeeb406c8be998f0746548a1e2dd (diff) | |
download | libsigrokdecode-e1f5df5bd1d4847f1ebfade8d71161f8a5ede862.tar.gz libsigrokdecode-e1f5df5bd1d4847f1ebfade8d71161f8a5ede862.zip |
srd: pan1321: Add 'Text' (short) annotation format.
Rename the old 'Text' format to 'Text (verbose)'.
Diffstat (limited to 'decoders/pan1321')
-rw-r--r-- | decoders/pan1321/pan1321.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/decoders/pan1321/pan1321.py b/decoders/pan1321/pan1321.py index 670a48e..827269d 100644 --- a/decoders/pan1321/pan1321.py +++ b/decoders/pan1321/pan1321.py @@ -39,6 +39,7 @@ class Decoder(srd.Decoder): optional_probes = [] options = {} annotations = [ + ['Text (verbose)', 'Human-readable text (verbose)'], ['Text', 'Human-readable text'], ] @@ -60,23 +61,30 @@ class Decoder(srd.Decoder): if s.startswith('AT+JSEC'): pin = s[-4:] self.putx([0, ['Host set the Bluetooth PIN to ' + pin]]) + self.putx([1, ['PIN = ' + pin]]) elif s.startswith('AT+JSLN'): name = s[s.find(',') + 1:] self.putx([0, ['Host set the Bluetooth name to ' + name]]) + self.putx([1, ['BT name = ' + name]]) else: self.putx([0, ['Host sent unsupported command: %s' % s]]) + self.putx([1, ['Unsupported command: %s' % s]]) self.cmd[rxtx] = '' def handle_device_reply(self, rxtx, s): if s == 'ROK': self.putx([0, ['Device initialized correctly']]) + self.putx([1, ['Init']]) elif s == 'OK': self.putx([0, ['Device acknowledged last command']]) + self.putx([1, ['ACK']]) elif s.startswith('ERR'): error = s[s.find('=') + 1:] self.putx([0, ['Device sent error code ' + error]]) + self.putx([1, ['ERR = ' + error]]) else: self.putx([0, ['Device sent an unknown reply: %s' % s]]) + self.putx([1, ['Unknown reply: %s' % s]]) self.cmd[rxtx] = '' def decode(self, ss, es, data): |