Public Member Functions | Public Attributes | Private Member Functions
wiegand.decoder Class Reference

List of all members.

Public Member Functions

def __init__
def cancel

Public Attributes

 bit_timeout
 bits
 callback
 cb_0
 cb_1
 code_timeout
 gpio_0
 gpio_1
 in_code
 num
 pi

Private Member Functions

def _cb

Detailed Description

A class to read Wiegand codes of an arbitrary length.

The code length and value are returned.

EXAMPLE

#!/usr/bin/env python

import time

import pigpio

import wiegand

def callback(bits, code):
   print("bits={} code={}".format(bits, code))

pi = pigpio.pi()

w = wiegand.decoder(pi, 14, 15, callback)

time.sleep(300)

w.cancel()

pi.stop()

Definition at line 5 of file wiegand.py.


Constructor & Destructor Documentation

def wiegand.decoder.__init__ (   self,
  pi,
  gpio_0,
  gpio_1,
  callback,
  bit_timeout = 5 
)
Instantiate with the pi, gpio for 0 (green wire), the gpio for 1
(white wire), the callback function, and the bit timeout in
milliseconds which indicates the end of a code.

The callback is passed the code length in bits and the value.

Definition at line 36 of file wiegand.py.


Member Function Documentation

def wiegand.decoder._cb (   self,
  gpio,
  level,
  tick 
) [private]
Accumulate bits until both gpios 0 and 1 timeout.

Definition at line 65 of file wiegand.py.

def wiegand.decoder.cancel (   self)
Cancel the Wiegand decoder.

Definition at line 106 of file wiegand.py.


Member Data Documentation

Definition at line 42 of file wiegand.py.

Definition at line 67 of file wiegand.py.

Definition at line 42 of file wiegand.py.

Definition at line 42 of file wiegand.py.

Definition at line 42 of file wiegand.py.

Definition at line 67 of file wiegand.py.

Definition at line 42 of file wiegand.py.

Definition at line 42 of file wiegand.py.

Definition at line 42 of file wiegand.py.

Definition at line 67 of file wiegand.py.

Definition at line 42 of file wiegand.py.


The documentation for this class was generated from the following file:


cob_hand_bridge
Author(s): Mathias Lüdtke
autogenerated on Thu Jun 6 2019 20:43:57