ir_hasher.hpp
Go to the documentation of this file.
1 #ifndef IR_RX_HASHER_HPP
2 #define IR_RX_HASHER_HPP
3 
4 #include <stdint.h>
5 
6 typedef void (*HasherCB_t)(uint32_t);
7 
8 class Hasher
9 {
10 
11  /*
12  This class forms a hash over the IR pulses generated by an
13  IR remote.
14 
15  The remote key press is not converted into a code in the manner of
16  the lirc module. No attempt is made to decode the type of protocol
17  used by the remote. The hash is likely to be unique for different
18  keys and different remotes but this is not guaranteed.
19 
20  This hashing process works for some remotes/protocols but not for
21  others. The only way to find out if it works for one or more of
22  your remotes is to try it and see.
23  */
24 
27  int in_code;
28  uint32_t hash_val;
29  int edges;
30  uint32_t t1, t2, t3, t4;
31 
32  void _hash(int old_val, int new_val);
33  void _callback(int gpio, int level, uint32_t tick);
34 
35  /* Need a static callback to link with C. */
36  static void _callbackExt(int gpio, int level, uint32_t tick, void *user);
37 
38  public:
39 
40  Hasher(int gpio, HasherCB_t callback, int timeout=5);
41 };
42 
43 #endif
44 
uint32_t t2
Definition: ir_hasher.hpp:30
uint32_t t4
Definition: ir_hasher.hpp:30
uint32_t hash_val
Definition: ir_hasher.hpp:28
HasherCB_t mycallback
Definition: ir_hasher.hpp:26
Hasher(int gpio, HasherCB_t callback, int timeout=5)
Definition: ir_hasher.cpp:75
void callback(uint32_t hash)
int in_code
Definition: ir_hasher.hpp:27
static void _callbackExt(int gpio, int level, uint32_t tick, void *user)
Definition: ir_hasher.cpp:64
void _hash(int old_val, int new_val)
Definition: ir_hasher.cpp:5
uint32_t t1
Definition: ir_hasher.hpp:30
void _callback(int gpio, int level, uint32_t tick)
Definition: ir_hasher.cpp:17
uint32_t t3
Definition: ir_hasher.hpp:30
int edges
Definition: ir_hasher.hpp:29
int mytimeout
Definition: ir_hasher.hpp:25
int mygpio
Definition: ir_hasher.hpp:25
void(* HasherCB_t)(uint32_t)
Definition: ir_hasher.hpp:6


cob_hand_bridge
Author(s): Mathias Lüdtke
autogenerated on Tue Oct 20 2020 03:35:57