Leosac  0.8.0
Open Source Access Control
Leosac::Hardware::Buzzer Class Reference

Abstraction of Buzzer device attributes. More...

#include <Buzzer.hpp>

+ Inheritance diagram for Leosac::Hardware::Buzzer:
+ Collaboration diagram for Leosac::Hardware::Buzzer:

Public Member Functions

 Buzzer ()
 
virtual ~Buzzer ()=default
 
void validation_callback (odb::callback_event e, odb::database &) const override
 
const GPIOPtrgpio () const
 
void gpio (const GPIOPtr &gpio)
 
int64_t default_blink_duration () const
 
void default_blink_duration (int64_t default_blink_duration)
 
int64_t default_blink_speed () const
 
void default_blink_speed (int64_t default_blink_speed)
 
- Public Member Functions inherited from Leosac::Hardware::Device
 Device ()
 
 Device (DeviceClass device_class)
 
virtual ~Device ()=default
 
UUID id () const
 
const std::string & name () const
 
void name (const std::string &name)
 
DeviceClass device_class () const
 
void device_class (DeviceClass d)
 
bool enabled () const
 
void enabled (bool e)
 
uint64_t odb_version () const
 

Private Attributes

int64_t default_blink_duration_
 
int64_t default_blink_speed_
 
GPIOPtr gpio_
 The underlying GPIO. More...
 

Detailed Description

Abstraction of Buzzer device attributes.

Note: This code is copy pasted with the LED class. Both device share the same attribute set but are different from a semantic point of view. It might be possible to reduce code duplication by using template to share code.

Definition at line 42 of file Buzzer.hpp.

Constructor & Destructor Documentation

◆ Buzzer()

Leosac::Hardware::Buzzer::Buzzer ( )
explicit

Definition at line 28 of file Buzzer.cpp.

◆ ~Buzzer()

virtual Leosac::Hardware::Buzzer::~Buzzer ( )
virtualdefault

Member Function Documentation

◆ default_blink_duration() [1/2]

int64_t Leosac::Hardware::Buzzer::default_blink_duration ( ) const

Definition at line 48 of file Buzzer.cpp.

◆ default_blink_duration() [2/2]

void Leosac::Hardware::Buzzer::default_blink_duration ( int64_t  default_blink_duration)

Definition at line 53 of file Buzzer.cpp.

◆ default_blink_speed() [1/2]

int64_t Leosac::Hardware::Buzzer::default_blink_speed ( ) const

Definition at line 58 of file Buzzer.cpp.

◆ default_blink_speed() [2/2]

void Leosac::Hardware::Buzzer::default_blink_speed ( int64_t  default_blink_speed)

Definition at line 63 of file Buzzer.cpp.

◆ gpio() [1/2]

const GPIOPtr & Leosac::Hardware::Buzzer::gpio ( ) const

Definition at line 38 of file Buzzer.cpp.

◆ gpio() [2/2]

void Leosac::Hardware::Buzzer::gpio ( const GPIOPtr gpio)

Definition at line 43 of file Buzzer.cpp.

◆ validation_callback()

void Leosac::Hardware::Buzzer::validation_callback ( odb::callback_event  e,
odb::database &  db 
) const
overridevirtual

Reimplemented from Leosac::Hardware::Device.

Definition at line 33 of file Buzzer.cpp.

Member Data Documentation

◆ default_blink_duration_

int64_t Leosac::Hardware::Buzzer::default_blink_duration_
private

Definition at line 63 of file Buzzer.hpp.

◆ default_blink_speed_

int64_t Leosac::Hardware::Buzzer::default_blink_speed_
private

Definition at line 64 of file Buzzer.hpp.

◆ gpio_

GPIOPtr Leosac::Hardware::Buzzer::gpio_
private

The underlying GPIO.

Definition at line 69 of file Buzzer.hpp.


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