diff --git a/files/dawn.config b/files/dawn.config index a81923e..8cad0b0 100644 --- a/files/dawn.config +++ b/files/dawn.config @@ -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' \ No newline at end of file + option eval_probe_req '1' diff --git a/src/utils/ubus.c b/src/utils/ubus.c index eb3d0b2..80feb64 100644 --- a/src/utils/ubus.c +++ b/src/utils/ubus.c @@ -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); } \ No newline at end of file