X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=decoders%2Fpan1321%2Fpd.py;h=ecaa6807f752c20d0ade4bce2c56081ba27e0d58;hb=4f0d192d748e987af43ec5b811a643eb0a8601b2;hp=7edd1c893b07a091ab4a9477a190dd4b480ebaad;hpb=e28f7aee3b96afeb543e0c3c29e3950ddd61a490;p=libsigrokdecode.git diff --git a/decoders/pan1321/pd.py b/decoders/pan1321/pd.py index 7edd1c8..ecaa680 100644 --- a/decoders/pan1321/pd.py +++ b/decoders/pan1321/pd.py @@ -14,8 +14,7 @@ ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +## along with this program; if not, see . ## import sigrokdecode as srd @@ -25,7 +24,7 @@ RX = 0 TX = 1 class Decoder(srd.Decoder): - api_version = 2 + api_version = 3 id = 'pan1321' name = 'PAN1321' longname = 'Panasonic PAN1321' @@ -39,7 +38,10 @@ class Decoder(srd.Decoder): ('warnings', 'Human-readable warnings'), ) - def __init__(self, **kwargs): + def __init__(self): + self.reset() + + def reset(self): self.cmd = ['', ''] self.ss_block = None @@ -136,6 +138,9 @@ class Decoder(srd.Decoder): if ptype != 'DATA': return + # We're only interested in the byte value (not individual bits). + pdata = pdata[0] + # If this is the start of a command/reply, remember the start sample. if self.cmd[rxtx] == '': self.ss_block = ss @@ -156,4 +161,3 @@ class Decoder(srd.Decoder): self.handle_host_command(rxtx, self.cmd[rxtx][:-2]) self.cmd[rxtx] = '' -