Macros | Functions | Variables
m2m_wifi.c File Reference

This module contains M2M Wi-Fi APIs implementation. More...

#include "driver/include/m2m_wifi.h"
#include "driver/source/m2m_hif.h"
#include "driver/source/nmasic.h"
#include "ISConstants.h"
Include dependency graph for m2m_wifi.c:

Go to the source code of this file.

Macros

#define free   FREE
 
#define malloc   MALLOC
 

Functions

NMI_API sint8 m2m_ota_get_firmware_version (tstrM2mRev *pstrRev)
 Synchronous API to obtain the firmware version of the WINC image that is stored in the inactive flash partition. This is the image that would run on the WINC IC if m2m_ota_switch_firmware or m2m_ota_rollback were called, followed by a reset of the WINC IC. More...
 
static sint8 m2m_validate_ap_parameters (CONST tstrM2MAPConfig *pstrM2MAPConfig)
 
static sint8 m2m_validate_scan_options (tstrM2MScanOption *ptstrM2MScanOption)
 
NMI_API sint8 m2m_wifi_ble_api_send (uint8 *msg, uint32 len)
 
NMI_API sint8 m2m_wifi_ble_set_gain_table (uint8 table_idx)
 Asynchronous API that notifies the WINC with the Gain Table index from Flash that should use to configure the WiFi and BLE gains. More...
 
static void m2m_wifi_cb (uint8 u8OpCode, uint16 u16DataSize, uint32 u32Addr)
 
sint8 m2m_wifi_check_ota_rb (void)
 Synchronous API to check presence and compatibility of the WINC image that is stored in the inactive flash partition. This is the image that would run on the WINC IC if m2m_ota_switch_firmware or m2m_ota_rollback were called, followed by a reset of the WINC IC. More...
 
sint8 m2m_wifi_connect (char *pcSsid, uint8 u8SsidLen, uint8 u8SecType, void *pvAuthInfo, uint16 u16Ch)
 Asynchronous API to request connection to a specified access point. More...
 
sint8 m2m_wifi_connect_sc (char *pcSsid, uint8 u8SsidLen, uint8 u8SecType, void *pvAuthInfo, uint16 u16Ch, uint8 u8NoSaveCred)
 Asynchronous API to request connection to a specific AP with option to store credentials in flash. More...
 
sint8 m2m_wifi_default_connect (void)
 Asynchronous API that attempts to reconnect to the last-associated access point. More...
 
sint8 m2m_wifi_deinit (void *arg)
 Synchronous API that de-initialises the WINC driver. More...
 
sint8 m2m_wifi_disable_ap (void)
 Synchronous API to disable access point mode on the WINC IC. More...
 
sint8 m2m_wifi_disconnect (void)
 Synchronous API to request disconnection from a network. More...
 
sint8 m2m_wifi_download_mode ()
 Synchronous API that prepares the WINC IC to enter firmware or certificate download mode. More...
 
sint8 m2m_wifi_enable_ap (CONST tstrM2MAPConfig *pstrM2MAPConfig)
 Asynchronous API to enable access point (AKA "hot-spot") mode on the WINC IC. More...
 
sint8 m2m_wifi_enable_dhcp (uint8 u8DhcpEn)
 Asynchronous function to control the DHCP client functionality within the WINC IC. More...
 
sint8 m2m_wifi_enable_firmware_logs (uint8 u8Enable)
 Enable or Disable logs in run time (Disable Firmware logs will enhance the firmware start-up time and performance) More...
 
sint8 m2m_wifi_enable_sntp (uint8 bEnable)
 Asynchronous API to enable or disable the SNTP client running on the WINC IC. More...
 
uint32 m2m_wifi_get_chipId (void)
 Synchronous API to obtain the firmware WINC chip ID. More...
 
sint8 m2m_wifi_get_connection_info (void)
 Asynchronous API for retrieving the WINC IC's connection status. More...
 
sint8 m2m_wifi_get_firmware_version (tstrM2mRev *pstrRev)
 Synchronous API to obtain the firmware version currently running on the WINC IC. More...
 
sint8 m2m_wifi_get_mac_address (uint8 *pu8MacAddr)
 Synchronous API to retrieve the MAC address currently in use on the device. More...
 
uint8 m2m_wifi_get_num_ap_found (void)
 Synchronous API to retrieve the number of AP's found during the last scan operation. More...
 
sint8 m2m_wifi_get_otp_mac_address (uint8 *pu8MacAddr, uint8 *pu8IsValid)
 Synchronous API to query the MAC address programmed into the WINC ICs OTP memory. More...
 
uint8 m2m_wifi_get_sleep_mode (void)
 Synchronous API to retrieve the current power save mode of the WINC IC. More...
 
sint8 m2m_wifi_get_sytem_time (void)
 Asynchronous API to obtain the system time in use by the WINC IC. More...
 
sint8 m2m_wifi_handle_events (void *arg)
 Synchronous M2M event handler function. More...
 
sint8 m2m_wifi_init (tstrWifiInitParam *param)
 Synchronous API that initialises the WINC driver. More...
 
sint8 m2m_wifi_init_hold (void)
 First part of m2m_wifi_init, up to the point of initializing spi for flash access. More...
 
sint8 m2m_wifi_init_start (tstrWifiInitParam *param)
 Second part of m2m_wifi_init, continuing from where m2m_wifi_init_hold left off. More...
 
sint8 m2m_wifi_p2p (uint8 u8Channel)
 Asynchronous API for enabling Wi-Fi Direct (P2P) mode in the WINC IC. More...
 
sint8 m2m_wifi_p2p_disconnect (void)
 Synchronous API to disable Wi-Fi Direct (P2P) Mode on the WINC IC. More...
 
sint8 m2m_wifi_prng_get_random_bytes (uint8 *pu8PrngBuff, uint16 u16PrngSize)
 Get random bytes using the PRNG bytes. More...
 
sint8 m2m_wifi_reinit (tstrWifiInitParam *param)
 Deinitialize and reinitialize wifi. Resets the WINC. Parameter may be set to NULL, in which case there is no change to the parameters given at initialization. More...
 
sint8 m2m_wifi_reinit_hold (void)
 First part of m2m_wifi_reinit, up to the point of initializing spi for flash access. More...
 
sint8 m2m_wifi_reinit_start (tstrWifiInitParam *param)
 Second part of m2m_wifi_reinit, continuing from where m2m_wifi_reinit_hold left off. More...
 
sint8 m2m_wifi_req_curr_rssi (void)
 Asynchronous API to request the current Receive Signal Strength (RSSI) of the current connection. More...
 
sint8 m2m_wifi_req_restrict_ble (void)
 Asynchronous API to request restricting of BLE functionality by placing the BLE processor in a low power state. It is recommended to do this if it is know that BLE functionality will not be used for any significant length of time. More...
 
sint8 m2m_wifi_req_scan_result (uint8 index)
 Asynchronous API to request the information of an access point discovered via scanning. More...
 
sint8 m2m_wifi_req_unrestrict_ble (void)
 Asynchronous API to request un-restricting of BLE functionality by reverting the BLE processor to full power mode. More...
 
sint8 m2m_wifi_request_dhcp_client (void)
 Legacy (deprecated) Asynchronous API for starting a DHCP client on the WINC IC. More...
 
sint8 m2m_wifi_request_dhcp_server (uint8 *addr)
 Legacy (deprecated) Asynchronous function to start a DHCP client on the WINC IC. More...
 
sint8 m2m_wifi_request_scan (uint8 ch)
 Asynchronous API to request the WINC IC perform a scan for networks. More...
 
sint8 m2m_wifi_request_scan_passive (uint8 ch)
 
sint8 m2m_wifi_request_sleep (uint32 u32SlpReqTime)
 Asynchronous API to place the WINC IC into sleep mode for a specified period of time. More...
 
sint8 m2m_wifi_send_ethernet_pkt (uint8 *pu8Packet, uint16 u16PacketSize)
 Asynchronous API to queue an Ethernet packet for transmission by the WINC IC. More...
 
sint8 m2m_wifi_set_battery_voltage (uint16 u16BattVoltx100)
 Enable or Disable logs in run time (Disable Firmware logs will enhance the firmware start-up time and performance) More...
 
sint8 m2m_wifi_set_cust_InfoElement (uint8 *pau8M2mCustInfoElement)
 Asynchronous API to add or remove a user-defined Information Element. More...
 
sint8 m2m_wifi_set_device_name (uint8 *pu8DeviceName, uint8 u8DeviceNameLength)
 Asynchronous API to set the Wi-Fi Direct "Device Name" of the WINC IC. More...
 
sint8 m2m_wifi_set_lsn_int (tstrM2mLsnInt *pstrM2mLsnInt)
 Asynchronous API to set Wi-Fi listen interval for power save operation. More...
 
sint8 m2m_wifi_set_mac_address (uint8 au8MacAddress[6])
 Synchronous API for assigning a MAC address to the WINC IC. More...
 
sint8 m2m_wifi_set_power_profile (uint8 u8PwrMode)
 Change the power profile mode. More...
 
sint8 m2m_wifi_set_scan_options (tstrM2MScanOption *ptstrM2MScanOption)
 Synchronous API for configuring the behaviour of the WINC IC's network scanning functions. More...
 
sint8 m2m_wifi_set_scan_region (uint16 ScanRegion)
 Synchronous API for configuring the regulatory restrictions that may affect the WINC ICs scanning behaviour. More...
 
sint8 m2m_wifi_set_sleep_mode (uint8 PsTyp, uint8 BcastEn)
 Synchronous API to set the power-save mode of the WINC IC. More...
 
sint8 m2m_wifi_set_static_ip (tstrM2MIPConfig *pstrStaticIPConf)
 Synchronous API to manually assign a (static) IP address to the WINC IC. More...
 
sint8 m2m_wifi_set_sytem_time (uint32 u32UTCSeconds)
 Asynchronous function for setting the system time within the WINC IC. More...
 
sint8 m2m_wifi_set_tx_power (uint8 u8TxPwrLevel)
 set the TX power tenuM2mTxPwrLevel More...
 
sint8 m2m_wifi_start_provision_mode (tstrM2MAPConfig *pstrAPConfig, char *pcHttpServerDomainName, uint8 bEnableHttpRedirect)
 Asynchronous API for control of Wi-Fi provisioning functionality. More...
 
sint8 m2m_wifi_stop_provision_mode (void)
 Synchronous API for terminating provisioning mode on the WINC IC. More...
 
sint8 m2m_wifi_wps (uint8 u8TriggerType, const char *pcPinNumber)
 Asynchronous API to engage the WINC IC's Wi-Fi Protected Setup (enrolee) function. More...
 
sint8 m2m_wifi_wps_disable (void)
 Synchronous API that disables Wi-Fi Protected Setup mode in the WINC IC. More...
 
void m2m_wifi_yield (void)
 Yield from processing more synchronous M2M events. More...
 

Variables

static tpfAppWifiCb gpfAppWifiCb = NULL
 
static volatile uint8 gu8ChNum
 

Detailed Description

This module contains M2M Wi-Fi APIs implementation.

Copyright (c) 2017-2018 Microchip Technology Inc. and its subsidiaries.

Definition in file m2m_wifi.c.

Macro Definition Documentation

◆ free

#define free   FREE

Definition at line 41 of file m2m_wifi.c.

◆ malloc

#define malloc   MALLOC

Definition at line 40 of file m2m_wifi.c.

Function Documentation

◆ m2m_validate_ap_parameters()

static sint8 m2m_validate_ap_parameters ( CONST tstrM2MAPConfig pstrM2MAPConfig)
static

Definition at line 337 of file m2m_wifi.c.

◆ m2m_validate_scan_options()

static sint8 m2m_validate_scan_options ( tstrM2MScanOption ptstrM2MScanOption)
static

Definition at line 412 of file m2m_wifi.c.

◆ m2m_wifi_cb()

static void m2m_wifi_cb ( uint8  u8OpCode,
uint16  u16DataSize,
uint32  u32Addr 
)
static

Definition at line 80 of file m2m_wifi.c.

◆ m2m_wifi_prng_get_random_bytes()

sint8 m2m_wifi_prng_get_random_bytes ( uint8 pu8PrngBuff,
uint16  u16PrngSize 
)

Get random bytes using the PRNG bytes.

Parameters
[in]pu8PrngBuffPointer to Buffer to receive data. Size greater than the maximum specified (M2M_BUFFER_MAX_SIZE - sizeof(tstrPrng)) causes a negative error M2M_ERR_FAIL.
[in]u16PrngSizerequest size in bytes
Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise.
Parameters
[in]u16PrngSizeSize of the required random bytes to be generated.
[in]pu8PrngBuffPointer to user allocated buffer.
Returns
The function SHALL return M2M_SUCCESE for success and a negative value otherwise.

Definition at line 1383 of file m2m_wifi.c.

Variable Documentation

◆ gpfAppWifiCb

tpfAppWifiCb gpfAppWifiCb = NULL
static

Definition at line 44 of file m2m_wifi.c.

◆ gu8ChNum

volatile uint8 gu8ChNum
static

Definition at line 43 of file m2m_wifi.c.



inertial_sense_ros
Author(s):
autogenerated on Sun Feb 28 2021 03:17:59