some fixes

This commit is contained in:
Martin/Geno 2018-07-17 23:01:38 +02:00
parent 63e16dd756
commit ef40400d12
No known key found for this signature in database
GPG Key ID: 9D7D3C6BFF600C6A
3 changed files with 11 additions and 7 deletions

View File

@ -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);
}

View File

@ -3,6 +3,6 @@
#include <libubus.h>
int wifictld_ubus_add_bss(struct ubus_object *ctx);
int wifictld_ubus_add_bss(struct ubus_context *ctx);
#endif

View File

@ -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) {