FotoBox
FotoBox::Buzzer Class Reference

This class handles the buzzer. More...

#include <buzzer.h>

+ Inheritance diagram for FotoBox::Buzzer:
+ Collaboration diagram for FotoBox::Buzzer:

Public Slots

void queryPin ()
 Query the Raspberry Pi pin. More...
 

Signals

void triggered ()
 Buzzer was pressed. More...
 

Public Member Functions

 Buzzer (QObject *parent=nullptr)
 Buzzer constructor. More...
 
 ~Buzzer () override
 Buzzer destructor. More...
 
 Buzzer (const Buzzer &)=delete
 Buzzer copy constructor. More...
 
Buzzeroperator= (const Buzzer &)=delete
 Buzzer delete copy assignment. More...
 
 Buzzer (Buzzer &&other)=delete
 Buzzer default move constructor. More...
 
Buzzeroperator= (Buzzer &&other)=delete
 Buzzer default move assignment. More...
 
auto initialise () -> bool
 Initialises the library and sets the GPIO mode. More...
 
void stop ()
 Stop executing. More...
 

Static Public Member Functions

static auto checkDeamon () -> bool
 Check if pigpio daemon is reachable. More...
 

Private Attributes

int m_pi {-1}
 
std::atomic< bool > m_stop {false}
 

Detailed Description

This class handles the buzzer.

http://abyz.me.uk/rpi/pigpio/pdif2.html

Definition at line 26 of file buzzer.h.

Constructor & Destructor Documentation

◆ Buzzer() [1/3]

FotoBox::Buzzer::Buzzer ( QObject *  parent = nullptr)
explicit

Buzzer constructor.

Parameters
parentQObject

Definition at line 84 of file buzzer.cpp.

84 : QObject(nullptr) { }

◆ ~Buzzer()

FotoBox::Buzzer::~Buzzer ( )
override

Buzzer destructor.

Definition at line 76 of file buzzer.cpp.

76 {}; // NOLINT

◆ Buzzer() [2/3]

FotoBox::Buzzer::Buzzer ( const Buzzer )
delete

Buzzer copy constructor.

◆ Buzzer() [3/3]

FotoBox::Buzzer::Buzzer ( Buzzer &&  other)
delete

Buzzer default move constructor.

Member Function Documentation

◆ checkDeamon()

auto FotoBox::Buzzer::checkDeamon ( ) -> bool
static

Check if pigpio daemon is reachable.

Returns
true: reachable / false: unreachable

Definition at line 78 of file buzzer.cpp.

78 {return false;}; // NOLINT

Referenced by FotoBox::Preferences::pigpioDeamon().

+ Here is the caller graph for this function:

◆ initialise()

auto FotoBox::Buzzer::initialise ( ) -> bool

Initialises the library and sets the GPIO mode.

Returns
true: initialisation okay / false: initialisation failed

Definition at line 77 of file buzzer.cpp.

77 {return false;}; // NOLINT

◆ operator=() [1/2]

Buzzer& FotoBox::Buzzer::operator= ( Buzzer &&  other)
delete

Buzzer default move assignment.

◆ operator=() [2/2]

Buzzer& FotoBox::Buzzer::operator= ( const Buzzer )
delete

Buzzer delete copy assignment.

◆ queryPin

void FotoBox::Buzzer::queryPin ( )
slot

Query the Raspberry Pi pin.

Definition at line 79 of file buzzer.cpp.

79 {/* stub */}; // NOLINT

Referenced by FotoBox::FotoBox::buzzer().

+ Here is the caller graph for this function:

◆ stop()

void FotoBox::Buzzer::stop ( )

Stop executing.

See also
queryPin()

Definition at line 86 of file buzzer.cpp.

87 {
88  //set std::atomic to true
89  m_stop = true;
90 }
std::atomic< bool > m_stop
Definition: buzzer.h:95

References m_stop.

◆ triggered

void FotoBox::Buzzer::triggered ( )
signal

Buzzer was pressed.

Referenced by FotoBox::FotoBox::buzzer().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_pi

int FotoBox::Buzzer::m_pi {-1}
private

This value is passed to the GPIO routines to specify the Pi to be operated on.

Definition at line 93 of file buzzer.h.

◆ m_stop

std::atomic<bool> FotoBox::Buzzer::m_stop {false}
private

atomic bool to stop

See also
queryPin()

Definition at line 95 of file buzzer.h.

Referenced by stop().


The documentation for this class was generated from the following files: