From cde0a2c3dfd03892c9fb184c35fe036eb83f8f74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Thu, 30 Jan 2014 16:59:43 +0100 Subject: [PATCH] Radio433 documentation added --- libhive/radio433.cpp | 25 +++++++++++++++++++++++-- libhive/radio433.h | 3 +++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/libhive/radio433.cpp b/libhive/radio433.cpp index 766f47fe..bf337b70 100644 --- a/libhive/radio433.cpp +++ b/libhive/radio433.cpp @@ -1,8 +1,19 @@ +/*! + \class Radio433 + \brief The Radio433 class helps to interact with the 433 MHz Receiver and Transmitter. + + \inmodule libhive + +*/ + #include "radio433.h" #include #include +/*! Constructs a \l{Radio433} object with the given \a parent and initializes the \l{Gpio} pins + * for the transmitter and the receiver. + */ Radio433::Radio433(QObject *parent) : QObject(parent) { @@ -20,13 +31,17 @@ Radio433::Radio433(QObject *parent) : m_receiver->start(); } - +/*! Destroyes the \l{Radio433} object and stops the running threads. + */ Radio433::~Radio433() { m_receiver->quit(); m_receiver->wait(); } +/*! Sends the given \a rawData over the transmitter. The sync signal has to be already in the + * \a rawData. + */ void Radio433::sendData(QList rawData) { @@ -51,6 +66,8 @@ void Radio433::sendData(QList rawData) } +/*! Returns the current system time in microseconds. + */ int Radio433::micros() { struct timeval tv ; @@ -62,6 +79,8 @@ int Radio433::micros() return (int)(now - m_epochMicro) ; } +/*! Creates a delay of a certain time (\a microSeconds). + */ void Radio433::delayMicros(int microSeconds) { struct timespec sleeper; @@ -72,7 +91,9 @@ void Radio433::delayMicros(int microSeconds) nanosleep (&sleeper, NULL) ; } - +/*! This method handels an interrupt on the receiver pin and recognizes, if a valid message of + * 48 bit was received. + */ void Radio433::handleInterrupt() { long currentTime = micros(); diff --git a/libhive/radio433.h b/libhive/radio433.h index 3f00ce52..1ab85edf 100644 --- a/libhive/radio433.h +++ b/libhive/radio433.h @@ -37,6 +37,9 @@ private slots: signals: + /*! This signal is emitted whenever a valid signal of 48 bits was recognized over the + * 433 MHz receiver + */ void dataReceived(QList rawData); };