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 
Hasher::_callback
void _callback(int gpio, int level, uint32_t tick)
Definition: ir_hasher.cpp:17
Hasher::t3
uint32_t t3
Definition: ir_hasher.hpp:30
Hasher::edges
int edges
Definition: ir_hasher.hpp:29
Hasher::mytimeout
int mytimeout
Definition: ir_hasher.hpp:25
Hasher::mygpio
int mygpio
Definition: ir_hasher.hpp:25
Hasher::mycallback
HasherCB_t mycallback
Definition: ir_hasher.hpp:26
callback
void callback(uint32_t hash)
Definition: test_ir_hasher.c:23
Hasher::t4
uint32_t t4
Definition: ir_hasher.hpp:30
Hasher::t2
uint32_t t2
Definition: ir_hasher.hpp:30
Hasher::Hasher
Hasher(int gpio, HasherCB_t callback, int timeout=5)
Definition: ir_hasher.cpp:75
Hasher
Definition: ir_hasher.hpp:8
Hasher::in_code
int in_code
Definition: ir_hasher.hpp:27
Hasher::_callbackExt
static void _callbackExt(int gpio, int level, uint32_t tick, void *user)
Definition: ir_hasher.cpp:64
Hasher::hash_val
uint32_t hash_val
Definition: ir_hasher.hpp:28
Hasher::_hash
void _hash(int old_val, int new_val)
Definition: ir_hasher.cpp:5
HasherCB_t
void(* HasherCB_t)(uint32_t)
Definition: ir_hasher.hpp:6
Hasher::t1
uint32_t t1
Definition: ir_hasher.hpp:30


cob_hand_bridge
Author(s): Mathias Lüdtke
autogenerated on Fri Aug 2 2024 09:40:56