57 class PIR :
public IPIR
60 typedef std::function< void( const std::string &serial ) > PIRClosedCallback;
62 PIR(
const std::string & serial,
unsigned int version, IPIR::Type type,
const std::string & path,
PIR_Settings * settings, PIRClosedCallback closed );
66 std::string
serial()
const;
68 std::string path()
const;
70 bool sendCCF(
const std::string ccf,
unsigned char bitmask,
unsigned char repeats);
71 bool blink(
unsigned char count);
75 IPIR::Type
type()
const;
76 void waitForStartup();
81 unsigned int m_Version;
85 PIRClosedCallback m_ClosedCallback;
86 hid_device * m_Device;
88 pthread_mutex_t m_Mutex;
89 pthread_mutex_t m_FunctionQueueMutex;
92 BoolSig m_StartupSignal;
93 IParserPtr m_CurrentParser;
94 IParserPtr m_SendIRParser;
95 IParserPtr m_UnknownParser;
96 IParserPtr m_ReceiveParser;
97 IParserPtr m_ButtonParser;
98 IParserPtr m_IRLearnParser;
100 typedef std::function<void()> QueuedFunction;
101 std::list<QueuedFunction> m_QueuedFunctions;
102 std::list<IRSendPtr> m_QueuedIrSignals;
104 static void *_proc(
void * attr );
107 void startCCFSend(
const IRSend *send);
108 void queue( QueuedFunction f );
109 void irSendingDone();
110 size_t functionQueueSize();
113 typedef std::shared_ptr<PIR> PIRPtr;
virtual bool blink(unsigned char count)=0
blinks the LED on the PIR-1
virtual bool sendCCF(const std::string ccf, unsigned char bitmask, unsigned char repeats)=0
sends CCF code.
The PIR interface class.
Definition: ipir.h:47
virtual unsigned int version() const =0
Returns the firmware version number.
virtual std::string serial() const =0
Returns the serial number.
virtual bool learn()=0
starts learn mode on a PIR-1
virtual Type type() const =0
returns the Type of the PIR
the Settings structure.
Definition: pirlib2.h:334
virtual bool cancelLearn()=0
ends learn mode on a PIR-1