25 #include <zmqpp/zmqpp.hpp> 47 PFDigitalPin(zmqpp::context &ctx,
const std::string &name,
int gpio_no,
48 Direction direction,
bool value, uint8_t hardware_address);
76 std::chrono::system_clock::time_point
next_update()
const;
83 bool turn_on(zmqpp::message *msg =
nullptr);
std::chrono::system_clock::time_point next_update() const
This method shall returns the time point at which we want to be updated.
bool turn_on(zmqpp::message *msg=nullptr)
Write to PFDigital to turn the gpio on.
bool turn_off()
Write to PFDigital turn the gpio off.
zmqpp::socket * bus_push_
PUSH socket to write to the bus.
zmqpp::socket sock_
listen to command from other component.
void handle_message()
The PFGpioModule will register this method so its called when a message is ready on the pin socket...
This is a implementation class.
PFDigitalPin(zmqpp::context &ctx, const std::string &name, int gpio_no, Direction direction, bool value, uint8_t hardware_address)
Create a new GPIO pin.
void update()
Let the GPIO pin perform internal task.
bool want_update_
Does this object wants to be update()d ?
void send_state()
Send the current GPIO state on the socket.
uint8_t hardware_address_
bool read_value()
Ask the PiFace device for this pin's value and return it.
std::chrono::system_clock::time_point next_update_time_
Time point of next wished update.
const Direction direction_
This is the direction of the GPIO pin.
bool default_value_
The default value of the pin, it is only relevant is the pin is output.
PFDigitalPin & operator=(const PFDigitalPin &)=delete