27 const boost::property_tree::ptree &cfg,
30 , bus_push_(ctx,
zmqpp::socket_type::push)
31 , controller_(ctx,
zmqpp::socket_type::router)
33 std::string bind_str =
35 config_.get_child(
"module_config").get<std::string>(
"ipc_endpoint");
37 INFO(
"Binding to: " << bind_str);
38 bus_push_.connect(
"inproc://zmq-bus-pull");
45 INFO(
"COMMAND AVAILABLE");
52 msg >> identity >> str;
68 std::string gpio_name;
70 *str >> gpio_name >> cmd;
71 DEBUG(
"GPIO CMD: " << gpio_name <<
", " << cmd);
74 bus_push_.send(zmqpp::message() << (
"S_" + gpio_name) <<
"ON");
76 else if (cmd ==
"OFF")
78 bus_push_.send(zmqpp::message() << (
"S_" + gpio_name) <<
"OFF");
80 else if (cmd ==
"INT")
82 bus_push_.send(zmqpp::message() << std::string(
"S_INT:" + gpio_name));