Leosac
0.8.0
Open Source Access Control
|
Facade object for a Wiegand Reader device. More...
#include <FExternalServer.hpp>
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 | |
FExternalServer & | operator= (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_ |
Facade object for a Wiegand Reader device.
You can control a reader through this class by acting on its led and buzzer.
Definition at line 38 of file FExternalServer.hpp.
FExternalServer::FExternalServer | ( | zmqpp::context & | ctx, |
const std::string & | server_name | ||
) |
Construct a facade to an external server; this facade will connect to the server.
ctx | ZMQ context |
server_name | name of targeted server |
Definition at line 24 of file FExternalServer.cpp.
|
delete |
|
default |
bool FExternalServer::connect | ( | ) |
Connect to the server.
Definition at line 31 of file FExternalServer.cpp.
bool FExternalServer::disconnect | ( | ) |
Disconnect from the server.
Definition at line 39 of file FExternalServer.cpp.
bool Leosac::Hardware::FExternalServer::isConnected | ( | ) | const |
Check if is connected to the server.
const std::string & FExternalServer::name | ( | ) | const |
Returns the device's name.
Definition at line 59 of file FExternalServer.cpp.
|
delete |
|
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.
|
private |
A socket to talk to the backend server.
Definition at line 85 of file FExternalServer.hpp.
|
private |
Definition at line 87 of file FExternalServer.hpp.