This repository has been archived on 2024-12-15. You can view files and clone it, but cannot push or open issues or pull requests.
qSniff/source/sniffer.cpp

23 lines
308 B
C++
Raw Permalink Normal View History

2017-10-18 20:31:39 +00:00
#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;
}