Classes | Typedefs | Enumerations | Functions
m2m_wifi.h File Reference

WINC3400 IoT Application Interface. More...

#include "common/include/nm_common.h"
#include "driver/include/m2m_types.h"
#include "driver/source/nmdrv.h"
Include dependency graph for m2m_wifi.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tstrEthInitParam
 Structure to hold Ethernet interface parameters. Structure is to be defined and have its attributes set, based on the application's functionality before a call is made to initialize the wi-fi operations by calling the m2m_wifi_init function. Part of the wi-fi configuration structure tstrWifiInitParam. Applications shouldn't need to define this structure, if the bypass mode is not defined. More...
 
struct  tstrM2mIpCtrlBuf
 
Structure holding the incoming buffer's data size information, indicating the data size of the 

buffer and the remaining buffer's data size. The data of the buffer which holds the packet sent to the host when in the bypass mode, is placed in the tstrEthInitParam::au8ethRcvBuf attribute. This following information is retrieved in the host when an event M2M_WIFI_RESP_ETHERNET_RX_PACKET is received in the Wi-Fi callback function tpfAppWifiCb. More...

 
struct  tstrWifiInitParam
 Structure, holding the Wi-fi configuration attributes such as the wi-fi callback , monitoring mode callback and Ethernet parameter initialization structure. Such configuration parameters are required to be set before calling the wi-fi initialization function m2m_wifi_init. pfAppWifiCb attribute must be set to handle the wi-fi callback operations. pfAppMonCb attribute, is optional based on whether the application requires the monitoring mode configuration, and can there not be set before the initialization. strEthInitParam structure, is another optional configuration based on whether the bypass mode is set. More...
 

Typedefs

typedef void(* tpfAppEthCb) (uint8 u8MsgType, void *pvMsg, void *pvCtrlBuf)
 Ethernet (Bypass mode) notification callback function receiving Bypass mode events as defined in the Wi-Fi responses enumeration tenuM2mStaCmd. More...
 
typedef void(* tpfAppMonCb) (tstrM2MWifiRxPacketInfo *pstrWifiRxPacket, uint8 *pu8Payload, uint16 u16PayloadSize)
 Wi-Fi monitoring mode callback function. This function delivers all received wi-Fi packets to the application. Applications requiring to operate in the monitoring shall call the function m2m_wifi_enable_monitoring_mode, each frame received will invoke a single call to this callback function. Monitoring mode may be disabled by calling m2m_wifi_disable_monitoring_mode. More...
 
typedef void(* tpfAppWifiCb) (uint8 u8MsgType, void *pvMsg)
 This is the main callback function for the Wi-Fi driver and is responsible for processing any M2M_WIFI events that are received on the Wi-Fi interface. These events (notifications) are usually received in response to earlier Wi-Fi requests such as m2m_wifi_request_scan, and m2m_wifi_connect. More...
 

Enumerations

enum  tenuInfoElementId {
  ISSID = 0, ISUPRATES = 1, IFHPARMS = 2, IDSPARMS = 3,
  ICFPARMS = 4, ITIM = 5, IIBPARMS = 6, ICOUNTRY = 7,
  IEDCAPARAMS = 12, ITSPEC = 13, ITCLAS = 14, ISCHED = 15,
  ICTEXT = 16, IPOWERCONSTRAINT = 32, IPOWERCAPABILITY = 33, ITPCREQUEST = 34,
  ITPCREPORT = 35, ISUPCHANNEL = 36, ICHSWANNOUNC = 37, IMEASUREMENTREQUEST = 38,
  IMEASUREMENTREPORT = 39, IQUIET = 40, IIBSSDFS = 41, IERPINFO = 42,
  ITSDELAY = 43, ITCLASPROCESS = 44, IHTCAP = 45, IQOSCAP = 46,
  IRSNELEMENT = 48, IEXSUPRATES = 50, IEXCHSWANNOUNC = 60, IHTOPERATION = 61,
  ISECCHOFF = 62, I2040COEX = 72, I2040INTOLCHREPORT = 73, IOBSSSCAN = 74,
  IEXTCAP = 127, IWMM = 221, IWPAELEMENT = 221
}
 Enumeration for the Wi-Fi Information Element(IE) IDs, which indicates the specific type of IEs. IEs are management frame information included in management frames. More...
 
enum  tenuSubTypes {
  ASSOC_REQ = 0x00, ASSOC_RSP = 0x10, REASSOC_REQ = 0x20, REASSOC_RSP = 0x30,
  PROBE_REQ = 0x40, PROBE_RSP = 0x50, BEACON = 0x80, ATIM = 0x90,
  DISASOC = 0xA0, AUTH = 0xB0, DEAUTH = 0xC0, ACTION = 0xD0,
  PS_POLL = 0xA4, RTS = 0xB4, CTS = 0xC4, ACK = 0xD4,
  CFEND = 0xE4, CFEND_ACK = 0xF4, BLOCKACK_REQ = 0x84, BLOCKACK = 0x94,
  DATA = 0x08, DATA_ACK = 0x18, DATA_POLL = 0x28, DATA_POLL_ACK = 0x38,
  NULL_FRAME = 0x48, CFACK = 0x58, CFPOLL = 0x68, CFPOLL_ACK = 0x78,
  QOS_DATA = 0x88, QOS_DATA_ACK = 0x98, QOS_DATA_POLL = 0xA8, QOS_DATA_POLL_ACK = 0xB8,
  QOS_NULL_FRAME = 0xC8, QOS_CFPOLL = 0xE8, QOS_CFPOLL_ACK = 0xF8
}
 Enumeration for Wi-Fi MAC Frame subtype code (6-bit). The frame subtypes fall into one of the three frame type groups as defined in tenuWifiFrameType (MANAGEMENT, CONTROL & DATA). More...
 
enum  tenuWifiCapability {
  ESS = 0x01, IBSS = 0x02, POLLABLE = 0x04, POLLREQ = 0x08,
  PRIVACY = 0x10, SHORTPREAMBLE = 0x20, SHORTSLOT = 0x400, PBCC = 0x40,
  CHANNELAGILITY = 0x80, SPECTRUM_MGMT = 0x100, DSSS_OFDM = 0x2000
}
 Enumeration for capability Information field bit. The value of the capability information field from the 802.11 management frames received by the wireless LAN interface. Defining the capabilities of the Wi-Fi system. More...
 
enum  tenuWifiFrameType { MANAGEMENT = 0x00, CONTROL = 0x04, DATA_BASICTYPE = 0x08, RESERVED = 0x0C }
 Enumeration for Wi-Fi MAC frame type codes (2-bit) The following types are used to identify the type of frame sent or received. Each frame type constitutes a number of frame subtypes as defined in tenuSubTypes to specify the exact type of frame. More...
 

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...
 
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...
 
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...
 
NMI_API 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...
 
NMI_API sint8 m2m_wifi_connect_sc (char *pcSsid, uint8 u8SsidLen, uint8 u8SecType, void *pvAuthInfo, uint16 u16Ch, uint8 u8SaveCred)
 Asynchronous API to request connection to a specific AP with option to store credentials in flash. More...
 
NMI_API sint8 m2m_wifi_default_connect (void)
 Asynchronous API that attempts to reconnect to the last-associated access point. More...
 
NMI_API sint8 m2m_wifi_deinit (void *arg)
 Synchronous API that de-initialises the WINC driver. More...
 
NMI_API sint8 m2m_wifi_disable_ap (void)
 Synchronous API to disable access point mode on the WINC IC. More...
 
NMI_API sint8 m2m_wifi_disable_monitoring_mode (void)
 Asynchronous API to disable Wi-Fi monitoring (promiscuous receive) mode. More...
 
NMI_API sint8 m2m_wifi_disconnect (void)
 Synchronous API to request disconnection from a network. More...
 
NMI_API sint8 m2m_wifi_download_mode (void)
 Synchronous API that prepares the WINC IC to enter firmware or certificate download mode. More...
 
NMI_API sint8 m2m_wifi_enable_ap (CONST tstrM2MAPConfig *pstrM2MAPConfig)
 Asynchronous API to enable access point (AKA "hot-spot") mode on the WINC IC. More...
 
NMI_API 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...
 
NMI_API sint8 m2m_wifi_enable_mac_mcast (uint8 *pu8MulticastMacAddress, uint8 u8AddRemove)
 Asynchronous API to add or remove MAC addresses in the multicast filter. More...
 
NMI_API sint8 m2m_wifi_enable_monitoring_mode (tstrM2MWifiMonitorModeCtrl *pstrMtrCtrl, uint8 *pu8PayloadBuffer, uint16 u16BufferSize, uint16 u16DataOffset)
 Asynchronous call to enable Wi-Fi monitoring (promiscuous receive) mode. More...
 
NMI_API 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...
 
NMI_API 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...
 
NMI_API sint8 m2m_wifi_get_mac_address (uint8 *pu8MacAddr)
 Synchronous API to retrieve the MAC address currently in use on the device. More...
 
NMI_API uint8 m2m_wifi_get_num_ap_found (void)
 Synchronous API to retrieve the number of AP's found during the last scan operation. More...
 
NMI_API 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...
 
NMI_API uint8 m2m_wifi_get_sleep_mode (void)
 Synchronous API to retrieve the current power save mode of the WINC IC. More...
 
NMI_API sint8 m2m_wifi_get_sytem_time (void)
 Asynchronous API to obtain the system time in use by the WINC IC. More...
 
NMI_API sint8 m2m_wifi_handle_events (void *arg)
 Synchronous M2M event handler function. More...
 
NMI_API sint8 m2m_wifi_init (tstrWifiInitParam *pWifiInitParam)
 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...
 
NMI_API sint8 m2m_wifi_p2p (uint8 u8Channel)
 Asynchronous API for enabling Wi-Fi Direct (P2P) mode in the WINC IC. More...
 
NMI_API 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...
 
NMI_API sint8 m2m_wifi_req_curr_rssi (void)
 Asynchronous API to request the current Receive Signal Strength (RSSI) of the current connection. More...
 
NMI_API 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...
 
NMI_API sint8 m2m_wifi_req_scan_result (uint8 index)
 Asynchronous API to request the information of an access point discovered via scanning. More...
 
NMI_API 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...
 
NMI_API sint8 m2m_wifi_request_dhcp_client (void)
 Legacy (deprecated) Asynchronous API for starting a DHCP client on the WINC IC. More...
 
NMI_API sint8 m2m_wifi_request_dhcp_server (uint8 *addr)
 Legacy (deprecated) Asynchronous function to start a DHCP client on the WINC IC. More...
 
NMI_API 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)
 
NMI_API sint8 m2m_wifi_request_sleep (uint32 u32SlpReqTime)
 Asynchronous API to place the WINC IC into sleep mode for a specified period of time. More...
 
NMI_API sint8 m2m_wifi_send_ethernet_pkt (uint8 *pu8Packet, uint16 u16PacketSize)
 Asynchronous API to queue an Ethernet packet for transmission by the WINC IC. More...
 
NMI_API sint8 m2m_wifi_send_wlan_pkt (uint8 *pu8WlanPacket, uint16 u16WlanHeaderLength, uint16 u16WlanPktSize)
 Asynchronous API to queue a raw Wi-Fi 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...
 
NMI_API sint8 m2m_wifi_set_cust_InfoElement (uint8 *pau8M2mCustInfoElement)
 Asynchronous API to add or remove a user-defined Information Element. More...
 
NMI_API 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...
 
NMI_API sint8 m2m_wifi_set_lsn_int (tstrM2mLsnInt *pstrM2mLsnInt)
 Asynchronous API to set Wi-Fi listen interval for power save operation. More...
 
NMI_API 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...
 
NMI_API sint8 m2m_wifi_set_receive_buffer (void *pvBuffer, uint16 u16BufferLen)
 Asynchronous API to set or change the size of the WINC IC's receive buffer. More...
 
NMI_API sint8 m2m_wifi_set_scan_options (tstrM2MScanOption *ptstrM2MScanOption)
 Synchronous API for configuring the behaviour of the WINC IC's network scanning functions. More...
 
NMI_API sint8 m2m_wifi_set_scan_region (uint16 ScanRegion)
 Synchronous API for configuring the regulatory restrictions that may affect the WINC ICs scanning behaviour. More...
 
NMI_API sint8 m2m_wifi_set_sleep_mode (uint8 PsTyp, uint8 BcastEn)
 Synchronous API to set the power-save mode of the WINC IC. More...
 
NMI_API sint8 m2m_wifi_set_static_ip (tstrM2MIPConfig *pstrStaticIPConf)
 Synchronous API to manually assign a (static) IP address to the WINC IC. More...
 
NMI_API 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...
 
NMI_API sint8 m2m_wifi_start_provision_mode (tstrM2MAPConfig *pstrAPConfig, char *pcHttpServerDomainName, uint8 bEnableHttpRedirect)
 Asynchronous API for control of Wi-Fi provisioning functionality. More...
 
NMI_API sint8 m2m_wifi_stop_provision_mode (void)
 Synchronous API for terminating provisioning mode on the WINC IC. More...
 
NMI_API sint8 m2m_wifi_wps (uint8 u8TriggerType, const char *pcPinNumber)
 Asynchronous API to engage the WINC IC's Wi-Fi Protected Setup (enrolee) function. More...
 
NMI_API sint8 m2m_wifi_wps_disable (void)
 Synchronous API that disables Wi-Fi Protected Setup mode in the WINC IC. More...
 
NMI_API void m2m_wifi_yield (void)
 Yield from processing more synchronous M2M events. More...
 

Detailed Description

WINC3400 IoT Application Interface.

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

Definition in file m2m_wifi.h.

Function Documentation

◆ 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.



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