Added console application, Fixes #5
This commit is contained in:
parent
7143900c22
commit
d12eb36ffe
5 changed files with 76 additions and 24 deletions
22
source/sniffer.cpp
Normal file
22
source/sniffer.cpp
Normal file
|
@ -0,0 +1,22 @@
|
|||
#include "sniffer.h"
|
||||
|
||||
Sniffer::Sniffer(unsigned int pin)
|
||||
{
|
||||
wiringPiSetup();
|
||||
|
||||
m_switch.enableReceive(pin);
|
||||
}
|
||||
|
||||
unsigned int Sniffer::receive()
|
||||
{
|
||||
|
||||
if (m_switch.available())
|
||||
{
|
||||
unsigned int receivedValue = m_switch.getReceivedValue();
|
||||
m_switch.resetAvailable();
|
||||
return receivedValue;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue