]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/nunchuk.py
Partial implementation of the streaming PD API.
[libsigrokdecode.git] / decoders / nunchuk.py
index 77b154eb377cedfb4a55089e1c508d423ea52121..57be1d77068c8539b6e0d24b061386bcbe2af3d9 100644 (file)
@@ -47,7 +47,12 @@ example_packets = [
        {'type': 'P',  'range': (32, 33), 'data': None, 'ann': ''},
 ]
 
-def decode(inbuf):
+def decode(l):
+       print(l)
+       sigrok.put(l)
+
+
+def decode2(inbuf):
        """Nintendo Wii Nunchuk decoder"""
 
        # FIXME: Get the data in the correct format in the first place.
@@ -139,27 +144,26 @@ def decode(inbuf):
        # FIXME
        return ''
 
-def register():
-       return {
-               'id': 'nunchuk',
-               'name': 'Nunchuk',
-               'longname': 'Nintendo Wii Nunchuk decoder',
-               'desc': 'Decodes the Nintendo Wii Nunchuk I2C-based protocol.',
-               'longdesc': '...',
-               'author': 'Uwe Hermann',
-               'email': 'uwe@hermann-uwe.de',
-               'license': 'gplv2+',
-               'in': ['i2c'],
-               'out': ['nunchuck'],
-               'probes': [
-                       # TODO
-               ],
-               'options': {
-                       # TODO
-               },
-               # 'start': start,
-               # 'report': report,
-       }
+register = {
+       'id': 'nunchuk',
+       'name': 'Nunchuk',
+       'longname': 'Nintendo Wii Nunchuk decoder',
+       'desc': 'Decodes the Nintendo Wii Nunchuk I2C-based protocol.',
+       'longdesc': '...',
+       'author': 'Uwe Hermann',
+       'email': 'uwe@hermann-uwe.de',
+       'license': 'gplv2+',
+       'in': ['i2c'],
+       'out': ['nunchuck'],
+       'probes': [
+               # TODO
+       ],
+       'options': {
+               # TODO
+       },
+       # 'start': start,
+       # 'report': report,
+}
 
 # Use psyco (if available) as it results in huge performance improvements.
 try: