| 190 | } |
| 191 | |
| 192 | void waybar::modules::Network::createInfoSocket() { |
| 193 | sock_ = nl_socket_alloc(); |
| 194 | if (genl_connect(sock_) != 0) { |
| 195 | throw std::runtime_error("Can't connect to netlink socket"); |
| 196 | } |
| 197 | if (nl_socket_modify_cb(sock_, NL_CB_VALID, NL_CB_CUSTOM, handleScan, this) < 0) { |
| 198 | throw std::runtime_error("Can't set callback"); |
| 199 | } |
| 200 | nl80211_id_ = genl_ctrl_resolve(sock_, "nl80211"); |
| 201 | if (nl80211_id_ < 0) { |
| 202 | spdlog::warn("Can't resolve nl80211 interface"); |
| 203 | } |
| 204 | } |
| 205 | |
| 206 | void waybar::modules::Network::worker() { |
| 207 | // update via here not working |
nothing calls this directly
no outgoing calls
no test coverage detected