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

Facade object for a Wiegand Reader device. More...

#include <FExternalServer.hpp>

+ Collaboration diagram for Leosac::Hardware::FExternalServer:

Public Member Functions

 FExternalServer (zmqpp::context &ctx, const std::string &server_name)
 Construct a facade to an external server; this facade will connect to the server. More...
 
 FExternalServer (const FExternalServer &)=delete
 
FExternalServeroperator= (const FExternalServer &)=delete
 
 ~FExternalServer ()=default
 
bool connect ()
 Connect to the server. More...
 
bool disconnect ()
 Disconnect from the server. More...
 
bool isConnected () const
 Check if is connected to the server. More...
 
const std::string & name () const
 Returns the device's name. More...
 

Private Member Functions

bool send_to_backend (zmqpp::message &m)
 Send a message to the backend_ server and wait for a response. More...
 

Private Attributes

zmqpp::socket backend_
 A socket to talk to the backend server. More...
 
std::string name_
 

Detailed Description

Facade object for a Wiegand Reader device.

You can control a reader through this class by acting on its led and buzzer.

Note
This class implements the client code to [theses specifications](Specification for Wiegand module).

Definition at line 38 of file FExternalServer.hpp.

Constructor & Destructor Documentation

◆ FExternalServer() [1/2]

FExternalServer::FExternalServer ( zmqpp::context &  ctx,
const std::string &  server_name 
)

Construct a facade to an external server; this facade will connect to the server.

Parameters
ctxZMQ context
server_namename of targeted server

Definition at line 24 of file FExternalServer.cpp.

◆ FExternalServer() [2/2]

Leosac::Hardware::FExternalServer::FExternalServer ( const FExternalServer )
delete

◆ ~FExternalServer()

Leosac::Hardware::FExternalServer::~FExternalServer ( )
default

Member Function Documentation

◆ connect()

bool FExternalServer::connect ( )

Connect to the server.

Definition at line 31 of file FExternalServer.cpp.

◆ disconnect()

bool FExternalServer::disconnect ( )

Disconnect from the server.

Definition at line 39 of file FExternalServer.cpp.

◆ isConnected()

bool Leosac::Hardware::FExternalServer::isConnected ( ) const

Check if is connected to the server.

◆ name()

const std::string & FExternalServer::name ( ) const

Returns the device's name.

Definition at line 59 of file FExternalServer.cpp.

◆ operator=()

FExternalServer& Leosac::Hardware::FExternalServer::operator= ( const FExternalServer )
delete

◆ send_to_backend()

bool FExternalServer::send_to_backend ( zmqpp::message &  m)
private

Send a message to the backend_ server and wait for a response.

The response shall be either "OK" or "KO"

Definition at line 47 of file FExternalServer.cpp.

Member Data Documentation

◆ backend_

zmqpp::socket Leosac::Hardware::FExternalServer::backend_
private

A socket to talk to the backend server.

Definition at line 85 of file FExternalServer.hpp.

◆ name_

std::string Leosac::Hardware::FExternalServer::name_
private

Definition at line 87 of file FExternalServer.hpp.


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