SDK4.0 This document shows Ameba SDK 4.0 APIs

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Data Structures | Macros | Typedefs | Functions
wifi_conf.h File Reference

This file provides user interface for Wi-Fi station and AP mode configuration base on the functionalities provided by Realtek Wi-Fi driver. More...

`#include "FreeRTOS.h"`
`#include "wifi_constants.h"`
`#include "wifi_structures.h"`
`#include "wifi_util.h"`
`#include "wifi_ind.h"`
`#include <platform/platform_stdlib.h>`

## Data Structures
struct | scan_buf_arg
struct | internal_scan_handler
struct | internal_join_result_t

## Macros
#define | RTW_ENABLE_API_INFO
#define | RTW_API_INFO(args) do {printf args;} while(0)
#define | MAC_ARG(x) ((u8*)(x))[0],((u8*)(x))[1],((u8*)(x))[2],((u8*)(x))[3],((u8*)(x))[4],((u8*)(x))[5]
#define | CMP_MAC(a, b)
#define | SCAN_LONGEST_WAIT_TIME (4500)
#define | MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x"
#define | PSCAN_ENABLE 0x01
#define | PSCAN_FAST_SURVEY 0x02
#define | PSCAN_SIMPLE_CONFIG 0x04

## Typedefs
typedef void(* | rtw_scan_result_callback_t) (rtw_scan_result_t **result_ptr, void *user_data)
typedef rtw_result_t(* | rtw_scan_result_handler_t) (rtw_scan_handler_result_t *malloced_scan_result)
typedef struct internal_scan_handler | internal_scan_handler_t

## Functions
int | wifi_manager_init (void)
| Initialize Realtek WiFi API System. More...
int | wifi_connect (char *ssid, rtw_security_t security_type, char *password, int ssid_len, int password_len, int key_id, void *semaphore)
| Join a Wi-Fi network. Scan for, associate and authenticate with a Wi-Fi network. On successful return, the system is ready to send data packets. More...
int | wifi_connect_bssid (unsigned char bssid[ETH_ALEN], char *ssid, rtw_security_t security_type, char *password, int bssid_len, int ssid_len, int password_len, int key_id, void *semaphore)
| Join a Wi-Fi network with specified BSSID. Scan for, associate and authenticate with a Wi-Fi network. On successful return, the system is ready to send data packets. More...
int | wifi_disconnect (void)
| Disassociates from current Wi-Fi network. More...
int | wifi_is_connected_to_ap (void)
| Check if Wi-Fi has connected to AP before dhcp. More...
int | wifi_is_up (rtw_interface_t interface)
| Check if the specified interface is up. More...
int | wifi_is_ready_to_transceive (rtw_interface_t interface)
int | wifi_set_mac_address (char *mac)
| This function sets the current Media Access Control (MAC) address of the 802.11 device. More...
int | wifi_get_mac_address (char *mac)
| Retrieves the current Media Access Control (MAC) address (or Ethernet hardware address) of the 802.11 device. More...
int | wifi_enable_powersave (void)
| Enable Wi-Fi powersave mode. More...
int | wifi_disable_powersave (void)
| Disable Wi-Fi powersave mode. More...
int | wifi_get_txpower (int *poweridx)
int | wifi_set_txpower (int poweridx)
| Set the tx power in index units. More...
int | wifi_get_associated_client_list (void *client_list_buffer, unsigned short buffer_length)
| Get the associated clients with SoftAP. More...
int | wifi_get_ap_info (rtw_bss_info_t *ap_info, rtw_security_t *security)
| Get the SoftAP information. More...
int | wifi_set_country (rtw_country_code_t country_code)
| Set the country code to driver to determine the channel set. More...
int | wifi_get_rssi (int *pRSSI)
| Retrieve the latest RSSI value. More...
int | wifi_set_channel (int channel)
| Set the listening channel for promiscuous mode. More...
int | wifi_get_channel (int *channel)
| Get the current channel on STA interface. More...
int | wifi_register_multicast_address (rtw_mac_t *mac)
| Register interest in a multicast address. Once a multicast address has been registered, all packets detected on the medium destined for that address are forwarded to the host. Otherwise they are ignored. More...
int | wifi_unregister_multicast_address (rtw_mac_t *mac)
| Unregister interest in a multicast address. Once a multicast address has been unregistered, all packets detected on the medium destined for that address are ignored. More...
_WEAK void | wifi_set_mib (void)
| Setup the adaptivity mode. You can replace this weak function by the same name funcation to setup adaptivity mode you want. More...
_WEAK void | wifi_set_country_code (void)
| Setup country code. You can replace this weak function by the same name funcation to setup country code you want. More...
int | wifi_rf_on (void)
| Enable Wi-Fi RF. More...
int | wifi_rf_off (void)
| Disable Wi-Fi RF. More...
int | wifi_on (rtw_mode_t mode)
| Enable Wi-Fi. More...
int | wifi_off (void)
| Disable Wi-Fi. More...
int | wifi_off_fastly (void)
int | wifi_set_power_mode (unsigned char ips_mode, unsigned char lps_mode)
| Set IPS/LPS mode. More...
int | wifi_set_tdma_param (unsigned char slot_period, unsigned char rfon_period_len_1, unsigned char rfon_period_len_2, unsigned char rfon_period_len_3)
int | wifi_set_lps_dtim (unsigned char dtim)
| Set LPS DTIM. More...
int | wifi_get_lps_dtim (unsigned char *dtim)
| Get LPS DTIM. More...
int | wifi_start_ap (char *ssid, rtw_security_t security_type, char *password, int ssid_len, int password_len, int channel)
| Trigger Wi-Fi driver to start an infrastructure Wi-Fi network. More...
int | wifi_start_ap_with_hidden_ssid (char *ssid, rtw_security_t security_type, char *password, int ssid_len, int password_len, int channel)
| Start an infrastructure Wi-Fi network with hidden SSID. More...
int | wifi_scan (rtw_scan_type_t scan_type, rtw_bss_type_t bss_type, void *result_ptr)
| Initiate a scan to search for 802.11 networks. More...
int | wifi_scan_networks (rtw_scan_result_handler_t results_handler, void *user_data)
| Initiate a scan to search for 802.11 networks, a higher level API based on wifi_scan to simplify the scan operation. More...
int | wifi_scan_networks_with_ssid (int(results_handler)(char *, int, char *, void *), void *user_data, int scan_buflen, char *ssid, int ssid_len)
| Initiate a scan to search for 802.11 networks with specified SSID. More...
int | wifi_set_pscan_chan (__u8 *channel_list, __u8 *pscan_config, __u8 length)
| Set the channel used to be partial scanned. More...
int | wifi_get_setting (const char *ifname, rtw_wifi_setting_t *pSetting)
| Get current Wi-Fi setting from driver. More...
int | wifi_show_setting (const char *ifname, rtw_wifi_setting_t *pSetting)
| Show the network information stored in a rtw_wifi_setting_t structure. More...
int | wifi_set_network_mode (rtw_network_mode_t mode)
| Set the network mode according to the data rate its supported. Driver works in BGN mode in default after driver initialization. This function is used to change wireless network mode for station mode before connecting to AP. More...
int | wifi_set_promisc (rtw_rcr_level_t enabled, void(*callback)(unsigned char *, unsigned int, void *), unsigned char len_used)
| Set the chip to start or stop the promiscuous mode. More...
void | wifi_enter_promisc_mode (void)
| Let Wi-Fi enter promiscuous mode. More...
int | wifi_set_wps_phase (unsigned char is_trigger_wps)
int | wifi_restart_ap (unsigned char *ssid, rtw_security_t security_type, unsigned char *password, int ssid_len, int password_len, int channel)
| Trigger Wi-Fi driver to restart an infrastructure Wi-Fi network. More...
int | wifi_config_autoreconnect (__u8 mode, __u8 retry_times, __u16 timeout)
| Set reconnection mode with configuration. More...
int | wifi_set_autoreconnect (__u8 mode)
| Set reconnection mode with 3 retry limit and 5 seconds timeout as default. More...
int | wifi_get_autoreconnect (__u8 *mode)
| Get the result of setting reconnection mode. More...
int | wifi_get_last_error (void)
| Present the device disconnect reason while connecting. More...
void | wifi_set_indicate_mgnt (int enable)
| Get antenna infomation. More...
Ameba1 Only
void | wifi_set_ap_polling_sta (__u8 enabled)
| enable AP sending QoS Null0 Data to poll Sta be alive More...

## Detailed Description

This file provides user interface for Wi-Fi station and AP mode configuration base on the functionalities provided by Realtek Wi-Fi driver.

Author

Version

Attention

This module is a confidential and proprietary property of RealTek and possession or use of this module requires written permission of RealTek.

Copyright(c) 2016, Realtek Semiconductor Corporation. All rights reserved.