From: Uwe Hermann Date: Sun, 4 Aug 2013 12:15:33 +0000 (+0200) Subject: pan1321: Support JSEC and JPRO. X-Git-Tag: libsigrokdecode-0.3.0~341 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=5b2b0b0d88b19301e744e0a84df3bad91c5e28d5;p=libsigrokdecode.git pan1321: Support JSEC and JPRO. --- 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 +## Copyright (C) 2012-2013 Uwe Hermann ## ## 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]])