diff --git a/wireless/wifictld/src/ubus_events.c b/wireless/wifictld/src/ubus_events.c index 48e556f..db05550 100644 --- a/wireless/wifictld/src/ubus_events.c +++ b/wireless/wifictld/src/ubus_events.c @@ -52,9 +52,13 @@ int wifictld_ubus_bind_events(struct ubus_context *ctx) static void recieve_interfaces(struct ubus_context *ctx, struct ubus_object_data *obj, void *priv) { int ret = 0; - const char *str = "notify_response"; + const char *str = "notify_response", + *path_prefix = "hostapd."; - if (obj->path == NULL || !strstr(obj->path, "hostapd.")) { + size_t lenpre = strlen(path_prefix), + lenpath = strlen(obj->path); + + if (lenpath < lenpre || strncmp(path_prefix, obj->path, lenpre) != 0) { return; } @@ -72,7 +76,7 @@ static void recieve_interfaces(struct ubus_context *ctx, struct ubus_object_data log_error("Error while register subscribe for event '%s': %s\n", obj->path, ubus_strerror(ret)); } - log_info("sub %s: %d:%d\n", obj->path, obj->id, obj->type_id); + log_info("subscribe %s: %d:%d\n", obj->path, obj->id, obj->type_id); } diff --git a/wireless/wifictld/src/ubus_service.h b/wireless/wifictld/src/ubus_service.h index d6dee1e..a5b6a38 100644 --- a/wireless/wifictld/src/ubus_service.h +++ b/wireless/wifictld/src/ubus_service.h @@ -3,6 +3,6 @@ #include -int wifictld_ubus_add_bss(struct ubus_object *ctx); +int wifictld_ubus_add_bss(struct ubus_context *ctx); #endif diff --git a/wireless/wifictld/src/wifi_clients.c b/wireless/wifictld/src/wifi_clients.c index 7d05e73..eac0ec5 100644 --- a/wireless/wifictld/src/wifi_clients.c +++ b/wireless/wifictld/src/wifi_clients.c @@ -8,7 +8,7 @@ #include "log.h" #include "wifi_clients.h" -int client_try_threashold = 4; +int client_try_threashold = 3; int client_signal_threashold = -75; int clean_every = 600; //in ms = 10min @@ -122,11 +122,11 @@ int wifi_clients_try(const u8 *address, uint32_t freq, uint32_t ssi_signal) { client->connected = 1; return 0; } - //TODO handle ssi_signal + if (client->freq_highest > WIFI_CLIENT_FREQ_THREASHOLD && ssi_signal > client_signal_threashold ) { - log_info("reject - learned higher freq\n"); + log_info("reject - learned higher freq + ssi is high enough\n"); return -1; } if(client->try > client_try_threashold) {