basic/scan/scan.c
/*
* ZentriOS SDK LICENSE AGREEMENT | Zentri.com, 2015.
*
* Use of source code and/or libraries contained in the ZentriOS SDK is
* subject to the Zentri Operating System SDK license agreement and
* applicable open source license agreements.
*
*/
/* Documentation for this app is available online.
* See https://docs.zentri.com/wifi/sdk/latest/examples/basic/scan
*/
#include "zos.h"
#define SCAN_PERIOD 15000 // ms
/*************************************************************************************************/
void zn_app_init(void)
{
}
/*************************************************************************************************/
zos_bool_t zn_app_idle(void)
{
// return TRUE so the event loop idles
}
/*************************************************************************************************/
static void scan_event_handler(void *arg)
{
zos_result_t ret;
zos_scan_result_t *scan_results;
int i = 0;
{
ZOS_LOG("Failed to issue scan: %d", ret);
return;
}
ZOS_LOG(" # Type BSSID RSSI Rate Chan Security SSID" );
ZOS_LOG("--------------------------------------------------------------------" );
{
print_scan_result(i, result);
}
}
/*************************************************************************************************/
{
char buffer[128], mac[20];
fpi_str_buffer_t data_rate_str;
char *ptr = buffer;
ptr += sprintf(ptr, " %2d", index);
ptr += sprintf(ptr, " %-5s", data_rate_str);
"Unknown" );
ptr += sprintf(ptr, " ");
{
}
else
{
strcpy(ptr, "<ssid hidden>");
}
ZOS_LOG("%s", buffer);
}