add example

This commit is contained in:
pvvx 2017-06-07 23:44:38 +03:00
parent 0cd01e4dc1
commit 5cd34b0c9f
75 changed files with 6023 additions and 217 deletions

View file

@ -0,0 +1,26 @@
/******************************************************************************
*
* Copyright(c) 2007 - 2015 Realtek Corporation. All rights reserved.
*
*
******************************************************************************/
#include <platform_opts.h>
#include <wifi_mac_monitor/example_wifi_mac_monitor.h>
#include <platform/platform_stdlib.h>
typedef int (*mac_monitor_ptr)(unsigned char *phone_macaddr,char real_rssi);
extern mac_monitor_ptr mac_monitor_callback;
int get_station_mac(unsigned char *sta_mac,char rssi)
{
printf("\n\r%s: %02x:%02x:%02x:%02x:%02x:%02x, Rssi = %d\n",__func__,*(sta_mac)\
,*(sta_mac+1),*(sta_mac+2),*(sta_mac+3),*(sta_mac+4),*(sta_mac+5),rssi);
return 0;
}
void example_wifi_mac_monitor(void)
{
mac_monitor_callback = get_station_mac;
return;
}

View file

@ -0,0 +1,14 @@
#ifndef __EXAMPLE_WIFI_MAC_MONITOR_H__
#define __EXAMPLE_WIFI_MAC_MONITOR_H__
/******************************************************************************
*
* Copyright(c) 2007 - 2015 Realtek Corporation. All rights reserved.
*
*
******************************************************************************/
void example_wifi_mac_monitor(void);
int get_station_mac(unsigned char *sta_mac,char rssi);
#endif //#ifndef __EXAMPLE_WIFI_MAC_MONITOR_H__

View file

@ -0,0 +1,12 @@
WIFI MAC MONITOR EXAMPLE
Description:
Get station mac information in AP mode
Configuration:
[platform_opts.h]
#define CONFIG_EXAMPLE_WIFI_MAC_MONITOR 1
Execution:
When define CONFIG_EXAMPLE_WIFI_MAC_MONITOR, the callback function is automatically registered as get_station_mac().
It can collect the station mac address and rssi.