236 #include "pirlib2_global.h"
249 #define PIR_ARRIVED_STATUS 1
250 #define PIR_REMOVED_STATUS 2
267 typedef void (*
fStatusCB) (
const char * serial,
unsigned char status,
void * userData);
279 typedef void (*
fIrReceivedCB) (
const char * serial,
const unsigned int * pulses,
unsigned int pulseCount,
void * userData);
287 typedef void (*
fIrSentCB) (
const char * serial,
unsigned char status,
void * userData );
298 typedef void (*
fIrRawLearnCB) (
const char * serial,
unsigned int modulation,
const unsigned int * pulses,
unsigned int pulseCount,
void * userData );
313 #define PIR_BUTTON_IDLE 0
314 #define PIR_BUTTON_DOWN 1
315 #define PIR_BUTTON_REPEAT 2
316 #define PIR_BUTTON_UP 3
329 typedef void (*
fButtonCB) (
const char * serial,
int button1,
int button2,
int button3,
int button4,
void * userData );
398 PIRLIB2SHARED_EXPORT
int pir_sendCCF (
const char * serial,
const char * ccf,
int bitmask,
unsigned char repeats ) ;
408 PIRLIB2SHARED_EXPORT
unsigned int pir_list1 (
char * buffer,
unsigned int size );
419 PIRLIB2SHARED_EXPORT
unsigned int pir_list4 (
char * buffer,
unsigned int size );
427 PIRLIB2SHARED_EXPORT
int pir_version (
const char * serial );
437 PIRLIB2SHARED_EXPORT
int pir_blink(
const char * serial,
unsigned char count );
456 PIRLIB2SHARED_EXPORT
int pir_type(
const char * serial );
477 PIRLIB2SHARED_EXPORT
int pir_learn(
const char * serial );
PIRLIB2SHARED_EXPORT int pir_cancelLearn(const char *serial)
starts learn mode
Definition: pirlib2.cpp:174
fStatusCB statusCallback
called when an PIR arrives or is removed.
Definition: pirlib2.h:340
PIRLIB2SHARED_EXPORT int pir_blink(const char *serial, unsigned char count)
Blinks the LED on the attached PIR-1.
Definition: pirlib2.cpp:116
fIrReceivedCB receiveCallback
called when an IR signal is recevied in normal mode.
Definition: pirlib2.h:342
PIRLIB2SHARED_EXPORT int pir_close()
Close the library.
Definition: pirlib2.cpp:25
PIRLIB2SHARED_EXPORT int pir_detect()
Looks for attached PIR-1 or PIR-4 devices. This library runs this code on startup but after that the ...
Definition: pirlib2.cpp:150
void(* fIrRawLearnCB)(const char *serial, unsigned int modulation, const unsigned int *pulses, unsigned int pulseCount, void *userData)
fIrRawLearnCB is called when an IR code is received in LEARN mode.
Definition: pirlib2.h:298
int size
fill with sizeof(PIR_Settings)
Definition: pirlib2.h:336
fIrSentCB sendCallback
called when IR signal is done sending.
Definition: pirlib2.h:338
PIRLIB2SHARED_EXPORT unsigned int pir_list1(char *buffer, unsigned int size)
Get a comma separated list of PIR-1 serial numbers.
Definition: pirlib2.cpp:49
void(* fButtonCB)(const char *serial, int button1, int button2, int button3, int button4, void *userData)
fButtonCB is called on a button event.
Definition: pirlib2.h:329
void(* fStatusCB)(const char *serial, unsigned char status, void *userData)
Callback called when the status of the PIR-1 driver is affected.
Definition: pirlib2.h:267
PIRLIB2SHARED_EXPORT unsigned int pir_list4(char *buffer, unsigned int size)
Get a comma separated list of PIR-4 serial numbers.
Definition: pirlib2.cpp:74
void * userData
data needed by caller of pir library, passed by into all callbacks.
Definition: pirlib2.h:349
PIRLIB2SHARED_EXPORT int pir_version(const char *serial)
Returns the firmware version of the attached PIR.
Definition: pirlib2.cpp:99
PIRLIB2SHARED_EXPORT int pir_open(PIR_Settings *settings)
Opens the PIR Library. This must be called only once.
Definition: pirlib2.cpp:10
fButtonCB buttonCallback
called when a button is pressed on a PIR-1.
Definition: pirlib2.h:344
the Settings structure.
Definition: pirlib2.h:334
void(* fIrSentCB)(const char *serial, unsigned char status, void *userData)
fIrSentCB is called when an IR code was sent.
Definition: pirlib2.h:287
fIrRawLearnCB rawLearnCallback
called when an IR signal is received in learn mode.
Definition: pirlib2.h:346
PIRLIB2SHARED_EXPORT int pir_sendCCF(const char *serial, const char *ccf, int bitmask, unsigned char repeats)
Transmit a CCF code.
Definition: pirlib2.cpp:38
void(* fIrReceivedCB)(const char *serial, const unsigned int *pulses, unsigned int pulseCount, void *userData)
Called when an IR signal is received in non-learn mode.
Definition: pirlib2.h:279
PIRLIB2SHARED_EXPORT int pir_learn(const char *serial)
starts learn mode
Definition: pirlib2.cpp:162
PIRLIB2SHARED_EXPORT int pir_type(const char *serial)
Returns the type.
Definition: pirlib2.cpp:133