wlan signal via libnl

Vaittinen, Ville (GE Healthcare) ville.vaittinen at ge.com
Tue May 24 04:30:51 PDT 2016


Hi,

we are trying to use libnl for querying wlan signal strength
and have got it basically working. 

Our basic calling pattern is
    nl_send_auto_complete(m_socket, msg);

    nl_cb* callback = nl_socket_get_cb(m_socket);

    int ret = nl_recvmsgs(m_socket, callback);

And in the callback function we parse the message / signal strength.

Due to the lacking knowledge of lower level implementation details we are wondering,
if it actually can happen that due to some internals nl_recvmsgs() might actually block
and never return? And if so, what would be the counter-measure (configuring a timeout possible?, non-blocking socket).

Furthermore is it sufficient in this case to call nl_recvmsgs() once or should it be called
in while loop along the lines iw tool does it that sets additional callbacks of types NL_CB_FINISH, NL_CB_ACK and
checks the output in them to stop the while loop.

Ville Vaittinen


More information about the libnl mailing list