mirror of
https://github.com/berlin-open-wireless-lab/DAWN.git
synced 2025-03-09 15:40:12 +00:00
Merge pull request #38 from berlin-open-wireless-lab/feature/use_notify
Feature/use notify
This commit is contained in:
commit
0cde3df6de
2 changed files with 17 additions and 1 deletions
|
@ -35,4 +35,4 @@ config metric
|
|||
option min_probe_count '4'
|
||||
option bandwith_threshold '6'
|
||||
option use_station_count '1'
|
||||
option eval_probe_req '1'
|
||||
option eval_probe_req '1'
|
||||
|
|
|
@ -188,8 +188,11 @@ int hostapd_array_check_id(uint32_t id);
|
|||
void hostapd_array_insert(uint32_t id);
|
||||
|
||||
void hostapd_array_delete(uint32_t id);
|
||||
|
||||
static void ubus_add_oject();
|
||||
|
||||
static void respond_to_notify(uint32_t id);
|
||||
|
||||
void add_client_update_timer(time_t time) {
|
||||
uloop_timeout_set(&client_timer, time);
|
||||
}
|
||||
|
@ -591,6 +594,9 @@ static int add_subscriber(char *name) {
|
|||
hostapd_array_insert(id);
|
||||
fprintf(stderr, "Watching object %08x: %s\n", id, ubus_strerror(ret));
|
||||
|
||||
// respond to notify...
|
||||
respond_to_notify(id);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1007,4 +1013,14 @@ static void ubus_add_oject()
|
|||
if (ret)
|
||||
fprintf(stderr, "Failed to add watch handler: %s\n", ubus_strerror(ret));
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
static void respond_to_notify(uint32_t id) {
|
||||
printf("SENDING NOTIFY!!!\n");
|
||||
blob_buf_init(&b, 0);
|
||||
blobmsg_add_u32(&b, "notify_response", 1);
|
||||
|
||||
int timeout = 1;
|
||||
ubus_invoke(ctx, id, "notify_response", b.head, NULL, NULL, timeout * 1000);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue