Hi,
I want to subscribe to hostapd sockets.
If the wifi is turned off the hostapd subcribers are removed. After turning the wifi on again the hostapd sockets are added again.
Now I want to do a lookup for same id again ("hostapd.wlan0") and it's just freezing...
Do I have to cancel the uloop or something like this?
To reproduce:
ubus_init()
ubus_add_uloop(...)
ubus_register_subscriber(...)
ubus_lookup_id("hostapd.wlan0",id...)
ubus_subscribe(id,...)
uloop_run()
(hostapd off/on)
(Some other thread)
ubus_lookup_id("hostapd.wlan0",id)
** freeze **
ubus_subscribe(...) (would follow...)
Doing something like this in another thread causes no problems. The problem is that I can't add it to the uloop so the callback function is nonblocking and nothing is working...
ctx_hostapd = ubus_connect(ubus_socket);
ubus_register_subscriber(...)
while (1) {
ubus_lookup_id("hostapd.wlan0",id...)
(if not already subscribed)
ubus_subscribe(id,...)
}