This module contains WILC M2M Wi-Fi APIs implementation.
Copyright (c) 2016-2021 Microchip Technology Inc. and its subsidiaries.
#include <string.h>
#include "driver/include/m2m_wifi.h"
#include "driver/source/nmdrv.h"
#include "driver/source/m2m_hif.h"
#include "driver/source/nmasic.h"
Functions | |
sint8 | m2m_wifi_allow_p2p_connection () |
sint8 | m2m_wifi_ap_add_black_list (uint8 bAddNewEntry, uint8 *mac_addr) |
sint8 | m2m_wifi_ap_get_assoc_info (void) |
Request the status information of the currently connected stations to the WILC1000 AP. The result is passed to the Wi-Fi notification callback with the event M2M_WIFI_RESP_AP_ASSOC_INFO. More... | |
static void | m2m_wifi_cb (uint8 u8OpCode, uint16 u16DataSize, uint8 *pu8Buffer) |
sint8 | m2m_wifi_change_monitoring_channel (uint8 u8ChannelID) |
sint8 | m2m_wifi_connect (char *pcSsid, uint8 u8SsidLen, uint8 u8SecType, tuniM2MWifiAuth *puniAuthInfo, uint16 u16Ch) |
sint8 | m2m_wifi_deinit (void *arg) |
sint8 | m2m_wifi_disable_ap (void) |
NMI_API sint8 | m2m_wifi_disable_mcast_filter (void) |
sint8 | m2m_wifi_disable_monitoring_mode (void) |
sint8 | m2m_wifi_disconnect (void) |
sint8 | m2m_wifi_download_cert (uint8 *pCertData, uint32 u32CertSize) |
sint8 | m2m_wifi_enable_ap (CONST tstrM2MAPConfig *pstrM2MAPConfig) |
NMI_API sint8 | m2m_wifi_enable_mac_mcast (uint8 *pu8MulticastMacAddress, uint8 u8AddRemove) |
Add MAC filter to receive Multicast packets. More... | |
NMI_API sint8 | m2m_wifi_enable_mcast_filter (void) |
Enable Multicast filter. More... | |
sint8 | m2m_wifi_enable_monitoring_mode (tstrM2MWifiMonitorModeCtrl *pstrMtrCtrl) |
sint8 | m2m_wifi_get_connection_info (void) |
Request the status information of the currently connected Wi-Fi AP. The result is passed to the Wi-Fi notification callback with the event M2M_WIFI_RESP_CONN_INFO. More... | |
sint8 | m2m_wifi_get_mac_address (uint8 *pu8MacAddr0, uint8 *pu8MacAddr1) |
Request the current MAC addresses of the device (the working mac addresses). (the function is Blocking until response received) More... | |
uint8 | m2m_wifi_get_num_ap_found (void) |
Reads the number of AP's found in the last Scan Request, The function read the number of AP's from global variable which updated in the wifi_cb in M2M_WIFI_RESP_SCAN_DONE. More... | |
sint8 | m2m_wifi_get_otp_mac_address (uint8 *pu8MacAddr, uint8 *pu8IsValid) |
Request the MAC address stored on the OTP (one time programmable) memory of the device. (the function is Blocking until response received) More... | |
uint8 | m2m_wifi_get_sleep_mode (void) |
Get the current Power save mode. More... | |
sint8 | m2m_wifi_handle_events (void *arg) |
sint8 | m2m_wifi_init (tstrWifiInitParam *param) |
sint8 | m2m_wifi_p2p (uint8 u8Channel, tenuP2PTrigger enuTrigger, uint16 u16WPS_CfgMehods) |
sint8 | m2m_wifi_p2p_disconnect (void) |
sint8 | m2m_wifi_req_curr_rssi (void) |
Request the current RSSI for the current connected AP, the response received in wifi_cb M2M_WIFI_RESP_CURRENT_RSSI. More... | |
sint8 | m2m_wifi_req_scan_result (uint8 index) |
Reads the AP information from the Scan Result list with the given index, the response received in wifi_cb M2M_WIFI_RESP_SCAN_RESULT, the response pointer should be casted with tstrM2mWifiscanResult structure. More... | |
sint8 | m2m_wifi_request_scan (uint8 ch) |
sint8 | m2m_wifi_request_scan_ssid (uint8 ch, char *pcssid) |
sint8 | m2m_wifi_send_ethernet_pkt (uint8 *pu8Packet, uint16 u16PacketSize, uint8 u8IfcId) |
sint8 | m2m_wifi_send_wlan_pkt (uint8 *pu8WlanPacket, uint16 u16WlanHeaderLength, uint16 u16WlanPktSize) |
NMI_API sint8 | m2m_wifi_set_antenna_mode (uint8 ant_mode, uint8 gpio_mode, uint8 ant_gpio1, uint8 ant_gpio2) |
sint8 | m2m_wifi_set_cust_InfoElement (uint8 *pau8M2mCustInfoElement) |
sint8 | m2m_wifi_set_ht_enable (uint8 value) |
This function enables or disables 11n HT (MCS retes) based on parameter passed. More... | |
sint8 | m2m_wifi_set_lsn_int (tstrM2mLsnInt *pstrM2mLsnInt) |
Set the Wi-Fi listen interval for power save operation. It is represented in units of AP Beacon periods. More... | |
sint8 | m2m_wifi_set_mac_address (uint8 au8MacAddress0[6], uint8 au8MacAddress1[6]) |
Assign MAC addresses to the WILC device. More... | |
NMI_API sint8 | m2m_wifi_set_max_tx_rate (tenuTxDataRate enuMaxTxDataRate) |
sint8 | m2m_wifi_set_p2p_control_ifc (uint8 u8IfcId) |
sint8 | m2m_wifi_set_p2p_pin (uint8 *pu8PinNumber, uint8 u8PinLength) |
NMI_API sint8 | m2m_wifi_set_receive_buffer (void *pvBuffer, uint16 u16BufferLen) |
set the ethernet receive buffer, should be called in the receive call back. More... | |
sint8 | m2m_wifi_set_scan_list (tstrM2MScanList *pstrScanList) |
sint8 | m2m_wifi_set_scan_options (uint8 u8NumOfSlot, uint8 u8SlotTime) |
sint8 | m2m_wifi_set_scan_region (uint8 ScanRegion) |
sint8 | m2m_wifi_set_sleep_mode (uint8 PsTyp, uint8 BcastEn) |
Set the power saving mode for the WILC1000. More... | |
sint8 | m2m_wifi_set_tx_power (uint8 u8TxPwrLevel) |
set the TX power More... | |
sint8 | m2m_wifi_wps (uint8 u8TriggerType, const char *pcPinNumber) |
sint8 | m2m_wifi_wps_disable (void) |
Disable the WILC WPS operation. More... | |
sint8 | m2m_wifi_set_device_name (uint8 *pu8DeviceName, uint8 u8DeviceNameLength) |
Set the WILC1000 device name which is used as P2P device name. More... | |
Variables | |
tuCtrlStruct guCtrlStruct | __M2M_DMA_BUF_ATT__ |
static tpfAppEthCb | gpfAppEthCb = NULL |
static tpfAppMonCb | gpfAppMonCb = NULL |
tpfAppWifiCb | gpfAppWifiCb = NULL |
static uint8 * | gpu8ethRcvBuf =NULL |
static uint16 | gu16ethRcvBufSize |
static volatile uint8 | gu8ChNum |
static volatile uint8 | gu8scanInProgress = 0 |
[in] | None |
References m2m_wifi_set_p2p_pin().
Referenced by wifi_cb().
References gpfAppEthCb, gpfAppMonCb, gpfAppWifiCb, gpu8ethRcvBuf, gu16ethRcvBufSize, gu8ChNum, gu8scanInProgress, M2M_DBG, M2M_ERR, M2M_ETH_PAD_SIZE, M2M_HIF_HDR_OFFSET, M2M_WIFI_REQ_P2P_AUTH, M2M_WIFI_RES_WPS, M2M_WIFI_RESP_AP_ASSOC_INFO, M2M_WIFI_RESP_CON_STATE_CHANGED, M2M_WIFI_RESP_CONN_INFO, M2M_WIFI_RESP_CURRENT_RSSI, M2M_WIFI_RESP_ETHERNET_RX_PACKET, M2M_WIFI_RESP_FIRMWARE_STRTED, M2M_WIFI_RESP_IP_CONFLICT, M2M_WIFI_RESP_PACKET_SENT, M2M_WIFI_RESP_SCAN_DONE, M2M_WIFI_RESP_SCAN_RESULT, M2M_WIFI_RESP_WIFI_RX_PACKET, NULL, tstrM2MDataBufCtrl::u16DataSize, tstrM2mIpRsvdPkt::u16PktOffset, tstrM2mIpRsvdPkt::u16PktSz, tstrM2MDataBufCtrl::u16RemainigDataSize, tstrM2MIPConfig::u32StaticIP, tstrM2MDataBufCtrl::u8DataOffset, tstrM2MDataBufCtrl::u8IfcId, tstrM2mIpRsvdPkt::u8IfcId, and tstrM2mScanDone::u8NumofCh.
Referenced by m2m_wifi_init().
References hif_send(), M2M_REQ_GRP_WIFI, M2M_WIFI_REQ_DISABLE_MCAST_FILTER, and NULL.
Referenced by os_m2m_wifi_disable_mcast_filter().
Add MAC filter to receive Multicast packets.
[in] | pu8MulticastMacAddress | Pointer to the MAC address. |
[in] | u8AddRemove | Flag to Add/Remove MAC address. |
References tstrM2MMulticastMac::au8macaddress, hif_send(), M2M_DBG, M2M_ERR_FAIL, M2M_MAC_ADDRES_LEN, m2m_memcpy(), M2M_REQ_GRP_WIFI, M2M_WIFI_REQ_SET_MAC_MCAST, NULL, and tstrM2MMulticastMac::u8AddRemove.
Referenced by os_m2m_wifi_enable_mac_mcast_imp().
Enable Multicast filter.
[in] | None |
References hif_send(), M2M_REQ_GRP_WIFI, M2M_WIFI_REQ_ENABLE_MCAST_FILTER, and NULL.
Referenced by os_m2m_wifi_enable_mcast_filter().
NMI_API sint8 m2m_wifi_set_antenna_mode | ( | uint8 | ant_mode, |
uint8 | gpio_mode, | ||
uint8 | ant_gpio1, | ||
uint8 | ant_gpio2 | ||
) |
References ANT_SWTCH_GPIO_DUAL, ANT_SWTCH_GPIO_NONE, tstrM2mAntDivParams::antenna1, tstrM2mAntDivParams::antenna2, tstrM2mAntDivParams::gpio_mode, hif_send(), is_valid_gpio(), M2M_ERR, M2M_ERR_FAIL, M2M_REQ_GRP_WIFI, M2M_WIFI_REQ_SET_ANT_SWITCH_MODE, tstrM2mAntDivParams::mode, NULL, and NUM_ANT_MODE.
Referenced by atCmd_AntDiversity_Handler(), sta_task(), and wilc_task_1().
References hif_send(), M2M_ERR, M2M_ERR_FAIL, m2m_memcpy(), M2M_REQ_GRP_WIFI, M2M_WIFI_REQ_CUST_INFO_ELEMENT, and NULL.
Referenced by os_m2m_wifi_set_cust_InfoElement_imp().
This function enables or disables 11n HT (MCS retes) based on parameter passed.
[in] | value | value can be 0 or 1, 0 to disable 11n HT and 1 to enable 11n HT. |
References hif_send(), M2M_ERR_FAIL, M2M_REQ_GRP_WIFI, M2M_WIFI_REQ_HT_MIB_ENABLE, NULL, and tstrM2mReqHTEnable::u8Enable.
NMI_API sint8 m2m_wifi_set_max_tx_rate | ( | tenuTxDataRate | enuMaxTxDataRate | ) |
References hif_send(), M2M_DBG, M2M_ERR_FAIL, M2M_REQ_GRP_WIFI, M2M_WIFI_REQ_SET_MAX_TX_RATE, NULL, and tstrM2MUserMaxTxRate::u32UsrMaxTxRate.
Referenced by os_m2m_wifi_set_max_tx_rate_imp().
References hif_send(), M2M_REQ_GRP_WIFI, M2M_WIFI_REQ_SET_P2P_IFC_ID, NULL, P2P_AP_CONCURRENCY_INTERFACE, P2P_STA_CONCURRENCY_INTERFACE, and tstrM2MIfId::u8IfcId.
Referenced by os_m2m_wifi_set_p2p_control_ifc().
set the ethernet receive buffer, should be called in the receive call back.
[in] | pvBuffer | Pointer to the ethernet receive buffer. |
[in] | u16BufferLen | Length of the buffer. |
References gpu8ethRcvBuf, gu16ethRcvBufSize, hif_set_receive_buffer(), M2M_ERR, M2M_ERR_FAIL, M2M_SUCCESS, and NULL.
Referenced by os_m2m_wifi_set_receive_buffer_imp().
set the TX power
[in] | u8TxPwrLevel | TX power ppa to one of these values: 0dBm, 3dBm, 6dBm, 9dBm, 12dBm, 15dBm, 18dBm. Other values between these steps will be floored to the nearest supported level. A maximum level might be enforced by the firmware to comply to RF regulations |
References hif_send(), M2M_REQ_GRP_WIFI, M2M_SUCCESS, M2M_WIFI_REQ_SET_TX_POWER, NULL, and tstrM2mTxPwrLevel::u8TxPwrLevel.
Referenced by atCmd_TxPwr_Handler().
static uint32 u32CertChunkSize __M2M_DMA_BUF_ATT__ |
|
static |
Referenced by m2m_wifi_cb(), and m2m_wifi_init().
|
static |
Referenced by m2m_wifi_cb(), and m2m_wifi_init().
tpfAppWifiCb gpfAppWifiCb = NULL |
Referenced by m2m_wifi_cb(), m2m_wifi_init(), and status_callback().
Referenced by m2m_wifi_cb(), m2m_wifi_init(), and m2m_wifi_set_receive_buffer().
|
static |
Referenced by m2m_wifi_cb(), m2m_wifi_init(), and m2m_wifi_set_receive_buffer().
|
static |
Referenced by m2m_wifi_cb(), and m2m_wifi_get_num_ap_found().
|
static |
Referenced by m2m_wifi_cb(), m2m_wifi_init(), m2m_wifi_request_scan(), m2m_wifi_request_scan_ssid(), and m2m_wifi_wps().