summaryrefslogtreecommitdiff
path: root/decoders/pan1321
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2013-08-04 14:15:33 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2013-09-02 09:05:01 +0200
commit5b2b0b0d88b19301e744e0a84df3bad91c5e28d5 (patch)
treef1b3db7bc89bb41d6b6549182b962c51c6c4bba1 /decoders/pan1321
parent2994587f98f205bb8847554bd28483532b277f2c (diff)
downloadlibsigrokdecode-5b2b0b0d88b19301e744e0a84df3bad91c5e28d5.tar.gz
libsigrokdecode-5b2b0b0d88b19301e744e0a84df3bad91c5e28d5.zip
pan1321: Support JSEC and JPRO.
Diffstat (limited to 'decoders/pan1321')
-rw-r--r--decoders/pan1321/pd.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/decoders/pan1321/pd.py b/decoders/pan1321/pd.py
index 96abc48..241399f 100644
--- a/decoders/pan1321/pd.py
+++ b/decoders/pan1321/pd.py
@@ -1,7 +1,7 @@
##
## This file is part of the libsigrokdecode project.
##
-## Copyright (C) 2012 Uwe Hermann <uwe@hermann-uwe.de>
+## Copyright (C) 2012-2013 Uwe Hermann <uwe@hermann-uwe.de>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
@@ -58,13 +58,22 @@ class Decoder(srd.Decoder):
self.put(self.ss_block, self.es_block, self.out_ann, data)
def handle_host_command(self, rxtx, s):
- if s.startswith('AT+JSEC'):
+ if s.startswith('AT+JPRO'):
+ p = s[s.find('=') + 1:]
+ onoff = 'off' if (p == '0') else 'on'
+ x = 'Leaving' if (p == '0') else 'Entering'
+ self.putx([0, ['%s production mode' % x]])
+ self.putx([1, ['Production mode = %s' % onoff]])
+ elif s.startswith('AT+JRES'):
+ self.putx([0, ['Triggering a software reset']])
+ self.putx([1, ['Reset']])
+ elif s.startswith('AT+JSEC'):
pin = s[-4:]
- self.putx([0, ['Host set the Bluetooth PIN to ' + pin]])
+ 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([0, ['Host set the Bluetooth name to "' + name + '"']])
self.putx([1, ['BT name = ' + name]])
else:
self.putx([0, ['Host sent unsupported command: %s' % s]])