|
Leosac
0.8.0
Open Source Access Control
|
Go to the documentation of this file.
24 #include <zmqpp/zmqpp.hpp>
55 LibgpiodPin(zmqpp::context &ctx,
const std::string &name,
const std::string &gpio_device,
83 std::chrono::system_clock::time_point
next_update()
const;
108 bool turn_on(zmqpp::message *msg =
nullptr);
void set_direction(Direction dir)
Write direction to the direction file.
void handle_message()
The SysFsGpioModule will register this method so its called when a message is ready on the pin socket...
LibgpiodModule & module_
Reference to the module.
void update()
Update the PIN.
std::chrono::system_clock::time_point next_update() const
This method shall returns the time point at which we want to be updated.
void release()
Release Libgpiod resources.
Hardware::GPIO::Direction Direction
bool turn_on(zmqpp::message *msg=nullptr)
Write to sysfs to turn the gpio on.
This is the header file for a generated source file, GitSHA1.cpp.
Handle GPIO management over libgpiod.
bool toggle()
Read to sysfs and then write the opposite value.
std::chrono::system_clock::time_point next_update_time_
Time point of next wished update.
void set_interrupt(InterruptMode mode)
Write interrupt mode to the edge file.
LibgpiodPin(zmqpp::context &ctx, const std::string &name, const std::string &gpio_device, int gpio_offset, Direction direction, InterruptMode interrupt_mode, bool initial_value, LibgpiodModule &module)
void handle_interrupt()
Interrupt happened for this GPIO ping.
This is a implementation class.
LibgpiodPin & operator=(const LibgpiodPin &)=delete
void register_sockets(zmqpp::reactor *reactor)
Register own socket to the module's reactor.
const Direction direction_
Direction of the PIN.
bool turn_off()
Write to sysfs to turn the gpio on.
int gpio_offset_
Offset of the GPIO.
std::string gpio_device_
File descriptor of the GPIO in sysfs.
bool read_value()
Read value from filesystem.
const bool initial_value_
Initial value of the PIN.
zmqpp::socket sock_
listen to command from other component.