Leosac  0.8.0
Open Source Access Control
Leosac::Test::Helper::FakeGPIO Class Reference

A test helper class that emulate a GPIO pin. More...

#include <FakeGPIO.hpp>

+ Collaboration diagram for Leosac::Test::Helper::FakeGPIO:

Public Member Functions

 FakeGPIO (zmqpp::context &ctx, const std::string &name)
 
 FakeGPIO (const FakeGPIO &)=delete
 
void interrupt ()
 Emulate an interrupt by writing to the message bus. More...
 
bool run (zmqpp::socket *pipe)
 if you want the GPIO in "passive" mode (ie to watch event generated BY the device), run this with a zmqpp::actor. More...
 

Private Member Functions

void send_state ()
 
void handle_cmd ()
 

Private Attributes

zmqpp::context & ctx_
 
std::string name_
 
zmqpp::socket push_
 
zmqpp::socket rep_
 Receive command here. More...
 
bool value_
 

Detailed Description

A test helper class that emulate a GPIO pin.

It doesn't support the full command set.

Definition at line 34 of file FakeGPIO.hpp.

Constructor & Destructor Documentation

◆ FakeGPIO() [1/2]

FakeGPIO::FakeGPIO ( zmqpp::context &  ctx,
const std::string &  name 
)

Definition at line 24 of file FakeGPIO.cpp.

◆ FakeGPIO() [2/2]

Leosac::Test::Helper::FakeGPIO::FakeGPIO ( const FakeGPIO )
delete

Member Function Documentation

◆ handle_cmd()

void FakeGPIO::handle_cmd ( )
private

Definition at line 63 of file FakeGPIO.cpp.

◆ interrupt()

void FakeGPIO::interrupt ( )

Emulate an interrupt by writing to the message bus.

Definition at line 35 of file FakeGPIO.cpp.

◆ run()

bool FakeGPIO::run ( zmqpp::socket *  pipe)

if you want the GPIO in "passive" mode (ie to watch event generated BY the device), run this with a zmqpp::actor.

Definition at line 40 of file FakeGPIO.cpp.

◆ send_state()

void FakeGPIO::send_state ( )
private

Definition at line 85 of file FakeGPIO.cpp.

Member Data Documentation

◆ ctx_

zmqpp::context& Leosac::Test::Helper::FakeGPIO::ctx_
private

Definition at line 59 of file FakeGPIO.hpp.

◆ name_

std::string Leosac::Test::Helper::FakeGPIO::name_
private

Definition at line 60 of file FakeGPIO.hpp.

◆ push_

zmqpp::socket Leosac::Test::Helper::FakeGPIO::push_
private

Definition at line 61 of file FakeGPIO.hpp.

◆ rep_

zmqpp::socket Leosac::Test::Helper::FakeGPIO::rep_
private

Receive command here.

Definition at line 66 of file FakeGPIO.hpp.

◆ value_

bool Leosac::Test::Helper::FakeGPIO::value_
private

Definition at line 68 of file FakeGPIO.hpp.


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