Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion build/openwrt/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ include makefile.inc
EASY_MESH_NODE = 1
EM_APP = 1
ONEWIFI_STA_MGR_APP_SUPPORT = 1
ONEWIFI_EASYCONNECT_APP_SUPPORT = 1

# wifi hal rules
HAL_LIBRARY = $(INSTALLDIR)/lib/libwifihal.a
Expand Down Expand Up @@ -489,7 +490,7 @@ ALL_HEBUS_LIB_OBJECTS = $(HEBUS_OBJECTS)
ALLOBJECTS = $(CXXOBJECTS) $(COBJECTS) $(WEBCONFIG_OBJECTS) $(HEBUS_OBJECTS)

CFLAGS += $(INCLUDEDIRS) $(INCLUDE_HE_LIB_DIRS) -g -Os -fPIC -D_ANSC_LINUX -D_COSA_INTEL_USG_ATOM_ -DUSE_NOTIFY_COMPONENT -DCISCO_XB3_PLATFORM_CHANGES -DDUAL_CORE_XB3 -DFEATURE_ONE_WIFI -DWIFI_HAL_VERSION_3 -DFEATURE_SUPPORT_PASSPOINT -DFEATURE_SUPPORT_WEBCONFIG -DBANANA_PI_PORT -DNL80211_ACL -D_PLATFORM_BANANAPI_R4_ -DFEATURE_SINGLE_PHY -DEASY_MESH_NODE -DEM_APP \
-DONEWIFI_STA_MGR_APP_SUPPORT
-DONEWIFI_STA_MGR_APP_SUPPORT -DONEWIFI_EASYCONNECT_APP_SUPPORT

ifneq ($(OS), Darwin)
CFLAGS += -DPLATFORM_LINUX
Expand Down
2 changes: 1 addition & 1 deletion include/wifi_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ typedef struct {
char wps_pin[10];
} __attribute__((__packed__)) wps_pin_config_t;

#define MAX_SCANNED_VAPS 32
#define MAX_SCANNED_VAPS 200

typedef struct {
unsigned int radio_index;
Expand Down
31 changes: 21 additions & 10 deletions source/core/wifi_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1060,27 +1060,38 @@ int start_wifi_health_monitor_thread(void)

int scan_results_callback(int radio_index, wifi_bss_info_t **bss, unsigned int *num)
{
scan_results_t res;

memset(&res, 0, sizeof(scan_results_t));

res.radio_index = radio_index;
scan_results_t *res;

if (*num) {
// if number of scanned AP's is more than size of res.bss array - truncate
if (*num > MAX_SCANNED_VAPS){
*num = MAX_SCANNED_VAPS;
}
res.num = *num;
memcpy((unsigned char *)res.bss, (unsigned char *)(*bss), (*num)*sizeof(wifi_bss_info_t));
}

res = (scan_results_t *)calloc(1, sizeof(scan_results_t));
if(!res) {
wifi_util_dbg_print(WIFI_CTRL,"%s:%d Failed to allocate memory for scan_results_t\n", __FUNCTION__, __LINE__);
return RETURN_ERR;
}

res->radio_index = radio_index;
res->num = *num;
memcpy((unsigned char *)res->bss, (unsigned char *)(*bss), (*num)*sizeof(wifi_bss_info_t));

if (is_sta_enabled()) {
push_event_to_ctrl_queue(&res, sizeof(scan_results_t), wifi_event_type_hal_ind,
wifi_event_scan_results, NULL);
if(push_event_to_ctrl_queue(res, sizeof(scan_results_t), wifi_event_type_hal_ind,
wifi_event_scan_results, NULL) != RETURN_OK) {
wifi_util_error_print(WIFI_CTRL,"%s:%d Failed to push scan_results to queue\n", __FUNCTION__, __LINE__);
free(*bss);
free(res);
return RETURN_ERR;
}
}
free(*bss);
free(res);

return 0;
return RETURN_OK;
}

void sta_connection_handler(const char *vif_name, wifi_bss_info_t *bss_info, wifi_station_stats_t *sta)
Expand Down
Loading