From decde15ecb51b3326b31019af61e0a729b9c61d0 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Wed, 25 Jan 2012 22:11:38 +0100 Subject: srd: All PDs: Various fixes, cosmetics. - List all API methods and metadata variables in all PDs to make things easier and more consistent for new PD writers. - Fix probe assignment in a few PDs. - Raise exceptions upon invalid states of the PD state machines (bug). --- decoders/pan1321/pan1321.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'decoders/pan1321') diff --git a/decoders/pan1321/pan1321.py b/decoders/pan1321/pan1321.py index 2c86449..f383e00 100644 --- a/decoders/pan1321/pan1321.py +++ b/decoders/pan1321/pan1321.py @@ -47,6 +47,7 @@ class Decoder(srd.Decoder): inputs = ['uart'] outputs = ['pan1321'] probes = [] + extra_probes = [] options = {} annotations = [ ['ASCII', 'TODO: description'], @@ -73,7 +74,7 @@ class Decoder(srd.Decoder): [ANN_ASCII, ['Host set the Bluetooth name to ' + name]]) else: self.put(ss, es, self.out_ann, - [ANN_ASCII, ['Host sent unsupported command']]) + [ANN_ASCII, ['Host sent unsupported command: %s' % s]]) self.cmd[rxtx] = '' def handle_device_reply(self, ss, es, rxtx, s): @@ -89,7 +90,7 @@ class Decoder(srd.Decoder): [ANN_ASCII, ['Device sent error code ' + error]]) else: self.put(ss, es, self.out_ann, - [ANN_ASCII, ['Device sent an unknown reply']]) + [ANN_ASCII, ['Device sent an unknown reply: %s' % s]]) self.cmd[rxtx] = '' def decode(self, ss, es, data): @@ -112,5 +113,5 @@ class Decoder(srd.Decoder): elif rxtx == TX: self.handle_host_command(ss, es, rxtx, self.cmd[rxtx]) else: - pass # TODO: Error. + raise Exception('Invalid rxtx value: %d' % rxtx) -- cgit v1.2.3-70-g09d2