]> sigrok.org Git - libsigrokdecode.git/commitdiff
pan1321: Add support for JAAC.
authorUwe Hermann <redacted>
Fri, 9 Aug 2013 17:19:00 +0000 (19:19 +0200)
committerUwe Hermann <redacted>
Mon, 2 Sep 2013 07:05:02 +0000 (09:05 +0200)
decoders/pan1321/pd.py

index 96d4385f4cffa949dadb2493285c79ae91ca1658..7e3774e6c8a370fab0da61c2eec80dd8370ba402 100644 (file)
@@ -59,7 +59,16 @@ 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+JPRO'):
+        if s.startswith('AT+JAAC'):
+            # AT+JAAC=x (x can be 0 or 1)
+            p = s[s.find('=') + 1:]
+            if p not in ('0', '1'):
+                self.putx([2, ['Warning: Invalid JAAC parameter "%s"' % p]])
+                return
+            x = 'Auto' if (p == '1') else 'Don\'t auto'
+            self.putx([0, ['%s-accept new connections' % x]])
+            self.putx([1, ['%s-accept connections' % x]])
+        elif s.startswith('AT+JPRO'):
             p = s[s.find('=') + 1:]
             if p not in ('0', '1'):
                 self.putx([2, ['Warning: Invalid JPRO parameter "%s"' % p]])