From 5b2b0b0d88b19301e744e0a84df3bad91c5e28d5 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Sun, 4 Aug 2013 14:15:33 +0200 Subject: pan1321: Support JSEC and JPRO. --- decoders/pan1321/pd.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'decoders/pan1321') 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]]) -- cgit v1.2.3-70-g09d2