X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=decoders%2Fmiller%2Fpd.py;h=33214b14f600833ac49032eddd2f2c03867b467a;hb=dca19fbfdf0650dba693c0ac6213f6cdb748a8c3;hp=7ccd75eb9c337f9b18d95f997c176f184c88408e;hpb=4e7f2d702807d39bc5cd3835f02ff9d773b0cea1;p=libsigrokdecode.git diff --git a/decoders/miller/pd.py b/decoders/miller/pd.py index 7ccd75e..33214b1 100644 --- a/decoders/miller/pd.py +++ b/decoders/miller/pd.py @@ -34,11 +34,12 @@ class Decoder(srd.Decoder): api_version = 3 id = 'miller' name = 'Miller' - longname = 'Miller decoder for NFC' - desc = 'Decodes (modified) Miller encoding as used in NFC communication.' + longname = 'Miller encoding' + desc = 'Miller encoding protocol.' license = 'gplv2+' inputs = ['logic'] - outputs = ['miller'] + outputs = [] + tags = ['Encoding'] channels = ( {'id': 'data', 'name': 'Data', 'desc': 'Data signal'}, ) @@ -50,9 +51,15 @@ class Decoder(srd.Decoder): ('bit', 'Bit'), ('bitstring', 'Bitstring'), ) - annotation_rows = tuple((u, v, (i,)) for i, (u, v) in enumerate(annotations)) + annotation_rows = tuple((u + 's', v + 's', (i,)) for i, (u, v) in enumerate(annotations)) + binary = ( + ('raw', 'Raw binary'), + ) def __init__(self): + self.reset() + + def reset(self): self.samplerate = None def metadata(self, key, value): @@ -176,7 +183,7 @@ class Decoder(srd.Decoder): numbytes = numbits // 8 + (numbits % 8 > 0) bytestring = bitvalue.to_bytes(numbytes, 'little') - self.put(int(stringstart), int(stringend), self.out_binary, [1, bytestring]) + self.put(int(stringstart), int(stringend), self.out_binary, [0, bytestring]) def decode(self): while True: