|
Leosac
0.8.0
Open Source Access Control
|
Go to the documentation of this file.
25 #include <boost/asio/io_service.hpp>
26 #include <boost/property_tree/ptree.hpp>
28 #include <zmqpp/reactor.hpp>
29 #include <zmqpp/socket.hpp>
50 class PFDigitalModule;
85 PFDigitalModule(zmqpp::context &ctx, zmqpp::socket *module_manager_pipe,
86 const boost::property_tree::ptree &config,
CoreUtilsPtr utils);
94 virtual void run()
override;
Base class for module implementation.
bool get_input_pin_name(std::string &dest, int idx, uint8_t hw_addr)
Retrieve the (user-given) name of the pin and store it in dest.
zmqpp::socket bus_push_
Socket to push event to the bus.
PFDigitalModule(zmqpp::context &ctx, zmqpp::socket *module_manager_pipe, const boost::property_tree::ptree &config, CoreUtilsPtr utils)
void unregister_ws_handlers(WebSockAPI::Service &ws_service) override
This class provide a base implementation -designed to be extended by subclass- so that non-boost-asio...
BaseModuleSupportThread(const CoreUtilsPtr &core_utils, const ModuleParameters ¶m)
Main class for the piface digital module.
void load_config_from_database()
void process_xml_config(const boost::property_tree::ptree &cfg)
Process the XML configuration, preparing configured GPIO pin.
void test_output_pin(const UUID &gpio_id)
Implements the "pfdigital.test_output_pin" API call.
void setup_database()
Create / update database schema for the module.
void register_ws_handlers(WebSockAPI::Service &ws_service) override
Called when websocket handler registration is possible.
WSHelperThread(const CoreUtilsPtr &core_utils)
This is the header file for a generated source file, GitSHA1.cpp.
virtual void run() override
Module's main loop.
A service object provided by the Websocket module.
std::vector< PFDigitalPin > gpios_
GPIO vector.
bool degraded_mode_
True if we are running in "degraded" mode (ie, not on a device that support the PifaceDigital).
void handle_interrupt()
An interrupt was triggered.
void process_config()
Process configuration.
int interrupt_fd_
File descriptor of the PIN that triggers interrupts.
WSHelperThread ws_helper_thread_
Support thread for processing websocket requests.
std::shared_ptr< CoreUtils > CoreUtilsPtr
Thin wrapper around boost::uuids::uuid.
Some ~const parameter that are required to process websocket requests.