WINC3400 IoT Software APIs: WINC3400 API Reference Manual

WINC3400 IoT Software APIs 1.2.1
Description of WINC3400 Software Interface data types and APIs
WINC3400 API Reference Manual

Table of Contents

  • Introduction
    • WINC3400 ASIC
    • WINC3400 Firmware Driver Architecture
    • IoT Application Software Configuration
  • Wi-Fi Software API Files

Introduction

[General Architecture of WINC3400 SoC]

The ATWINC3400 provides a single chip solution for internet connectivity to microcontroller-based applications along with BLE 4.0 connectivity to peripheral and central devices. It provides the host microcontroller with methods to perform WLAN management (e.g. association, disassociation, etc), BSD compatible socket interface for modern industry standard networking applications, and BLE 4.0 connectivity via the Atmel BLE API.

WiFi - The WINC3400 runs firmware on chip which provides IEEE 802.11 b/g/n and MAC functionality. The 802.11 MAC software in firmware works closely with WINC3400 802.11 MAC accelerators on ASIC to provide Wi-Fi station mode and Access point mode.
BLE - The WINC3400 also runs firmware to provide BLE MAC functionality, via an ASIC BLE MAC accelerator to provide BLE provisioning and profile support in central and peripheral mode.

The firmware provides networking protocols on top of MAC software such as TCP/IP, UDP, DNS resolver, DHCP client, DHCP server, TLS v1.2 and WPS. The WINC3400 provides the host microcontroller application which has limited memory and CPU power with a wide range of connectivity methods from peer-to-peer connections, LAN communication and communication with internet servers in the cloud.

The following subsections will provide an overview of the basic building blocks of the WINC3400 architecture, together with Application Interface(API) details.

WINC3400 ASIC

[WINC3400 ASICs]
The WINC3400 SoC features 802.11 b/g/n RF, PHY and MAC hardware. The SoC contains two APS3 Cortus controllers, the main processor handles the WLAN traffic and management tasks, and runs at a clock speed of 40MHz with 128KB program memory and 64KB data memory. This Cortus and 802.11 MAC share 128KB of shared memory for Wi-Fi packet transmit/receive.
The second Cortus runs at 26MHz and handles the BLE traffic, and has access to 292KB of program memory and 64KB of data memory, with 32KB of shared memory with the BLE MAC.
The SoC communicates with external host controllers via I2C, SPI or UART serial interfaces. The device is equipped with 1024KB flash for firmware and configuration parameters storage.

WINC3400 Firmware Driver Architecture

[WINC3400 Firmware Driver Architecture]

The Firmware driver is a C library which provides the Host Processor application with Wi-Fi configuration APIs as well as BSD compatible socket APIs. In return asynchronous callbacks are provided upon receiving HIF messages from WINC3400 firmware. The Firmware driver can be broken into several modules as follows:

  • m2m_wifi module : provides the entry point, DHCP, DNS and Wi-Fi configuration APIs to the Host Processor application. Also provides API for BLE messaging.
  • socket module : provides BSD compatible socket APIs to Host Processor application. The API provides non-blocking implementation of socket(), bind(), connect(), listen(), accept(), send(), sendto(), recv() and recvfrom() APIs.
  • m2m_ssl module : provides APIs to configure options for TLS handshake.
  • m2m_ota module : provides APIs to control inbuilt OTA of WINC firmware.
  • m2m_flash module : provides APIs to access WINC flash regions.
  • m2m_hif module : provides data transport to socket, m2m_ssl, m2m_ota and m2m_wifi modules over interface over serial bus (SPI). It utilizes an interrupt handler from BSP module.
  • nmdrv module : provides device specific initialization to m2m_wifi and m2m_flash modules.
  • spi_flash module : provides WINC flash access (via nmbus and nmspi modules) to m2m_flash module.
  • nmasic module : provides various WINC3400 device specific functions to m2m_hif and nmdrv modules.
  • nmbus module : provides WINC3400 device specific low-level communication protocol to do register read/write and memory read/write. nmbus module depends on nmispi module. This module depends on the Host platform bus wrapper module.

When Firmware driver is ported to a new platform, new BSP and bus wrapper modules have to be provided.

  • BSP module provides Firmware driver with the following interfaces:
    • WINC3400 device reset : control CHIP_EN and RESET_N GPIOs.
    • Interrupt handler : enable interrupt source from IRQN line and provide ISR handler.
    • Milliseconds delay : calibrated ms delay function.
  • bus wrapper module provides basic raw TX/RX operations over serial interface (SPI).

IoT Application Software Configuration

[Architecture of the host CPU application]

The IoT application software is an application running on a host microcontroller which communicates with the WINC3400 through a serial interface.

  • The Host Interface Layer is responsible for handling the communication mechanism between the host CPU and the WINC3400. This includes Interrupt handling, DMA control and management of communication logic between firmware driver at host and WINC3400 firmware.
  • The BSP gives an abstract of the host hardware.

Wi-Fi Software API Files

The table below lists the modules and files included in the Wi-Fi Software API, which will be explained in more detail through this reference manual with reference examples.

Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: $title

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. The name of Atmel may not be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Generated on Fri Aug 18 2017 00:42:03 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: Modules

Modules
Here is a list of all modules:
[detail level 12]
▼ FLASH
Defines
Enumeration/Typedefs
Functions
▼ OTA
Functions
Defines
Enumeration/Typedefs
▼ SSL
Enumeration/Typedefs
Functions
▼ VERSION
Defines
Functions
▼ WLAN
Defines
Enumeration/Typedefs
Functions
▼ BSP
Defines
Enumeration/Typedefs
Functions
▼ COMMON
Defines
Functions
▼ SOCKET
Defines
Byte Order
Error Codes
Enumeration/Typedefs
Functions
TLS Cipher Suite IDs
Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: FLASH

Modules
FLASH

Modules

Defines
Enumeration/Typedefs
Functions

Detailed Description

Generated on Fri Aug 18 2017 00:42:03 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: Defines

Macros
Defines
FLASH

Macros

#define | FLASH_UPDATEIMAGE_OPTION_UPDATE NBIT0
#define | FLASH_UPDATEIMAGE_OPTION_VALIDATE NBIT1
#define | FLASH_UPDATEIMAGE_OPTION_SWITCH NBIT2
#define | FLASH_SUCCESS 0
#define | FLASH_ERR_PARAM (-1)
#define | FLASH_ERR_LOCAL_ACCESS (-2)
#define | FLASH_ERR_WINC_ACCESS (-3)
#define | FLASH_ERR_SIZE (-4)
#define | FLASH_ERR_WINC_CONFLICT (-5)
#define | FLASH_ERR_UNINIT (-6)
#define | FLASH_ERR_INTERNAL (-7)

Detailed Description

Macro Definition Documentation

◆ FLASH_UPDATEIMAGE_OPTION_UPDATE

#define FLASH_UPDATEIMAGE_OPTION_UPDATE NBIT0

Bit 0 of u8Options parameter of m2m_flash_updateimage.
Request to write new firmware image to WINC inactive partition.

◆ FLASH_UPDATEIMAGE_OPTION_VALIDATE

#define FLASH_UPDATEIMAGE_OPTION_VALIDATE NBIT1

Bit 1 of u8Options parameter of m2m_flash_updateimage.
Request to mark image in WINC inactive partition as valid. If set along with FLASH_UPDATEIMAGE_OPTION_UPDATE, the image is not marked valid if the writing fails.

◆ FLASH_UPDATEIMAGE_OPTION_SWITCH

#define FLASH_UPDATEIMAGE_OPTION_SWITCH NBIT2

Bit 2 of u8Options parameter of m2m_flash_updateimage.
Request to switch the WINC active/inactive partitions. Use this to switch to a new image or to revert to an old one. The switch only succeeds if the image has been marked valid.

◆ FLASH_SUCCESS

#define FLASH_SUCCESS 0

Return success, transfer succeeded.

◆ FLASH_ERR_PARAM

#define FLASH_ERR_PARAM (-1)

Return error. The parameters provided by the MCU application failed sanity checks.

◆ FLASH_ERR_LOCAL_ACCESS

#define FLASH_ERR_LOCAL_ACCESS (-2)

Return error. An MCU application function of type tpfDataAccessFn returned failure.

◆ FLASH_ERR_WINC_ACCESS

#define FLASH_ERR_WINC_ACCESS (-3)

Return error. There was an error while accessing WINC flash, or contents of WINC flash were not as expected.

◆ FLASH_ERR_SIZE

#define FLASH_ERR_SIZE (-4)

Return error. The transfer destination location was too small for the size of data to be transferred.

◆ FLASH_ERR_WINC_CONFLICT

#define FLASH_ERR_WINC_CONFLICT (-5)

Return error. The data provided by the MCU application caused a failure. For example:

  • An item could not be added to a WINC flash store because the identifier matched an existing item.
  • An item could not be read or removed from a WINC flash store because the identifier did not match an existing item.
  • A firmware image could not be written to WINC flash because it did not match the format of WINC firmware images.

◆ FLASH_ERR_UNINIT

#define FLASH_ERR_UNINIT (-6)

Return error. The MCU application did not call m2m_flash_init during Wi-Fi initialization.

◆ FLASH_ERR_INTERNAL

#define FLASH_ERR_INTERNAL (-7)

Return error. The module hit an internal error, such as insufficient heap memory.


WINC3400 IoT Software APIs: Enumeration/Typedefs

Data Structures | Typedefs | Enumerations
Enumeration/Typedefs
FLASH

Data Structures

struct | tstrDataAccessInitParamsApp
struct | tstrDataAccessParamsApp
struct | tstrFlashState

Typedefs

typedef sint8(* tpfDataAccessFn) (tenuFlashDataFnCtl enuCtl, void *pvStr)

Enumerations

enum | tenuFlashDataFnCtl { FLASH_DATA_FN_INITIALIZE, FLASH_DATA_FN_DATA, FLASH_DATA_FN_TERMINATE, FLASH_DATA_FN_COMPLETE }
enum | tenuDataFnRW { FLASH_DATA_FN_READ, FLASH_DATA_FN_WRITE }
enum | tenuImageId { FLASH_IMAGE_INACTIVE, FLASH_IMAGE_ACTIVE }

Detailed Description

Typedef Documentation

◆ tpfDataAccessFn

tpfDataAccessFn

A function of this type is used for local data access. It can be implemented to handle simple RAM access with pointer/length, or it can be implemented to handle access to external memory. Functions of this type are provided to the module via various function APIs.

See also
m2m_flash_rootcert_add
m2m_flash_rootcert_read
m2m_flash_rootcert_readidx
m2m_flash_updateimage
m2m_flash_readimage
Parameters
[in] enuCtl Control parameter.
[in] pvStr Generic pointer to structure. The structure type depends on enuCtl:
  • tstrDataAccessInitParamsApp if enuCtl is FLASH_DATA_FN_INITIALIZE.
  • tstrDataAccessParamsApp if enuCtl is FLASH_DATA_FN_DATA.
  • NULL if enuCtl is FLASH_DATA_FN_TERMINATE or FLASH_DATA_FN_COMPLETE.
Note
The function is typically called by the module multiple times during a data transfer: Once with FLASH_DATA_FN_INITIALIZE, then multiple times with FLASH_DATA_FN_DATA, then once with FLASH_DATA_FN_COMPLETE.
Returns
Zero for success. Non-zero otherwise.

Example

This example illustrates an implementation of a function of type tpfDataAccessFn.
This example assumes the application's data buffer is in RAM, so we can use memcpy. Alternatively memcpy can be replaced by dedicated functions which read/write the application buffer.

gpu8DataLocation is a pointer to the data buffer in RAM, set by the application.
gu32DataSize is the size of the data buffer, set by the application.

sint8 data_access_ptr(tenuFlashDataFnCtl enuCtl, void *pvStr)
{
// Return value.
sint8 s8Ret = -1;
// Fixed variables, set in case FLASH_DATA_FN_INITIALIZE, reset in case FLASH_DATA_FN_COMPLETE.
static tenuDataFnRW enuRW;
static uint8 *pu8Location = NULL;
static uint32 u32BytesRemaining = 0;
switch (enuCtl)
{
case FLASH_DATA_FN_INITIALIZE:
if (pvStr != NULL)
{
tstrDataAccessInitParamsApp *init_params = (tstrDataAccessInitParamsApp*)pvStr;
if (init_params->u32TotalSize > gu32DataSize)
break;
// Set fixed variables.
enuRW = init_params->enuRW;
pu8Location = gpu8DataLocation;
u32BytesRemaining = init_params->u32TotalSize;
s8Ret = 0;
}
break;
case FLASH_DATA_FN_DATA:
if ((pvStr != NULL) && (pu8Location != NULL))
{
tstrDataAccessParamsApp *params = (tstrDataAccessParamsApp*)pvStr;
// Some sanity checks which should never fail.
if (u32BytesRemaining < params->u32DataSize)
break;
if (params->pu8Data == NULL)
break;
switch (enuRW)
{
case FLASH_DATA_FN_WRITE:
memcpy(pu8Location, params->pu8Data, params->u32DataSize);
s8Ret = 0;
break;
case FLASH_DATA_FN_READ:
memcpy(params->pu8Data, pu8Location, params->u32DataSize);
s8Ret = 0;
break;
}
// Update fixed variables for sequential access.
pu8Location += params->u32DataSize;
u32BytesRemaining -= params->u32DataSize;
}
break;
case FLASH_DATA_FN_TERMINATE:
case FLASH_DATA_FN_COMPLETE:
// Reset fixed variables.
pu8Location = NULL;
u32BytesRemaining = 0;
s8Ret = 0;
break;
}
return s8Ret;
}

Enumeration Type Documentation

◆ tenuFlashDataFnCtl

enum tenuFlashDataFnCtl

Control parameter for tpfDataAccessFn.

Enumerator
FLASH_DATA_FN_INITIALIZE | Data access about to start. Check and save parameters as required, ready for subsequent data accesses.
FLASH_DATA_FN_DATA | Sequential data access, using parameters previously provided by FLASH_DATA_FN_INITIALIZE.
FLASH_DATA_FN_TERMINATE | Data access aborted. Did not complete and will not be continued.
FLASH_DATA_FN_COMPLETE | Data access complete.

◆ tenuDataFnRW

enum tenuDataFnRW

Indicates whether data is to be read or written.

Enumerator
FLASH_DATA_FN_READ | Read data from application memory.
FLASH_DATA_FN_WRITE | Write data to application memory.

◆ tenuImageId

enum tenuImageId

Indicates which image to access in WINC flash.

Enumerator
FLASH_IMAGE_INACTIVE | Access the image in the inactive partition.
FLASH_IMAGE_ACTIVE | Access the image in the active partition.


WINC3400 IoT Software APIs: tstrDataAccessInitParamsApp Struct Reference

Data Fields
tstrDataAccessInitParamsApp Struct Reference
FLASH » Enumeration/Typedefs

Data Fields

uint32 u32TotalSize
tenuDataFnRW enuRW

Detailed Description

This structure contains parameters for initializing a local data access (read or write).

See also
tpfDataAccessFn.

Field Documentation

◆ u32TotalSize

uint32 u32TotalSize

Total size of data to be accessed in data location.

◆ enuRW

tenuDataFnRW enuRW

Flags indicating type of data access (read or write).


WINC3400 IoT Software APIs: tstrDataAccessParamsApp Struct Reference

Data Fields
tstrDataAccessParamsApp Struct Reference
FLASH » Enumeration/Typedefs

Data Fields

uint8 * pu8Data
uint32 u32DataSize

Detailed Description

This structure contains data for local data access (read or write).

See also
tpfDataAccessFn.

Field Documentation

◆ pu8Data

uint8* pu8Data

Buffer to be written from or read to.

◆ u32DataSize

uint32 u32DataSize

Size of data to be written or read.


WINC3400 IoT Software APIs: tstrFlashState Struct Reference

Data Fields
tstrFlashState Struct Reference
FLASH » Enumeration/Typedefs

Data Fields

uint16 u16LastAccessId
uint8 u8Success
uint8 u8Changed
uint8 u8Init
uint8 u8Reset

Detailed Description

This structure contains information about an attempted transfer.

See also
m2m_flash_init

Field Documentation

◆ u16LastAccessId

uint16 u16LastAccessId

Last access attempt. Identifier provided by MCU application. 0 if info not available.

◆ u8Success

uint8 u8Success

Was the last access attempt successful?

◆ u8Changed

uint8 u8Changed

Did the last access attempt result in modified WINC flash?

◆ u8Init

uint8 u8Init

Has the module been initialized?

◆ u8Reset

uint8 u8Reset

Has the module been initialized more recently than the module last reset the WINC?


WINC3400 IoT Software APIs: Functions

Functions
Functions
FLASH

Functions

sint8 | m2m_flash_updateimage (uint8 u8Options, uint16 u16Id, tpfDataAccessFn pfSourceFn, uint32 u32SourceSize)
sint8 | m2m_flash_readimage (tenuImageId enuImageId, uint16 u16Id, tpfDataAccessFn pfDestFn, uint32 u32DestSize)
sint8 | m2m_flash_rootcert_add (uint16 u16Id, tpfDataAccessFn pfFn, uint32 u32Size)
sint8 | m2m_flash_rootcert_remove (uint16 u16Id, uint8 *pu8Identifier, uint32 u32IdentifierSz)
sint8 | m2m_flash_rootcert_read (uint16 u16Id, tpfDataAccessFn pfDestFn, uint32 u32DestSize, uint8 *pu8Identifier, uint32 u32IdentifierSz)
sint8 | m2m_flash_rootcert_readidx (uint16 u16Id, tpfDataAccessFn pfDestFn, uint32 u32DestSize, uint8 u8Index)
void | m2m_flash_get_state (tstrFlashState *pstrState)
sint8 | m2m_flash_init (void)

Detailed Description

Function Documentation

◆ m2m_flash_updateimage()

sint8 m2m_flash_updateimage | ( | uint8 | u8Options,
 |  | uint16 | u16Id,
 |  | tpfDataAccessFn | pfSourceFn,
 |  | uint32 | u32SourceSize
 | ) |  |

Write/validate/switch a WINC firmware image.

Parameters
[in] | u8Options | Flags indicating the required combination of write / validate / switch.
[in] | u16Id | Transfer identifier, not interpreted by this module.
[in] | pfSourceFn | Function for the module to call to obtain the image from the MCU application.
[in] | u32SourceSize | Size of the image being provided by the MCU application.
See also
FLASH_UPDATEIMAGE_OPTION_UPDATE
FLASH_UPDATEIMAGE_OPTION_VALIDATE
FLASH_UPDATEIMAGE_OPTION_SWITCH
Returns
Zero indicates success. Negative values indicate failure.

◆ m2m_flash_readimage()

sint8 m2m_flash_readimage | ( | tenuImageId | enuImageId,
 |  | uint16 | u16Id,
 |  | tpfDataAccessFn | pfDestFn,
 |  | uint32 | u32DestSize
 | ) |  |

Read a WINC firmware image.

Parameters
[in] | enuImageId | Which partition to read image from.
[in] | u16Id | Transfer identifier, not interpreted by this module.
[in] | pfDestFn | Function for the module to call to send the image to the MCU application.
[in] | u32DestSize | Size of the memory available to the MCU application for storing the image.
Returns
Zero indicates success. Negative values indicate failure.

◆ m2m_flash_rootcert_add()

sint8 m2m_flash_rootcert_add | ( | uint16 | u16Id,
 |  | tpfDataAccessFn | pfSourceFn,
 |  | uint32 | u32SourceSize
 | ) |  |

Add an entry to the WINC TLS root certificate store.

Parameters
[in] | u16Id | Transfer identifier, not interpreted by this module.
[in] | pfSourceFn | Function for the module to call to obtain the certificate entry from the MCU application.
[in] | u32SourceSize | Size of the certificate entry being provided by the MCU application.
Note
The data location to be accessed via pfSourceFn contains the entry to be added. The format of a TLS root certificate entry is:
Name Offset Length Contents
Header 0 36 tstrRootCertEntryHeader
Key 36 KeyLength Public key and padding
Padding 36+KeyLength PadLength 0xFF
For RSA public keys, the format of Key is:
Name Offset Length
Modulus 36 ModLength RSA modulus, with leading 0s stripped off
Exponent 36+ModLength ExpLength Public exponent, with leading 0s stripped off
In this case PadLength is the amount of padding that would be required for 4-byte alignment of Modulus plus the amount of padding that would be required for 4-byte alignment of Exponent.
For ECDSA public keys, the format of Key is:
Name Offset Length
X Coord 36 CoordLength Public key X-coordinate
Y Coord 36+CoordLength CoordLength Public key Y-coordinate
In this case PadLength is the amount of padding that would be required for 4-byte alignment of X Coord plus the amount of padding that would be required for 4-byte alignment of Y Coord.
Returns
Zero indicates success. Negative values indicate failure.

◆ m2m_flash_rootcert_remove()

sint8 m2m_flash_rootcert_remove | ( | uint16 | u16Id,
 |  | uint8 * | pu8Identifier,
 |  | uint32 | u32IdentifierSz
 | ) |  |

Remove an entry from the WINC TLS root certificate store.

Parameters
[in] | u16Id | Transfer identifier, not interpreted by this module.
[in] | pu8Identifier | Identifier for the entry to be removed. This is the SHA1 digest of the certificate issuer name.
[in] | u32IdentifierSz | Size of the identifier (20).
Returns
Zero indicates success. Negative values indicate failure.

◆ m2m_flash_rootcert_read()

sint8 m2m_flash_rootcert_read | ( | uint16 | u16Id,
 |  | tpfDataAccessFn | pfDestFn,
 |  | uint32 | u32DestSize,
 |  | uint8 * | pu8Identifier,
 |  | uint32 | u32IdentifierSz
 | ) |  |

Read an entry from the WINC TLS root certificate store, referenced by entry identifier.

Parameters
[in] | u16Id | Transfer identifier, not interpreted by this module.
[in] | pfDestFn | Function for the module to call to send the certificate entry to the MCU application.
[in] | u32DestSize | Size of the memory available to the MCU application for storing the entry.
[in] | pu8Identifier | Identifier for the entry to be read. This is the SHA1 digest of the certificate issuer name.
[in] | u32IdentifierSz | Size of the identifier (20).
Returns
Zero indicates success. Negative values indicate failure.

◆ m2m_flash_rootcert_readidx()

sint8 m2m_flash_rootcert_readidx | ( | uint16 | u16Id,
 |  | tpfDataAccessFn | pfDestFn,
 |  | uint32 | u32DestSize,
 |  | uint8 | u8Index
 | ) |  |

Read an entry from the WINC TLS root certificate store, referenced by entry index.

Parameters
[in] | u16Id | Transfer identifier, not interpreted by this module.
[in] | pfDestFn | Function for the module to call to send the certificate entry to the MCU application.
[in] | u32DestSize | Size of the memory available to the MCU application for storing the entry.
[in] | u8Index | Zero-based index of the entry to be read.
Returns
Zero indicates success. Negative values indicate failure.

◆ m2m_flash_get_state()

void m2m_flash_get_state ( tstrFlashState * pstrState )

Get information about the module current state and about the most recent access attempt.

Parameters
[out] pstrState Module state and most recent access attempt info.
Returns
None.

◆ m2m_flash_init()

sint8 m2m_flash_init ( void )

Initialize the module.

Warning
This API must be called at a particular point during MCU application initialization.
See also
m2m_wifi_init
m2m_wifi_init_hold
m2m_wifi_init_start

Example

This example demonstrates how to add m2m_flash_init and m2m_flash_get_state to MCU application initialization code.

Original code:

{
tstrWifiInitParam param = {...}
sint8 status = 0;
status = m2m_wifi_init(param);
if (status != 0)
{
// Wifi init failed.
}
}

New code:

{
tstrWifiInitParam param = {...}
sint8 status = 0;
status = m2m_wifi_init_hold();
if (status == 0)
{
tstrFlashState strFlashState;
m2m_flash_get_state(&strFlashState);
printf("FlashAccess:%x:%d%d\n", strFlashState.u16LastAccessId, strFlashState.u8Success, strFlashState.u8Changed);
switch (strFlashState.u16LastAccessId)
{
// Application code dependent on meaning of u16LastAccessId.
}
m2m_flash_init();
status = m2m_wifi_init_start(param);
}
if (status != 0)
{
// Wifi init failed.
}
}
Returns
Zero for successful initialization of module. Negative value otherwise.


WINC3400 IoT Software APIs: OTA

Modules
OTA

Modules

Functions
Defines
Enumeration/Typedefs

Detailed Description

Generated on Fri Aug 18 2017 00:42:03 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: Functions

Functions
Functions
OTA

Functions

NMI_API sint8 | m2m_ota_init (tpfOtaUpdateCb pfOtaUpdateCb, tpfOtaNotifCb pfOtaNotifCb)
NMI_API sint8 | m2m_ota_notif_set_url (uint8 *u8Url)
NMI_API sint8 | m2m_ota_notif_check_for_update (void)
NMI_API sint8 | m2m_ota_notif_sched (uint32 u32Period)
NMI_API sint8 | m2m_ota_start_update (uint8 *u8DownloadUrl)
NMI_API sint8 | m2m_ota_rollback (void)
NMI_API sint8 | m2m_ota_abort (void)
NMI_API sint8 | m2m_ota_switch_firmware (void)

Detailed Description

Function Documentation

◆ m2m_ota_init()

NMI_API sint8 m2m_ota_init | ( | tpfOtaUpdateCb | pfOtaUpdateCb,
 |  | tpfOtaNotifCb | pfOtaNotifCb
 | ) |  |

Synchronous initialization function for the OTA layer by registering the update callback. The notification callback is not supported at the current version. Calling this API is a prerequisite for all other OTA API's.

Parameters
[in] | pfOtaUpdateCb | OTA Update callback function
[in] | pfOtaNotifCb | OTA notify callback function
Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise.

◆ m2m_ota_notif_set_url()

NMI_API sint8 m2m_ota_notif_set_url ( uint8 * u8Url )

Set the OTA notification server URL, the functions need to be called before any check for update. This functionality is not supported by WINC firmware.

Parameters
[in] u8Url Set the OTA notification server URL, the functions need to be called before any check for update.
Warning
This functionality is not supported by WINC firmware.
See also
m2m_ota_init
Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise.

◆ m2m_ota_notif_check_for_update()

NMI_API sint8 m2m_ota_notif_check_for_update ( void )

Synchronous function to check for the OTA update using the Notification Server URL. This functionality is not supported by WINC firmware.

Warning
This functionality is not supported by WINC firmware.
See also
m2m_ota_init m2m_ota_notif_set_url
Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise.

◆ m2m_ota_notif_sched()

NMI_API sint8 m2m_ota_notif_sched ( uint32 u32Period )

Schedule OTA notification Server check for update request after specific number of days. This functionality is not supported by WINC firmware.

Parameters
[in] u32Period Period in days
Warning
This functionality is not supported by WINC firmware.
See also
m2m_ota_init m2m_ota_notif_check_for_update m2m_ota_notif_set_url
Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise.

◆ m2m_ota_start_update()

NMI_API sint8 m2m_ota_start_update ( uint8 * u8DownloadUrl )

Request OTA start update using the downloaded URL. The firmware OTA module will download the OTA image, ensure integrity of the image, and update the validity of the image in the control structure. On completion, a callback of type tpfOtaUpdateCb is called (callback previously provided via m2m_ota_init()). Switching to the updated image additionally requires completion of m2m_ota_switch_firmware(), and system_reset().

Parameters
[in] u8DownloadUrl The download firmware URL, according to the application server.
Warning
Calling this API does not guarantee OTA WINC image update; it depends on the connection with the download server and the validity of the image. Calling this API invalidates the previous rollback image. The current image will become the rollback image after m2m_ota_switch_firmware().
Precondition
m2m_ota_init() must have been called before using m2m_ota_start_update().
See also
m2m_ota_init() m2m_ota_switch_firmware() tpfOtaUpdateCb
Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise. Note that successful operation in this context means the OTA update request has reached the firmware OTA module. It does not indicate whether or not the image update succeeded.

Example

This example shows how an OTA image update and switch is carried out. It demonstrates use of the following OTA APIs: m2m_ota_init() tpfOtaUpdateCb m2m_ota_start_update() m2m_ota_switch_firmware() m2m_ota_rollback() It also makes use of m2m_wifi_check_ota_rb() in order to inform OTA decisions.

static void OtaUpdateCb(uint8 u8OtaUpdateStatusType ,uint8 u8OtaUpdateStatus)
{
sint8 s8tmp;
tstrM2mRev strtmp;
M2M_INFO("%d %d\n", u8OtaUpdateStatusType, u8OtaUpdateStatus);
switch(u8OtaUpdateStatusType) {
case DL_STATUS:
if(u8OtaUpdateStatus == OTA_STATUS_SUCSESS) {
M2M_INFO("OTA download succeeded\n");
s8tmp = m2m_wifi_check_ota_rb();
if(s8tmp == M2M_ERR_FW_VER_MISMATCH) {
// In this case the application SHOULD update the host driver before calling
// @ref m2m_ota_switch_firmware(). Switching firmware image and resetting without updating host
// driver would lead to severely limited functionality (i.e. OTA rollback only).
}
else if(s8tmp == M2M_SUCCESS) {
// In this case the application MAY WANT TO update the host driver before calling
// @ref m2m_ota_switch_firmware(). Switching firmware image and resetting without updating host
// driver may lead to suboptimal functionality.
}
else {
M2M_INFO("Cannot recognize downloaded image\n");
// In this case the application MUST NOT update the host driver if such an update would change the
// driver HIF Major field. Firmware switch @ref using m2m_ota_switch_firmware() is blocked.
break;
}
M2M_INFO("Now switching active partition...\n");
s8tmp = m2m_ota_switch_firmware();
}
break;
case SW_STATUS:
case RB_STATUS:
if(u8OtaUpdateStatus == OTA_STATUS_SUCSESS) {
M2M_INFO("Switch/Rollback succeeded\n");
M2M_INFO("Now resetting the system...\n");
system_reset();
}
break;
}
}
static void wifi_event_cb(uint8 u8WiFiEvent, void * pvMsg)
{
// ...
case M2M_WIFI_REQ_DHCP_CONF:
{
//After successful connection, start the OTA upgrade.
m2m_ota_start_update(OTA_URL);
}
break;
// ...
}
int main (void)
{
sint8 ret = M2M_SUCCESS;
tstrWifiInitParam param;
bool rollback_required = FALSE;
// ... system init etc here ...
//Initialize the WINC Driver.
m2m_memset((uint8*)&param, 0, sizeof(param));
param.pfAppWifiCb = wifi_event_cb;
ret = m2m_wifi_init(&param);
if(ret == M2M_ERR_FW_VER_MISMATCH) {
ret = m2m_wifi_check_ota_rb();
if(ret == M2M_SUCCESS) {
// In this case the image in the inactive partition has compatible HIF. We will switch/rollback to it
// after initializing the OTA module.
rollback_required = TRUE;
}
}
if(ret != M2M_SUCCESS) {
M2M_ERR("Driver Init Failed <%d>\n",ret);
while(1);
}
//Initialize the OTA module.
m2m_ota_init(OtaUpdateCb, NULL);
if(rollback_required) {
// We need to call either @ref m2m_ota_rollback() or @ref m2m_ota_switch_firmware() (functionally equivalent).
m2m_ota_rollback();
} else {
// Connect to AP that provides connection to the OTA server
m2m_wifi_default_connect();
}
while(1) {
// Handle the app state machine plus the WINC event handler.
while(m2m_wifi_handle_events(NULL) != M2M_SUCCESS) {
}
}
}

◆ m2m_ota_rollback()

NMI_API sint8 m2m_ota_rollback ( void )

Request rollback to the old (inactive) WINC image. The WINC firmware will check the validity of the inactive image and activate it if it is valid. On completion, a callback of type tpfOtaUpdateCb is called (application must previously have provided the callback via m2m_ota_init()). If the callback indicates successful activation, the newly-activated image will start running after next system reset.

Warning
If rollback will necessitate a host driver update in order to maintain HIF compatibility (HIF major value change), then it is recommended to update the host driver prior to calling this API. In the event of system reset with incompatible driver/firmware, compatibility can be recovered by calling m2m_ota_rollback or m2m_ota_switch_firmware. See Example.
See also
m2m_ota_init m2m_ota_start_update
Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise.

◆ m2m_ota_abort()

NMI_API sint8 m2m_ota_abort ( void )

Abort an ota in progress (eg if server has stalled) and clean up

See also
m2m_ota_init m2m_ota_start_update
Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise.

◆ m2m_ota_switch_firmware()

NMI_API sint8 m2m_ota_switch_firmware ( void )

Request switch to the updated WINC image. The WINC firmware will check the validity of the inactive image and activate it if it is valid. On completion, a callback of type tpfOtaUpdateCb is called (application must previously have provided the callback via m2m_ota_init()). If the callback indicates successful activation, the newly-activated image will start running after next system reset.

Warning
If switch will necessitate a host driver update in order to maintain HIF compatibility (HIF major value change), then it is recommended to update the host driver prior to calling this API. In the event of system reset with incompatible driver/firmware, compatibility can be recovered by calling m2m_ota_rollback or m2m_ota_switch_firmware. See Example.
See also
m2m_ota_init m2m_ota_start_update
Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise.


WINC3400 IoT Software APIs: Defines

Macros
Defines
OTA

Macros

#define | OTA_STATUS_VALID (0x12526285)
#define | OTA_STATUS_INVALID (0x23987718)
#define | OTA_MAGIC_VALUE (0x1ABCDEF9)
#define | OTA_SHA256_DIGEST_SIZE (32)
#define | OTA_SUCCESS (0)
#define | OTA_ERR_WORKING_IMAGE_LOAD_FAIL ((sint8)-1)
#define | OTA_ERR_INVAILD_CONTROL_SEC ((sint8)-2)
#define | M2M_ERR_OTA_SWITCH_FAIL ((sint8)-3)
#define | M2M_ERR_OTA_START_UPDATE_FAIL ((sint8)-4)
#define | M2M_ERR_OTA_ROLLBACK_FAIL ((sint8)-5)
#define | M2M_ERR_OTA_INVAILD_FLASH_SIZE ((sint8)-6)
#define | M2M_ERR_OTA_INVAILD_ARG ((sint8)-7)

Detailed Description

Macro Definition Documentation

◆ OTA_STATUS_VALID

#define OTA_STATUS_VALID (0x12526285)

Magic value in the control structure for a valid image after ROLLBACK.

◆ OTA_STATUS_INVALID

#define OTA_STATUS_INVALID (0x23987718)

Magic value in the control structure for a invalid image after ROLLBACK.

◆ OTA_MAGIC_VALUE

#define OTA_MAGIC_VALUE (0x1ABCDEF9)

Magic value set at the beginning of the OTA image header.

◆ OTA_SHA256_DIGEST_SIZE

#define OTA_SHA256_DIGEST_SIZE (32)

SHA256 digest size in the OTA image. The SHA256 digest is set at the beginning of image before the OTA header.

◆ OTA_SUCCESS

#define OTA_SUCCESS (0)

OTA success status.

◆ OTA_ERR_WORKING_IMAGE_LOAD_FAIL

#define OTA_ERR_WORKING_IMAGE_LOAD_FAIL ((sint8)-1)

Failure to load the firmware image.

◆ OTA_ERR_INVAILD_CONTROL_SEC

#define OTA_ERR_INVAILD_CONTROL_SEC ((sint8)-2)

Control structure is being corrupted.

◆ M2M_ERR_OTA_SWITCH_FAIL

#define M2M_ERR_OTA_SWITCH_FAIL ((sint8)-3)

Failure to switch to the updated image, due to this being invalid.

◆ M2M_ERR_OTA_START_UPDATE_FAIL

#define M2M_ERR_OTA_START_UPDATE_FAIL ((sint8)-4)

Failure to start the OTA update. This could be due to a connection failure or a problem with the integrity of the image.

◆ M2M_ERR_OTA_ROLLBACK_FAIL

#define M2M_ERR_OTA_ROLLBACK_FAIL ((sint8)-5)

Invalid roll-back image.

◆ M2M_ERR_OTA_INVAILD_FLASH_SIZE

#define M2M_ERR_OTA_INVAILD_FLASH_SIZE ((sint8)-6)

The OTA Support requires 8MB flash size. This error indicates the current flash is less than 8M.

◆ M2M_ERR_OTA_INVAILD_ARG

#define M2M_ERR_OTA_INVAILD_ARG ((sint8)-7)

Invalid argument in any OTA Function

Generated on Fri Aug 18 2017 00:42:03 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: Enumeration/Typedefs

Typedefs | Enumerations
Enumeration/Typedefs
OTA

Typedefs

typedef void(* | tpfOtaNotifCb) (tstrOtaUpdateInfo *pstrOtaUpdateInfo)
typedef void(* | tpfOtaUpdateCb) (uint8 u8OtaUpdateStatusType, uint8 u8OtaUpdateStatus)

Enumerations

enum tenuM2mOtaCmd {
M2M_OTA_REQ_NOTIF_SET_URL = M2M_OTA_CMD_BASE, M2M_OTA_REQ_NOTIF_CHECK_FOR_UPDATE, M2M_OTA_REQ_NOTIF_SCHED, M2M_OTA_REQ_START_UPDATE,
M2M_OTA_REQ_SWITCH_FIRMWARE, M2M_OTA_REQ_ROLLBACK, M2M_OTA_REQ_ABORT, M2M_OTA_RESP_NOTIF_UPDATE_INFO,
M2M_OTA_RESP_UPDATE_STATUS, M2M_OTA_REQ_TEST, M2M_OTA_MAX_ALL
}
enum tenuOtaUpdateStatus {
OTA_STATUS_SUCSESS = 0, OTA_STATUS_FAIL = 1, OTA_STATUS_INVAILD_ARG = 2, OTA_STATUS_INVAILD_RB_IMAGE = 3,
OTA_STATUS_INVAILD_FLASH_SIZE = 4, OTA_STATUS_AlREADY_ENABLED = 5, OTA_STATUS_UPDATE_INPROGRESS = 6, OTA_STATUS_IMAGE_VERIF_FAILED = 7,
OTA_STATUS_CONNECTION_ERROR = 8, OTA_STATUS_SERVER_ERROR = 9, OTA_STATUS_ABORTED = 10
}
enum tenuOtaUpdateStatusType { DL_STATUS = 1, SW_STATUS = 2, RB_STATUS = 3, AB_STATUS = 4 }

Detailed Description

Typedef Documentation

◆ tpfOtaNotifCb

void(* tpfOtaNotifCb)(tstrOtaUpdateInfo *)

A callback to get notification about a potential OTA update.

Parameters
[in] pstrOtaUpdateInfo A structure to provide notification payload.
See also
tstrOtaUpdateInfo
Warning
The notification is not supported (Not implemented yet)

◆ tpfOtaUpdateCb

void(* tpfOtaUpdateCb)(uint8 u8OtaUpdateStatusType,uint8 u8OtaUpdateStatus)

A callback to get OTA status update, the callback provides the download status, the switch to the downloaded firmware status and roll-back status.

Parameters
[in] u8OtaUpdateStatusType Possible values are listed in tenuOtaUpdateStatusType. Possible types are:
  • DL_STATUS
  • SW_STATUS
  • RB_STATUS
[in] u8OtaUpdateStatus Possible values are listed in tenuOtaUpdateStatus.
See also
tenuOtaUpdateStatusType tenuOtaUpdateStatus

Enumeration Type Documentation

◆ tenuM2mOtaCmd

enum tenuM2mOtaCmd

This enum contains all the WINC commands used for OTA operation.

Enumerator
M2M_OTA_REQ_NOTIF_SET_URL | Reserved. Do not use.
M2M_OTA_REQ_NOTIF_CHECK_FOR_UPDATE | Reserved. Do not use.
M2M_OTA_REQ_NOTIF_SCHED | Reserved. Do not use.
M2M_OTA_REQ_START_UPDATE | Request to start an OTA update.
M2M_OTA_REQ_SWITCH_FIRMWARE | Request to switch firmware.
M2M_OTA_REQ_ROLLBACK | Request to perform an OTA rollback.
M2M_OTA_REQ_ABORT | Request to abort OTA.
M2M_OTA_RESP_NOTIF_UPDATE_INFO | Reserved. Do not use.
M2M_OTA_RESP_UPDATE_STATUS | Response to indicate the OTA update status.
M2M_OTA_REQ_TEST | Reserved. Do not use.
M2M_OTA_MAX_ALL |

◆ tenuOtaUpdateStatus

enum tenuOtaUpdateStatus

This struct contains the OTA return status.

Enumerator
OTA_STATUS_SUCSESS | OTA Success with no errors.
OTA_STATUS_FAIL | OTA generic fail.
OTA_STATUS_INVAILD_ARG | Invalid or malformed download URL.
OTA_STATUS_INVAILD_RB_IMAGE | Invalid rollback image.
OTA_STATUS_INVAILD_FLASH_SIZE | Flash size on device is not enough for OTA.
OTA_STATUS_AlREADY_ENABLED | An OTA operation is already enabled.
OTA_STATUS_UPDATE_INPROGRESS | An OTA operation update is in progress
OTA_STATUS_IMAGE_VERIF_FAILED | OTA Verfication failed
OTA_STATUS_CONNECTION_ERROR | OTA connection error
OTA_STATUS_SERVER_ERROR | OTA server Error (file not found or else ...)
OTA_STATUS_ABORTED | OTA download has been aborted by the application.

◆ tenuOtaUpdateStatusType

enum tenuOtaUpdateStatusType

This struct contains the OTA update status type.

Enumerator
DL_STATUS | Download OTA file status
SW_STATUS | Switching to the upgrade firmware status
RB_STATUS | Roll-back status
AB_STATUS | Abort status


WINC3400 IoT Software APIs: SSL

Modules
SSL

Modules

Enumeration/Typedefs
Functions

Detailed Description

Generated on Fri Aug 18 2017 00:42:03 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: Enumeration/Typedefs

Typedefs
Enumeration/Typedefs
SSL

Typedefs

typedef void(* tpfAppSSLCb) (uint8 u8MsgType, void *pvMsg)

Detailed Description

Typedef Documentation

◆ tpfAppSSLCb

void(* tpfAppSSLCb)(uint8 u8MsgType, void *pvMsg)

A callback to get SSL notifications.

Parameters
[in] | u8MsgType
[in] | pvMsg | A structure to provide notification payload.


WINC3400 IoT Software APIs: Functions

Functions
Functions
SSL

Functions

NMI_API sint8 | m2m_ssl_init (tpfAppSSLCb pfAppSSLCb)
NMI_API sint8 | m2m_ssl_handshake_rsp (tstrEccReqInfo *strECCResp, uint8 *pu8RspDataBuff, uint16 u16RspDataSz)
NMI_API sint8 | m2m_ssl_send_certs_to_winc (uint8 *pu8Buffer, uint32 u32BufferSz)
NMI_API sint8 | m2m_ssl_retrieve_cert (uint16 *pu16CurveType, uint8 *pu8Hash, uint8 *pu8Sig, tstrECPoint *pu8Key)
NMI_API sint8 | m2m_ssl_retrieve_hash (uint8 *pu8Hash, uint16 u16HashSz)
NMI_API void | m2m_ssl_stop_processing_certs (void)
NMI_API void | m2m_ssl_ecc_process_done (void)
sint8 | m2m_ssl_set_active_ciphersuites (uint32 u32SslCsBMP)

Detailed Description

Function Documentation

◆ m2m_ssl_init()

NMI_API sint8 m2m_ssl_init ( tpfAppSSLCb pfAppSSLCb )

◆ m2m_ssl_handshake_rsp()

NMI_API sint8 m2m_ssl_handshake_rsp | ( | tstrEccReqInfo * | strECCResp,
 |  | uint8 * | pu8RspDataBuff,
 |  | uint16 | u16RspDataSz
 | ) |  |

Sends ECC responses to the WINC.

Parameters
[in] | strECCResp | ECC Response struct.
[in] | pu8RspDataBuff | Pointer of the response data to be sent.
[in] | u16RspDataSz | Response data size.
Returns
The function SHALL return 0 for success and a negative value otherwise.

◆ m2m_ssl_send_certs_to_winc()

NMI_API sint8 m2m_ssl_send_certs_to_winc | ( | uint8 * | pu8Buffer,
 |  | uint32 | u32BufferSz
 | ) |  |

Sends certificates to the WINC.

Parameters
[in] | pu8Buffer | Pointer to the certificates. The buffer format must match the format of tstrTlsSrvSecHdr
[in] | u32BufferSz | Size of the certificates.
Returns
The function SHALL return 0 for success and a negative value otherwise.

◆ m2m_ssl_retrieve_cert()

NMI_API sint8 m2m_ssl_retrieve_cert | ( | uint16 * | pu16CurveType,
 |  | uint8 * | pu8Hash,
 |  | uint8 * | pu8Sig,
 |  | tstrECPoint * | pu8Key
 | ) |  |

Retrieve the ECDSA certificate to be verified from the WINC.

Parameters
[out] | pu16CurveType | Pointer to the certificate curve type.
[out] | pu8Hash | Pointer to the certificate hash.
[out] | pu8Sig | Pointer to the certificate signature.
[out] | pu8Key | Pointer to the certificate Key.
Returns
The function SHALL return 0 for success and a negative value otherwise.

◆ m2m_ssl_retrieve_hash()

NMI_API sint8 m2m_ssl_retrieve_hash | ( | uint8 * | pu8Hash,
 |  | uint16 | u16HashSz
 | ) |  |

Retrieve the certificate hash.

Parameters
[out] | pu8Hash | Pointer to the certificate hash.
[in] | u16HashSz | Hash size.
Returns
The function SHALL return 0 for success and a negative value otherwise.

◆ m2m_ssl_stop_processing_certs()

NMI_API void m2m_ssl_stop_processing_certs ( void )

Allow ssl driver to tidy up in case application does not read all available certificates.

Warning
This API must only be called if some certificates are left unread.
Returns
None.

◆ m2m_ssl_ecc_process_done()

NMI_API void m2m_ssl_ecc_process_done ( void )

Allow ssl driver to tidy up after application has finished processing ecc message.

Warning
This API must be called after receiving a SSL callback with type M2M_SSL_REQ_ECC
Returns
None.

◆ m2m_ssl_set_active_ciphersuites()

NMI_API sint8 m2m_ssl_set_active_ciphersuites ( uint32 u32SslCsBMP )

Override the default Active SSL ciphers in the SSL module with a certain combination selected by the caller in the form of a bitmap containing the required ciphers to be on. There is no need to call this function if the application will not change the default ciphersuites.

Parameters
[in] u32SslCsBMP Bitmap containing the desired ciphers to be enabled for the SSL module. The ciphersuites are defined in TLS Cipher Suite IDs. The default ciphersuites are all ciphersuites supported by the firmware with the exception of ECC ciphersuites. The caller can override the default with any desired combination, except for combinations involving both RSA and ECC; if any RSA ciphersuite is enabled, then firmware will disable all ECC ciphersuites. If u32SslCsBMP does not contain any ciphersuites supported by firmware, then the current active list will not be changed.
Returns
  • SOCK_ERR_NO_ERROR
  • SOCK_ERR_INVALID_ARG


WINC3400 IoT Software APIs: VERSION

Modules
VERSION

Modules

Defines
Functions

Detailed Description

Generated on Fri Aug 18 2017 00:42:03 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: Defines

Macros
Defines
VERSION

Macros

#define | M2M_HIF_INFO_SHIFT (0)
#define | M2M_HIF_INFO_MASK (0xffff)
#define | M2M_HIF_BLOCK_SHIFT (14)
#define | M2M_HIF_BLOCK_MASK (0x3)
#define | M2M_HIF_LEVEL_SHIFT (0)
#define | M2M_HIF_LEVEL_MASK (0x3fff)
#define | M2M_HIF_MAJOR_SHIFT (8)
#define | M2M_HIF_MAJOR_MASK (0x3f)
#define | M2M_HIF_MINOR_SHIFT (0)
#define | M2M_HIF_MINOR_MASK (0xff)
#define | M2M_GET_HIF_INFO(hif_ver) ((uint16)(((hif_ver) >> M2M_HIF_INFO_SHIFT) & M2M_HIF_INFO_MASK))
#define | M2M_GET_HIF_BLOCK(hif_info) ((uint8)(((hif_info) >> M2M_HIF_BLOCK_SHIFT) & M2M_HIF_BLOCK_MASK))
#define | M2M_GET_HIF_LEVEL(hif_info) ((uint16)(((hif_info) >> M2M_HIF_LEVEL_SHIFT) & M2M_HIF_LEVEL_MASK))
#define | M2M_GET_HIF_MAJOR(hif_info) ((uint8)(((hif_info) >> M2M_HIF_MAJOR_SHIFT) & M2M_HIF_MAJOR_MASK))
#define | M2M_GET_HIF_MINOR(hif_info) ((uint8)(((hif_info) >> M2M_HIF_MINOR_SHIFT) & M2M_HIF_MINOR_MASK))
#define | M2M_MAKE_HIF_INFO(hif_level)
#define | M2M_HIF_BLOCK_VALUE (2)
#define | M2M_HIF_MAJOR_VALUE (1)
#define | M2M_HIF_MINOR_VALUE (3)
#define | M2M_HIF_LEVEL
#define | M2M_DRIVER_VERSION_MAJOR_NO (1)
#define | M2M_DRIVER_VERSION_MINOR_NO (0)
#define | M2M_DRIVER_VERSION_PATCH_NO (8)

Detailed Description

Macro Definition Documentation

◆ M2M_HIF_INFO_SHIFT

#define M2M_HIF_INFO_SHIFT (0)

◆ M2M_HIF_INFO_MASK

#define M2M_HIF_INFO_MASK (0xffff)

◆ M2M_HIF_BLOCK_SHIFT

#define M2M_HIF_BLOCK_SHIFT (14)

◆ M2M_HIF_BLOCK_MASK

#define M2M_HIF_BLOCK_MASK (0x3)

◆ M2M_HIF_LEVEL_SHIFT

#define M2M_HIF_LEVEL_SHIFT (0)

◆ M2M_HIF_LEVEL_MASK

#define M2M_HIF_LEVEL_MASK (0x3fff)

◆ M2M_HIF_MAJOR_SHIFT

#define M2M_HIF_MAJOR_SHIFT (8)

◆ M2M_HIF_MAJOR_MASK

#define M2M_HIF_MAJOR_MASK (0x3f)

◆ M2M_HIF_MINOR_SHIFT

#define M2M_HIF_MINOR_SHIFT (0)

◆ M2M_HIF_MINOR_MASK

#define M2M_HIF_MINOR_MASK (0xff)

◆ M2M_GET_HIF_INFO

#define M2M_GET_HIF_INFO ( hif_ver ) ((uint16)(((hif_ver) >> M2M_HIF_INFO_SHIFT) & M2M_HIF_INFO_MASK))

◆ M2M_GET_HIF_BLOCK

#define M2M_GET_HIF_BLOCK ( hif_info ) ((uint8)(((hif_info) >> M2M_HIF_BLOCK_SHIFT) & M2M_HIF_BLOCK_MASK))

◆ M2M_GET_HIF_LEVEL

#define M2M_GET_HIF_LEVEL ( hif_info ) ((uint16)(((hif_info) >> M2M_HIF_LEVEL_SHIFT) & M2M_HIF_LEVEL_MASK))

◆ M2M_GET_HIF_MAJOR

#define M2M_GET_HIF_MAJOR ( hif_info ) ((uint8)(((hif_info) >> M2M_HIF_MAJOR_SHIFT) & M2M_HIF_MAJOR_MASK))

◆ M2M_GET_HIF_MINOR

#define M2M_GET_HIF_MINOR ( hif_info ) ((uint8)(((hif_info) >> M2M_HIF_MINOR_SHIFT) & M2M_HIF_MINOR_MASK))

◆ M2M_MAKE_HIF_INFO

#define M2M_MAKE_HIF_INFO ( hif_level )
Value:
( \
(((uint16)(hif_level) & M2M_HIF_LEVEL_MASK) << M2M_HIF_LEVEL_SHIFT) | \
(((uint16)M2M_HIF_BLOCK_VALUE & M2M_HIF_BLOCK_MASK) << M2M_HIF_BLOCK_SHIFT) )
M2M_HIF_LEVEL_MASK
#define M2M_HIF_LEVEL_MASK
Definition: m2m_types.h:118
M2M_HIF_BLOCK_SHIFT
#define M2M_HIF_BLOCK_SHIFT
Definition: m2m_types.h:115
M2M_HIF_BLOCK_MASK
#define M2M_HIF_BLOCK_MASK
Definition: m2m_types.h:116
M2M_HIF_LEVEL_SHIFT
#define M2M_HIF_LEVEL_SHIFT
Definition: m2m_types.h:117
M2M_HIF_BLOCK_VALUE
#define M2M_HIF_BLOCK_VALUE
Definition: m2m_types.h:140
uint16
unsigned short uint16
Range of values between 0 to 65535.
Definition: nm_bsp.h:103

◆ M2M_HIF_BLOCK_VALUE

#define M2M_HIF_BLOCK_VALUE (2)

Drv/Fw blocking compatibility check.

◆ M2M_HIF_MAJOR_VALUE

#define M2M_HIF_MAJOR_VALUE (1)

Drv/Fw major compatibility check.

◆ M2M_HIF_MINOR_VALUE

#define M2M_HIF_MINOR_VALUE (3)

Drv/Fw minor compatibility check.

◆ M2M_HIF_LEVEL

#define M2M_HIF_LEVEL
Value:
( \
((M2M_HIF_MAJOR_VALUE & M2M_HIF_MAJOR_MASK) << M2M_HIF_MAJOR_SHIFT) | \
((M2M_HIF_MINOR_VALUE & M2M_HIF_MINOR_MASK) << M2M_HIF_MINOR_SHIFT) \
)
M2M_HIF_MAJOR_MASK
#define M2M_HIF_MAJOR_MASK
Definition: m2m_types.h:122
M2M_HIF_MINOR_SHIFT
#define M2M_HIF_MINOR_SHIFT
Definition: m2m_types.h:123
M2M_HIF_MINOR_MASK
#define M2M_HIF_MINOR_MASK
Definition: m2m_types.h:124
M2M_HIF_MAJOR_VALUE
#define M2M_HIF_MAJOR_VALUE
Definition: m2m_types.h:143
M2M_HIF_MAJOR_SHIFT
#define M2M_HIF_MAJOR_SHIFT
Definition: m2m_types.h:121
M2M_HIF_MINOR_VALUE
#define M2M_HIF_MINOR_VALUE
Definition: m2m_types.h:146

HIF Level (Major/Minor) for Drv/Fw compatibility.

◆ M2M_DRIVER_VERSION_MAJOR_NO

#define M2M_DRIVER_VERSION_MAJOR_NO (1)

Driver Major release version number.

◆ M2M_DRIVER_VERSION_MINOR_NO

#define M2M_DRIVER_VERSION_MINOR_NO (0)

Driver Minor release version number.

◆ M2M_DRIVER_VERSION_PATCH_NO

#define M2M_DRIVER_VERSION_PATCH_NO (8)

Driver patch release version number.


WINC3400 IoT Software APIs: Functions

Functions
Functions
VERSION

Functions

uint32 | m2m_wifi_get_chipId (void)
sint8 | m2m_wifi_check_ota_rb (void)
sint8 | m2m_wifi_get_firmware_version (tstrM2mRev *pstrRev)
NMI_API sint8 | m2m_ota_get_firmware_version (tstrM2mRev *pstrRev)

Detailed Description

Function Documentation

◆ m2m_wifi_get_chipId()

uint32 m2m_wifi_get_chipId ( void )

Synchronous API to obtain the firmware WINC chip ID.

Returns
The function SHALL return chipID > 0 or 0 for failure.

◆ m2m_wifi_check_ota_rb()

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.

Returns
The function SHALL return M2M_SUCCESS for compatible image and a negative value otherwise.

◆ m2m_wifi_get_firmware_version()

sint8 m2m_wifi_get_firmware_version ( tstrM2mRev * pstrRev )

Synchronous API to obtain the firmware version currently running on the WINC IC.

Parameters
[out] pstrRev pointer holds address of structure "tstrM2mRev" that contains the firmware version parameters
Returns
The function SHALL return M2M_SUCCESS for success and a negative value otherwise.

◆ m2m_ota_get_firmware_version()

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.

Parameters
[out] pstrRev pointer holds address of structure "tstrM2mRev" that contains the ota fw version parameters
Returns
The function SHALL return M2M_SUCCESS for success and a negative value otherwise.


WINC3400 IoT Software APIs: WLAN

Modules
WLAN

Modules

Defines
Enumeration/Typedefs
Functions

Detailed Description

Generated on Fri Aug 18 2017 00:42:03 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: Defines

Macros
Defines
WLAN

Macros

#define | M2M_BUFFER_MAX_SIZE (1600UL - 4)
#define | M2M_MAC_ADDRES_LEN 6
#define | M2M_ETHERNET_HDR_OFFSET 34
#define | M2M_ETHERNET_HDR_LEN 14
#define | M2M_MAX_SSID_LEN 33
#define | M2M_MAX_PSK_LEN 65
#define | M2M_DEVICE_NAME_MAX 48
#define | M2M_LISTEN_INTERVAL 1
#define | M2M_1X_USR_NAME_MAX 21
#define | M2M_1X_PWD_MAX 41
#define | M2M_CUST_IE_LEN_MAX 252
#define | M2M_CONFIG_CMD_BASE 1
#define | M2M_STA_CMD_BASE 40
#define | M2M_AP_CMD_BASE 70
#define | M2M_P2P_CMD_BASE 90
#define | M2M_OTA_CMD_BASE 100
#define | M2M_SERVER_CMD_BASE 120
#define | WEP_40_KEY_STRING_SIZE ((uint8)10)
#define | WEP_104_KEY_STRING_SIZE ((uint8)26)
#define | WEP_KEY_MAX_INDEX ((uint8)4)
#define | M2M_SCAN_DEFAULT_NUM_SLOTS (2)
#define | M2M_SCAN_DEFAULT_SLOT_TIME (20)
#define | M2M_SCAN_DEFAULT_PASSIVE_SLOT_TIME (300)
#define | M2M_SCAN_DEFAULT_NUM_PROBE (2)
#define | M2M_FASTCONNECT_DEFAULT_RSSI_THRESH (-45)
#define | M2M_SCAN_FAIL ((uint8)1)
#define | M2M_JOIN_FAIL ((uint8)2)
#define | M2M_AUTH_FAIL ((uint8)3)
#define | M2M_ASSOC_FAIL ((uint8)4)
#define | M2M_SCAN_ERR_WIFI ((sint8)-2)
#define | M2M_SCAN_ERR_IP ((sint8)-3)
#define | M2M_SCAN_ERR_AP ((sint8)-4)
#define | M2M_SCAN_ERR_P2P ((sint8)-5)
#define | M2M_SCAN_ERR_WPS ((sint8)-6)
#define | M2M_WIFI_FRAME_TYPE_ANY 0xFF
#define | M2M_WIFI_FRAME_SUB_TYPE_ANY 0xFF
#define | TLS_FILE_NAME_MAX 48
#define | TLS_SRV_SEC_MAX_FILES 8
#define | TLS_SRV_SEC_START_PATTERN_LEN 8

Detailed Description

Macro Definition Documentation

◆ M2M_BUFFER_MAX_SIZE

#define M2M_BUFFER_MAX_SIZE (1600UL - 4)

Maximum size for the shared packet buffer.

◆ M2M_MAC_ADDRES_LEN

#define M2M_MAC_ADDRES_LEN 6

Size of the MAC address.

◆ M2M_ETHERNET_HDR_OFFSET

#define M2M_ETHERNET_HDR_OFFSET 34

Offset of the ethernet header within the WLAN Tx Buffer.

◆ M2M_ETHERNET_HDR_LEN

#define M2M_ETHERNET_HDR_LEN 14

Length of the ethernet header in bytes.

◆ M2M_MAX_SSID_LEN

#define M2M_MAX_SSID_LEN 33

Maximum size for the Wi-Fi SSID including the NULL termination.

◆ M2M_MAX_PSK_LEN

#define M2M_MAX_PSK_LEN 65

Maximum size for the WPA PSK including the NULL termination.

◆ M2M_DEVICE_NAME_MAX

#define M2M_DEVICE_NAME_MAX 48

Maximum Size for the device name including the NULL termination.

◆ M2M_LISTEN_INTERVAL

#define M2M_LISTEN_INTERVAL 1

The STA uses the Listen Interval parameter to indicate to the AP how many beacon intervals it shall sleep before it retrieves the queued frames from the AP.

◆ M2M_1X_USR_NAME_MAX

#define M2M_1X_USR_NAME_MAX 21

The maximum size of the user name including the NULL termination. It is used for RADIUS authentication in case of connecting the device to an AP secured with WPA-Enterprise.

◆ M2M_1X_PWD_MAX

#define M2M_1X_PWD_MAX 41

The maximum size of the password including the NULL termination. It is used for RADIUS authentication in case of connecting the device to an AP secured with WPA-Enterprise.

◆ M2M_CUST_IE_LEN_MAX

#define M2M_CUST_IE_LEN_MAX 252

Maximum size for the Information Element.

◆ M2M_CONFIG_CMD_BASE

#define M2M_CONFIG_CMD_BASE 1

The base value of all the Host configuration commands opcodes.

◆ M2M_STA_CMD_BASE

#define M2M_STA_CMD_BASE 40

The base value of all the Station mode host commands opcodes.

◆ M2M_AP_CMD_BASE

#define M2M_AP_CMD_BASE 70

The base value of all the Access Point mode host commands opcodes.

◆ M2M_P2P_CMD_BASE

#define M2M_P2P_CMD_BASE 90

The base value of all the P2P mode host commands opcodes.

◆ M2M_OTA_CMD_BASE

#define M2M_OTA_CMD_BASE 100

The base value of all the OTA mode host commands opcodes.

◆ M2M_SERVER_CMD_BASE

#define M2M_SERVER_CMD_BASE 120

The base value of all the Power Save mode host commands codes.

◆ WEP_40_KEY_STRING_SIZE

#define WEP_40_KEY_STRING_SIZE ((uint8)10)

Indicates the WEP key size for the 40 bit string passphrase.

◆ WEP_104_KEY_STRING_SIZE

#define WEP_104_KEY_STRING_SIZE ((uint8)26)

Indicates the WEP key size for the 104 bit string passphrase.

◆ WEP_KEY_MAX_INDEX

#define WEP_KEY_MAX_INDEX ((uint8)4)

Indicates the maximum key index value for WEP authentication.

◆ M2M_SCAN_DEFAULT_NUM_SLOTS

#define M2M_SCAN_DEFAULT_NUM_SLOTS (2)

The default number of scan slots used by the WINC board.

◆ M2M_SCAN_DEFAULT_SLOT_TIME

#define M2M_SCAN_DEFAULT_SLOT_TIME (20)

The active scan slot default duration in ms.

◆ M2M_SCAN_DEFAULT_PASSIVE_SLOT_TIME

#define M2M_SCAN_DEFAULT_PASSIVE_SLOT_TIME (300)

The passive scan slot default duration in ms.

◆ M2M_SCAN_DEFAULT_NUM_PROBE

#define M2M_SCAN_DEFAULT_NUM_PROBE (2)

The default number of probes per slot.

◆ M2M_FASTCONNECT_DEFAULT_RSSI_THRESH

#define M2M_FASTCONNECT_DEFAULT_RSSI_THRESH (-45)

The default threshold RSSI for fast reconnection to an AP.

◆ M2M_SCAN_FAIL

#define M2M_SCAN_FAIL ((uint8)1)

Indicates the WINC board has failed to perform the scan operation.

◆ M2M_JOIN_FAIL

#define M2M_JOIN_FAIL ((uint8)2)

Indicates the WINC board has failed to join the BSS.

◆ M2M_AUTH_FAIL

#define M2M_AUTH_FAIL ((uint8)3)

Indicates the WINC board has failed to authenticate with the AP.

◆ M2M_ASSOC_FAIL

#define M2M_ASSOC_FAIL ((uint8)4)

Indicates the WINC board has failed to associate with the AP.

◆ M2M_SCAN_ERR_WIFI

#define M2M_SCAN_ERR_WIFI ((sint8)-2)

Currently not used.

◆ M2M_SCAN_ERR_IP

#define M2M_SCAN_ERR_IP ((sint8)-3)

Currently not used.

◆ M2M_SCAN_ERR_AP

#define M2M_SCAN_ERR_AP ((sint8)-4)

Currently not used.

◆ M2M_SCAN_ERR_P2P

#define M2M_SCAN_ERR_P2P ((sint8)-5)

Currently not used.

◆ M2M_SCAN_ERR_WPS

#define M2M_SCAN_ERR_WPS ((sint8)-6)

Currently not used.

◆ M2M_WIFI_FRAME_TYPE_ANY

#define M2M_WIFI_FRAME_TYPE_ANY 0xFF

Receive any frame type when configured as Monitor Mode.

◆ M2M_WIFI_FRAME_SUB_TYPE_ANY

#define M2M_WIFI_FRAME_SUB_TYPE_ANY 0xFF

Receive frames with any sub type when configured as Monitor Mode.

◆ TLS_FILE_NAME_MAX

#define TLS_FILE_NAME_MAX 48

Maximum length for each TLS certificate file name.

◆ TLS_SRV_SEC_MAX_FILES

#define TLS_SRV_SEC_MAX_FILES 8

Maximum number of certificates allowed in TLS_SRV section.

◆ TLS_SRV_SEC_START_PATTERN_LEN

#define TLS_SRV_SEC_START_PATTERN_LEN 8

Length of certificate struct start pattern.


WINC3400 IoT Software APIs: Enumeration/Typedefs

Typedefs | Enumerations
Enumeration/Typedefs
WLAN

Typedefs

typedef void(* | tpfAppWifiCb) (uint8 u8MsgType, void *pvMsg)
typedef void(* | tpfAppEthCb) (uint8 u8MsgType, void *pvMsg, void *pvCtrlBuf)
typedef void(* | tpfAppMonCb) (tstrM2MWifiRxPacketInfo *pstrWifiRxPacket, uint8 *pu8Payload, uint16 u16PayloadSize)

Enumerations

enum tenuM2mReqGroup {
M2M_REQ_GROUP_MAIN = 0, M2M_REQ_GROUP_WIFI, M2M_REQ_GROUP_IP, M2M_REQ_GROUP_HIF,
M2M_REQ_GROUP_OTA, M2M_REQ_GROUP_SSL, M2M_REQ_GROUP_SIGMA
}
enum | tenuM2mReqpkt { M2M_REQ_CONFIG_PKT, M2M_REQ_DATA_PKT = 0x80 }
enum | tenuM2mWepKeyIndex { M2M_WIFI_WEP_KEY_INDEX_1 = ((uint8) 1), M2M_WIFI_WEP_KEY_INDEX_2, M2M_WIFI_WEP_KEY_INDEX_3, M2M_WIFI_WEP_KEY_INDEX_4 }
enum | tenuM2mDefaultConnErrcode { M2M_DEFAULT_CONN_INPROGRESS = ((sint8)-23), M2M_DEFAULT_CONN_FAIL, M2M_DEFAULT_CONN_SCAN_MISMATCH, M2M_DEFAULT_CONN_EMPTY_LIST }
enum tenuM2mConnChangedErrcode {
M2M_ERR_SCAN_FAIL = ((uint8)1), M2M_ERR_JOIN_FAIL, M2M_ERR_AUTH_FAIL, M2M_ERR_ASSOC_FAIL,
M2M_ERR_CONN_INPROGRESS
}
enum | tenuM2mSetGainsErrcode { M2M_ERR_GAIN_TABLE_INVALID = ((sint8)-10), M2M_ERR_READ_GAIN_TABLE }
enum | tenuM2mPwrMode { PWR_AUTO = ((uint8) 1), PWR_LOW1, PWR_LOW2, PWR_HIGH }
enum | tenuM2mTxPwrLevel { TX_PWR_HIGH = ((uint8) 1), TX_PWR_MED, TX_PWR_LOW }
enum tenuM2mConfigCmd {
M2M_WIFI_REQ_RESTART = M2M_CONFIG_CMD_BASE, M2M_WIFI_REQ_SET_MAC_ADDRESS, M2M_WIFI_REQ_CURRENT_RSSI, M2M_WIFI_RESP_CURRENT_RSSI,
M2M_WIFI_REQ_RESTRICT_BLE, M2M_WIFI_REQ_UNRESTRICT_BLE, M2M_WIFI_REQ_GET_CONN_INFO, M2M_WIFI_RESP_CONN_INFO,
M2M_WIFI_REQ_SET_DEVICE_NAME, M2M_WIFI_REQ_START_PROVISION_MODE, M2M_WIFI_RESP_PROVISION_INFO, M2M_WIFI_REQ_STOP_PROVISION_MODE,
M2M_WIFI_REQ_SET_SYS_TIME, M2M_WIFI_REQ_ENABLE_SNTP_CLIENT, M2M_WIFI_REQ_DISABLE_SNTP_CLIENT, M2M_WIFI_RESP_MEMORY_RECOVER,
M2M_WIFI_REQ_CUST_INFO_ELEMENT, M2M_WIFI_REQ_SCAN, M2M_WIFI_RESP_SCAN_DONE, M2M_WIFI_REQ_SCAN_RESULT,
M2M_WIFI_RESP_SCAN_RESULT, M2M_WIFI_REQ_SET_SCAN_OPTION, M2M_WIFI_REQ_SET_SCAN_REGION, M2M_WIFI_REQ_SET_POWER_PROFILE,
M2M_WIFI_REQ_SET_TX_POWER, M2M_WIFI_REQ_SET_BATTERY_VOLTAGE, M2M_WIFI_REQ_SET_ENABLE_LOGS, M2M_WIFI_REQ_GET_SYS_TIME,
M2M_WIFI_RESP_GET_SYS_TIME, M2M_WIFI_REQ_SEND_ETHERNET_PACKET, M2M_WIFI_RESP_ETHERNET_RX_PACKET, M2M_WIFI_REQ_SET_MAC_MCAST,
M2M_WIFI_REQ_BLE_API_SEND, M2M_WIFI_RESP_BLE_API_RECV, M2M_WIFI_REQ_SET_GAIN_TABLE, M2M_WIFI_RESP_SET_GAIN_TABLE,
M2M_WIFI_REQ_PASSIVE_SCAN, M2M_WIFI_MAX_CONFIG_ALL
}
enum tenuM2mStaCmd {
M2M_WIFI_REQ_CONNECT = M2M_STA_CMD_BASE, M2M_WIFI_REQ_DEFAULT_CONNECT, M2M_WIFI_RESP_DEFAULT_CONNECT, M2M_WIFI_REQ_DISCONNECT,
M2M_WIFI_RESP_CON_STATE_CHANGED, M2M_WIFI_REQ_SLEEP, M2M_WIFI_REQ_WPS_SCAN, M2M_WIFI_REQ_WPS,
M2M_WIFI_REQ_START_WPS, M2M_WIFI_REQ_DISABLE_WPS, M2M_WIFI_REQ_DHCP_CONF, M2M_WIFI_RESP_IP_CONFIGURED,
M2M_WIFI_RESP_IP_CONFLICT, M2M_WIFI_REQ_ENABLE_MONITORING, M2M_WIFI_REQ_DISABLE_MONITORING, M2M_WIFI_RESP_WIFI_RX_PACKET,
M2M_WIFI_REQ_SEND_WIFI_PACKET, M2M_WIFI_REQ_LSN_INT, M2M_WIFI_REQ_DOZE, M2M_WIFI_REQ_GET_PRNG,
M2M_WIFI_RESP_GET_PRNG, M2M_WIFI_MAX_STA_ALL
}
enum | tenuM2mApCmd { M2M_WIFI_REQ_ENABLE_AP = M2M_AP_CMD_BASE, M2M_WIFI_REQ_DISABLE_AP, M2M_WIFI_MAX_AP_ALL }
enum tenuM2mP2pCmd {
M2M_WIFI_REQ_P2P_INT_CONNECT = M2M_P2P_CMD_BASE, M2M_WIFI_REQ_ENABLE_P2P, M2M_WIFI_REQ_DISABLE_P2P, M2M_WIFI_REQ_P2P_REPOST,
M2M_WIFI_MAX_P2P_ALL
}
enum | tenuM2mServerCmd { M2M_WIFI_REQ_CLIENT_CTRL = M2M_SERVER_CMD_BASE, M2M_WIFI_RESP_CLIENT_INFO, M2M_WIFI_REQ_SERVER_INIT, M2M_WIFI_MAX_SERVER_ALL }
enum | tenuM2mIpCmd { M2M_IP_REQ_STATIC_IP_CONF = ((uint8) 10), M2M_IP_REQ_ENABLE_DHCP, M2M_IP_REQ_DISABLE_DHCP }
enum tenuM2mSigmaCmd {
M2M_SIGMA_ENABLE = ((uint8) 3), M2M_SIGMA_TA_START, M2M_SIGMA_TA_STATS, M2M_SIGMA_TA_RECEIVE_STOP,
M2M_SIGMA_ICMP_ARP, M2M_SIGMA_ICMP_RX, M2M_SIGMA_ICMP_TX, M2M_SIGMA_UDP_TX,
M2M_SIGMA_UDP_TX_DEFER, M2M_SIGMA_SECURITY_POLICY, M2M_SIGMA_SET_SYSTIME
}
enum tenuM2mSslCmd {
M2M_SSL_REQ_CERT_VERIF, M2M_SSL_REQ_ECC, M2M_SSL_RESP_ECC, M2M_SSL_RSV,
M2M_SSL_REQ_WRITE_OWN_CERTS, M2M_SSL_REQ_SET_CS_LIST, M2M_SSL_RESP_SET_CS_LIST, M2M_SSL_RESP_WRITE_OWN_CERTS
}
enum | tenuM2mConnState { M2M_WIFI_DISCONNECTED = 0, M2M_WIFI_CONNECTED, M2M_WIFI_UNDEF = 0xff }
enum tenuM2mSecType {
M2M_WIFI_SEC_INVALID = 0, M2M_WIFI_SEC_OPEN, M2M_WIFI_SEC_WPA_PSK, M2M_WIFI_SEC_WEP,
M2M_WIFI_SEC_802_1X
}
enum | tenuM2mSsidMode { SSID_MODE_VISIBLE = 0, SSID_MODE_HIDDEN }
enum tenuM2mScanCh {
M2M_WIFI_CH_1 = ((uint8) 1), M2M_WIFI_CH_2, M2M_WIFI_CH_3, M2M_WIFI_CH_4,
M2M_WIFI_CH_5, M2M_WIFI_CH_6, M2M_WIFI_CH_7, M2M_WIFI_CH_8,
M2M_WIFI_CH_9, M2M_WIFI_CH_10, M2M_WIFI_CH_11, M2M_WIFI_CH_12,
M2M_WIFI_CH_13, M2M_WIFI_CH_14, M2M_WIFI_CH_ALL = ((uint8) 255)
}
enum tenuM2mScanRegion {
REG_CH_1 = ((uint16) 1 << 0), REG_CH_2 = ((uint16) 1 << 1), REG_CH_3 = ((uint16) 1 << 2), REG_CH_4 = ((uint16) 1 << 3),
REG_CH_5 = ((uint16) 1 << 4), REG_CH_6 = ((uint16) 1 << 5), REG_CH_7 = ((uint16) 1 << 6), REG_CH_8 = ((uint16) 1 << 7),
REG_CH_9 = ((uint16) 1 << 8), REG_CH_10 = ((uint16) 1 << 9), REG_CH_11 = ((uint16) 1 << 10), REG_CH_12 = ((uint16) 1 << 11),
REG_CH_13 = ((uint16) 1 << 12), REG_CH_14 = ((uint16) 1 << 13), REG_CH_ALL = ((uint16) 0x3FFF), NORTH_AMERICA = ((uint16) 0x7FF),
EUROPE = ((uint16) 0x1FFF), ASIA = ((uint16) 0x3FFF)
}
enum tenuPowerSaveModes {
M2M_NO_PS, M2M_PS_AUTOMATIC, M2M_PS_H_AUTOMATIC, M2M_PS_DEEP_AUTOMATIC,
M2M_PS_MANUAL
}
enum | tenuM2mWifiMode { M2M_WIFI_MODE_NORMAL = ((uint8) 1), M2M_WIFI_MODE_CONFIG }
enum | tenuWPSTrigger { WPS_PIN_TRIGGER = 0, WPS_PBC_TRIGGER = 4 }
enum | tenuRootCertPubKeyType { ROOT_CERT_PUBKEY_RSA = 1, ROOT_CERT_PUBKEY_ECDSA = 2 }
enum | tenuWifiFrameType { MANAGEMENT = 0x00, CONTROL = 0x04, DATA_BASICTYPE = 0x08, RESERVED = 0x0C }
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
}
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
}
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
}

Detailed Description

Typedef Documentation

◆ tpfAppWifiCb

tpfAppWifiCb

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.

Most Wi-Fi APIs are asynchronous and calling them generates information that is passed back via this callback - for instance m2m_wifi_request_scan will return a set of detected networks.

Applications must ensure a callback function is registered with the Wi-Fi driver by calling m2m_wifi_init.

Parameters
[in] u8MsgType Type of notification. Possible types are:
  • M2M_WIFI_RESP_CON_STATE_CHANGED
  • M2M_WIFI_RESP_CONN_INFO
  • M2M_WIFI_REQ_DHCP_CONF
  • M2M_WIFI_REQ_WPS
  • M2M_WIFI_RESP_IP_CONFLICT
  • M2M_WIFI_RESP_SCAN_DONE
  • M2M_WIFI_RESP_SCAN_RESULT
  • M2M_WIFI_RESP_CURRENT_RSSI
  • M2M_WIFI_RESP_CLIENT_INFO
  • M2M_WIFI_RESP_PROVISION_INFO
  • M2M_WIFI_RESP_DEFAULT_CONNECT
  • M2M_WIFI_RESP_ETHERNET_RX_PACKET (If Bypass mode is active)
  • M2M_WIFI_RESP_WIFI_RX_PACKET (If monitoring mode is active)
[in] pvMsg A pointer to a buffer containing the notification parameters (if any). It should be Casted to the data type associated with type of notification.
See also
tstrM2mWifiStateChanged tstrM2MWPSInfo tstrM2mScanDone tstrM2mWifiscanResult m2m_wifi_init

◆ tpfAppEthCb

tpfAppEthCb

Ethernet (Bypass mode) notification callback function receiving Bypass mode events as defined in the Wi-Fi responses enumeration tenuM2mStaCmd.

If bypass mode is enabled, applications must ensure this callback function is registered with the Wi-Fi driver by calling m2m_wifi_init.

Parameters
[in] u8MsgType Type of notification. Possible types are:
  • M2M_WIFI_RESP_ETHERNET_RX_PACKET
[in] | pvMsg | A pointer to a buffer containing the notification parameters (if any). This must be casted to the data type uint8 *.
[in] | pvControlBuf | A pointer to control buffer describing the accompanied message. This must be casted to the data type tstrM2mIpCtrlBuf.
See also
m2m_wifi_init

◆ tpfAppMonCb

tpfAppMonCb

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.

Parameters
[in] | pstrWifiRxPacket | Pointer to a structure holding the Wi-Fi packet header parameters.
[in] | pu8Payload | Pointer to the buffer holding the Wi-Fi packet payload information required by the application starting from the defined OFFSET by the application (when calling m2m_wifi_enable_monitoring_mode). Could hold a value of NULL, if the application does not need any data from the payload.
[in] | u16PayloadSize | The size of the payload in bytes.
See also
m2m_wifi_enable_monitoring_mode
Warning
u16PayloadSize may not exceed the buffer size given through m2m_wifi_enable_monitoring_mode.

Enumeration Type Documentation

◆ tenuM2mReqGroup

enum tenuM2mReqGroup
Enumerator
M2M_REQ_GROUP_MAIN
M2M_REQ_GROUP_WIFI
M2M_REQ_GROUP_IP
M2M_REQ_GROUP_HIF
M2M_REQ_GROUP_OTA
M2M_REQ_GROUP_SSL
M2M_REQ_GROUP_SIGMA

◆ tenuM2mReqpkt

enum tenuM2mReqpkt
Enumerator
M2M_REQ_CONFIG_PKT
M2M_REQ_DATA_PKT

◆ tenuM2mWepKeyIndex

enum tenuM2mWepKeyIndex
Enumerator
M2M_WIFI_WEP_KEY_INDEX_1 | Index 1 for WEP key Authentication
M2M_WIFI_WEP_KEY_INDEX_2 | Index 2 for WEP key Authentication
M2M_WIFI_WEP_KEY_INDEX_3 | Index 3 for WEP key Authentication
M2M_WIFI_WEP_KEY_INDEX_4 | Index 4 for WEP key Authentication

◆ tenuM2mDefaultConnErrcode

enum tenuM2mDefaultConnErrcode
Enumerator
M2M_DEFAULT_CONN_INPROGRESS | Failure response due to another connection being already in progress
M2M_DEFAULT_CONN_FAIL | Failure to connect to the cached network
M2M_DEFAULT_CONN_SCAN_MISMATCH | Failure to find any of the cached networks in the scan results.
M2M_DEFAULT_CONN_EMPTY_LIST | Failure due to empty network list.

◆ tenuM2mConnChangedErrcode

enum tenuM2mConnChangedErrcode
Enumerator
M2M_ERR_SCAN_FAIL | Failure to perform the scan operation.
M2M_ERR_JOIN_FAIL | Failure to join the BSS.
M2M_ERR_AUTH_FAIL | Failure to authenticate with the AP.
M2M_ERR_ASSOC_FAIL | Failure to associate with the AP.
M2M_ERR_CONN_INPROGRESS | Failure due to another connection being in progress.

◆ tenuM2mSetGainsErrcode

enum tenuM2mSetGainsErrcode
Enumerator
M2M_ERR_GAIN_TABLE_INVALID | Failure response due to trying to use an invalid table
M2M_ERR_READ_GAIN_TABLE | Failure to read gains from flash

◆ tenuM2mPwrMode

enum tenuM2mPwrMode
Enumerator
PWR_AUTO | Automatic power mode.
PWR_LOW1 | Low power mode #1. RX current 60mA.
PWR_LOW2 | Low power mode #2, RX current 55mA, sensitivity is less by 3dBm
PWR_HIGH | High power mode: RX current 100mA.

◆ tenuM2mTxPwrLevel

enum tenuM2mTxPwrLevel
Enumerator
TX_PWR_HIGH | PPA Gain 6dbm PA Gain 18dbm
TX_PWR_MED | PPA Gain 6dbm PA Gain 12dbm
TX_PWR_LOW | PPA Gain 6dbm PA Gain 6dbm

◆ tenuM2mConfigCmd

enum tenuM2mConfigCmd

This enum contains all the host commands used to configure the WINC board.

Enumerator
M2M_WIFI_REQ_RESTART | Restart the WINC MAC layer, it's doesn't restart the IP layer.
M2M_WIFI_REQ_SET_MAC_ADDRESS | Set the WINC mac address (not possible for production effused boards).
M2M_WIFI_REQ_CURRENT_RSSI | Request the current connected AP RSSI.
M2M_WIFI_RESP_CURRENT_RSSI | Response to M2M_WIFI_REQ_CURRENT_RSSI with the RSSI value.
M2M_WIFI_REQ_RESTRICT_BLE | Request restrict ble.
M2M_WIFI_REQ_UNRESTRICT_BLE | Request unrestrict ble.
M2M_WIFI_REQ_GET_CONN_INFO | Request connection information.
M2M_WIFI_RESP_CONN_INFO | Response to M2M_WIFI_REQ_GET_CONN_INFO with the connection information.
M2M_WIFI_REQ_SET_DEVICE_NAME | Request to set WINC device name property.
M2M_WIFI_REQ_START_PROVISION_MODE | Request to start provisioning mode.
M2M_WIFI_RESP_PROVISION_INFO | Response to the host with the provisioning information.
M2M_WIFI_REQ_STOP_PROVISION_MODE | Request to stop provision mode.
M2M_WIFI_REQ_SET_SYS_TIME | Request to set system time.
M2M_WIFI_REQ_ENABLE_SNTP_CLIENT | Request to enable the simple network time protocol to get the time from the Internet. This is required for security purposes.
M2M_WIFI_REQ_DISABLE_SNTP_CLIENT | Request to disable the simple network time protocol for applications that do not need it.
M2M_WIFI_RESP_MEMORY_RECOVER | Reserved for debuging
M2M_WIFI_REQ_CUST_INFO_ELEMENT | Request to add custom information to the Beacons IE.
M2M_WIFI_REQ_SCAN | Request scan command.
M2M_WIFI_RESP_SCAN_DONE | Response to notify scan complete.
M2M_WIFI_REQ_SCAN_RESULT | Request for scan results.
M2M_WIFI_RESP_SCAN_RESULT | Response to provide the scan results.
M2M_WIFI_REQ_SET_SCAN_OPTION | Request to set scan options "slot time, slot number .. etc".
M2M_WIFI_REQ_SET_SCAN_REGION | Request to set scan region.
M2M_WIFI_REQ_SET_POWER_PROFILE | Request to set the Power Profile.
M2M_WIFI_REQ_SET_TX_POWER | Request to set the TX Power.
M2M_WIFI_REQ_SET_BATTERY_VOLTAGE | Request to set the Battery Voltage.
M2M_WIFI_REQ_SET_ENABLE_LOGS | Request to enable logs.
M2M_WIFI_REQ_GET_SYS_TIME | Request to get system time.
M2M_WIFI_RESP_GET_SYS_TIME | Response to retrieve the system time.
M2M_WIFI_REQ_SEND_ETHERNET_PACKET | Request to send Ethernet packet in bypass mode.
M2M_WIFI_RESP_ETHERNET_RX_PACKET | Response to receive an Ethernet packet in bypass mode.
M2M_WIFI_REQ_SET_MAC_MCAST | Request to set multicast filters.
M2M_WIFI_REQ_BLE_API_SEND | Request to send an Encapsulated BLE API MSG
M2M_WIFI_RESP_BLE_API_RECV | Response to receive an Encapsulated BLE API MSG
M2M_WIFI_REQ_SET_GAIN_TABLE | Request to use Gain table from Flash
M2M_WIFI_RESP_SET_GAIN_TABLE | Response to fail to use Gain table from Flash
M2M_WIFI_REQ_PASSIVE_SCAN | Request a passive scan.
M2M_WIFI_MAX_CONFIG_ALL |

◆ tenuM2mStaCmd

enum tenuM2mStaCmd

This enum contains all the WINC commands while in Station mode.

Enumerator
M2M_WIFI_REQ_CONNECT | Request to connect with an specified AP.
M2M_WIFI_REQ_DEFAULT_CONNECT | Request to connect with a cached AP.
M2M_WIFI_RESP_DEFAULT_CONNECT | Response for the default connect.
M2M_WIFI_REQ_DISCONNECT | Request to disconnect from the AP.
M2M_WIFI_RESP_CON_STATE_CHANGED | Response to indicate a change in the connection state.
M2M_WIFI_REQ_SLEEP | Request to sleep.
M2M_WIFI_REQ_WPS_SCAN | Request to WPS scan.
M2M_WIFI_REQ_WPS | Request to start WPS.
M2M_WIFI_REQ_START_WPS | This command is for internal use by the WINC and should not be used by the host driver.
M2M_WIFI_REQ_DISABLE_WPS | Request to disable WPS.
M2M_WIFI_REQ_DHCP_CONF | Response to indicate the obtained IP address.
M2M_WIFI_RESP_IP_CONFIGURED | This command is for internal use by the WINC and should not be used by the host driver.
M2M_WIFI_RESP_IP_CONFLICT | Response to indicate a conflict in obtained IP address. The user should re attempt the DHCP request.
M2M_WIFI_REQ_ENABLE_MONITORING | Request to enable monitor mode.
M2M_WIFI_REQ_DISABLE_MONITORING | Request to disable monitor mode.
M2M_WIFI_RESP_WIFI_RX_PACKET | Response to indicate a packet was received in monitor mode.
M2M_WIFI_REQ_SEND_WIFI_PACKET | Request to send a packet in monitor mode.
M2M_WIFI_REQ_LSN_INT | Request to set the listen interval.
M2M_WIFI_REQ_DOZE | Request to doze
M2M_WIFI_REQ_GET_PRNG | Request PRNG.
M2M_WIFI_RESP_GET_PRNG | Response for PRNG.
M2M_WIFI_MAX_STA_ALL |

◆ tenuM2mApCmd

enum tenuM2mApCmd

This enum contains all the WINC commands while in AP mode.

Enumerator
M2M_WIFI_REQ_ENABLE_AP | Request to enable AP mode.
M2M_WIFI_REQ_DISABLE_AP | Request to disable AP mode.
M2M_WIFI_MAX_AP_ALL |

◆ tenuM2mP2pCmd

enum tenuM2mP2pCmd

This enum contains all the WINC commands while in P2P mode.

Enumerator
M2M_WIFI_REQ_P2P_INT_CONNECT | This command is for internal use by the WINC and should not be used by the host driver.
M2M_WIFI_REQ_ENABLE_P2P | Request to enable P2P mode.
M2M_WIFI_REQ_DISABLE_P2P | Request to disable P2P mode.
M2M_WIFI_REQ_P2P_REPOST | This command is for internal use by the WINC and should not be used by the host driver.
M2M_WIFI_MAX_P2P_ALL |

◆ tenuM2mServerCmd

enum tenuM2mServerCmd

These commands are currently not supported.

Enumerator
M2M_WIFI_REQ_CLIENT_CTRL | Currently not supported.
M2M_WIFI_RESP_CLIENT_INFO | Currently not supported.
M2M_WIFI_REQ_SERVER_INIT | Currently not supported.
M2M_WIFI_MAX_SERVER_ALL |

◆ tenuM2mIpCmd

enum tenuM2mIpCmd

This enum contains all the WINC commands related to IP.

Enumerator
M2M_IP_REQ_STATIC_IP_CONF | Request to set static IP.
M2M_IP_REQ_ENABLE_DHCP | Request to enable DHCP.
M2M_IP_REQ_DISABLE_DHCP | Request to disable DHCP.

◆ tenuM2mSigmaCmd

enum tenuM2mSigmaCmd

This enum contains all the WINC commands related to Sigma.

Enumerator
M2M_SIGMA_ENABLE | Enable Sigma.
M2M_SIGMA_TA_START | Start the traffic agent.
M2M_SIGMA_TA_STATS | Get traffic stadistics.
M2M_SIGMA_TA_RECEIVE_STOP | Stop receiving from the traffic agent.
M2M_SIGMA_ICMP_ARP | Send ARP.
M2M_SIGMA_ICMP_RX | Receive ICMP.
M2M_SIGMA_ICMP_TX | Transmit ICMP.
M2M_SIGMA_UDP_TX | Transmit UDP.
M2M_SIGMA_UDP_TX_DEFER | Transmit UDP defer.
M2M_SIGMA_SECURITY_POLICY | Set security policy.
M2M_SIGMA_SET_SYSTIME | Set system time.

◆ tenuM2mSslCmd

enum tenuM2mSslCmd

This enum contains WINC commands related to TLS handshake.

Enumerator
M2M_SSL_REQ_CERT_VERIF
M2M_SSL_REQ_ECC
M2M_SSL_RESP_ECC
M2M_SSL_RSV
M2M_SSL_REQ_WRITE_OWN_CERTS
M2M_SSL_REQ_SET_CS_LIST
M2M_SSL_RESP_SET_CS_LIST
M2M_SSL_RESP_WRITE_OWN_CERTS

◆ tenuM2mConnState

enum tenuM2mConnState

This enum contains all the Wi-Fi connection states.

Enumerator
M2M_WIFI_DISCONNECTED | Wi-Fi state is disconnected.
M2M_WIFI_CONNECTED | Wi-Fi state is connected.
M2M_WIFI_UNDEF | Undefined Wi-Fi State.

◆ tenuM2mSecType

enum tenuM2mSecType

This enum contains all the supported Wi-Fi security types.

This enum contains all the supported Wi-Fi SSID types.

Enumerator
M2M_WIFI_SEC_INVALID | Invalid security type.
M2M_WIFI_SEC_OPEN | Wi-Fi network is not secured.
M2M_WIFI_SEC_WPA_PSK | Wi-Fi network is secured with WPA/WPA2 personal(PSK).
M2M_WIFI_SEC_WEP | Security type WEP (40 or 104) OPEN OR SHARED.
M2M_WIFI_SEC_802_1X | Wi-Fi network is secured with WPA/WPA2 Enterprise.IEEE802.1x user-name/password authentication.

◆ tenuM2mSsidMode

enum tenuM2mSsidMode
Enumerator
SSID_MODE_VISIBLE | SSID is visible to others.
SSID_MODE_HIDDEN | SSID is hidden.

◆ tenuM2mScanCh

enum tenuM2mScanCh

This enum contains all the Wi-Fi RF channels.

Enumerator
M2M_WIFI_CH_1 | Channel 1.
M2M_WIFI_CH_2 | Channel 2.
M2M_WIFI_CH_3 | Channel 3.
M2M_WIFI_CH_4 | Channel 4.
M2M_WIFI_CH_5 | Channel 5.
M2M_WIFI_CH_6 | Channel 6.
M2M_WIFI_CH_7 | Channel 7.
M2M_WIFI_CH_8 | Channel 8.
M2M_WIFI_CH_9 | Channel 9.
M2M_WIFI_CH_10 | Channel 10.
M2M_WIFI_CH_11 | Channel 11.
M2M_WIFI_CH_12 | Channel 12.
M2M_WIFI_CH_13 | Channel 13.
M2M_WIFI_CH_14 | Channel 14.
M2M_WIFI_CH_ALL |

◆ tenuM2mScanRegion

enum tenuM2mScanRegion

This enum contains all the Wi-Fi channel regions.

Enumerator
REG_CH_1 | Region channel 1.
REG_CH_2 | Region channel 2.
REG_CH_3 | Region channel 3.
REG_CH_4 | Region channel 4.
REG_CH_5 | Region channel 5.
REG_CH_6 | Region channel 6.
REG_CH_7 | Region channel 7.
REG_CH_8 | Region channel 8.
REG_CH_9 | Region channel 9.
REG_CH_10 | Region channel 10.
REG_CH_11 | Region channel 11.
REG_CH_12 | Region channel 12.
REG_CH_13 | Region channel 13.
REG_CH_14 | Region channel 14.
REG_CH_ALL | Region for all channels.
NORTH_AMERICA | North America region with 11 channels
EUROPE | Europe region with 13 channels
ASIA | Asia region with 14 channels

◆ tenuPowerSaveModes

enum tenuPowerSaveModes

This enum contains all the supported Wi-Fi Power Save modes.

Enumerator
M2M_NO_PS | Power save is disabled.
M2M_PS_AUTOMATIC |
M2M_PS_H_AUTOMATIC | This powersave mode is not supported on WINC3400
M2M_PS_DEEP_AUTOMATIC | This powersave mode is not supported on WINC3400 Power save is done automatically by the WINC. Achieves the highest possible power save.
M2M_PS_MANUAL | This powersave mode is not supported on WINC3400

◆ tenuM2mWifiMode

enum tenuM2mWifiMode

This enum contains all the supported Wi-Fi Operation Modes.

Enumerator
M2M_WIFI_MODE_NORMAL | Customer firmware.
M2M_WIFI_MODE_CONFIG | Production test firmware.

◆ tenuWPSTrigger

enum tenuWPSTrigger

This enum contains the WPS triggering methods.

Enumerator
WPS_PIN_TRIGGER | WPS is triggered in PIN method.
WPS_PBC_TRIGGER | WPS is triggered via push button.

◆ tenuRootCertPubKeyType

enum tenuRootCertPubKeyType

This enum contains the supported public key types for TLS root certificates.

Enumerator
ROOT_CERT_PUBKEY_RSA | RSA public key.
ROOT_CERT_PUBKEY_ECDSA | ECDSA public key.

◆ tenuWifiFrameType

enum tenuWifiFrameType

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.

Values are defined as per the IEEE 802.11 standard.

Remarks
The following frame types are useful for advanced user usage when symbol CONF_MGMT is defined and the user application requires to monitor the frame transmission and reception.
Warning
This functionality is not supported by current WINC firmware.
See also
tenuSubTypes
Enumerator
MANAGEMENT | Wi-Fi Management frame (Probe Req/Resp, Beacon, Association Req/Resp ...etc).
CONTROL | Wi-Fi Control frame (eg. ACK frame).
DATA_BASICTYPE | Wi-Fi Data frame.
RESERVED |

◆ tenuSubTypes

enum tenuSubTypes

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

Values are defined as per the IEEE 802.11 standard.

Remarks
The following sub-frame types are useful for advanced user usage when symbol CONF_MGMT is defined and the application developer requires to monitor the frame transmission and reception.
Warning
This functionality is not supported by current WINC firmware.
See also
tenuWifiFrameType
Enumerator
ASSOC_REQ | Management: Association Request
ASSOC_RSP | Management: Association Response
REASSOC_REQ | Management: Re-Association Request
REASSOC_RSP | Management: Re-Association Response
PROBE_REQ | Management: Probe Request
PROBE_RSP | Management: Probe Response
BEACON | Management: Beacon
ATIM | Management: Announcement Traffic Information Map
DISASOC | Management: Disassociation
AUTH | Management: Authentication
DEAUTH | Management: Deauthentication
ACTION | Management: Action
PS_POLL | Control: Power Save Poll
RTS | Control: Request to Send
CTS | Control: Clear to Send
ACK | Control: Acknowledgement
CFEND | Control: End of Contention Free Period
CFEND_ACK | Control: ACK of data from STA + CFEND
BLOCKACK_REQ | Control: Block Acknoweledgement Request
BLOCKACK | Control: Block Acknowledgement
DATA | Data: A non-QoS data frame
DATA_ACK | Data: Data + CF-Ack
DATA_POLL | Data: Data + CF-Poll
DATA_POLL_ACK | Data: Data + CF-Ack + CF-Poll
NULL_FRAME | Data: Null (no data)
CFACK | Data: CF-Ack (no data)
CFPOLL | Data: CF-Poll (no data)
CFPOLL_ACK | Data: CF-Poll + CF-Ack (no data)
QOS_DATA | Data: A QoS data frame
QOS_DATA_ACK | Data: QoS data + CF-Ack
QOS_DATA_POLL | Data: QoS data + CF-Poll
QOS_DATA_POLL_ACK | Data: QoS data + CF-Ack + CF-Poll
QOS_NULL_FRAME | Data: QoS Null (no data)
QOS_CFPOLL | Data: Qos CF-Poll (no data)
QOS_CFPOLL_ACK | Data: QoS CF-Poll + CF-Ack (no data)

◆ tenuInfoElementId

enum tenuInfoElementId

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.

Values are defined as per the IEEE 802.11 standard.

Warning
This functionality is not supported by current WINC firmware.
Enumerator
ISSID | Service Set Identifier (SSID)
ISUPRATES | Supported Rates
IFHPARMS | FH parameter set
IDSPARMS | DS parameter set
ICFPARMS | CF parameter set
ITIM | Traffic Information Map
IIBPARMS | IBSS parameter set
ICOUNTRY | Country element.
IEDCAPARAMS | EDCA parameter set
ITSPEC | Traffic Specification
ITCLAS | Traffic Classification
ISCHED | Schedule.
ICTEXT | Challenge Text
IPOWERCONSTRAINT | Power Constraint.
IPOWERCAPABILITY | Power Capability
ITPCREQUEST | TPC Request
ITPCREPORT | TPC Report
ISUPCHANNEL | Supported channel list
ICHSWANNOUNC | Channel Switch Announcement
IMEASUREMENTREQUEST | Measurement request
IMEASUREMENTREPORT | Measurement report
IQUIET | Quiet element Info
IIBSSDFS | IBSS DFS
IERPINFO | ERP Information
ITSDELAY | TS Delay
ITCLASPROCESS | TCLAS Processing
IHTCAP | HT Capabilities
IQOSCAP | QoS Capability
IRSNELEMENT | RSN Information Element
IEXSUPRATES | Extended Supported Rates
IEXCHSWANNOUNC | Extended Ch Switch Announcement
IHTOPERATION | HT Information
ISECCHOFF | Secondary Channel Offset
I2040COEX | 20/40 Coexistence IE
I2040INTOLCHREPORT | 20/40 Intolerant channel report
IOBSSSCAN | OBSS Scan parameters
IEXTCAP | Extended capability
IWMM | WMM parameters
IWPAELEMENT | WPA Information Element

◆ tenuWifiCapability

enum tenuWifiCapability

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.

Values are defined as per the IEEE 802.11 standard.

Warning
This functionality is not supported by current WINC firmware.
Enumerator
ESS | ESS capability
IBSS | IBSS mode
POLLABLE | CF Pollable
POLLREQ | Request to be polled
PRIVACY | WEP encryption supported
SHORTPREAMBLE | Short Preamble is supported
SHORTSLOT | Short Slot is supported
PBCC | PBCC
CHANNELAGILITY | Channel Agility
SPECTRUM_MGMT | Spectrum Management
DSSS_OFDM | DSSS-OFDM


WINC3400 IoT Software APIs: Functions

Functions
Functions
WLAN

Functions

NMI_API sint8 | m2m_wifi_download_mode (void)
NMI_API sint8 | m2m_wifi_init (tstrWifiInitParam *pWifiInitParam)
NMI_API sint8 | m2m_wifi_deinit (void *arg)
sint8 | m2m_wifi_init_hold (void)
sint8 | m2m_wifi_init_start (tstrWifiInitParam *param)
sint8 | m2m_wifi_reinit (tstrWifiInitParam *param)
sint8 | m2m_wifi_reinit_hold (void)
sint8 | m2m_wifi_reinit_start (tstrWifiInitParam *param)
NMI_API void | m2m_wifi_yield (void)
NMI_API sint8 | m2m_wifi_handle_events (void *arg)
NMI_API sint8 | m2m_wifi_default_connect (void)
NMI_API sint8 | m2m_wifi_connect (char *pcSsid, uint8 u8SsidLen, uint8 u8SecType, void *pvAuthInfo, uint16 u16Ch)
NMI_API sint8 | m2m_wifi_connect_sc (char *pcSsid, uint8 u8SsidLen, uint8 u8SecType, void *pvAuthInfo, uint16 u16Ch, uint8 u8SaveCred)
NMI_API sint8 | m2m_wifi_disconnect (void)
NMI_API sint8 | m2m_wifi_start_provision_mode (tstrM2MAPConfig *pstrAPConfig, char *pcHttpServerDomainName, uint8 bEnableHttpRedirect)
NMI_API sint8 | m2m_wifi_stop_provision_mode (void)
NMI_API sint8 | m2m_wifi_get_connection_info (void)
NMI_API sint8 | m2m_wifi_set_mac_address (uint8 au8MacAddress[6])
NMI_API sint8 | m2m_wifi_ble_set_gain_table (uint8 table_idx)
NMI_API sint8 | m2m_wifi_wps (uint8 u8TriggerType, const char *pcPinNumber)
NMI_API sint8 | m2m_wifi_wps_disable (void)
NMI_API sint8 | m2m_wifi_p2p (uint8 u8Channel)
NMI_API sint8 | m2m_wifi_p2p_disconnect (void)
NMI_API sint8 | m2m_wifi_enable_ap (CONST tstrM2MAPConfig *pstrM2MAPConfig)
NMI_API sint8 | m2m_wifi_disable_ap (void)
NMI_API sint8 | m2m_wifi_set_static_ip (tstrM2MIPConfig *pstrStaticIPConf)
NMI_API sint8 | m2m_wifi_request_dhcp_client (void)
NMI_API sint8 | m2m_wifi_request_dhcp_server (uint8 *addr)
NMI_API sint8 | m2m_wifi_enable_dhcp (uint8 u8DhcpEn)
NMI_API sint8 | m2m_wifi_set_scan_options (tstrM2MScanOption *ptstrM2MScanOption)
NMI_API sint8 | m2m_wifi_set_scan_region (uint16 ScanRegion)
NMI_API sint8 | m2m_wifi_request_scan (uint8 ch)
sint8 | m2m_wifi_request_scan_passive (uint8 ch)
NMI_API uint8 | m2m_wifi_get_num_ap_found (void)
NMI_API sint8 | m2m_wifi_req_scan_result (uint8 index)
NMI_API sint8 | m2m_wifi_req_curr_rssi (void)
NMI_API sint8 | m2m_wifi_req_restrict_ble (void)
NMI_API sint8 | m2m_wifi_req_unrestrict_ble (void)
NMI_API sint8 | m2m_wifi_get_otp_mac_address (uint8 *pu8MacAddr, uint8 *pu8IsValid)
NMI_API sint8 | m2m_wifi_get_mac_address (uint8 *pu8MacAddr)
NMI_API sint8 | m2m_wifi_set_sleep_mode (uint8 PsTyp, uint8 BcastEn)
NMI_API sint8 | m2m_wifi_request_sleep (uint32 u32SlpReqTime)
NMI_API uint8 | m2m_wifi_get_sleep_mode (void)
NMI_API sint8 | m2m_wifi_set_device_name (uint8 *pu8DeviceName, uint8 u8DeviceNameLength)
NMI_API sint8 | m2m_wifi_set_lsn_int (tstrM2mLsnInt *pstrM2mLsnInt)
NMI_API sint8 | m2m_wifi_enable_monitoring_mode (tstrM2MWifiMonitorModeCtrl *pstrMtrCtrl, uint8 *pu8PayloadBuffer, uint16 u16BufferSize, uint16 u16DataOffset)
NMI_API sint8 | m2m_wifi_disable_monitoring_mode (void)
NMI_API sint8 | m2m_wifi_send_wlan_pkt (uint8 *pu8WlanPacket, uint16 u16WlanHeaderLength, uint16 u16WlanPktSize)
NMI_API sint8 | m2m_wifi_send_ethernet_pkt (uint8 *pu8Packet, uint16 u16PacketSize)
NMI_API sint8 | m2m_wifi_enable_sntp (uint8 bEnable)
NMI_API sint8 | m2m_wifi_set_sytem_time (uint32 u32UTCSeconds)
NMI_API sint8 | m2m_wifi_get_sytem_time (void)
NMI_API sint8 | m2m_wifi_set_cust_InfoElement (uint8 *pau8M2mCustInfoElement)
sint8 | m2m_wifi_set_power_profile (uint8 u8PwrMode)
sint8 | m2m_wifi_set_tx_power (uint8 u8TxPwrLevel)
sint8 | m2m_wifi_enable_firmware_logs (uint8 u8Enable)
sint8 | m2m_wifi_set_battery_voltage (uint16 u16BattVoltx100)
NMI_API sint8 | m2m_wifi_ble_api_send (uint8 *msg, uint32 len)
NMI_API sint8 | m2m_wifi_enable_mac_mcast (uint8 *pu8MulticastMacAddress, uint8 u8AddRemove)
NMI_API sint8 | m2m_wifi_set_receive_buffer (void *pvBuffer, uint16 u16BufferLen)

Detailed Description

Function Documentation

◆ m2m_wifi_download_mode()

NMI_API void m2m_wifi_download_mode ( void )

Synchronous API that prepares the WINC IC to enter firmware or certificate download mode.

The WINC board is prepared for download, through initializations for the WINC driver including bus initializations and interrupt enabling, it also halts the chip, to allow for the firmware downloads. Firmware can be downloaded through a number of interfaces, UART, I2C and SPI.

Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise.

◆ m2m_wifi_init()

NMI_API sint8 m2m_wifi_init ( tstrWifiInitParam * pWifiInitParam )

Synchronous API that initialises the WINC driver.

This function initializes the driver by registering the call back function for M2M_WIFI layer (also the call back function for bypass mode/monitoring mode if defined), initializing the host interface layer and the bus interfaces. Wi-Fi callback registering is essential to allow the handling of the events received, in response to the asynchronous Wi-Fi operations.

Following are the possible Wi-Fi events that are expected to be received through the callback function (provided by the application):

  • M2M_WIFI_RESP_CON_STATE_CHANGED
  • M2M_WIFI_RESP_CONN_INFO
  • M2M_WIFI_REQ_DHCP_CONF
  • M2M_WIFI_REQ_WPS
  • M2M_WIFI_RESP_IP_CONFLICT
  • M2M_WIFI_RESP_SCAN_DONE
  • M2M_WIFI_RESP_SCAN_RESULT
  • M2M_WIFI_RESP_CURRENT_RSSI
  • M2M_WIFI_RESP_CLIENT_INFO
  • M2M_WIFI_RESP_PROVISION_INFO
  • M2M_WIFI_RESP_DEFAULT_CONNECT
  • M2M_WIFI_RESP_ETHERNET_RX_PACKET (if bypass mode is enabled)
  • M2M_WIFI_RESP_WIFI_RX_PACKET (if monitoring mode is enabled)

Any application using the WINC driver must call this function at the start of its main function.

Parameters
[in] pWifiInitParam This is a pointer to the tstrWifiInitParam structure which contains pointers to the application WIFI layer callback, monitoring mode callback and tstrEthInitParam structure (which contains initialisation settings for bypass mode).
Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise.
Precondition
Prior to this function call, application users must provide a callback function responsible for receiving all the wi-fi events that are received on the M2M_WIFI layer.
Warning
Failure to successfully complete function indicates that the driver couldn't be initialized and a fatal error will prevent the application from proceeding.
See also
m2m_wifi_deinit tenuM2mStaCmd

◆ m2m_wifi_deinit()

NMI_API sint8 m2m_wifi_deinit ( void * arg )

Synchronous API that de-initialises the WINC driver.

This disables the host interface and frees any resources used by the M2M_WIFI layer. The function must be called in the during the final phases of closing the application to ensure that all resources have been correctly released.

Parameters
[in] arg Opaque argument, not used in current implementation. Application should use null.
Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC, and a negative value otherwise.

◆ m2m_wifi_init_hold()

sint8 m2m_wifi_init_hold ( void )

First part of m2m_wifi_init, up to the point of initializing spi for flash access.

See also
m2m_wifi_init

◆ m2m_wifi_init_start()

sint8 m2m_wifi_init_start ( tstrWifiInitParam * param )

Second part of m2m_wifi_init, continuing from where m2m_wifi_init_hold left off.

Parameters
[in] param Structure containing configration details
See also
m2m_wifi_init

◆ m2m_wifi_reinit()

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.

◆ m2m_wifi_reinit_hold()

sint8 m2m_wifi_reinit_hold ( void )

First part of m2m_wifi_reinit, up to the point of initializing spi for flash access.

See also
m2m_wifi_reinit

◆ m2m_wifi_reinit_start()

sint8 m2m_wifi_reinit_start ( tstrWifiInitParam * param )

Second part of m2m_wifi_reinit, continuing from where m2m_wifi_reinit_hold left off.

See also
m2m_wifi_reinit

◆ m2m_wifi_yield()

NMI_API void m2m_wifi_yield ( void )

Yield from processing more synchronous M2M events.

This function causes the synchronous M2M event handler function to yield from processing further events and return control to the caller.

Returns
The function returns M2M_SUCCESS for successful interrupt handling and a negative value otherwise.
Precondition
Prior to receiving Wi-Fi interrupts, the WINC driver should have been successfully initialized by calling the m2m_wifi_init function.
Warning
Failure to successfully complete this function indicates bus errors and hence a fatal error that will prevent the application from proceeding.

◆ m2m_wifi_handle_events()

NMI_API sint8 m2m_wifi_handle_events ( void * arg )

Synchronous M2M event handler function.

This function is responsible for handling interrupts received from the WINC firmware. Applications should call this function periodically in-order to receive the events that are to be handled by the callback functions implemented by the application.

◆ m2m_wifi_default_connect()

NMI_API sint8 m2m_wifi_default_connect ( void )

Asynchronous API that attempts to reconnect to the last-associated access point.

An application calling this function will cause the firmware to attempt to reconnect to the access point with which it had last successfully connected. A failure to connect will result in a response of M2M_WIFI_RESP_DEFAULT_CONNECT indicating a connection error as defined in the structure tstrM2MDefaultConnResp.

Possible errors are:

  • M2M_DEFAULT_CONN_EMPTY_LIST indicating that the connection list is empty, or
  • M2M_DEFAULT_CONN_SCAN_MISMATCH indicating a mismatch for the saved AP name.
Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC, and a negative value otherwise.
Precondition
Prior to connecting, the WINC driver should have been successfully initialized by calling the m2m_wifi_init function.
Warning
  • This function maybe called in station mode only.
  • It is important to note that successful completion of a call to m2m_wifi_default_connect() does not guarantee success of the WIFI connection; a negative return value indicates only locally-detected errors.
See also
m2m_wifi_connect

◆ m2m_wifi_connect()

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.

Prior to a successful connection, the application developers must know the SSID, the security type, and the authentication parameters of the target access point; knowledge of the channel number is optional.

The connection status will be indicated to the application via a M2M_WIFI_RESP_CON_STATE_CHANGED event. The status will be one of those defined in tenuM2mConnState withe M2M_WIFI_CONNECTED indicating a successful connection.

Parameters
[in] | pcSsid | A buffer holding the SSID corresponding to the requested AP.
[in] | u8SsidLen | Length of the given SSID (not including the NULL termination). A length less than ZERO or greater than the maximum defined SSID M2M_MAX_SSID_LEN will result in a negative error M2M_ERR_FAIL.
[in] | u8SecType | Wi-Fi security type security for the network. It can be one of the following types: -M2M_WIFI_SEC_OPEN -M2M_WIFI_SEC_WEP -M2M_WIFI_SEC_WPA_PSK -M2M_WIFI_SEC_802_1X A value outside these possible values will result in a negative return error M2M_ERR_FAIL.
[in] | pvAuthInfo | Authentication parameters required for completing the connection. It is type is based on the security type. If the authentication parameters are NULL or are greater than the maximum length of the authentication parameters length as defined by M2M_MAX_PSK_LEN a negative error will return M2M_ERR_FAIL(-12) indicating connection failure.
[in] | u16Ch | Wi-Fi channel number as defined in tenuM2mScanCh enumeration. Specification of a channel number greater than M2M_WIFI_CH_14 returns a negative error M2M_ERR_FAIL(-12) unless the value is M2M_WIFI_CH_ALL (255). A channel number of M2M_WIFI_CH_ALL indicates that the firmware should scan all channels to find the SSID specified in parameter pcSsid.

Failure to find the connection match will return a negative error M2M_DEFAULT_CONN_SCAN_MISMATCH.

Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC, and a negative value otherwise.
Precondition
Prior to a successful connection request, the wi-fi driver must have been successfully initialized through the call of the m2m_wifi_init function
See also
tuniM2MWifiAuth tstr1xAuthCredentials tstrM2mWifiWepParams
Warning
  • This function must be called in station mode only.
  • Successful completion of this function does not guarantee success of the WIFI connection, and a negative return value indicates only locally-detected errors.

◆ m2m_wifi_connect_sc()

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.

Prior to a successful connection, the application developers must know the SSID, the security type, and the authentication parameters of the target access point; knowledge of the channel number is optional.

The connection status will be indicated to the application via a M2M_WIFI_RESP_CON_STATE_CHANGED event. The status will be one of those defined in tenuM2mConnState withe M2M_WIFI_CONNECTED indicating a successful connection.

The only difference between this function and m2m_wifi_connect, is the option to save the acess point info ( SSID, password...etc) into flash.

Parameters
[in] | pcSsid | A buffer holding the SSID corresponding to the requested AP.
[in] | u8SsidLen | Length of the given SSID (not including the NULL termination). A length less than ZERO or greater than the maximum defined SSID M2M_MAX_SSID_LEN will result in a negative error M2M_ERR_FAIL.
[in] | u8SecType | Wi-Fi security type security for the network. It can be one of the following types: -M2M_WIFI_SEC_OPEN -M2M_WIFI_SEC_WEP -M2M_WIFI_SEC_WPA_PSK -M2M_WIFI_SEC_802_1X A value outside these possible values will result in a negative return error M2M_ERR_FAIL.
[in] | pvAuthInfo | Authentication parameters required for completing the connection. It is type is based on the security type. If the authentication parameters are NULL or are greater than the maximum length of the authentication parameters length as defined by M2M_MAX_PSK_LEN a negative error will return M2M_ERR_FAIL(-12) indicating connection failure.
[in] | u16Ch | Wi-Fi channel number as defined in tenuM2mScanCh enumeration. Specification of a channel number greater than M2M_WIFI_CH_14 returns a negative error M2M_ERR_FAIL(-12) unless the value is M2M_WIFI_CH_ALL (255). A channel number of M2M_WIFI_CH_ALL indicates that the firmware should scan all channels to find the SSID specified in parameter pcSsid.

Failure to find the connection match will return a negative error M2M_DEFAULT_CONN_SCAN_MISMATCH.

Parameters
[in] u8SaveCred Option to store the acess point SSID and password into the WINC flash memory or not.
Precondition
Prior to a successful connection request, the wi-fi driver must have been successfully initialized through the call of the m2m_wifi_init function
See also
tuniM2MWifiAuth tstr1xAuthCredentials tstrM2mWifiWepParams
Warning
  • This function must be called in station mode only.
  • Successful completion of this function does not guarantee success of the WIFI connection, and a negative return value indicates only locally-detected errors.
Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC, and a negative value otherwise.

◆ m2m_wifi_disconnect()

NMI_API sint8 m2m_wifi_disconnect ( void )

Synchronous API to request disconnection from a network.

This function will cause the WINC IC to disconnect from any currently connected access point.

Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC, and a negative value otherwise.
Precondition
Disconnection must be made to a successfully connected AP. If the WINC is not in the connected state, a call to this function will hold insignificant.
Warning
This function must be called in station mode only.
See also
m2m_wifi_connect m2m_wifi_default_connect

◆ m2m_wifi_start_provision_mode()

NMI_API sint8 m2m_wifi_start_provision_mode | ( | tstrM2MAPConfig * | pstrAPConfig,
 |  | char * | pcHttpServerDomainName,
 |  | uint8 | bEnableHttpRedirect
 | ) |  |

Asynchronous API for control of Wi-Fi provisioning functionality.

This function allows the application to start the WINC IC in 'provisioning mode', a special mode that triggers the WINC to create a Wi-Fi access point, DHCP server, and HTTP server.

The HTTP server presents a provisioning page to a connected client which lists the access points detected in the vicinity of the WINC, and allows one of these to be selected and any appropriate credentials to be entered. This allows a headless system to be provisioned (configured to connect with an access point).

Provisioning status is returned in a M2M_WIFI_RESP_PROVISION_INFO event.

Parameters
[in] | pstrAPConfig | AP configuration parameters as defined in tstrM2MAPConfig configuration structure. A NULL value passed in, will result in a negative error M2M_ERR_FAIL.
[in] | pcHttpServerDomainName | Domain name of the HTTP Provision WEB server which others will use to load the provisioning Home page. For example "wincconf.net".
[in] bEnableHttpRedirect A flag to enable/disable the HTTP redirect feature. Possible values are:
  • Zero: DO NOT Use HTTP Redirect. In this case the associated device could open the provisioning page ONLY when the HTTP Provision URL of the WINC HTTP Server is correctly written on the browser.
  • Non-Zero: Use HTTP Redirect. In this case, all http traffic (http://URL) from the associated device (Phone, PC, ...etc) will be redirected to the WINC HTTP Provisioning Home page.
Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC, and a negative value otherwise.
Precondition
  • A Wi-Fi notification callback of type tpfAppWifiCb MUST be implemented and registered at startup. Registering the callback is done through passing it to the initialization m2m_wifi_init function.
  • The event M2M_WIFI_RESP_CONN_INFO must be handled in the callback to receive the requested connection info.
See also
tpfAppWifiCb m2m_wifi_init M2M_WIFI_RESP_PROVISION_INFO m2m_wifi_stop_provision_mode tstrM2MAPConfig
Warning
DO Not use ".local" in the pcHttpServerDomainName.

Example

The example demonstrates a code snippet for how provisioning is triggered and the response event received accordingly.

#include "m2m_wifi.h"
#include "m2m_types.h"
void wifi_event_cb(uint8 u8WiFiEvent, void * pvMsg)
{
switch(u8WiFiEvent)
{
case M2M_WIFI_RESP_PROVISION_INFO:
{
tstrM2MProvisionInfo *pstrProvInfo = (tstrM2MProvisionInfo*)pvMsg;
if(pstrProvInfo->u8Status == M2M_SUCCESS)
{
m2m_wifi_connect((char*)pstrProvInfo->au8SSID, (uint8)strlen(pstrProvInfo->au8SSID), pstrProvInfo->u8SecType,
pstrProvInfo->au8Password, M2M_WIFI_CH_ALL);
printf("PROV SSID : %s\n",pstrProvInfo->au8SSID);
printf("PROV PSK : %s\n",pstrProvInfo->au8Password);
}
else
{
printf("(ERR) Provisioning Failed\n");
}
}
break;
default:
break;
}
}
int main()
{
tstrWifiInitParam param;
param.pfAppWifiCb = wifi_event_cb;
if(!m2m_wifi_init(&param))
{
tstrM2MAPConfig apConfig;
uint8 bEnableRedirect = 1;
strcpy(apConfig.au8SSID, "WINC_SSID");
apConfig.u8ListenChannel = 1;
apConfig.u8SecType = M2M_WIFI_SEC_OPEN;
apConfig.u8SsidHide = 0;
// IP Address
apConfig.au8DHCPServerIP[0] = 192;
apConfig.au8DHCPServerIP[1] = 168;
apConfig.au8DHCPServerIP[2] = 1;
apConfig.au8DHCPServerIP[0] = 1;
m2m_wifi_start_provision_mode(&apConfig, "atmelwincconf.com", bEnableRedirect);
while(1)
{
m2m_wifi_handle_events(NULL);
}
}
}

◆ m2m_wifi_stop_provision_mode()

sint8 m2m_wifi_stop_provision_mode ( void )

Synchronous API for terminating provisioning mode on the WINC IC.

This function will terminate any currently active provisioning mode on the WINC IC, returning the IC to idle.

Returns
The function returns ZERO for success and a negative value otherwise.
Precondition
An active provisioning session must be active before it is terminated through this function.
See also
m2m_wifi_start_provision_mode

◆ m2m_wifi_get_connection_info()

sint8 m2m_wifi_get_connection_info ( void )

Asynchronous API for retrieving the WINC IC's connection status.

Requests the connection status from the WINC IC including information regarding any access point to which it is currently connected, or any non-AP station that is connected to the WINC. All information will be returned to the application via the Wi-Fi notifiction callback and the event M2M_WIFI_RESP_CONN_INFO.

The connection info can be retrieved using the structure tstrM2MConnInfo which contains:

  • Connection Security
  • Connection RSSI
  • Remote MAC address
  • Remote IP address
  • SSID of the network (in cases where the WINC is in non-AP mode)
Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC, and a negative value otherwise.
Precondition
  • A Wi-Fi notification callback of type tpfAppWifiCb MUST be implemented and registered at startup. Registering the callback is done through passing it to the initialization m2m_wifi_init function.
  • The event M2M_WIFI_RESP_CONN_INFO must be handled in the callback to receive the requested connection info.
Warning
  • In case of WINC AP mode or P2P mode, the SSID field shall be a NULL string.
See also
M2M_WIFI_RESP_CONN_INFO, tstrM2MConnInfo

Example

The code snippet shows an example of how wi-fi connection information is retrieved .

#include "m2m_wifi.h"
#include "m2m_types.h"
void wifi_event_cb(uint8 u8WiFiEvent, void * pvMsg)
{
switch(u8WiFiEvent)
{
case M2M_WIFI_RESP_CONN_INFO:
{
tstrM2MConnInfo *pstrConnInfo = (tstrM2MConnInfo*)pvMsg;
printf("CONNECTED AP INFO\n");
printf("SSID : %s\n",pstrConnInfo->acSSID);
printf("SEC TYPE : %d\n",pstrConnInfo->u8SecType);
printf("Signal Strength : %d\n", pstrConnInfo->s8RSSI);
printf("Local IP Address : %d.%d.%d.%d\n",
pstrConnInfo->au8IPAddr[0] , pstrConnInfo->au8IPAddr[1], pstrConnInfo->au8IPAddr[2], pstrConnInfo->au8IPAddr[3]);
}
break;
case M2M_WIFI_REQ_DHCP_CONF:
{
// Get the current AP information.
m2m_wifi_get_connection_info();
}
break;
default:
break;
}
}
int main()
{
tstrWifiInitParam param;
param.pfAppWifiCb = wifi_event_cb;
if(!m2m_wifi_init(&param))
{
// connect to the default AP
m2m_wifi_default_connect();
while(1)
{
m2m_wifi_handle_events(NULL);
}
}
}

◆ m2m_wifi_set_mac_address()

NMI_API sint8 m2m_wifi_set_mac_address ( uint8 au8MacAddress[6] )

Synchronous API for assigning a MAC address to the WINC IC.

This function is intended to allow non-production software to assign a MAC address to the WINC IC.

Parameters
[in] au8MacAddress MAC Address to be provisioned to the WINC.
Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC, and a negative value otherwise.
Warning
This function is intended for development use only and not for use in production software.

◆ m2m_wifi_ble_set_gain_table()

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.

Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC, and a negative value otherwise.

◆ m2m_wifi_wps()

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.

This function can be called to make the WINC enter WPS (Wi-Fi Protected Setup) mode. The result is passed to the Wi-Fi notification callback with the event M2M_WIFI_REQ_WPS.

Parameters
[in] u8TriggerType WPS Trigger method. This may be:
  • WPS_PIN_TRIGGER Push button method
  • WPS_PBC_TRIGGER Pin method
[in] pcPinNumber Valid only if the u8TriggerType is WPS_PIN_TRIGGER, this parameter contains the PIN number. The number must follow the format as given in the WSC1.0 specification.
Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC, and a negative value otherwise.
Warning
This function is not supported in AP or P2P modes.
Precondition
  • A Wi-Fi notification callback of type (tpfAppWifiCb MUST be implemented and registered at startup. Registering the callback is done through passing it to the m2m_wifi_init.
  • The event M2M_WIFI_REQ_WPS must be handled in the callback to receive the WPS status.
  • The WINC device MUST be in IDLE or STA mode. If AP or P2P mode is active, the WPS will not be performed.
  • The m2m_wifi_handle_events MUST be called to receive the responses in the callback.
See also
tpfAppWifiCb m2m_wifi_init M2M_WIFI_REQ_WPS tenuWPSTrigger tstrM2MWPSInfo

Example

The code snippet shows an example of how wifi WPS is triggered .

#include "m2m_wifi.h"
#include "m2m_types.h"
void wifi_event_cb(uint8 u8WiFiEvent, void * pvMsg)
{
switch(u8WiFiEvent)
{
case M2M_WIFI_REQ_WPS:
{
tstrM2MWPSInfo *pstrWPS = (tstrM2MWPSInfo*)pvMsg;
if(pstrWPS->u8AuthType != 0)
{
printf("WPS SSID : %s\n",pstrWPS->au8SSID);
printf("WPS PSK : %s\n",pstrWPS->au8PSK);
printf("WPS SSID Auth Type : %s\n",pstrWPS->u8AuthType == M2M_WIFI_SEC_OPEN ? "OPEN" : "WPA/WPA2");
printf("WPS Channel : %d\n",pstrWPS->u8Ch + 1);
// establish Wi-Fi connection
m2m_wifi_connect((char*)pstrWPS->au8SSID, (uint8)m2m_strlen(pstrWPS->au8SSID),
pstrWPS->u8AuthType, pstrWPS->au8PSK, pstrWPS->u8Ch);
}
else
{
printf("(ERR) WPS Is not enabled OR Timed out\n");
}
}
break;
default:
break;
}
}
int main()
{
tstrWifiInitParam param;
param.pfAppWifiCb = wifi_event_cb;
if(!m2m_wifi_init(&param))
{
// Trigger WPS in Push button mode.
m2m_wifi_wps(WPS_PBC_TRIGGER, NULL);
while(1)
{
m2m_wifi_handle_events(NULL);
}
}
}

◆ m2m_wifi_wps_disable()

NMI_API sint8 m2m_wifi_wps_disable ( void )

Synchronous API that disables Wi-Fi Protected Setup mode in the WINC IC.

Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC, and a negative value otherwise.

◆ m2m_wifi_p2p()

NMI_API sint8 m2m_wifi_p2p ( uint8 u8Channel )

Asynchronous API for enabling Wi-Fi Direct (P2P) mode in the WINC IC.

Parameters
[in] u8Channel P2P Listen RF channel.
Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC, and a negative value otherwise.
Precondition
  • A Wi-Fi notification callback of type tpfAppWifiCb MUST be implemented and registered at initialization. Registering the callback is done through passing it to the m2m_wifi_init.
  • The events M2M_WIFI_RESP_CON_STATE_CHANGED and M2M_WIFI_REQ_DHCP_CONF must be handled in the callback.
  • The m2m_wifi_handle_events MUST be called to receive the responses in the callback.
Warning
  • This function is not available in the WINC 3400
  • This function is not allowed in AP or STA modes.
See also
tpfAppWifiCb m2m_wifi_init M2M_WIFI_RESP_CON_STATE_CHANGED M2M_WIFI_REQ_DHCP_CONF tstrM2mWifiStateChanged

Example

The code snippet shows an example of how the p2p mode operates.

#include "m2m_wifi.h"
#include "m2m_types.h"
void wifi_event_cb(uint8 u8WiFiEvent, void * pvMsg)
{
switch(u8WiFiEvent)
{
case M2M_WIFI_RESP_CON_STATE_CHANGED:
{
tstrM2mWifiStateChanged *pstrWifiState = (tstrM2mWifiStateChanged*)pvMsg;
M2M_INFO("Wifi State :: %s :: ErrCode %d\n", pstrWifiState->u8CurrState? "CONNECTED":"DISCONNECTED",pstrWifiState->u8ErrCode);
// Do something
}
break;
case M2M_WIFI_REQ_DHCP_CONF:
{
uint8 *pu8IPAddress = (uint8*)pvMsg;
printf("P2P IP Address \"%u.%u.%u.%u\"\n",pu8IPAddress[0],pu8IPAddress[1],pu8IPAddress[2],pu8IPAddress[3]);
}
break;
default:
break;
}
}
int main()
{
tstrWifiInitParam param;
param.pfAppWifiCb = wifi_event_cb;
if(!m2m_wifi_init(&param))
{
// Trigger P2P
m2m_wifi_p2p(M2M_WIFI_CH_1);
while(1)
{
m2m_wifi_handle_events(NULL);
}
}
}

◆ m2m_wifi_p2p_disconnect()

NMI_API sint8 m2m_wifi_p2p_disconnect ( void )

Synchronous API to disable Wi-Fi Direct (P2P) Mode on the WINC IC.

Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC, and a negative value otherwise.
See also
m2m_wifi_p2p

◆ m2m_wifi_enable_ap()

NMI_API sint8 m2m_wifi_enable_ap ( CONST tstrM2MAPConfig * pstrM2MAPConfig )

Asynchronous API to enable access point (AKA "hot-spot") mode on the WINC IC.

The WINC IC supports the ability to operate as an access point with the limitation that:

  • only 1 station may be associated at any one time
  • open system and WEP are the only security suites supported.
Parameters
[in] pstrM2MAPConfig A structure holding the AP configurations.
Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC, and a negative value otherwise.
Warning
This function is not allowed in P2P or STA modes.
Precondition
  • A Wi-Fi notification callback of type tpfAppWifiCb MUST be implemented and registered at initialization. Registering the callback is done through passing it to the m2m_wifi_init.
  • The event M2M_WIFI_REQ_DHCP_CONF must be handled in the callback.
  • The m2m_wifi_handle_events MUST be called to receive the responses in the callback.
See also
tpfAppWifiCb tenuM2mSecType m2m_wifi_init M2M_WIFI_REQ_DHCP_CONF tstrM2mWifiStateChanged tstrM2MAPConfig

Example

The code snippet demonstrates how the AP mode is enabled after the driver is initialized in the application's main function and the handling of the event M2M_WIFI_REQ_DHCP_CONF, to indicate successful connection.

#include "m2m_wifi.h"
#include "m2m_types.h"
void wifi_event_cb(uint8 u8WiFiEvent, void * pvMsg)
{
switch(u8WiFiEvent)
{
case M2M_WIFI_REQ_DHCP_CONF:
{
uint8 *pu8IPAddress = (uint8*)pvMsg;
printf("Associated STA has IP Address \"%u.%u.%u.%u\"\n",pu8IPAddress[0],pu8IPAddress[1],pu8IPAddress[2],pu8IPAddress[3]);
}
break;
default:
break;
}
}
int main()
{
tstrWifiInitParam param;
param.pfAppWifiCb = wifi_event_cb;
if(!m2m_wifi_init(&param))
{
tstrM2MAPConfig apConfig;
strcpy(apConfig.au8SSID, "WINC_SSID");
apConfig.u8ListenChannel = 1;
apConfig.u8SecType = M2M_WIFI_SEC_OPEN;
apConfig.u8SsidHide = 0;
// IP Address
apConfig.au8DHCPServerIP[0] = 192;
apConfig.au8DHCPServerIP[1] = 168;
apConfig.au8DHCPServerIP[2] = 1;
apConfig.au8DHCPServerIP[0] = 1;
// Trigger AP
m2m_wifi_enable_ap(&apConfig);
while(1)
{
m2m_wifi_handle_events(NULL);
}
}
}

◆ m2m_wifi_disable_ap()

NMI_API sint8 m2m_wifi_disable_ap ( void )

Synchronous API to disable access point mode on the WINC IC.

Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC, and a negative value otherwise.
See also
m2m_wifi_enable_ap

◆ m2m_wifi_set_static_ip()

NMI_API sint8 m2m_wifi_set_static_ip ( tstrM2MIPConfig * pstrStaticIPConf )

Synchronous API to manually assign a (static) IP address to the WINC IC.

Typically an infrastructure access point will be able to provide an IP address to all clients after they associate. The WINC will request configuration via DHCP automatically after successfully connecting to an access point. This function should only be called in the event that the network has no DHCP server and the application knows the specifics of the network.

Parameters
[in] pstrStaticIPConf Pointer to a structure holding the static IP Configurations (IP, Gateway, subnet mask and DNS address).
Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC, and a negative value otherwise.
Precondition
The application must first call m2m_wifi_enable_dhcp to request that DHCP functionality is disabled prior to calling this function.
Warning
Exercise caution using this function. DHCP is the preferred method for configuring IP addresses.
See also
tstrM2MIPConfig

◆ m2m_wifi_request_dhcp_client()

NMI_API sint8 m2m_wifi_request_dhcp_client ( void )

Legacy (deprecated) Asynchronous API for starting a DHCP client on the WINC IC.

This is a legacy API and is no longer supported. Calls to this API will not result in any changes being made to the state of the WINC IC.

Returns
This function always returns M2M_SUCCESS.
Warning
  • This function has been deprecated. DHCP is used automatically when the WINC IC connects.

◆ m2m_wifi_request_dhcp_server()

NMI_API sint8 m2m_wifi_request_dhcp_server ( uint8 * addr )

Legacy (deprecated) Asynchronous function to start a DHCP client on the WINC IC.

This is a legacy API and is no longer supported. Calls to this API will not result in any changes being made to the state of the WINC IC.

Parameters
[in] addr The address to issue to a connected client (only one client is supported)
Returns
This function always returns M2M_SUCCESS.
Warning
  • This function has been deprecated. DHCP is used automatically when the WINC IC connects.

◆ m2m_wifi_enable_dhcp()

NMI_API sint8 m2m_wifi_enable_dhcp ( uint8 u8DhcpEn )

Asynchronous function to control the DHCP client functionality within the WINC IC.

This function allows the application to control the behaviour of the DHCP client function within the WINC IC once it has associated with an access point. DHCP client functionality is enabled by default.

Parameters
[in] u8DhcpEn The state of the DHCP client feature after successful association with an access point:
  • 0: DHCP client will be disabled after connection.
  • 1: DHCP client will be enabled after connection.
Returns
The function SHALL return 0 for success and a negative value otherwise.
Warning
  • DHCP client is enabled by default
  • This Function should be called to disable DHCP client operation before using m2m_wifi_set_static_ip
See also
m2m_wifi_set_static_ip()

◆ m2m_wifi_set_scan_options()

sint8 m2m_wifi_set_scan_options ( tstrM2MScanOption * ptstrM2MScanOption )

Synchronous API for configuring the behaviour of the WINC IC's network scanning functions.

This function allows the application to tune the scanning behaviour of the WINC IC using the parameters described in tstrM2MScanOption.

Parameters
[in] ptstrM2MScanOption; Pointer to the structure holding the Scan Parameters.
Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC, and a negative value otherwise.
See also
tenuM2mScanCh m2m_wifi_request_scan tstrM2MScanOption

◆ m2m_wifi_set_scan_region()

sint8 m2m_wifi_set_scan_region ( uint16 ScanRegion )

Synchronous API for configuring the regulatory restrictions that may affect the WINC ICs scanning behaviour.

This function sets a property called the scan region, a parameter that affects the range of channels that the WINC IC may legally scan given a geographic region.

Parameters
[in] ScanRegion
Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC, and a negative value otherwise.
See also
tenuM2mScanRegion m2m_wifi_request_scan

◆ m2m_wifi_request_scan()

NMI_API sint8 m2m_wifi_request_scan ( uint8 ch )

Asynchronous API to request the WINC IC perform a scan for networks.

Scan statuses are delivered to the application via the Wi-Fi event callback (tpfAppWifiCb) in three stages. The first step involves the event M2M_WIFI_RESP_SCAN_DONE which, if successful, provides the number of detected networks (access points). The application must then read the list of access points via multiple calls to the asynchronous m2m_wifi_req_scan_result API. For each call to this function, the application will receive (step three) the event M2M_WIFI_RESP_SCAN_RESULT.

Parameters
[in] ch RF Channel ID for SCAN operation. It should be set according to tenuM2mScanCh, with a value of M2M_WIFI_CH_ALL to scan all channels.
Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC, and a negative value otherwise.
Warning
This API is valid only for STA mode, it may be called regardless of connection state (connected or disconnected).
Precondition
  • A Wi-Fi notification callback of type tpfAppWifiCb MUST be implemented and registered at initialization. Registration of the callback is done via m2m_wifi_init.
  • The events M2M_WIFI_RESP_SCAN_DONE and M2M_WIFI_RESP_SCAN_RESULT must be handled in the (tpfAppWifiCb) callback.
  • The m2m_wifi_handle_events function must be called to receive the responses in the callback.
See also
M2M_WIFI_RESP_SCAN_DONE
M2M_WIFI_RESP_SCAN_RESULT
tpfAppWifiCb
tstrM2mWifiscanResult
tenuM2mScanCh
m2m_wifi_init
m2m_wifi_handle_events
m2m_wifi_req_scan_result

Example

The code snippet demonstrates an example of how the scan request is called from the application's main function and the handling of the events received in response.

#include "m2m_wifi.h"
#include "m2m_types.h"
void wifi_event_cb(uint8 u8WiFiEvent, void * pvMsg)
{
static uint8 u8ScanResultIdx = 0;
switch(u8WiFiEvent)
{
case M2M_WIFI_RESP_SCAN_DONE:
{
tstrM2mScanDone *pstrInfo = (tstrM2mScanDone*)pvMsg;
printf("Num of AP found %d\n",pstrInfo->u8NumofCh);
if(pstrInfo->s8ScanState == M2M_SUCCESS)
{
u8ScanResultIdx = 0;
if(pstrInfo->u8NumofCh >= 1)
{
m2m_wifi_req_scan_result(u8ScanResultIdx);
u8ScanResultIdx ++;
}
else
{
printf("No AP Found Rescan\n");
m2m_wifi_request_scan(M2M_WIFI_CH_ALL);
}
}
else
{
printf("(ERR) Scan fail with error <%d>\n",pstrInfo->s8ScanState);
}
}
break;
case M2M_WIFI_RESP_SCAN_RESULT:
{
tstrM2mWifiscanResult *pstrScanResult =(tstrM2mWifiscanResult*)pvMsg;
uint8 u8NumFoundAPs = m2m_wifi_get_num_ap_found();
printf(">>%02d RI %d SEC %s CH %02d BSSID %02X:%02X:%02X:%02X:%02X:%02X SSID %s\n",
pstrScanResult->u8index,pstrScanResult->s8rssi,
pstrScanResult->u8AuthType,
pstrScanResult->u8ch,
pstrScanResult->au8BSSID[0], pstrScanResult->au8BSSID[1], pstrScanResult->au8BSSID[2],
pstrScanResult->au8BSSID[3], pstrScanResult->au8BSSID[4], pstrScanResult->au8BSSID[5],
pstrScanResult->au8SSID);
if(u8ScanResultIdx < u8NumFoundAPs)
{
// Read the next scan result
m2m_wifi_req_scan_result(index);
u8ScanResultIdx ++;
}
}
break;
default:
break;
}
}
int main()
{
tstrWifiInitParam param;
param.pfAppWifiCb = wifi_event_cb;
if(!m2m_wifi_init(&param))
{
// Scan all channels
m2m_wifi_request_scan(M2M_WIFI_CH_ALL);
while(1)
{
m2m_wifi_handle_events(NULL);
}
}
}

◆ m2m_wifi_request_scan_passive()

sint8 m2m_wifi_request_scan_passive ( uint8 ch )
Parameters
[in] ch RF Channel ID for SCAN operation. It should be set according to tenuM2mScanCh, with a value of M2M_WIFI_CH_ALL to scan all channels.
Warning
This function is not allowed in P2P or AP modes. It works only for STA mode (both connected or disconnected states).
Precondition
  • A Wi-Fi notification callback of type tpfAppWifiCb MUST be implemented and registered at initialization. Registering the callback is done through passing it to the m2m_wifi_init.
  • The events M2M_WIFI_RESP_SCAN_DONE and M2M_WIFI_RESP_SCAN_RESULT. must be handled in the callback.
  • The m2m_wifi_handle_events function MUST be called to receive the responses in the callback.
See also
m2m_wifi_request_scan
M2M_WIFI_RESP_SCAN_DONE
M2M_WIFI_RESP_SCAN_RESULT
tpfAppWifiCb
tstrM2MScanOption
tstrM2mWifiscanResult
tenuM2mScanCh
m2m_wifi_init
m2m_wifi_handle_events
m2m_wifi_req_scan_result
Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise.

◆ m2m_wifi_get_num_ap_found()

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.

This function allows the application to recover the number of access points discovered during the most recent scan activity. This is achieved via a global variable in the WINC driver that is populated when receiving the M2M_WIFI_RESP_SCAN_DONE event.

Returns
Return the number of AP's found in the last Scan Request.
See also
m2m_wifi_request_scan M2M_WIFI_RESP_SCAN_DONE M2M_WIFI_RESP_SCAN_RESULT
Precondition
  • m2m_wifi_request_scan must be called first to ensure up to date results are available.
Warning
  • This function must be called only in the wi-fi callback function when the events M2M_WIFI_RESP_SCAN_DONE or M2M_WIFI_RESP_SCAN_RESULT are received. Calling this function in any other place may result in undefined/outdated numbers.

Example

The code snippet demonstrates an example of how the scan request is called from the application's main function and the handling of the events received in response.

#include "m2m_wifi.h"
#include "m2m_types.h"
void wifi_event_cb(uint8 u8WiFiEvent, void * pvMsg)
{
static uint8 u8ScanResultIdx = 0;
switch(u8WiFiEvent)
{
case M2M_WIFI_RESP_SCAN_DONE:
{
tstrM2mScanDone *pstrInfo = (tstrM2mScanDone*)pvMsg;
printf("Num of AP found %d\n",pstrInfo->u8NumofCh);
if(pstrInfo->s8ScanState == M2M_SUCCESS)
{
u8ScanResultIdx = 0;
if(pstrInfo->u8NumofCh >= 1)
{
m2m_wifi_req_scan_result(u8ScanResultIdx);
u8ScanResultIdx ++;
}
else
{
printf("No AP Found Rescan\n");
m2m_wifi_request_scan(M2M_WIFI_CH_ALL);
}
}
else
{
printf("(ERR) Scan fail with error <%d>\n",pstrInfo->s8ScanState);
}
}
break;
case M2M_WIFI_RESP_SCAN_RESULT:
{
tstrM2mWifiscanResult *pstrScanResult =(tstrM2mWifiscanResult*)pvMsg;
uint8 u8NumFoundAPs = m2m_wifi_get_num_ap_found();
printf(">>%02d RI %d SEC %s CH %02d BSSID %02X:%02X:%02X:%02X:%02X:%02X SSID %s\n",
pstrScanResult->u8index,pstrScanResult->s8rssi,
pstrScanResult->u8AuthType,
pstrScanResult->u8ch,
pstrScanResult->au8BSSID[0], pstrScanResult->au8BSSID[1], pstrScanResult->au8BSSID[2],
pstrScanResult->au8BSSID[3], pstrScanResult->au8BSSID[4], pstrScanResult->au8BSSID[5],
pstrScanResult->au8SSID);
if(u8ScanResultIdx < u8NumFoundAPs)
{
// Read the next scan result
m2m_wifi_req_scan_result(index);
u8ScanResultIdx ++;
}
}
break;
default:
break;
}
}
int main()
{
tstrWifiInitParam param;
param.pfAppWifiCb = wifi_event_cb;
if(!m2m_wifi_init(&param))
{
// Scan all channels
m2m_wifi_request_scan(M2M_WIFI_CH_ALL);
while(1)
{
m2m_wifi_handle_events(NULL);
}
}
}

◆ m2m_wifi_req_scan_result()

NMI_API sint8 m2m_wifi_req_scan_result ( uint8 index )

Asynchronous API to request the information of an access point discovered via scanning.

This function allows the information of any discovered access point to be retrieved. When a scan is completed, the application is informed of the number of networks (access points) discovered. Calling this function with an index, N, will return the information for the Nth access point. The information will be returned to the application via a M2M_WIFI_RESP_SCAN_RESULT event, and the response data may be obtained through casting the pointer (pvMsg) to tstrM2mWifiscanResult.

Parameters
[in] index Index for the requested result, the index range start from 0 till number of AP's found
Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC, and a negative value otherwise.
See also
tstrM2mWifiscanResult m2m_wifi_get_num_ap_found m2m_wifi_request_scan
Precondition
  • m2m_wifi_request_scan must be called first to ensure up to date results are available.
  • A Wi-Fi notification callback of type tpfAppWifiCb must be implemented and registered in order to receive scan data after calling this function. Registration of the callback is done via the m2m_wifi_init function.
  • The event M2M_WIFI_RESP_SCAN_RESULT must be handled in the callback to receive the requested connection information.
Warning
  • This API is valid only for STA mode, it may be called regardless of connection state (connected or disconnected).
  • Calling this function without first issuing a scan request may lead to stale data being recovered.
  • Application code should refrain from introducing significant delays between issuing the scan request and scan result requests.

Example

The code snippet demonstrates an example of how the scan request is called from the application's main function and the handling of the events received in response.

#include "m2m_wifi.h"
#include "m2m_types.h"
void wifi_event_cb(uint8 u8WiFiEvent, void * pvMsg)
{
static uint8 u8ScanResultIdx = 0;
switch(u8WiFiEvent)
{
case M2M_WIFI_RESP_SCAN_DONE:
{
tstrM2mScanDone *pstrInfo = (tstrM2mScanDone*)pvMsg;
printf("Num of AP found %d\n",pstrInfo->u8NumofCh);
if(pstrInfo->s8ScanState == M2M_SUCCESS)
{
u8ScanResultIdx = 0;
if(pstrInfo->u8NumofCh >= 1)
{
m2m_wifi_req_scan_result(u8ScanResultIdx);
u8ScanResultIdx ++;
}
else
{
printf("No AP Found Rescan\n");
m2m_wifi_request_scan(M2M_WIFI_CH_ALL);
}
}
else
{
printf("(ERR) Scan fail with error <%d>\n",pstrInfo->s8ScanState);
}
}
break;
case M2M_WIFI_RESP_SCAN_RESULT:
{
tstrM2mWifiscanResult *pstrScanResult =(tstrM2mWifiscanResult*)pvMsg;
uint8 u8NumFoundAPs = m2m_wifi_get_num_ap_found();
printf(">>%02d RI %d SEC %s CH %02d BSSID %02X:%02X:%02X:%02X:%02X:%02X SSID %s\n",
pstrScanResult->u8index,pstrScanResult->s8rssi,
pstrScanResult->u8AuthType,
pstrScanResult->u8ch,
pstrScanResult->au8BSSID[0], pstrScanResult->au8BSSID[1], pstrScanResult->au8BSSID[2],
pstrScanResult->au8BSSID[3], pstrScanResult->au8BSSID[4], pstrScanResult->au8BSSID[5],
pstrScanResult->au8SSID);
if(u8ScanResultIdx < u8NumFoundAPs)
{
// Read the next scan result
m2m_wifi_req_scan_result(index);
u8ScanResultIdx ++;
}
}
break;
default:
break;
}
}
int main()
{
tstrWifiInitParam param;
param.pfAppWifiCb = wifi_event_cb;
if(!m2m_wifi_init(&param))
{
// Scan all channels
m2m_wifi_request_scan(M2M_WIFI_CH_ALL);
while(1)
{
m2m_wifi_handle_events(NULL);
}
}
}

◆ m2m_wifi_req_curr_rssi()

NMI_API sint8 m2m_wifi_req_curr_rssi ( void )

Asynchronous API to request the current Receive Signal Strength (RSSI) of the current connection.

This function will result in the application receiving the RSSI via a M2M_WIFI_RESP_CURRENT_RSSI event.

Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC, and a negative value otherwise.
Precondition
  • A Wi-Fi notification callback of type tpfAppWifiCb MUST be implemented and registered during initialization. Registration of the callback is done via the m2m_wifi_init API.
  • The event M2M_WIFI_RESP_CURRENT_RSSI must be handled in the callback.

Example

The code snippet demonstrates how the RSSI request is called in the application's main function and the handling of event received in the callback.

#include "m2m_wifi.h"
#include "m2m_types.h"
void wifi_event_cb(uint8 u8WiFiEvent, void * pvMsg)
{
static uint8 u8ScanResultIdx = 0;
switch(u8WiFiEvent)
{
case M2M_WIFI_RESP_CURRENT_RSSI:
{
sint8 *rssi = (sint8*)pvMsg;
M2M_INFO("ch rssi %d\n",*rssi);
}
break;
default:
break;
}
}
int main()
{
tstrWifiInitParam param;
param.pfAppWifiCb = wifi_event_cb;
if(!m2m_wifi_init(&param))
{
// Scan all channels
m2m_wifi_req_curr_rssi();
while(1)
{
m2m_wifi_handle_events(NULL);
}
}
}

◆ m2m_wifi_req_restrict_ble()

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.

Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC, and a negative value otherwise.
Precondition
  • A Wi-Fi notification callback of type tpfAppWifiCb MUST be implemented and registered during initialization. Registration of the callback is done via the m2m_wifi_init API.

◆ m2m_wifi_req_unrestrict_ble()

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.

Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC, and a negative value otherwise.
Precondition
  • A Wi-Fi notification callback of type tpfAppWifiCb MUST be implemented and registered during initialization. Registration of the callback is done via the m2m_wifi_init API.

◆ m2m_wifi_get_otp_mac_address()

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.

This function attempts to read the device's MAC address from the One Time Programmable (OTP) memory on the IC. The presence (yes or no) of a MAC address in the OTP memory and, in the case of it being present, its value are returned via RAM pointed to by the input arguments.

Parameters
[out] | pu8MacAddr | Output MAC address buffer 6 bytes in size. This is valid only if *pu8Valid equals 1.
[out] | pu8IsValid | A boolean value set by the callee to indicate the validity of pu8MacAddr in OTP. If no MAC has been programmed in the OTP the value of this parameter will be zero; otherwise it will be non-zero.
Returns
The function returns M2M_SUCCESS for success and a negative value otherwise.
See also
m2m_wifi_get_mac_address

◆ m2m_wifi_get_mac_address()

NMI_API sint8 m2m_wifi_get_mac_address ( uint8 * pu8MacAddr )

Synchronous API to retrieve the MAC address currently in use on the device.

This function obtains the MAC address that is currently in use by the device. If the function returns with M2M_SUCCESS then the content of the memory referenced by pu8MacAddr will be populated with the 6 byte MAC address; otherwise, that memory will be left unchanged.

Parameters
[out] pu8MacAddr Pointer to a buffer in memory containing a 6-byte MAC address (provided function returns MEM_SUCCESS)
Returns
The function returns M2M_SUCCESS for successful operation and a negative value otherwise.
See also
m2m_wifi_get_otp_mac_address

◆ m2m_wifi_set_sleep_mode()

NMI_API sint8 m2m_wifi_set_sleep_mode | ( | uint8 | PsTyp,
 |  | uint8 | BcastEn
 | ) |  |

Synchronous API to set the power-save mode of the WINC IC.

Parameters
[in] PsTyp Desired power saving mode. Supported types are defined in tenuPowerSaveModes.
[in] BcastEn Broadcast reception enable flag.
  • If set to 1, the WINC IC will wake for each DTIM beacon to ensure broadcast traffic can be received.
  • If set to 0, the WINC IC will not wakeup at the DTIM beacon, instead it will wake every N beacon periods as per the negotiated Listen Interval.
Returns
The function returns M2M_SUCCESS for successful operation and a negative value otherwise.
See also
tenuPowerSaveModes m2m_wifi_get_sleep_mode

◆ m2m_wifi_request_sleep()

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.

This function allows a WINC IC that is running in M2M_PS_MANUAL mode to be placed into sleep state for a specified period of time (measured in milliseconds).

Parameters
[in] u32SlpReqTime The time in ms that the WINC IC should sleep for
Returns
The function returns M2M_SUCCESS for successful operation and a negative value otherwise.
Warning
  • This API is currently unsupported on the WINC3400
See also
tenuPowerSaveModes m2m_wifi_set_sleep_mode

◆ m2m_wifi_get_sleep_mode()

NMI_API uint8 m2m_wifi_get_sleep_mode ( void )

Synchronous API to retrieve the current power save mode of the WINC IC.

Returns
The current operating power saving mode. The value will be one of those from the enumerated type tenuPowerSaveModes.
See also
tenuPowerSaveModes m2m_wifi_set_sleep_mode

◆ m2m_wifi_set_device_name()

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.

Parameters
[in] | pu8DeviceName | Buffer holding the device name.
[in] | u8DeviceNameLength | Length of the device name. Should not exceed the maximum device name's length M2M_DEVICE_NAME_MAX.
Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC, and a negative value otherwise.

◆ m2m_wifi_set_lsn_int()

NMI_API sint8 m2m_wifi_set_lsn_int ( tstrM2mLsnInt * pstrM2mLsnInt )

Asynchronous API to set Wi-Fi listen interval for power save operation.

Parameters
[in] pstrM2mLsnInt Structure holding the listen interval configurations.
Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC, and a negative value otherwise.
Precondition
The function m2m_wifi_set_sleep_mode shall be called first
See also
  • tstrM2mLsnInt
  • m2m_wifi_set_sleep_mode

◆ m2m_wifi_enable_monitoring_mode()

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.

This function places the reciver into a mode where all frames (or those matching a set of filter criteria) received on air are passed to the application.

A dedicated callback function, tpfAppMonCb, must be registered to handle frames received in promiscuous mode. This is done via an instance of a tstrWifiInitParam structure and a call to the m2m_wifi_init function.

Parameters
[in] | pstrMtrCtrl | Pointer to tstrM2MWifiMonitorModeCtrl structure holding the Filtering parameters.
[in] | pu8PayloadBuffer | Pointer to a Buffer allocated by the application. The buffer SHALL hold the Data field of the WIFI RX Packet (Or a part from it). If it is set to NULL, the WIFI data payload will be discarded by the monitoring driver.
[in] | u16BufferSize | The total size of the pu8PayloadBuffer in bytes.
[in] u16DataOffset Starting offset in the DATA FIELD of the received WIFI packet. The application may be interested in reading specific information from the received packet. It must assign the offset to the starting position of it relative to the DATA payload start.
Example, if the SSID is needed to be read from a PROBE REQ packet, the u16Offset MUST be set to 0.
Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC, and a negative value otherwise.
Warning
This mode available as sniffer ONLY, you can not be connected in any modes (Station, Access Point, or P2P).
See also
  • tstrM2MWifiMonitorModeCtrl
  • tstrM2MWifiRxPacketInfo
  • tstrWifiInitParam
  • tenuM2mScanCh
  • m2m_wifi_disable_monitoring_mode

Example

The example demonstrates the main function where-by the monitoring enable function is called after the initialization of the driver and the packets are handled in the callback function.

#include "m2m_wifi.h"
#include "m2m_types.h"
//Declare receive buffer
uint8 gmgmt[1600];
//Callback functions
void wifi_cb(uint8 u8WiFiEvent, void * pvMsg)
{
;
}
void wifi_monitoring_cb(tstrM2MWifiRxPacketInfo *pstrWifiRxPacket, uint8 *pu8Payload, uint16 u16PayloadSize)
{
if((NULL != pstrWifiRxPacket) && (0 != u16PayloadSize)) {
if(MANAGEMENT == pstrWifiRxPacket->u8FrameType) {
M2M_INFO("***# MGMT PACKET #***\n");
} else if(DATA_BASICTYPE == pstrWifiRxPacket->u8FrameType) {
M2M_INFO("***# DATA PACKET #***\n");
} else if(CONTROL == pstrWifiRxPacket->u8FrameType) {
M2M_INFO("***# CONTROL PACKET #***\n");
}
}
}
int main()
{
//Register wifi_monitoring_cb
tstrWifiInitParam param;
param.pfAppWifiCb = wifi_cb;
param.pfAppMonCb = wifi_monitoring_cb;
nm_bsp_init();
if(!m2m_wifi_init(&param)) {
//Enable Monitor Mode with filter to receive all data frames on channel 1
tstrM2MWifiMonitorModeCtrl strMonitorCtrl = {0};
strMonitorCtrl.u8ChannelID = M2M_WIFI_CH_1;
strMonitorCtrl.u8FrameType = DATA_BASICTYPE;
strMonitorCtrl.u8FrameSubtype = M2M_WIFI_FRAME_SUB_TYPE_ANY; //Receive any subtype of data frame
m2m_wifi_enable_monitoring_mode(&strMonitorCtrl, gmgmt, sizeof(gmgmt), 0);
while(1) {
m2m_wifi_handle_events(NULL);
}
}
return 0;
}

◆ m2m_wifi_disable_monitoring_mode()

NMI_API sint8 m2m_wifi_disable_monitoring_mode ( void )

Asynchronous API to disable Wi-Fi monitoring (promiscuous receive) mode.

Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC, and a negative value otherwise.
See also
m2m_wifi_enable_monitoring_mode

◆ m2m_wifi_send_wlan_pkt()

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.

Parameters
[in] | pu8WlanPacket | Pointer to a buffer holding the whole WIFI frame.
[in] | u16WlanHeaderLength | The size of the WIFI packet header ONLY.
[in] | u16WlanPktSize | The size of the whole bytes in packet.
Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC, and a negative value otherwise.
See also
  • m2m_wifi_enable_monitoring_mode
  • m2m_wifi_disable_monitoring_mode
Warning
This function is only available in builds supporting monitoring mode.

◆ m2m_wifi_send_ethernet_pkt()

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.

Parameters
[in] | pu8Packet | Pointer to a buffer holding the whole Ethernet frame.
[in] | u16PacketSize | The size of the whole bytes in packet.
Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC, and a negative value otherwise.
See also
  • m2m_wifi_enable_monitoring_mode
  • m2m_wifi_disable_monitoring_mode
Warning
This function is only available in builds supporting monitoring mode.

◆ m2m_wifi_enable_sntp()

NMI_API sint8 m2m_wifi_enable_sntp ( uint8 bEnable )

Asynchronous API to enable or disable the SNTP client running on the WINC IC.

The SNTP client is enabled by default during chip initialisation. This function can be used to disable or subsequently re-enable the service.

The service is capable of syncrhonising the WINC's system clock to the UTC time from a well-known (and trusted) time server, for example "time.nist.gov". By default the SNTP client will update the system time once every 24 hours. The ability to track the time accurately is important for various applications such as checking expiry of X509 certificates during TLS session establishment.

It is highly recommended to leave SNTP enabled if there is no alternative source of timing information. For systems including an RTC device, SNTP may not be needed and the WINC IC's time may be set using the m2m_wifi_set_sytem_time function.

Parameters
[in] bEnable Enables or disables the SNTP service
  • '0' : disable SNTP
  • '1' : enable SNTP
Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC, and a negative value otherwise.
See also
m2m_wifi_set_sytem_time

◆ m2m_wifi_set_sytem_time()

NMI_API sint8 m2m_wifi_set_sytem_time ( uint32 u32UTCSeconds )

Asynchronous function for setting the system time within the WINC IC.

Parameters
[in] u32UTCSeconds UTC value in seconds.
Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC, and a negative value otherwise.
See also
  • m2m_wifi_enable_sntp
  • tstrSystemTime
Note
If there is an RTC on the host MCU, the SNTP may be disabled and the host may set the system time within the firmware using the API m2m_wifi_set_sytem_time.

◆ m2m_wifi_get_sytem_time()

NMI_API sint8 m2m_wifi_get_sytem_time ( void )

Asynchronous API to obtain the system time in use by the WINC IC.

This function will request that the WINC IC send it's current system time to the application. The information will arrive at the application via the tpfAppWifiCb and event M2M_WIFI_RESP_GET_SYS_TIME.

Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC, and a negative value otherwise.
Precondition
  • A Wi-Fi notification callback of type tpfAppWifiCb MUST be implemented and registered during initialization. Registration of the callback is done via the m2m_wifi_init API.
  • The event M2M_WIFI_RESP_GET_SYS_TIME must be handled in the callback.
See also
  • m2m_wifi_enable_sntp
  • tstrSystemTime

◆ m2m_wifi_set_cust_InfoElement()

NMI_API sint8 m2m_wifi_set_cust_InfoElement ( uint8 * pau8M2mCustInfoElement )

Asynchronous API to add or remove a user-defined Information Element.

This function allows the application to provide a custom Information Element to the WINC IC that will be included in all beacon and probe response frames.

Parameters
[in] pau8M2mCustInfoElement Pointer to Buffer containing the IE to be used. If null, this removes any current custom IE. If non-null, the pointer must reference data in the following format:
               --------------- ---------- ---------- ------------------- -------- -------- ----------- ----------------------
              | Byte[0]       | Byte[1]  | Byte[2]  | Byte[3:length1+2] | ..... | Byte[n] | Byte[n+1] | Byte[n+2:lengthx+2]  |
              |---------------|----------|----------|-------------------|-------- --------|-----------|------------------|
              | #of all Bytes | IE1 ID   | Length1  | Data1(Hex Coded)  | ..... | IEx ID  | Lengthx   | Datax(Hex Coded)     |
               --------------- ---------- ---------- ------------------- -------- -------- ----------- ----------------------
Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC, and a negative value otherwise.
Warning
  • Size of All elements combined must not exceed 255 byte.
  • Used in Access Point Mode

Example

The example demonstrates how the information elements are set using this function.

char elementData[21];
static char state = 0; // To Add, Append, and Delete
if(0 == state) { //Add 3 IEs
state = 1;
//Total Number of Bytes
elementData[0]=12;
//First IE
elementData[1]=200; elementData[2]=1; elementData[3]='A';
//Second IE
elementData[4]=201; elementData[5]=2; elementData[6]='B'; elementData[7]='C';
//Third IE
elementData[8]=202; elementData[9]=3; elementData[10]='D'; elementData[11]=0; elementData[12]='F';
} else if(1 == state) {
//Append 2 IEs to others, Notice that we keep old data in array starting with\n
//element 13 and total number of bytes increased to 20
state = 2;
//Total Number of Bytes
elementData[0]=20;
//Fourth IE
elementData[13]=203; elementData[14]=1; elementData[15]='G';
//Fifth IE
elementData[16]=204; elementData[17]=3; elementData[18]='X'; elementData[19]=5; elementData[20]='Z';
} else if(2 == state) { //Delete All IEs
state = 0;
//Total Number of Bytes
elementData[0]=0;
}
m2m_wifi_set_cust_InfoElement(elementData);

◆ m2m_wifi_set_power_profile()

NMI_API sint8 m2m_wifi_set_power_profile ( uint8 u8PwrMode )

Change the power profile mode.

Parameters
[in] u8PwrMode Change the WINC power profile to one of the modes: PWR_LOW1, PWR_LOW2, PWR_HIGH, PWR_AUTO.
Returns
The function SHALL return M2M_SUCCESS for success and a negative value otherwise.
See also
tenuM2mPwrMode
Warning
May only be called after initialization, before any connection request, and may not be used to change the power mode thereafter.

◆ m2m_wifi_set_tx_power()

NMI_API sint8 m2m_wifi_set_tx_power ( uint8 u8TxPwrLevel )

set the TX power tenuM2mTxPwrLevel

Parameters
[in] u8TxPwrLevel change the TX power tenuM2mTxPwrLevel
Returns
The function SHALL return M2M_SUCCESS for success and a negative value otherwise.
See also
tenuM2mTxPwrLevel

◆ m2m_wifi_enable_firmware_logs()

NMI_API 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)

Parameters
[in] u8Enable Set 1 to enable the logs 0 for disable
Returns
The function SHALL return M2M_SUCCESS for success and a negative value otherwise.
See also
DISABLE_FIRMWARE_LOGS (build option to disable logs from initializations)

◆ m2m_wifi_set_battery_voltage()

sint8 m2m_wifi_set_battery_voltage ( uint16 u16BattVoltx100 )

◆ m2m_wifi_ble_api_send()

NMI_API sint8 m2m_wifi_ble_api_send | ( | uint8 * | msg,
 |  | uint32 | len
 | ) |  |

◆ m2m_wifi_enable_mac_mcast()

NMI_API sint8 m2m_wifi_enable_mac_mcast | ( | uint8 * | pu8MulticastMacAddress,
 |  | uint8 | u8AddRemove
 | ) |  |

Asynchronous API to add or remove MAC addresses in the multicast filter.

This function allows the application to configure the capability of the WINC IC to receive multicast packets when operating in bypass mode.

Parameters
[in] pu8MulticastMacAddress Pointer to MAC address
[in] u8AddRemove A flag to add or remove the MAC ADDRESS, based on the following values:
  • 0 : remove MAC address
  • 1 : add MAC address
Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC, and a negative value otherwise.
Note
Maximum number of MAC addresses that could be added is 8.
Warning
This functionality is not supported by current WINC firmware.

◆ m2m_wifi_set_receive_buffer()

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.

Parameters
[in] | pvBuffer | Pointer to Buffer to receive data. A NULL pointer causes a negative error M2M_ERR_FAIL.
[in] | u16BufferLen | Length of data to be received. Maximum length of data should not exceed the size defined by TCP/IP defined as SOCKET_BUFFER_MAX_LENGTH
Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC, and a negative value otherwise.
Warning
This functionality is not supported by current WINC firmware.


WINC3400 IoT Software APIs: BSP

Modules
BSP

Modules

Defines
Enumeration/Typedefs
Functions

Detailed Description

Generated on Fri Aug 18 2017 00:42:03 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: Defines

Macros
Defines
BSP

Macros

#define | NMI_API
#define | CONST const
#define | NULL ((void*)0)
#define | BSP_MIN(x, y) ((x)>(y)?(y):(x))
#define | NM_BSP_B_L_32(x) (x)
#define | NM_BSP_B_L_16(x) (x)

Detailed Description

Macro Definition Documentation

◆ NMI_API

#define NMI_API

Attribute used to define memory section to map Functions in host memory.

◆ CONST

#define CONST const

◆ NULL

#define NULL ((void*)0)

Void Pointer to '0' in case of NULL is not defined.

◆ BSP_MIN

#define BSP_MIN | ( | x,
 |  | y
 | ) | ((x)>(y)?(y):(x))

Computes the minimum of x and y.

◆ NM_BSP_B_L_32

#define NM_BSP_B_L_32 ( x ) (x)

Retain endianness of 32bit word (In the case that Host is LE)

◆ NM_BSP_B_L_16

#define NM_BSP_B_L_16 ( x ) (x)

Retain endianness of 16bit word (In the case that Host is LE)


WINC3400 IoT Software APIs: Enumeration/Typedefs

Typedefs
Enumeration/Typedefs
BSP

Typedefs

typedef void(* | tpfNmBspIsr) (void)
typedef unsigned char | uint8
typedef unsigned short | uint16
typedef unsigned long | uint32
typedef signed char | sint8
typedef signed short | sint16
typedef signed long | sint32

Detailed Description

Typedef Documentation

◆ tpfNmBspIsr

void(* tpfNmBspIsr)(void)

Pointer to function.
Used as a data type of ISR function registered by nm_bsp_register_isr.

Used for code portability.

Returns
None

◆ uint8

unsigned char uint8

Range of values between 0 to 255.

◆ uint16

unsigned short uint16

Range of values between 0 to 65535.

◆ uint32

unsigned long uint32

Range of values between 0 to 4294967295.

◆ sint8

signed char sint8

Range of values between -128 to 127.

◆ sint16

signed short sint16

Range of values between -32768 to 32767.

◆ sint32

signed long sint32

Range of values between -2147483648 to 2147483647.


WINC3400 IoT Software APIs: Functions

Functions
Functions
BSP

Functions

sint8 | nm_bsp_init (void)
sint8 | nm_bsp_deinit (void)
void | nm_bsp_reset (void)
void | nm_bsp_sleep (uint32 u32TimeMsec)
void | nm_bsp_register_isr (tpfNmBspIsr pfIsr)
void | nm_bsp_interrupt_ctrl (uint8 u8Enable)

Detailed Description

Function Documentation

◆ nm_bsp_init()

sint8 nm_bsp_init ( void )

Initialization for BSP such as Reset and Chip Enable Pins for WINC, delays, register ISR, enable/disable IRQ for WINC, ...etc. You must use this function in the head of your application to enable WINC and Host Driver to communicate with each other.

Note
Implementation of this function is host dependent.
Warning
Omission will lead to unavailability of host communication.
Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise.

◆ nm_bsp_deinit()

sint8 nm_bsp_deinit ( void )

De-initialization for BSP (Board Support Package)

Precondition
Initialize nm_bsp_init first
Note
Implementation of this function is host dependent.
Warning
Omission may lead to unknown behavior in case of soft reset.
See also
nm_bsp_init
Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise.

◆ nm_bsp_reset()

void nm_bsp_reset ( void )

Resetting NMC1500 SoC by setting CHIP_EN and RESET_N signals low, then after specific delay the function will put CHIP_EN high then RESET_N high, for the timing between signals please review the WINC data-sheet

Precondition
Initialize nm_bsp_init first
Note
Implementation of this function is host dependent and called by HIF layer.
See also
nm_bsp_init
Returns
None

◆ nm_bsp_sleep()

void nm_bsp_sleep ( uint32 u32TimeMsec )

Sleep in units of milliseconds.
This function is used by HIF Layer as required in various situations.

Parameters
[in] u32TimeMsec Time unit in milliseconds
Precondition
Initialize nm_bsp_init first
Warning
Maximum value must nor exceed 4294967295 milliseconds which is equal to 4294967.295 seconds.
Note
Implementation of this function is host dependent.
See also
nm_bsp_init
Returns
None

◆ nm_bsp_register_isr()

void nm_bsp_register_isr ( tpfNmBspIsr pfIsr )

Register ISR (Interrupt Service Routine) in the initialization of HIF (Host Interface) Layer. When the interrupt trigger the BSP layer should call the pfisr function once inside the interrupt.

Parameters
[in] pfIsr Pointer to ISR handler in HIF
Warning
Make sure that ISR for IRQ pin for WINC is disabled by default in your implementation.
Note
Implementation of this function is host dependent and called by HIF layer.
See also
tpfNmBspIsr
Returns
None

◆ nm_bsp_interrupt_ctrl()

void nm_bsp_interrupt_ctrl ( uint8 u8Enable )

Enable/Disable interrupts.

Synchronous enable/disable interrupts function

Parameters
[in] u8Enable '0' disable interrupts. '1' enable interrupts
See also
tpfNmBspIsr
Note
Implementation of this function is host dependent and called by HIF layer.
Returns
None
Generated on Fri Aug 18 2017 00:42:03 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: COMMON

Modules
COMMON

Modules

Defines
Functions

Detailed Description

Generated on Fri Aug 18 2017 00:42:03 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: Defines

Macros
Defines
COMMON

Macros

#define | M2M_TIME_OUT_DELAY 10000
#define | M2M_SUCCESS ((sint8)0)
#define | M2M_ERR_SEND ((sint8)-1)
#define | M2M_ERR_RCV ((sint8)-2)
#define | M2M_ERR_MEM_ALLOC ((sint8)-3)
#define | M2M_ERR_TIME_OUT ((sint8)-4)
#define | M2M_ERR_INIT ((sint8)-5)
#define | M2M_ERR_BUS_FAIL ((sint8)-6)
#define | M2M_NOT_YET ((sint8)-7)
#define | M2M_ERR_FIRMWARE ((sint8)-8)
#define | M2M_SPI_FAIL ((sint8)-9)
#define | M2M_ERR_FIRMWARE_bURN ((sint8)-10)
#define | M2M_ACK ((sint8)-11)
#define | M2M_ERR_FAIL ((sint8)-12)
#define | M2M_ERR_FW_VER_MISMATCH ((sint8)-13)
#define | M2M_ERR_SCAN_IN_PROGRESS ((sint8)-14)
#define | M2M_ERR_INVALID_ARG ((sint8)-15)
#define | I2C_ERR_LARGE_ADDRESS 0xE1UL
#define | I2C_ERR_TX_ABRT 0xE2UL
#define | I2C_ERR_OVER_SIZE 0xE3UL
#define | ERR_PREFIX_NMIS 0xE4UL
#define | ERR_FIRMEWARE_EXCEED_SIZE 0xE5UL
#define | PROGRAM_START 0x26961735UL
#define | BOOT_SUCCESS 0x10add09eUL
#define | BOOT_START 0x12345678UL
#define | NBIT31 (0x80000000)
#define | NBIT30 (0x40000000)
#define | NBIT29 (0x20000000)
#define | NBIT28 (0x10000000)
#define | NBIT27 (0x08000000)
#define | NBIT26 (0x04000000)
#define | NBIT25 (0x02000000)
#define | NBIT24 (0x01000000)
#define | NBIT23 (0x00800000)
#define | NBIT22 (0x00400000)
#define | NBIT21 (0x00200000)
#define | NBIT20 (0x00100000)
#define | NBIT19 (0x00080000)
#define | NBIT18 (0x00040000)
#define | NBIT17 (0x00020000)
#define | NBIT16 (0x00010000)
#define | NBIT15 (0x00008000)
#define | NBIT14 (0x00004000)
#define | NBIT13 (0x00002000)
#define | NBIT12 (0x00001000)
#define | NBIT11 (0x00000800)
#define | NBIT10 (0x00000400)
#define | NBIT9 (0x00000200)
#define | NBIT8 (0x00000100)
#define | NBIT7 (0x00000080)
#define | NBIT6 (0x00000040)
#define | NBIT5 (0x00000020)
#define | NBIT4 (0x00000010)
#define | NBIT3 (0x00000008)
#define | NBIT2 (0x00000004)
#define | NBIT1 (0x00000002)
#define | NBIT0 (0x00000001)
#define | M2M_MAX(A, B) ((A) > (B) ? (A) : (B))
#define | M2M_SEL(x, m1, m2, m3) ((x>1)?((x>2)?(m3):(m2)):(m1))
#define | WORD_ALIGN(val) (((val) & 0x03) ? ((val) + 4 - ((val) & 0x03)) : (val))
#define | DATA_PKT_OFFSET 4
#define | BYTE_0(word) ((uint8)(((word) >> 0 ) & 0x000000FFUL))
#define | BYTE_1(word) ((uint8)(((word) >> 8 ) & 0x000000FFUL))
#define | BYTE_2(word) ((uint8)(((word) >> 16) & 0x000000FFUL))
#define | BYTE_3(word) ((uint8)(((word) >> 24) & 0x000000FFUL))

Detailed Description

Macro Definition Documentation

◆ M2M_TIME_OUT_DELAY

#define M2M_TIME_OUT_DELAY 10000

◆ M2M_SUCCESS

#define M2M_SUCCESS ((sint8)0)

◆ M2M_ERR_SEND

#define M2M_ERR_SEND ((sint8)-1)

◆ M2M_ERR_RCV

#define M2M_ERR_RCV ((sint8)-2)

◆ M2M_ERR_MEM_ALLOC

#define M2M_ERR_MEM_ALLOC ((sint8)-3)

◆ M2M_ERR_TIME_OUT

#define M2M_ERR_TIME_OUT ((sint8)-4)

◆ M2M_ERR_INIT

#define M2M_ERR_INIT ((sint8)-5)

◆ M2M_ERR_BUS_FAIL

#define M2M_ERR_BUS_FAIL ((sint8)-6)

◆ M2M_NOT_YET

#define M2M_NOT_YET ((sint8)-7)

◆ M2M_ERR_FIRMWARE

#define M2M_ERR_FIRMWARE ((sint8)-8)

◆ M2M_SPI_FAIL

#define M2M_SPI_FAIL ((sint8)-9)

◆ M2M_ERR_FIRMWARE_bURN

#define M2M_ERR_FIRMWARE_bURN ((sint8)-10)

◆ M2M_ACK

#define M2M_ACK ((sint8)-11)

◆ M2M_ERR_FAIL

#define M2M_ERR_FAIL ((sint8)-12)

◆ M2M_ERR_FW_VER_MISMATCH

#define M2M_ERR_FW_VER_MISMATCH ((sint8)-13)

◆ M2M_ERR_SCAN_IN_PROGRESS

#define M2M_ERR_SCAN_IN_PROGRESS ((sint8)-14)

◆ M2M_ERR_INVALID_ARG

#define M2M_ERR_INVALID_ARG ((sint8)-15)

◆ I2C_ERR_LARGE_ADDRESS

#define I2C_ERR_LARGE_ADDRESS 0xE1UL

the address exceed the max addressing mode in i2c flash

◆ I2C_ERR_TX_ABRT

#define I2C_ERR_TX_ABRT 0xE2UL

NO ACK from slave

◆ I2C_ERR_OVER_SIZE

#define I2C_ERR_OVER_SIZE 0xE3UL

◆ ERR_PREFIX_NMIS

#define ERR_PREFIX_NMIS 0xE4UL

wrong first four byte in flash NMIS

◆ ERR_FIRMEWARE_EXCEED_SIZE

#define ERR_FIRMEWARE_EXCEED_SIZE 0xE5UL

Total size of firmware exceed the max size 256k

◆ PROGRAM_START

#define PROGRAM_START 0x26961735UL

◆ BOOT_SUCCESS

#define BOOT_SUCCESS 0x10add09eUL

◆ BOOT_START

#define BOOT_START 0x12345678UL

◆ NBIT31

#define NBIT31 (0x80000000)

◆ NBIT30

#define NBIT30 (0x40000000)

◆ NBIT29

#define NBIT29 (0x20000000)

◆ NBIT28

#define NBIT28 (0x10000000)

◆ NBIT27

#define NBIT27 (0x08000000)

◆ NBIT26

#define NBIT26 (0x04000000)

◆ NBIT25

#define NBIT25 (0x02000000)

◆ NBIT24

#define NBIT24 (0x01000000)

◆ NBIT23

#define NBIT23 (0x00800000)

◆ NBIT22

#define NBIT22 (0x00400000)

◆ NBIT21

#define NBIT21 (0x00200000)

◆ NBIT20

#define NBIT20 (0x00100000)

◆ NBIT19

#define NBIT19 (0x00080000)

◆ NBIT18

#define NBIT18 (0x00040000)

◆ NBIT17

#define NBIT17 (0x00020000)

◆ NBIT16

#define NBIT16 (0x00010000)

◆ NBIT15

#define NBIT15 (0x00008000)

◆ NBIT14

#define NBIT14 (0x00004000)

◆ NBIT13

#define NBIT13 (0x00002000)

◆ NBIT12

#define NBIT12 (0x00001000)

◆ NBIT11

#define NBIT11 (0x00000800)

◆ NBIT10

#define NBIT10 (0x00000400)

◆ NBIT9

#define NBIT9 (0x00000200)

◆ NBIT8

#define NBIT8 (0x00000100)

◆ NBIT7

#define NBIT7 (0x00000080)

◆ NBIT6

#define NBIT6 (0x00000040)

◆ NBIT5

#define NBIT5 (0x00000020)

◆ NBIT4

#define NBIT4 (0x00000010)

◆ NBIT3

#define NBIT3 (0x00000008)

◆ NBIT2

#define NBIT2 (0x00000004)

◆ NBIT1

#define NBIT1 (0x00000002)

◆ NBIT0

#define NBIT0 (0x00000001)

◆ M2M_MAX

#define M2M_MAX | ( | A,
 |  | B
 | ) | ((A) > (B) ? (A) : (B))

Maximum of two values

◆ M2M_SEL

#define M2M_SEL | ( | x,
 |  | m1,
 |  | m2,
 |  | m3
 | ) | ((x>1)?((x>2)?(m3):(m2)):(m1))

Choose one of three values

◆ WORD_ALIGN

#define WORD_ALIGN ( val ) (((val) & 0x03) ? ((val) + 4 - ((val) & 0x03)) : (val))

Align to next multiple of 4

◆ DATA_PKT_OFFSET

#define DATA_PKT_OFFSET 4

◆ BYTE_0

#define BYTE_0 ( word ) ((uint8)(((word) >> 0 ) & 0x000000FFUL))

Most significant byte of 32bit word (LE)

◆ BYTE_1

#define BYTE_1 ( word ) ((uint8)(((word) >> 8 ) & 0x000000FFUL))

Second most significant byte of 32bit word (LE)

◆ BYTE_2

#define BYTE_2 ( word ) ((uint8)(((word) >> 16) & 0x000000FFUL))

Third most significant byte of 32bit word (LE)

◆ BYTE_3

#define BYTE_3 ( word ) ((uint8)(((word) >> 24) & 0x000000FFUL))

Least significant byte of 32bit word (LE)


WINC3400 IoT Software APIs: Functions

Functions | Variables
Functions
COMMON

Functions

NMI_API void | m2m_memcpy (uint8 *pDst, uint8 *pSrc, uint32 sz)
NMI_API void | m2m_memset (uint8 *pBuf, uint8 val, uint32 sz)
NMI_API uint16 | m2m_strlen (uint8 *pcStr)
NMI_API sint8 | m2m_memcmp (uint8 *pu8Buff1, uint8 *pu8Buff2, uint32 u32Size)
NMI_API uint8 | m2m_strncmp (uint8 *pcS1, uint8 *pcS2, uint16 u16Len)
NMI_API uint8 * | m2m_strstr (uint8 *pcIn, uint8 *pcStr)
NMI_API uint8 | m2m_checksum (uint8 *buf, int sz)

Variables

NMI_API void(* at_sb_printf )(const char *_format,...)

Detailed Description

Function Documentation

◆ m2m_memcpy()

void m2m_memcpy | ( | uint8 * | pDst,
 |  | uint8 * | pSrc,
 |  | uint32 | sz
 | ) |  |

Copy specified number of bytes from source buffer to destination buffer.

Parameters
[in] | sz | number of data bytes to copy
[in] | pSrc | source buffer
[out] | pDst | destination buffer
Returns
None

◆ m2m_memset()

void m2m_memset | ( | uint8 * | pBuf,
 |  | uint8 | val,
 |  | uint32 | sz
 | ) |  |

Set specified number of data bytes in specified data buffer to specified value.

Parameters
[in] | sz | number of data bytes (in specified data buffer whose values are to be set to the specified value)
[in] | val | the specified value (to which data bytes in data buffer will be set)
[out] | pBuf | the specified data buffer (whose data bytes will be set to the specified value)
Returns
None

◆ m2m_strlen()

uint16 m2m_strlen ( uint8 * pcStr )

Returns the string length of a null terminated string buffer.

Parameters
[in] pcStr null terminated string buffer
Returns
length of the string in the specified string buffer

◆ m2m_memcmp()

sint8 m2m_memcmp | ( | uint8 * | pu8Buff1,
 |  | uint8 * | pu8Buff2,
 |  | uint32 | u32Size
 | ) |  |

Compare specified number of data bytes in pu8Buff1 and pu8Buff2 and decide if they all match.

Parameters
[in] | u32Size | number of data bytes to compare
[in] | pu8Buff1 | one of two data buffers for the comparison
[in] | pu8Buff2 | one of two data buffers for the comparison
Returns
zero if matched, one if not matched

◆ m2m_strncmp()

uint8 m2m_strncmp | ( | uint8 * | pcS1,
 |  | uint8 * | pcS2,
 |  | uint16 | u16Len
 | ) |  |

Compare specified number of data bytes in string buffers pcS1 and pcS2.

Parameters
[in] | u16Len | Number of data bytes to compare
[in] | pcS1 | first of two string buffers for the comparison
[in] | pcS2 | second of two string buffers for the comparison
Returns
0 if matched, -1 if the first non-matching byte in pcS1 is smaller than that in pcS2, +1 if it is bigger

◆ m2m_strstr()

uint8 * m2m_strstr | ( | uint8 * | pcIn,
 |  | uint8 * | pcStr
 | ) |  |

Find the occurrence of pcStr string in pcIn string.

Parameters
[in] | pcStr | one of two string buffers
[in] | pcIn | one of two string buffers
Returns
If pcStr string is part of pcIn string return a valid pointer to the start of pcStr within pcIn. If not a NULL Pointer is returned

◆ m2m_checksum()

uint8 m2m_checksum | ( | uint8 * | buf,
 |  | int | sz
 | ) |  |

calculates checksum for the specified number of data bytes in specified data buffer

Parameters
[in] | sz | number of data bytes used in the checksum calculation
[in] | buf | the specified data buffer (whose data bytes will be used to calculate the checksum)
Returns
the calculated checksum

Variable Documentation

◆ at_sb_printf

void(* at_sb_printf)(const char *_format,...)

chooses which function to use in order to output debug


WINC3400 IoT Software APIs: SOCKET

Modules
SOCKET

Modules

Defines
Byte Order
Error Codes
Enumeration/Typedefs
Functions

Detailed Description

Generated on Fri Aug 18 2017 00:42:03 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: Defines

Macros
Defines
SOCKET

Macros

#define | HOSTNAME_MAX_SIZE 100
#define | SOCKET_BUFFER_MAX_LENGTH 1400
#define | AF_INET 2
#define | SOCK_STREAM 1
#define | SOCK_DGRAM 2
#define | SOCKET_FLAGS_SSL 0x01
#define | TCP_SOCK_MAX (7)
#define | UDP_SOCK_MAX 4
#define | MAX_SOCKET (TCP_SOCK_MAX + UDP_SOCK_MAX)
#define | SOL_SOCKET 1
#define | SO_SET_UDP_SEND_CALLBACK 0x00
#define | IP_ADD_MEMBERSHIP 0x01
#define | IP_DROP_MEMBERSHIP 0x02
#define | SOL_SSL_SOCKET 2
#define | SO_SSL_BYPASS_X509_VERIF 0x01
#define | SO_SSL_SNI 0x02
#define | SO_SSL_ENABLE_SESSION_CACHING 0x03
#define | SO_SSL_ENABLE_CERTNAME_VALIDATION 0x04
#define | SO_SSL_ENABLE_SNI_VALIDATION 0x04

Detailed Description

The following list of macros are used to define constants used throughout the socket layer, and SSL Socket options.

Macro Definition Documentation

◆ HOSTNAME_MAX_SIZE

#define HOSTNAME_MAX_SIZE 100

Maximum allowed size for a host domain name passed to the function gethostbyname gethostbyname. command value. Used with the setsocketopt function.

◆ SOCKET_BUFFER_MAX_LENGTH

#define SOCKET_BUFFER_MAX_LENGTH 1400

Maximum allowed size for a socket data buffer. Used with send socket function to ensure that the buffer sent is within the allowed range.

◆ AF_INET

#define AF_INET 2

The AF_INET is the address family used for IPv4. An IPv4 transport address is specified with the sockaddr_in structure. (It is the only supported type for the current implementation.)

◆ SOCK_STREAM

#define SOCK_STREAM 1

One of the IPv4 supported socket types for reliable connection-oriented stream connection. Passed to the socket function for the socket creation operation.

◆ SOCK_DGRAM

#define SOCK_DGRAM 2

One of the IPv4 supported socket types for unreliable connectionless datagram connection. Passed to the socket function for the socket creation operation.

◆ SOCKET_FLAGS_SSL

#define SOCKET_FLAGS_SSL 0x01

This flag shall be passed to the socket API for SSL session.

◆ TCP_SOCK_MAX

#define TCP_SOCK_MAX (7)

Maximum number of simultaneous TCP sockets.

◆ UDP_SOCK_MAX

#define UDP_SOCK_MAX 4

Maximum number of simultaneous UDP sockets.

◆ MAX_SOCKET

#define MAX_SOCKET (TCP_SOCK_MAX + UDP_SOCK_MAX)

Maximum number of simultaneous sockets.

◆ SOL_SOCKET

#define SOL_SOCKET 1

Socket option. Used with the setsockopt function

◆ SO_SET_UDP_SEND_CALLBACK

#define SO_SET_UDP_SEND_CALLBACK 0x00

Socket option used by the application to enable/disable the use of UDP send callbacks. Used with the setsockopt function.

◆ IP_ADD_MEMBERSHIP

#define IP_ADD_MEMBERSHIP 0x01

Set Socket Option Add Membership command value. Used with the setsockopt function.

◆ IP_DROP_MEMBERSHIP

#define IP_DROP_MEMBERSHIP 0x02

Set Socket Option Drop Membership command value. Used with the setsockopt function.

◆ SOL_SSL_SOCKET

#define SOL_SSL_SOCKET 2

SSL Socket option level. Used with the setsockopt function

◆ SO_SSL_BYPASS_X509_VERIF

#define SO_SSL_BYPASS_X509_VERIF 0x01

Allow an opened SSL socket to bypass the X509 certificate verification process. It is highly recommended NOT to use this socket option in production software applications. It is intended for debugging and testing purposes only.
The option value should be cast to int type and it is handled as a boolean flag.

◆ SO_SSL_SNI

#define SO_SSL_SNI 0x02

Set the Server Name Indicator (SNI) for an SSL socket. The SNI is a NULL terminated string containing the server name associated with the connection. It must not exceed the size of HOSTNAME_MAX_SIZE. If the SNI is not a null string, then TLS Client Hello messages will include the SNI extension.

◆ SO_SSL_ENABLE_SESSION_CACHING

#define SO_SSL_ENABLE_SESSION_CACHING 0x03

Allow the TLS to cache the session information for fast TLS session establishment in future connections using the TLS Protocol session resume features.
The option value should be cast to int type and it is handled as a boolean flag.

◆ SO_SSL_ENABLE_CERTNAME_VALIDATION

#define SO_SSL_ENABLE_CERTNAME_VALIDATION 0x04

Enable internal validation of server name against the server's certificate subject common name. If there is no server name provided (via the SO_SSL_SNI option), setting this option does nothing.
The option value should be cast to int type and it is handled as a boolean flag.

◆ SO_SSL_ENABLE_SNI_VALIDATION

#define SO_SSL_ENABLE_SNI_VALIDATION 0x04

Legacy name for SO_SSL_ENABLE_CERTNAME_VALIDATION.
The option value should be cast to int type and it is handled as a boolean flag.


WINC3400 IoT Software APIs: Byte Order

Macros
Byte Order
SOCKET

Macros

#define | _htonl(m) (uint32)(((uint32)(m << 24)) | ((uint32)((m & 0x0000FF00) << 8)) | ((uint32)((m & 0x00FF0000) >> 8)) | ((uint32)(((uint32)m) >> 24)))
#define | _htons(A) (uint16)((((uint16) (A)) << 8) | (((uint16) (A)) >> 8))
#define | _ntohl _htonl
#define | _ntohs _htons

Detailed Description

The following list of macros are used to convert between host representation and network byte order.

Macro Definition Documentation

◆ _htonl

#define _htonl ( m ) (uint32)(((uint32)(m << 24)) | ((uint32)((m & 0x0000FF00) << 8)) | ((uint32)((m & 0x00FF0000) >> 8)) | ((uint32)(((uint32)m) >> 24)))

Convert a 4-byte integer from Host representation to Network byte order (Host is LE).

◆ _htons

#define _htons ( A ) (uint16)((((uint16) (A)) << 8) | (((uint16) (A)) >> 8))

Convert a 2-byte integer (short) from Host representation to Network byte order (Host is LE).

◆ _ntohl

#define _ntohl _htonl

Convert a 4-byte integer from Network byte order to Host representation.

◆ _ntohs

#define _ntohs _htons

Convert a 2-byte integer from Network byte order to Host representation.


WINC3400 IoT Software APIs: Error Codes

Macros
Error Codes
SOCKET

Macros

#define | SOCK_ERR_NO_ERROR 0
#define | SOCK_ERR_INVALID_ADDRESS -1
#define | SOCK_ERR_ADDR_ALREADY_IN_USE -2
#define | SOCK_ERR_MAX_TCP_SOCK -3
#define | SOCK_ERR_MAX_UDP_SOCK -4
#define | SOCK_ERR_INVALID_ARG -6
#define | SOCK_ERR_MAX_LISTEN_SOCK -7
#define | SOCK_ERR_INVALID -9
#define | SOCK_ERR_ADDR_IS_REQUIRED -11
#define | SOCK_ERR_CONN_ABORTED -12
#define | SOCK_ERR_TIMEOUT -13
#define | SOCK_ERR_BUFFER_FULL -14

Detailed Description

The following list of macros are used to define the possible error codes. Errors are listed in numerical order with the error macro name.

Macro Definition Documentation

◆ SOCK_ERR_NO_ERROR

#define SOCK_ERR_NO_ERROR 0

Successful socket operation. This code is also used with event SOCKET_MSG_RECV if a socket connection is closed. In that case, the application should call close().

◆ SOCK_ERR_INVALID_ADDRESS

#define SOCK_ERR_INVALID_ADDRESS -1

Socket address is invalid. The socket operation cannot be completed successfully without specifying a valid address For example: bind is called without specifying a port number

◆ SOCK_ERR_ADDR_ALREADY_IN_USE

#define SOCK_ERR_ADDR_ALREADY_IN_USE -2

Socket operation cannot bind on the given address. Only one IP address per socket, and one socket per IP address is permitted - any attempt for a new socket to bind with an IP address already bound to another open socket will return the following error code.

◆ SOCK_ERR_MAX_TCP_SOCK

#define SOCK_ERR_MAX_TCP_SOCK -3

Exceeded the maximum number of TCP sockets. A maximum number of TCP sockets opened simultaneously is defined through TCP_SOCK_MAX. It is not permitted to exceed that number at socket creation. Identifies that socket operation failed.

◆ SOCK_ERR_MAX_UDP_SOCK

#define SOCK_ERR_MAX_UDP_SOCK -4

Exceeded the maximum number of UDP sockets. A maximum number of UDP sockets opened simultaneously is defined through UDP_SOCK_MAX. It is not permitted to exceed that number at socket creation. Identifies that socket operation failed

◆ SOCK_ERR_INVALID_ARG

#define SOCK_ERR_INVALID_ARG -6

An invalid argument is passed to a socket function. Identifies that socket operation failed

◆ SOCK_ERR_MAX_LISTEN_SOCK

#define SOCK_ERR_MAX_LISTEN_SOCK -7

Exceeded the maximum number of TCP passive listening sockets. Identifies that listen operation failed.

◆ SOCK_ERR_INVALID

#define SOCK_ERR_INVALID -9

The requested socket operation is not valid in the current socket state. For example: accept is called on a TCP socket before bind or listen.

◆ SOCK_ERR_ADDR_IS_REQUIRED

#define SOCK_ERR_ADDR_IS_REQUIRED -11

Destination address is required. Failure to provide the socket address required for the socket operation to be completed. The sendto function requires a destination address to send data.

◆ SOCK_ERR_CONN_ABORTED

#define SOCK_ERR_CONN_ABORTED -12

The socket is closed (reset) by the peer. If this error is received, the application should call close().

◆ SOCK_ERR_TIMEOUT

#define SOCK_ERR_TIMEOUT -13

The socket pending operation has timed out. The socket remains open.

◆ SOCK_ERR_BUFFER_FULL

#define SOCK_ERR_BUFFER_FULL -14

No buffer space available to be used for the requested socket operation.


WINC3400 IoT Software APIs: Enumeration/Typedefs

Typedefs | Enumerations
Enumeration/Typedefs
SOCKET

Typedefs

typedef sint8 | SOCKET
typedef void(* | tpfAppSocketCb) (SOCKET sock, uint8 u8Msg, void *pvMsg)
typedef void(* | tpfAppResolveCb) (uint8 *pu8DomainName, uint32 u32ServerIP)
typedef void(* | tpfPingCb) (uint32 u32IPAddr, uint32 u32RTT, uint8 u8ErrorCode)

Enumerations

enum tenuSocketCallbackMsgType {
SOCKET_MSG_BIND = 1, SOCKET_MSG_LISTEN, SOCKET_MSG_DNS_RESOLVE, SOCKET_MSG_ACCEPT,
SOCKET_MSG_CONNECT, SOCKET_MSG_RECV, SOCKET_MSG_SEND, SOCKET_MSG_SENDTO,
SOCKET_MSG_RECVFROM
}

Detailed Description

Specific Enumeration-typedefs used for socket operations

Typedef Documentation

◆ SOCKET

SOCKET

Definition for socket handler data type. Socket ID,used with all socket operations to uniquely identify the socket handler. The ID is uniquely assigned at socket creation when calling socket operation.

◆ tpfAppSocketCb

tpfAppSocketCb

The main socket application callback function. Applications register their main socket application callback through this function by calling registerSocketCallback. In response to events received, the following callback function is called to handle the corresponding asynchronous function called. Example: bind, connect,...etc.

Parameters
[in] sock Socket ID for the callback.

The socket callback function is called whenever a new event is received in response to socket operations.

Parameters
[in] u8Msg Socket event type. Possible values are:
  • SOCKET_MSG_BIND
  • SOCKET_MSG_LISTEN
  • SOCKET_MSG_ACCEPT
  • SOCKET_MSG_CONNECT
  • SOCKET_MSG_RECV
  • SOCKET_MSG_SEND
  • SOCKET_MSG_SENDTO
  • SOCKET_MSG_RECVFROM
[in] pvMsg Pointer to message structure. Existing types are:
  • tstrSocketBindMsg
  • tstrSocketListenMsg
  • tstrSocketAcceptMsg
  • tstrSocketConnectMsg
  • tstrSocketRecvMsg
See also
tenuSocketCallbackMsgType tstrSocketRecvMsg tstrSocketConnectMsg tstrSocketAcceptMsg tstrSocketListenMsg tstrSocketBindMsg

◆ tpfAppResolveCb

tpfAppResolveCb

DNS resolution callback function.

Applications requiring DNS resolution should register their callback through this function by calling registerSocketCallback. The following callback is triggered in response to an asynchronous call to the gethostbyname function (DNS Resolution callback).

Parameters
[in] | pu8DomainName | Domain name of the host.
[in] | u32ServerIP | Server IPv4 address encoded in Network byte order format. If it is Zero, then the DNS resolution failed.

◆ tpfPingCb

tpfPingCb

PING Callback.

The function delivers the ping statistics for the sent ping triggered by calling m2m_ping_req.

Parameters
[in] | u32IPAddr | Destination IP.
[in] | u32RTT | Round Trip Time.
[in] u8ErrorCode Ping error code. It may be one of:
  • PING_ERR_SUCCESS
  • PING_ERR_DEST_UNREACH
  • PING_ERR_TIMEOUT

Enumeration Type Documentation

◆ tenuSocketCallbackMsgType

enum tenuSocketCallbackMsgType

Asynchronous APIs make use of callback functions in-order to return back the results once the corresponding socket operation is completed. Hence resuming the normal execution of the application code while the socket operation returns the results. Callback functions expect event messages to be passed in, in-order to identify the operation they're returning the results for. The following enum identifies the type of events that are received in the callback function.

Application Use: In order for application developers to handle the pending events from the network controller through the callback functions, a function call must be made to the function m2m_wifi_handle_events at least once for each socket operation.

See also
bind
listen
accept
connect
send
recv
Enumerator
SOCKET_MSG_BIND | Bind socket event.
SOCKET_MSG_LISTEN | Listen socket event.
SOCKET_MSG_DNS_RESOLVE | DNS Resolution event.
SOCKET_MSG_ACCEPT | Accept socket event.
SOCKET_MSG_CONNECT | Connect socket event.
SOCKET_MSG_RECV | Receive socket event.
SOCKET_MSG_SEND | Send socket event.
SOCKET_MSG_SENDTO | Sendto socket event.
SOCKET_MSG_RECVFROM | Recvfrom socket event.


WINC3400 IoT Software APIs: Functions

Functions
Functions
SOCKET

Functions

NMI_API void | socketInit (void)
NMI_API void | socketDeinit (void)
NMI_API void | registerSocketCallback (tpfAppSocketCb socket_cb, tpfAppResolveCb resolve_cb)
NMI_API SOCKET | socket (uint16 u16Domain, uint8 u8Type, uint8 u8Flags)
NMI_API sint8 | bind (SOCKET sock, struct sockaddr *pstrAddr, uint8 u8AddrLen)
NMI_API sint8 | listen (SOCKET sock, uint8 backlog)
NMI_API sint8 | accept (SOCKET sock, struct sockaddr *addr, uint8 *addrlen)
NMI_API sint8 | connect (SOCKET sock, struct sockaddr *pstrAddr, uint8 u8AddrLen)
NMI_API sint16 | recv (SOCKET sock, void *pvRecvBuf, uint16 u16BufLen, uint32 u32Timeoutmsec)
NMI_API sint16 | recvfrom (SOCKET sock, void *pvRecvBuf, uint16 u16BufLen, uint32 u32Timeoutmsec)
NMI_API sint16 | send (SOCKET sock, void *pvSendBuffer, uint16 u16SendLength, uint16 u16Flags)
NMI_API sint16 | sendto (SOCKET sock, void *pvSendBuffer, uint16 u16SendLength, uint16 flags, struct sockaddr *pstrDestAddr, uint8 u8AddrLen)
NMI_API sint8 | close (SOCKET sock)
NMI_API uint32 | nmi_inet_addr (char *pcIpAddr)
NMI_API sint8 | gethostbyname (uint8 *pcHostName)
NMI_API sint8 | setsockopt (SOCKET socket, uint8 u8Level, uint8 option_name, const void *option_value, uint16 u16OptionLen)
NMI_API sint8 | getsockopt (SOCKET sock, uint8 u8Level, uint8 u8OptName, const void *pvOptValue, uint8 *pu8OptLen)
NMI_API sint8 | m2m_ping_req (uint32 u32DstIP, uint8 u8TTL, tpfPingCb fpPingCb)

Detailed Description

Function Documentation

◆ socketInit()

NMI_API void socketInit ( void )

The function performs the necessary initialization for the socket library through the following steps:

  • A check made by the global variable gbSocketInit, ensuring that initialization for sockets is performed only once, in-order to prevent reseting the socket instances already created in the global socket array (gastrSockets).
  • Zero initializations to the global socket array (gastrSockets), which holds the list of TCP sockets.
  • Registers the socket (Host Interface)hif callback function through the call to the hif_register_cb function. This facilitates handling all of the socket related functions received through interrupts from the firmware.
Returns
void
Remarks
This initialization function must be invoked before any socket operation is performed. No error codes from this initialization function since the socket array is statically allocated based on the maximum number of sockets MAX_SOCKET which is tuned to the systems capability.

Example

This example demonstrates the use of the socketInit for socket initialization for an mqtt chat application.

tstrWifiInitParam param;
int8_t ret;
char topic[strlen(MAIN_CHAT_TOPIC) + MAIN_CHAT_USER_NAME_SIZE + 1];
//Initialize the board.
system_init();
//Initialize the UART console.
configure_console();
// Initialize the BSP.
nm_bsp_init();
----------
// Initialize socket interface.
socketInit();
registerSocketCallback(socket_event_handler, socket_resolve_handler);
// Connect to router.
m2m_wifi_connect((char *)DEFAULT_SSID, sizeof(DEFAULT_SSID),
DEFAULT_AUTH, (char *)DEFAULT_KEY, M2M_WIFI_CH_ALL);

◆ socketDeinit()

NMI_API void socketDeinit ( void )

Socket Layer De-initialization.

The function performs the necessary cleanup for the socket library static data It must be invoked only after all desired socket operations have been performed on any active sockets.

◆ registerSocketCallback()

NMI_API void registerSocketCallback | ( | tpfAppSocketCb | socket_cb,
 |  | tpfAppResolveCb | resolve_cb
 | ) |  |

Register two callback functions one for asynchronous socket events and the other one for DNS callback registering function. The registered callback functions are used to retrieve information in response to the asynchronous socket functions called.

Parameters
[in] | socket_cb | Assignment of callback function to the global callback tpfAppSocketCb gpfAppSocketCb. Delivers socket messages to the host application. In response to the asynchronous function calls, such as bind listen accept connect
[in] | resolve_cb | Assignment of callback function to the global callback tpfAppResolveCb gpfAppResolveCb. Used for DNS resolving functionality. The DNS resolving technique is determined by the application registering the callback. NULL is assigned when DNS resolution is not required.
Returns
void
Remarks
If any of the socket functionality is not to be used, NULL is passed in as a parameter. It must be invoked after socketInit and before other socket layer operations.

Example

This example demonstrates the use of the registerSocketCallback to register a socket callback function with DNS resolution CB set to null for a simple UDP server example.

tstrWifiInitParam param;
int8_t ret;
struct sockaddr_in addr;
// Initialize the board
system_init();
//Initialize the UART console.
configure_console();
// Initialize the BSP.
nm_bsp_init();
// Initialize socket address structure.
addr.sin_family = AF_INET;
addr.sin_port = _htons(MAIN_WIFI_M2M_SERVER_PORT);
addr.sin_addr.s_addr = _htonl(MAIN_WIFI_M2M_SERVER_IP);
// Initialize Wi-Fi parameters structure.
memset((uint8_t *)&param, 0, sizeof(tstrWifiInitParam));
// Initialize Wi-Fi driver with data and status callbacks.
param.pfAppWifiCb = wifi_cb;
ret = m2m_wifi_init(&param);
if (M2M_SUCCESS != ret) {
printf("main: m2m_wifi_init call error!(%d)\r\n", ret);
while (1) {
}
}
// Initialize socket module
socketInit();
registerSocketCallback(socket_cb, NULL);
// Connect to router.
m2m_wifi_connect((char *)DEFAULT_SSID, sizeof(DEFAULT_SSID), DEFAULT_AUTH, (char *)DEFAULT_KEY, M2M_WIFI_CH_ALL);

◆ socket()

NMI_API SOCKET socket | ( | uint16 | u16Domain,
 |  | uint8 | u8Type,
 |  | uint8 | u8Flags
 | ) |  |

Synchronous socket allocation function based on the specified socket type. Created sockets are non-blocking and their possible types are either TCP or a UDP sockets. The maximum allowed number of TCP sockets is TCP_SOCK_MAX sockets while the maximum number of UDP sockets that can be created simultaneously is UDP_SOCK_MAX sockets.

Parameters
[in] | u16Domain | Socket family. The only allowed value is AF_INET (IPv4.0) for TCP/UDP sockets.
[in] u8Type Socket type. Allowed values are:
  • SOCK_STREAM
  • SOCK_DGRAM
[in] | u8Flags | Used to specify the socket creation flags. It shall be set to zero for normal TCP/UDP sockets, or SOCKET_FLAGS_SSL if the socket is used for SSL session. The use of the flag SOCKET_FLAGS_SSL has no meaning in case of UDP sockets.
Precondition
The socketInit function must be called once at the beginning of the application to initialize the socket handler. before any call to the socket function can be made.
See also
connect bind listen accept recv recvfrom send sendto close setsockopt getsockopt
Returns
On successful socket creation, a non-blocking socket type is created and a socket ID is returned In case of failure the function returns a negative value, identifying one of the socket error codes defined. For example: SOCK_ERR_INVALID for invalid argument or SOCK_ERR_MAX_TCP_SOCK if the number of TCP allocated sockets exceeds the number of available sockets.
Remarks
The socket function must be called before any other related socket functions "e.g. send, recv, close ..etc"

Example

This example demonstrates the use of the socket function to allocate the socket, returning the socket handler to be used for other socket operations. Socket creation is dependent on the socket type.

UDP example

SOCKET UdpServerSocket = -1;
UdpServerSocket = socket(AF_INET, SOCK_DGRAM, 0);

TCP example

static SOCKET tcp_client_socket = -1;
tcp_client_socket = socket(AF_INET, SOCK_STREAM, 0));

◆ bind()

NMI_API sint8 bind | ( | SOCKET | sock,
 |  | struct sockaddr * | pstrAddr,
 |  | uint8 | u8AddrLen
 | ) |  |

Asynchronous bind function associates the provided address and local port to the socket. The function can be used with both TCP and UDP sockets. It is mandatory to call the bind function before starting any UDP or TCP server operation. Upon socket bind completion, the application will receive a SOCKET_MSG_BIND message in the socket callback.

Parameters
[in] | sock | Socket ID, must hold a non negative value. A negative value will return a socket error SOCK_ERR_INVALID_ARG. Indicating that an invalid argument is passed in.
[in] | pstrAddr | Pointer to socket address structure "sockaddr_in" sockaddr_in
[in] | u8AddrLen | Size of the given socket address structure in bytes.
Precondition
The socket function must be called to allocate a socket before passing the socket ID to the bind function.
See also
socket
connect
listen
accept
recv
recvfrom
send
sendto
Returns
The function returns ZERO for successful operations and a negative value otherwise. The possible error values are:
  • SOCK_ERR_NO_ERROR Indicating that the operation was successful.
  • SOCK_ERR_INVALID_ARG Indicating passing invalid arguments such as negative socket ID or NULL socket address structure.
  • SOCK_ERR_INVALID Indicate socket bind failure.

Example

This example demonstrates the call of the bind socket operation after a successful socket operation.

struct sockaddr_in addr;
SOCKET udpServerSocket =-1;
int ret = -1;
if(udpServerSocket == -1)
{
udpServerSocket = socket(AF_INET,SOCK_DGRAM,0);
if(udpServerSocket >= 0)
{
addr.sin_family = AF_INET;
addr.sin_port = _htons(UDP_SERVER_PORT);
addr.sin_addr.s_addr = 0;
ret = bind(udpServerSocket,(struct sockaddr*)&addr,sizeof(addr));
if(ret == 0)
printf("Bind success!\n");
else
{
printf("Bind Failed. Error code = %d\n",ret);
close(udpServerSocket);
}
else
{
printf("UDP Server Socket Creation Failed\n");
return;
}
}

◆ listen()

NMI_API sint8 listen | ( | SOCKET | sock,
 |  | uint8 | backlog
 | ) |  |

After successfully binding a socket to an IP address and port on the system, start listening passively for incoming connections. The socket must be bound on a local port or the listen operation fails. Upon the call to the asynchronous listen function, response is received through the event SOCKET_MSG_LISTEN in the socket callback.

A successful listen means the TCP server operation is active. If a connection is accepted, then the application socket callback function is notified with the new connected socket through the event SOCKET_MSG_ACCEPT. Hence there is no need to call the accept function after calling listen.

After a connection is accepted, the user is then required to call recv to receive any packets transmitted by the remote host or to recieve notification of socket connection termination.

Parameters
[in] | sock | Socket ID, must hold a non negative value. A negative value will return a socket error SOCK_ERR_INVALID_ARG. Indicating that an invalid argument is passed in.
[in] | backlog | Not used by the current implementation.
Precondition
The bind function must be called to assign the port number and IP address to the socket before the listen operation.
See also
bind
accept
recv
recvfrom
send
sendto
Returns
The function returns ZERO for successful operations and a negative value otherwise. The possible error values are:
  • SOCK_ERR_NO_ERROR Indicating that the operation was successful.
  • SOCK_ERR_INVALID_ARG Indicating invalid arguments were passed, such as negative socket ID.
  • SOCK_ERR_INVALID Indicate socket listen failure.

Example

This example demonstrates the call of the listen socket operation after a successful socket operation.

static void TCP_Socketcallback(SOCKET sock, uint8 u8Msg, void * pvMsg)
{
int ret =-1;
switch(u8Msg)
{
case SOCKET_MSG_BIND:
{
tstrSocketBindMsg *pstrBind = (tstrSocketBindMsg*)pvMsg;
if(pstrBind != NULL)
{
if(pstrBind->status == 0)
{
ret = listen(sock, 0);
if(ret <0)
printf("Listen failure! Error = %d\n",ret);
}
else
{
M2M_ERR("bind Failure!\n");
close(sock);
}
}
}
break;
case SOCKET_MSG_LISTEN:
{
tstrSocketListenMsg *pstrListen = (tstrSocketListenMsg*)pvMsg;
if(pstrListen != NULL)
{
if(pstrListen->status == 0)
{
ret = accept(sock,NULL,0);
}
else
{
M2M_ERR("listen Failure!\n");
close(sock);
}
}
}
break;
case SOCKET_MSG_ACCEPT:
{
tstrSocketAcceptMsg *pstrAccept = (tstrSocketAcceptMsg*)pvMsg;
if(pstrAccept->sock >= 0)
{
TcpNotificationSocket = pstrAccept->sock;
recv(pstrAccept->sock,gau8RxBuffer,sizeof(gau8RxBuffer),TEST_RECV_TIMEOUT);
}
else
{
M2M_ERR("accept failure\n");
}
}
break;
default:
break;
}
}

◆ accept()

NMI_API sint8 accept | ( | SOCKET | sock,
 |  | struct sockaddr * | addr,
 |  | uint8 * | addrlen
 | ) |  |

The function has no current implementation. An empty deceleration is used to prevent errors when legacy application code is used. As it has no effect, it can be safely removed from any application using it.

Parameters
[in] | sock | Socket ID, must hold a non negative value. A negative value will return a socket error SOCK_ERR_INVALID_ARG. Indicating that an invalid argument is passed in.
[in] | addr | Not used in the current implementation.
[in] | addrlen | Not used in the current implementation.
Returns
The function returns ZERO for successful operations and a negative value otherwise. The possible error values are:
  • SOCK_ERR_NO_ERROR Indicating that the operation was successful.
  • SOCK_ERR_INVALID_ARG Indicating passing invalid arguments such as negative socket ID.

◆ connect()

NMI_API sint8 connect | ( | SOCKET | sock,
 |  | struct sockaddr * | pstrAddr,
 |  | uint8 | u8AddrLen
 | ) |  |

Establishes a TCP connection with a remote server. The asynchronous connect function must be called after receiving a valid socket ID from the socket function. The application socket callback function is notified of the result of the connection attempt through the event SOCKET_MSG_CONNECT, along with a structure tstrSocketConnectMsg. If socket connection fails, the application should call close(). A successful connect means the TCP session is active. The application is then required to make a call to the recv function to receive any packets transmitted by the remote server, unless the application is interrupted by a notification of socket connection termination.

Parameters
[in] | sock | Socket ID, must hold a non negative value. A negative value will return a socket error SOCK_ERR_INVALID_ARG. Indicating that an invalid argument is passed in.
[in] | pstrAddr | Address of the remote server.
[in] | u8AddrLen | Size of the given socket address structure in bytes. Not currently used, implemented for BSD compatibility only.
Precondition
The socket function must be called to allocate a TCP socket before passing the socket ID to the bind function. If the socket is not bound, you do NOT have to call bind before the "connect" function.
See also
socket recv send close
Returns
The function returns ZERO for successful operations and a negative value otherwise. The possible error values are:
  • SOCK_ERR_NO_ERROR Indicating that the operation was successful.
  • SOCK_ERR_INVALID_ARG Indicating passing invalid arguments such as negative socket ID or NULL socket address structure.
  • SOCK_ERR_INVALID Indicate socket connect failure.

Example

The example demonstrates a TCP application, showing how the asynchronous call to the connect function is made through the main function and how the callback function handles the SOCKET_MSG_CONNECT event.

Main Function

struct sockaddr_in Serv_Addr;
SOCKET TcpClientSocket =-1;
int ret = -1
TcpClientSocket = socket(AF_INET,SOCK_STREAM,0);
Serv_Addr.sin_family = AF_INET;
Serv_Addr.sin_port = _htons(1234);
Serv_Addr.sin_addr.s_addr = inet_addr(SERVER);
printf("Connected to server via socket %u\n",TcpClientSocket);
do
{
ret = connect(TcpClientSocket,(sockaddr_in*)&Serv_Addr,sizeof(Serv_Addr));
if(ret != 0)
{
printf("Connection Error\n");
}
else
{
printf("Connection successful.\n");
break;
}
}while(1)

Socket Callback

if(u8Msg == SOCKET_MSG_CONNECT)
{
tstrSocketConnectMsg *pstrConnect = (tstrSocketConnectMsg*)pvMsg;
if(pstrConnect->s8Error == 0)
{
uint8 acBuffer[GROWL_MSG_SIZE];
uint16 u16MsgSize;
printf("Connect success!\n");
u16MsgSize = FormatMsg(u8ClientID, acBuffer);
send(sock, acBuffer, u16MsgSize, 0);
recv(pstrNotification->Socket, (void*)au8Msg,GROWL_DESCRIPTION_MAX_LENGTH, GROWL_RX_TIMEOUT);
u8Retry = GROWL_CONNECT_RETRY;
}
else
{
M2M_DBG("Connection Failed, Error: %d\n",pstrConnect->s8Error ");
close(pstrNotification->Socket);
}
}

◆ recv()

NMI_API sint16 recv | ( | SOCKET | sock,
 |  | void * | pvRecvBuf,
 |  | uint16 | u16BufLen,
 |  | uint32 | u32Timeoutmsec
 | ) |  |

An asynchrnonous receive function, used to retrieve data from a TCP stream. Before calling the recv function, a successful socket connection status must have been received through any of the two socket events [SOCKET_MSG_CONNECT] or [SOCKET_MSG_ACCEPT], from the socket callback. Hence, indicating that the socket is already connected to a remote host. The application receives the required data in response to this asynchronous call through the reception of the event SOCKET_MSG_RECV in the socket callback.

Receiving the SOCKET_MSG_RECV message in the callback with zero or negative buffer length indicates the following:

  • SOCK_ERR_NO_ERROR : Socket connection closed. The application should now call close().
  • SOCK_ERR_CONN_ABORTED : Socket connection aborted. The application should now call close().
  • SOCK_ERR_TIMEOUT : Socket receive timed out. The socket connection remains open.
Parameters
[in] | sock | Socket ID, must hold a non negative value. A negative value will return a socket error SOCK_ERR_INVALID_ARG. Indicating that an invalid argument is passed in.
[in] | pvRecvBuf | Pointer to a buffer that will hold the received data. The buffer is used in the recv callback to deliver the received data to the caller. The buffer must be resident in memory (heap or global buffer).
[in] | u16BufLen | The buffer size in bytes.
[in] | u32Timeoutmsec | Timeout for the recv function in milli-seconds. If the value is set to ZERO, the timeout will be set to infinite (the recv function waits forever). If the timeout period is elapsed with no data received, the socket will get a timeout error.
Precondition
  • The socket function must be called to allocate a TCP socket before passing the socket ID to the recv function.
  • The socket in a connected state is expected to receive data through the socket interface.
See also
socket
connect
bind
listen
recvfrom
close
Returns
The function returns ZERO for successful operations and a negative value otherwise. The possible error values are:
  • SOCK_ERR_NO_ERROR Indicating that the operation was successful.
  • SOCK_ERR_INVALID_ARG Indicating passing invalid arguments such as negative socket ID or NULL Recieve buffer.
  • SOCK_ERR_BUFFER_FULL Indicate socket recieve failure.

Example

The example demonstrates a code snippet for the calling of the recv function in the socket callback upon notification of the accept or connect events, and the parsing of the received data when the SOCKET_MSG_RECV event is received.

switch(u8Msg)
{
case SOCKET_MSG_ACCEPT:
{
tstrSocketAcceptMsg *pstrAccept = (tstrSocketAcceptMsg*)pvMsg;
if(pstrAccept->sock >= 0)
{
recv(pstrAccept->sock,gau8RxBuffer,sizeof(gau8RxBuffer),TEST_RECV_TIMEOUT);
}
else
{
M2M_ERR("accept\n");
}
}
break;
case SOCKET_MSG_RECV:
{
tstrSocketRecvMsg *pstrRx = (tstrSocketRecvMsg*)pvMsg;
if(pstrRx->s16BufferSize > 0)
{
recv(sock,gau8RxBuffer,sizeof(gau8RxBuffer),TEST_RECV_TIMEOUT);
}
else
{
printf("Socet recv Error: %d\n",pstrRx->s16BufferSize);
close(sock);
}
}
break;
default:
break;
}

◆ recvfrom()

NMI_API sint16 recvfrom | ( | SOCKET | sock,
 |  | void * | pvRecvBuf,
 |  | uint16 | u16BufLen,
 |  | uint32 | u32TimeoutSeconds
 | ) |  |

Receives data from a UDP Scoket.

The asynchronous recvfrom function is used to retrieve data from a UDP socket. The socket must already be bound to a local port before a call to the recvfrom function is made (i.e message SOCKET_MSG_BIND is received with successful status in the socket callback).

Upon calling the recvfrom function with a successful return code, the application is expected to receive a notification in the socket callback whenever a message is received through the SOCKET_MSG_RECVFROM event.

Receiving the SOCKET_MSG_RECVFROM message in the callback with zero, indicates that the socket is closed. Whereby a negative buffer length indicates one of the socket error codes such as socket timeout error SOCK_ERR_TIMEOUT

The recvfrom callback can also be used to show the IP address of the remote host that sent the frame by using the "strRemoteAddr" element in the tstrSocketRecvMsg structure. (refer to the code example)

Parameters
[in] | sock | Socket ID, must hold a non negative value. A negative value will return a socket error SOCK_ERR_INVALID_ARG. Indicating that an invalid argument is passed in.
[in] | pvRecvBuf | Pointer to a buffer that will hold the received data. The buffer shall be used in the recv callback to deliver the received data to the caller. The buffer must be resident in memory (heap or global buffer).
[in] | u16BufLen | The buffer size in bytes.
[in] | u32TimeoutSeconds | Timeout for the recv function in milli-seconds. If the value is set to ZERO, the timeout will be set to infinite (the recv function waits forever).
Precondition
  • The socket function must be called to allocate a TCP socket before passing the socket ID to the recv function.
  • The socket corresponding to the socket ID must be successfully bound to a local port through the call to a bind function.
See also
socket bind close
Returns
The function returns ZERO for successful operations and a negative value otherwise. The possible error values are:
  • SOCK_ERR_NO_ERROR Indicating that the operation was successful.
  • SOCK_ERR_INVALID_ARG Indicating passing invalid arguments such as negative socket ID or NULL Receive buffer.
  • SOCK_ERR_BUFFER_FULL Indicate socket receive failure.

Example

The example demonstrates a code snippet for the calling of the recvfrom function in the socket callback upon notification of a successful bind event, and the parsing of the received data when the SOCKET_MSG_RECVFROM event is received.

switch(u8Msg)
{
case SOCKET_MSG_BIND:
{
tstrSocketBindMsg *pstrBind = (tstrSocketBindMsg*)pvMsg;
if(pstrBind != NULL)
{
if(pstrBind->status == 0)
{
recvfrom(sock, gau8SocketTestBuffer, TEST_BUFFER_SIZE, 0);
}
else
{
M2M_ERR("bind\n");
}
}
}
break;
case SOCKET_MSG_RECVFROM:
{
tstrSocketRecvMsg *pstrRx = (tstrSocketRecvMsg*)pvMsg;
if(pstrRx->s16BufferSize > 0)
{
//get the remote host address and port number
uint16 u16port = pstrRx->strRemoteAddr.sin_port;
uint32 strRemoteHostAddr = pstrRx->strRemoteAddr.sin_addr.s_addr;
printf("Received frame with size = %d.\tHost address=%x, Port number = %d\n\n",pstrRx->s16BufferSize,strRemoteHostAddr, u16port);
ret = recvfrom(sock,gau8SocketTestBuffer,sizeof(gau8SocketTestBuffer),TEST_RECV_TIMEOUT);
}
else
{
printf("Socket recv Error: %d\n",pstrRx->s16BufferSize);
ret = close(sock);
}
}
break;
default:
break;
}

◆ send()

NMI_API sint16 send | ( | SOCKET | sock,
 |  | void * | pvSendBuffer,
 |  | uint16 | u16SendLength,
 |  | uint16 | u16Flags
 | ) |  |

Asynchronous sending function, used to send data on a TCP/UDP socket.

Called by the application code when there is outgoing data available required to be sent on a specific socket handler. The only difference between this function and the similar sendto function, is the type of socket the data is sent on and the parameters passed in. send function is most commonly called for sockets in a connected state. After the data is sent, the socket callback function registered using registerSocketCallback(), is expected to receive an event of type SOCKET_MSG_SEND holding information containing the number of data bytes sent.

Parameters
[in] | sock | Socket ID, must hold a non negative value. A negative value will return a socket error SOCK_ERR_INVALID_ARG. Indicating that an invalid argument is passed in.
[in] | pvSendBuffer | Pointer to a buffer holding data to be transmitted.
[in] | u16SendLength | The buffer size in bytes.
[in] | u16Flags | Not used in the current implementation.
Precondition
Sockets must be initialized using socketInit.

For TCP Socket:
Must use a successfully connected Socket (so that the intended recipient address is known ahead of sending the data). Hence this function is expected to be called after a successful socket connect operation(in client case or accept in the the server case).
For UDP Socket:
UDP sockets most commonly use sendto function, where the destination address is defined. However, in-order to send outgoing data using the send function, at least one successful call must be made to the sendto function before consecutive calls to the send function, to ensure that the destination address is saved in the firmware.

See also
socketInit recv sendto socket connect accept sendto
Warning
u16SendLength must not exceed SOCKET_BUFFER_MAX_LENGTH.
Use a valid socket identifer through the aprior call to the socket function. Must use a valid buffer pointer. Successful completion of a call to send() does not guarantee delivery of the message, A negative return value indicates only locally-detected errors
Returns
The function shall return SOCK_ERR_NO_ERROR for successful operation and a negative value (indicating the error) otherwise.

◆ sendto()

NMI_API sint16 sendto | ( | SOCKET | sock,
 |  | void * | pvSendBuffer,
 |  | uint16 | u16SendLength,
 |  | uint16 | flags,
 |  | struct sockaddr * | pstrDestAddr,
 |  | uint8 | u8AddrLen
 | ) |  |

Asynchronous sending function, used to send data on a UDP socket. Called by the application code when there is data required to be sent on a UDP socket. The application code is expected to receive data from a successfully bound socket node. The only difference between this function and the similar send function, is the type of socket the data is received on. This function works only with UDP sockets. After the data is sent, the socket callback function registered using registerSocketCallback(), is expected to receive an event of type SOCKET_MSG_SENDTO.

Parameters
[in] | sock | Socket ID, must hold a non negative value. A negative value will return a socket error SOCK_ERR_INVALID_ARG. Indicating that an invalid argument is passed in.
[in] | pvSendBuffer | Pointer to a buffer holding data to be transmitted. A NULL value will return a socket error SOCK_ERR_INVALID_ARG. Indicating that an invalid argument is passed in.
[in] | u16SendLength | The buffer size in bytes. It must not exceed SOCKET_BUFFER_MAX_LENGTH.
[in] | flags | Not used in the current implementation
[in] | pstrDestAddr | The destination address.
[in] | u8AddrLen | Destination address length in bytes. Not used in the current implementation, only included for BSD compatibility.
Precondition
Sockets must be initialized using socketInit.
See also
socketInit recvfrom sendto socket connect accept send
Warning
u16SendLength must not exceed SOCKET_BUFFER_MAX_LENGTH.
Use a valid socket (returned from socket ). A valid buffer pointer must be used (not NULL).
Successful completion of a call to sendto() does not guarantee delivery of the message, A negative return value indicates only locally-detected errors
Returns
The function returns SOCK_ERR_NO_ERROR for successful operation and a negative value (indicating the error) otherwise.

◆ close()

NMI_API sint8 close ( SOCKET sock )

Synchronous close function, releases all the socket assigned resources.

Parameters
[in] sock Socket ID, must hold a non negative value. A negative value will return a socket error SOCK_ERR_INVALID_ARG. Indicating that an invalid argument is passed in.
Precondition
Sockets must be initialized through the call of the socketInit function. close is called only for valid socket identifiers created through the socket function.
Warning
If close is called while there are still pending messages (sent or received ) they will be discarded.
See also
socketInit socket
Returns
The function returned SOCK_ERR_NO_ERROR for successful operation and a negative value (indicating the error) otherwise.

◆ nmi_inet_addr()

NMI_API uint32 nmi_inet_addr ( char * pcIpAddr )

Synchronous function which returns a BSD socket compliant Internet Protocol (IPv4) socket address. This IPv4 address in the input string parameter could either be specified as a hostname, or as a numeric string representation like n.n.n.n known as the IPv4 dotted-decimal format (i.e. "192.168.10.1"). This function is used whenever an ip address needs to be set in the proper format (i.e. for the tstrM2MIPConfig structure).

Parameters
[in] pcIpAddr A null terminated string containing the IP address in IPv4 dotted-decimal address.
Returns
Unsigned 32-bit integer representing the IP address in Network byte order (eg. "192.168.10.1" will be expressed as 0x010AA8C0).

◆ gethostbyname()

NMI_API sint8 gethostbyname ( uint8 * pcHostName )

Asynchronous DNS resolving function. This function uses DNS to resolve a domain name to the corresponding IP address. A call to this function will cause a DNS request to be sent and the response will be delivered to the DNS callback function registered using registerSocketCallback()

Parameters
[in] pcHostName NULL terminated string containing the domain name for the remote host. Its size must not exceed HOSTNAME_MAX_SIZE.
See also
registerSocketCallback
Warning
Successful completion of a call to gethostbyname() does not guarantee success of the DNS request, a negative return value indicates only locally-detected errors
Returns
  • SOCK_ERR_NO_ERROR
  • SOCK_ERR_INVALID_ARG

◆ setsockopt()

NMI_API sint8 setsockopt | ( | SOCKET | socket,
 |  | uint8 | u8Level,
 |  | uint8 | option_name,
 |  | const void * | option_value,
 |  | uint16 | u16OptionLen
 | ) |  |

The setsockopt() function shall set the option specified by the option_name argument, at the protocol level specified by the level argument, to the value pointed to by the option_value argument for the socke specified by the socket argument.

Possible Options: SO_SET_UDP_SEND_CALLBACK: Enable/Disable callback messages for sendto().Since UDP is unreliable by default the user maybe interested (or not) in receiving a message of /ref SOCKET_MSG_SENDTO for each call of sendto(). Enabled if option_value equals /ref BTRUE Disabled otherwise. IP_ADD_MEMBERSHIP: valid for UDP sockets,this option is used to receive frames sent to a multicast group. option_value shall be a pointer to Unsigned 32 bit integer containing the Multicast ipv4 address. IP_DROP_MEMBERSHIP: valid for UDP sockets,this option is used to Stop receiving frames sent to a multicast group. option_value shall be a pointer to Unsigned 32 bit integer containing the Multicast ipv4 address.

Possible values for s32Level: This argument is ignored.

Parameters
[in] | socket | Socket handler.
[in] | u8Level | protocol level. always SOL_SOCKET for now.
[in] | option_name | option to be set.
[in] | option_value | pointer to user provided value.
[in] | u16OptionLen | length of the option value.
Warning
-Note that sending IGMP packets to Join/Leave multicast groups is not currently implemented.
Calling this function will Pass/Filter packets sent to the Multicast address provided in the option_value
Returns
The function shall return SOCK_ERR_NO_ERROR for successful operation and a negative value (indicating the error) otherwise.

◆ getsockopt()

sint8 getsockopt | ( | SOCKET | sock,
 |  | uint8 | u8Level,
 |  | uint8 | u8OptName,
 |  | const void * | pvOptValue,
 |  | uint8 * | pu8OptLen
 | ) |  |

Get socket options retrieves This Function isn't implemented yet but this is the form that will be released later.

Parameters
[in] | sock | Socket Identifie.
[in] | u8Level | The protocol level of the option.
[in] | u8OptName | The u8OptName argument specifies a single option to get.
[out] | pvOptValue | The pvOptValue argument contains pointer to a buffer containing the option value.
[out] | pu8OptLen | Option value buffer length.
Returns
The function shall return ZERO for successful operation and a negative value otherwise.

◆ m2m_ping_req()

NMI_API sint8 m2m_ping_req | ( | uint32 | u32DstIP,
 |  | uint8 | u8TTL,
 |  | tpfPingCb | fpPingCb
 | ) |  |

The function request to send ping request to the given IP Address.

Parameters
[in] | u32DstIP | Target Destination IP Address for the ping request. It must be represented in Network byte order. The function nmi_inet_addr could be used to translate the dotted decimal notation IP to its Network bytes order integer represntative.
[in] | u8TTL | IP TTL value for the ping request. If set to ZERO, the default value SHALL be used.
[in] | fpPingCb | Callback will be called to deliver the ping statistics.
See also
nmi_inet_addr
Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise.


WINC3400 IoT Software APIs: TLS Cipher Suite IDs

Macros
TLS Cipher Suite IDs

Macros

#define | SSL_CIPHER_RSA_WITH_AES_128_CBC_SHA NBIT0
#define | SSL_CIPHER_RSA_WITH_AES_128_CBC_SHA256 NBIT1
#define | SSL_CIPHER_DHE_RSA_WITH_AES_128_CBC_SHA NBIT2
#define | SSL_CIPHER_DHE_RSA_WITH_AES_128_CBC_SHA256 NBIT3
#define | SSL_CIPHER_RSA_WITH_AES_128_GCM_SHA256 NBIT4
#define | SSL_CIPHER_DHE_RSA_WITH_AES_128_GCM_SHA256 NBIT5
#define | SSL_CIPHER_RSA_WITH_AES_256_CBC_SHA NBIT6
#define | SSL_CIPHER_RSA_WITH_AES_256_CBC_SHA256 NBIT7
#define | SSL_CIPHER_DHE_RSA_WITH_AES_256_CBC_SHA NBIT8
#define | SSL_CIPHER_DHE_RSA_WITH_AES_256_CBC_SHA256 NBIT9
#define | SSL_CIPHER_ECDHE_RSA_WITH_AES_128_CBC_SHA NBIT10
#define | SSL_CIPHER_ECDHE_RSA_WITH_AES_256_CBC_SHA NBIT11
#define | SSL_CIPHER_ECDHE_RSA_WITH_AES_128_CBC_SHA256 NBIT12
#define | SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 NBIT13
#define | SSL_CIPHER_ECDHE_RSA_WITH_AES_128_GCM_SHA256 NBIT14
#define | SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 NBIT15
#define | SSL_ECC_ONLY_CIPHERS
#define | SSL_DEFAULT_CIPHERS

Detailed Description

The following list of macros defined the list of supported TLS Cipher suites. Each MACRO defines a single Cipher suite.

See also
m2m_ssl_set_active_ciphersuites

Macro Definition Documentation

◆ SSL_CIPHER_RSA_WITH_AES_128_CBC_SHA

#define SSL_CIPHER_RSA_WITH_AES_128_CBC_SHA NBIT0

◆ SSL_CIPHER_RSA_WITH_AES_128_CBC_SHA256

#define SSL_CIPHER_RSA_WITH_AES_128_CBC_SHA256 NBIT1

◆ SSL_CIPHER_DHE_RSA_WITH_AES_128_CBC_SHA

#define SSL_CIPHER_DHE_RSA_WITH_AES_128_CBC_SHA NBIT2

◆ SSL_CIPHER_DHE_RSA_WITH_AES_128_CBC_SHA256

#define SSL_CIPHER_DHE_RSA_WITH_AES_128_CBC_SHA256 NBIT3

◆ SSL_CIPHER_RSA_WITH_AES_128_GCM_SHA256

#define SSL_CIPHER_RSA_WITH_AES_128_GCM_SHA256 NBIT4

◆ SSL_CIPHER_DHE_RSA_WITH_AES_128_GCM_SHA256

#define SSL_CIPHER_DHE_RSA_WITH_AES_128_GCM_SHA256 NBIT5

◆ SSL_CIPHER_RSA_WITH_AES_256_CBC_SHA

#define SSL_CIPHER_RSA_WITH_AES_256_CBC_SHA NBIT6

◆ SSL_CIPHER_RSA_WITH_AES_256_CBC_SHA256

#define SSL_CIPHER_RSA_WITH_AES_256_CBC_SHA256 NBIT7

◆ SSL_CIPHER_DHE_RSA_WITH_AES_256_CBC_SHA

#define SSL_CIPHER_DHE_RSA_WITH_AES_256_CBC_SHA NBIT8

◆ SSL_CIPHER_DHE_RSA_WITH_AES_256_CBC_SHA256

#define SSL_CIPHER_DHE_RSA_WITH_AES_256_CBC_SHA256 NBIT9

◆ SSL_CIPHER_ECDHE_RSA_WITH_AES_128_CBC_SHA

#define SSL_CIPHER_ECDHE_RSA_WITH_AES_128_CBC_SHA NBIT10

◆ SSL_CIPHER_ECDHE_RSA_WITH_AES_256_CBC_SHA

#define SSL_CIPHER_ECDHE_RSA_WITH_AES_256_CBC_SHA NBIT11

◆ SSL_CIPHER_ECDHE_RSA_WITH_AES_128_CBC_SHA256

#define SSL_CIPHER_ECDHE_RSA_WITH_AES_128_CBC_SHA256 NBIT12

◆ SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256

#define SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 NBIT13

◆ SSL_CIPHER_ECDHE_RSA_WITH_AES_128_GCM_SHA256

#define SSL_CIPHER_ECDHE_RSA_WITH_AES_128_GCM_SHA256 NBIT14

◆ SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256

#define SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 NBIT15

◆ SSL_ECC_ONLY_CIPHERS

#define SSL_ECC_ONLY_CIPHERS
Value:
(\
SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 | \
SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 \
)

All supported ECC Ciphers. These ciphers are turned off by default at startup. The application may enable them if it has an ECC math engine (like ATECC508).

◆ SSL_DEFAULT_CIPHERS

#define SSL_DEFAULT_CIPHERS
Value:
(\
SSL_CIPHER_RSA_WITH_AES_128_CBC_SHA | \
SSL_CIPHER_RSA_WITH_AES_128_CBC_SHA256 | \
SSL_CIPHER_DHE_RSA_WITH_AES_128_CBC_SHA | \
SSL_CIPHER_DHE_RSA_WITH_AES_128_CBC_SHA256 | \
SSL_CIPHER_RSA_WITH_AES_128_GCM_SHA256 | \
SSL_CIPHER_DHE_RSA_WITH_AES_128_GCM_SHA256 | \
SSL_CIPHER_RSA_WITH_AES_256_CBC_SHA | \
SSL_CIPHER_RSA_WITH_AES_256_CBC_SHA256 | \
SSL_CIPHER_DHE_RSA_WITH_AES_256_CBC_SHA | \
SSL_CIPHER_DHE_RSA_WITH_AES_256_CBC_SHA256 \
)

All supported Non-ECC Ciphers. This is the default active group after startup. Note that firmware may support only a subset of these.


WINC3400 IoT Software APIs: Data Structures

Data Structures
Here are the data structures with brief descriptions:
C in_addr | IPv4 address representation
C sockaddr | Generic socket address structure
C sockaddr_in | Socket address structure for IPV4 addresses. Used to specify socket address information to connect to. Can be cast to sockaddr structure
C tstr1xAuthCredentials | This struct stores the credentials for the user to authenticate with the AAA server (WPA-Enterprise Mode IEEE802.1x)
C tstrDataAccessInitParamsApp | This structure contains parameters for initializing a local data access (read or write)
C tstrDataAccessParamsApp | This structure contains data for local data access (read or write)
C 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
C tstrFlashState | This structure contains information about an attempted transfer
C tstrM2MAPConfig | This structure holds the configuration parameters for the AP mode. It should be set by the application when it requests to enable the AP operation mode. The AP mode currently supports only OPEN and WEP security
C tstrM2mBatteryVoltage | This struct stores the battery voltage
C tstrM2mBleApiMsg | This struct contains a BLE message
C tstrM2MBLEInfo | BLE Result
C tstrM2mClientState | This struct contains the information for the PS Client state
C tstrM2MConnInfo | This struct contains the connection information
C tstrM2MDefaultConnResp | This struct contains the response error of m2m_default_connect
C tstrM2MDeviceNameConfig | This struct contains the Device Name of the WINC. It is used mainly for Wi-Fi Direct device discovery and WPS device information
C tstrM2mEnableLogs | This struct stores logging information
C tstrM2MGainTable | This struct contains the information of the gain table index from flash to be used
C tstrM2MGainTableRsp | This struct contains response when the firmware has failed to configure the gains from flash
C tstrM2MIPConfig | This struct contains the static IP configuration
C 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
C tstrM2mIpRsvdPkt | This struct contains the size and data offset for the received packet
C tstrM2mLsnInt | This struct contains the Listen Interval. It is the value of the Wi-Fi StA Listen Interval when power save is enabled. It is given in units of Beacon period. It is the number of Beacon periods the WINC can sleep before it wakes up to receive data buffered for it in the AP
C tstrM2MMulticastMac | This struct contains the information from the Multicast filter
C tstrM2MP2PConnect | This struct contains the Listen Channel for P2P connect
C tstrM2MProvisionInfo | This struct contains the provisioning information obtained from the HTTP Provisioning server
C tstrM2MProvisionModeConfig | This struct contains the provisioning mode configuration
C tstrM2mPsType | This struct contains the Power Save configuration
C tstrM2mPwrMode |
C tstrM2mPwrState | This struct stores the Power Save modes
C tstrM2mReqScanResult | The Wi-Fi Scan results list is stored in firmware. This struct contains the index by which the application can request a certain scan result
C tstrM2MScan | This struct contains the Wi-Fi scan request
C tstrM2mScanDone | This struct contains the Wi-Fi scan result
C tstrM2MScanOption | This struct contains the configuration options for Wi-Fi scan
C tstrM2MScanRegion | This struct contains the Wi-Fi information for the channel regions
C tstrM2Mservercmd | This struct contains the information for the PS Server command
C tstrM2mServerInit | This struct contains the information for the PS Server initialization
C tstrM2mSetMacAddress | This struct contains the MAC address to be used. The WINC loads the mac address from the efuse by default to the WINC configuration memory, however, the application can overwrite the configuration memory with the mac address indicated from the Host
C tstrM2mSlpReqTime | This struct contains the sleep time for the Power Save request
C tstrM2mTxPwrLevel | This struct stores the Tx Power levels
C tstrM2mWifiConnect | This struct stores the Wi-Fi connect request
C tstrM2MWifiMonitorModeCtrl | This struct contains the Wi-Fi Monitor Mode Filter. It sets the filtering criteria for WLAN packets when monitoring mode is enabled. The received packets matching the filtering parameters, are passed directly to the application
C tstrM2MWifiRxPacketInfo | This struct contains the Wi-Fi RX Frame Header. The M2M application has the ability to allow Wi-Fi monitoring mode for receiving all Wi-Fi Raw frames matching a well defined filtering criteria. When a target Wi-Fi packet is received, the header information are extracted and assigned in this structure
C tstrM2mWifiscanResult | This struct contains the information corresponding to an AP in the scan result list identified by its order (index) in the list
C tstrM2MWifiSecInfo | This struct stores the authentication credentials to connect to a Wi-Fi network
C tstrM2mWifiStateChanged | This struct contains the Wi-Fi connection state
C tstrM2MWifiTxPacketInfo | This struct contains the Wi-Fi TX Packet Info. The M2M Application has the ability to compose raw Wi-Fi frames (under the application responsibility). When transmitting a Wi-Fi packet, the application must supply the firmware with this structure for sending the target frame
C tstrM2mWifiWepParams | This struct stores the WEP security key parameters
C tstrM2MWPSConnect | This struct stores the WPS configuration parameters
C tstrM2MWPSInfo | WPS Result
C tstrOtaControlSec | This struct contains the Control Section. The Control Section is used to define the working image and the validity of the roll-back image and its offset, also both firmware versions is kept in that structure
C tstrOtaInitHdr | This struct contains the OTA image header
C tstrOtaUpdateInfo | This struct contains the OTA update information
C tstrOtaUpdateStatusResp | This struct contains the OTA update status
C tstrPrng | M2M Request PRNG
C tstrRootCertEcdsaKeyInfo | Info about a ECDSA public key
C tstrRootCertEntryHeader | Header of a root certificate entry in flash
C tstrRootCertFlashHeader | Header of the root certificate flash storage area
C tstrRootCertPubKeyInfo | Info about the public key contained in a root certificate
C tstrRootCertRsaKeyInfo | Info about a RSA public key
C tstrSocketAcceptMsg | Socket accept status
C tstrSocketBindMsg | Socket bind status
C tstrSocketConnectMsg | Socket connect status
C tstrSocketListenMsg | Socket listen status
C tstrSocketRecvMsg | Socket recv status
C tstrSslSetActiveCsList |
C tstrSystemTime | This struct contains the system time
C tstrTlsSrvChunkHdr |
C tstrTlsSrvSecFileEntry | This struct contains a TLS certificate
C tstrTlsSrvSecHdr | This struct contains a set of TLS certificates
C 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
C tuniM2MWifiAuth | This struct stores the Wi-Fi Security Parameters for all supported security modes
Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: in_addr Struct Reference

Data Fields
in_addr Struct Reference

Data Fields

uint32 s_addr

Detailed Description

IPv4 address representation.

This structure is used as a placeholder for IPV4 address in other structures.

See also
sockaddr_in

Field Documentation

◆ s_addr

uint32 s_addr

Network Byte Order representation of the IPv4 address. For example, the address "192.168.0.10" is represented as 0x0A00A8C0.


WINC3400 IoT Software APIs: sockaddr Struct Reference

Data Fields
sockaddr Struct Reference

Data Fields

uint16 sa_family
uint8 sa_data [14]

Detailed Description

Generic socket address structure.

See also
\ sockaddr_in

Field Documentation

◆ sa_family

uint16 sa_family

Socket address family.

◆ sa_data

uint8 sa_data[14]

Maximum size of all the different socket address structures.


WINC3400 IoT Software APIs: sockaddr_in Struct Reference

Data Fields
sockaddr_in Struct Reference

Data Fields

uint16 sin_family
uint16 sin_port
in_addr sin_addr
uint8 sin_zero [8]

Detailed Description

Socket address structure for IPV4 addresses. Used to specify socket address information to connect to. Can be cast to sockaddr structure.

Field Documentation

◆ sin_family

uint16 sin_family

Specifies the address family(AF). Members of AF_INET address family are IPv4 addresses. Hence,the only supported value for this is AF_INET.

◆ sin_port

uint16 sin_port

Port number of the socket. Network sockets are identified by a pair of IP addresses and port number. Must be set in the Network Byte Order format , _htons (e.g. _htons(80)). Can NOT have zero value.

◆ sin_addr

in_addr sin_addr

IP Address of the socket. The IP address is of type in_addr structure. Can be set to "0" to accept any IP address for server operation.

◆ sin_zero

uint8 sin_zero[8]

Padding to make structure the same size as sockaddr.


WINC3400 IoT Software APIs: tstr1xAuthCredentials Struct Reference

Data Fields
tstr1xAuthCredentials Struct Reference

Data Fields

uint8 au8UserName [M2M_1X_USR_NAME_MAX]
uint8 au8Passwd [M2M_1X_PWD_MAX]
uint8 __PAD__ [__PADDING_tstr1xAuthCredentials_]

Detailed Description

This struct stores the credentials for the user to authenticate with the AAA server (WPA-Enterprise Mode IEEE802.1x).

Field Documentation

◆ au8UserName

uint8 au8UserName[M2M_1X_USR_NAME_MAX]

User Name. It must be Null terminated string.

◆ au8Passwd

uint8 au8Passwd[M2M_1X_PWD_MAX]

Password corresponding to the user name. It must be Null terminated string.

◆ __PAD__

uint8 __PAD__[__PADDING_tstr1xAuthCredentials_]


WINC3400 IoT Software APIs: tstrEthInitParam Struct Reference

Data Fields
tstrEthInitParam Struct Reference

Data Fields

tpfAppWifiCb pfAppWifiCb
tpfAppEthCb pfAppEthCb
uint8 * au8ethRcvBuf
uint16 u16ethRcvBufSize

Detailed Description

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.

See also
tpfAppEthCb tpfAppWifiCb m2m_wifi_init

Field Documentation

◆ pfAppWifiCb

tpfAppWifiCb pfAppWifiCb

Callback for wifi notifications.

◆ pfAppEthCb

tpfAppEthCb pfAppEthCb

Callback for Ethernet interface.

◆ au8ethRcvBuf

uint8* au8ethRcvBuf

Pointer to Receive Buffer of Ethernet Packet

◆ u16ethRcvBufSize

uint16 u16ethRcvBufSize

Size of Receive Buffer for Ethernet Packet


WINC3400 IoT Software APIs: tstrM2MAPConfig Struct Reference

Data Fields
tstrM2MAPConfig Struct Reference

Data Fields

uint8 au8SSID [M2M_MAX_SSID_LEN]
uint8 u8ListenChannel
uint8 u8KeyIndx
uint8 u8KeySz
uint8 | au8WepKey [WEP_104_KEY_STRING_SIZE+1]
uint8 u8SecType
uint8 u8SsidHide
uint8 | au8DHCPServerIP [4]
uint8 | __PAD24__ [3]

Detailed Description

This structure holds the configuration parameters for the AP mode. It should be set by the application when it requests to enable the AP operation mode. The AP mode currently supports only OPEN and WEP security.

Field Documentation

◆ au8SSID

uint8 au8SSID[M2M_MAX_SSID_LEN]

AP SSID

◆ u8ListenChannel

uint8 u8ListenChannel

Wi-Fi RF Channel which the AP will operate on

◆ u8KeyIndx

uint8 u8KeyIndx

WEP key index

◆ u8KeySz

uint8 u8KeySz

WEP key size

◆ au8WepKey

uint8 au8WepKey[WEP_104_KEY_STRING_SIZE+1]

WEP key

◆ u8SecType

uint8 u8SecType

Security type: OPEN or WEP

◆ u8SsidHide

uint8 u8SsidHide

SSID Status "Hidden(1)/Visible(0)"

◆ au8DHCPServerIP

uint8 au8DHCPServerIP[4]

AP DHCP server address

◆ __PAD24__

uint8 __PAD24__[3]

Padding bytes for forcing alignment

Generated on Fri Aug 18 2017 00:42:03 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: tstrM2mBatteryVoltage Struct Reference

Data Fields
tstrM2mBatteryVoltage Struct Reference

Data Fields

uint16 u16BattVolt
uint8 __PAD16__ [2]

Detailed Description

This struct stores the battery voltage.

Field Documentation

◆ u16BattVolt

uint16 u16BattVolt

Battery Voltage

◆ __PAD16__

uint8 __PAD16__[2]

Padding bytes for forcing 4-byte alignment


WINC3400 IoT Software APIs: tstrM2mBleApiMsg Struct Reference

Data Fields
tstrM2mBleApiMsg Struct Reference

Data Fields

uint16 u16Len
uint8 data []

Detailed Description

This struct contains a BLE message.

Field Documentation

◆ u16Len

uint16 u16Len

Length of the message

◆ data

uint8 data[]


WINC3400 IoT Software APIs: tstrM2MBLEInfo Struct Reference

Data Fields
tstrM2MBLEInfo Struct Reference

Data Fields

uint8 u8AuthType
uint8 u8Ch
uint8 au8SSID [M2M_MAX_SSID_LEN]
uint8 au8PSK [M2M_MAX_PSK_LEN]
uint8 __PAD__ [__PADDING_tstrM2MBLEInfo_]

Detailed Description

BLE Result.

This struct is passed to the application in response to a BLE request. If the BLE session is completed successfully, the structure will have Non-ZERO authentication type. If the BLE Session fails (due to error or timeout) the authentication type is set to ZERO.

See also
tenuM2mSecType

Field Documentation

◆ u8AuthType

uint8 u8AuthType

Network authentication type.

◆ u8Ch

uint8 u8Ch

RF Channel for the AP.

◆ au8SSID

uint8 au8SSID[M2M_MAX_SSID_LEN]

SSID obtained from BLE provisioning.

◆ au8PSK

uint8 au8PSK[M2M_MAX_PSK_LEN]

PSK for the network obtained from BLE provisioning.

◆ __PAD__

uint8 __PAD__[__PADDING_tstrM2MBLEInfo_]


WINC3400 IoT Software APIs: tstrM2mClientState Struct Reference

Data Fields
tstrM2mClientState Struct Reference

Data Fields

uint8 u8State
uint8 __PAD24__ [3]

Detailed Description

This struct contains the information for the PS Client state.

Field Documentation

◆ u8State

uint8 u8State

PS Client State

◆ __PAD24__

uint8 __PAD24__[3]

Padding bytes for forcing 4-byte alignment


WINC3400 IoT Software APIs: tstrM2MConnInfo Struct Reference

Data Fields
tstrM2MConnInfo Struct Reference

Data Fields

char | acSSID [M2M_MAX_SSID_LEN]
uint8 u8SecType
uint8 | au8IPAddr [4]
uint8 | au8MACAddress [6]
sint8 s8RSSI
uint8 | __PAD24__ [3]

Detailed Description

This struct contains the connection information.

Field Documentation

◆ acSSID

char acSSID[M2M_MAX_SSID_LEN]

AP connection SSID name

◆ u8SecType

uint8 u8SecType

Security type

◆ au8IPAddr

uint8 au8IPAddr[4]

Connection IP address

◆ au8MACAddress

uint8 au8MACAddress[6]

MAC address of the peer Wi-Fi station

◆ s8RSSI

sint8 s8RSSI

Connection RSSI signal

◆ __PAD24__

uint8 __PAD24__[3]

Padding bytes for forcing 4-byte alignment


WINC3400 IoT Software APIs: tstrM2MDefaultConnResp Struct Reference

Data Fields
tstrM2MDefaultConnResp Struct Reference

Data Fields

sint8 s8ErrorCode
uint8 __PAD24__ [3]

Detailed Description

This struct contains the response error of m2m_default_connect.

See also
M2M_DEFAULT_CONN_SCAN_MISMATCH M2M_DEFAULT_CONN_EMPTY_LIST

Field Documentation

◆ s8ErrorCode

sint8 s8ErrorCode

Default connect error code. possible values are:

  • M2M_DEFAULT_CONN_EMPTY_LIST
  • M2M_DEFAULT_CONN_SCAN_MISMATCH

◆ __PAD24__

uint8 __PAD24__[3]


WINC3400 IoT Software APIs: tstrM2MDeviceNameConfig Struct Reference

Data Fields
tstrM2MDeviceNameConfig Struct Reference

Data Fields

uint8 au8DeviceName [M2M_DEVICE_NAME_MAX]

Detailed Description

This struct contains the Device Name of the WINC. It is used mainly for Wi-Fi Direct device discovery and WPS device information.

Field Documentation

◆ au8DeviceName

uint8 au8DeviceName[M2M_DEVICE_NAME_MAX]

NULL terminated device name

Generated on Fri Aug 18 2017 00:42:03 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: tstrM2mEnableLogs Struct Reference

Data Fields
tstrM2mEnableLogs Struct Reference

Data Fields

uint8 u8Enable
uint8 __PAD24__ [3]

Detailed Description

This struct stores logging information.

Field Documentation

◆ u8Enable

uint8 u8Enable

Enable/Disable firmware logs

◆ __PAD24__

uint8 __PAD24__[3]

Padding bytes for forcing 4-byte alignment


WINC3400 IoT Software APIs: tstrM2MGainTable Struct Reference

Data Fields
tstrM2MGainTable Struct Reference

Data Fields

uint8 u8GainTable
uint8 __PAD24___ [3]

Detailed Description

This struct contains the information of the gain table index from flash to be used.

Field Documentation

◆ u8GainTable

uint8 u8GainTable

Gain Table offset.

◆ __PAD24___

uint8 __PAD24___[3]

Padding bytes for forcing 4-byte alignment


WINC3400 IoT Software APIs: tstrM2MGainTableRsp Struct Reference

Data Fields
tstrM2MGainTableRsp Struct Reference

Data Fields

sint8 s8ErrorCode
uint8 __PAD24__ [3]

Detailed Description

This struct contains response when the firmware has failed to configure the gains from flash.

Field Documentation

◆ s8ErrorCode

sint8 s8ErrorCode

Error Code.

◆ __PAD24__

uint8 __PAD24__[3]

Padding bytes for forcing 4-byte alignment


WINC3400 IoT Software APIs: tstrM2MIPConfig Struct Reference

Data Fields
tstrM2MIPConfig Struct Reference

Data Fields

uint32 u32StaticIP
uint32 u32Gateway
uint32 u32DNS
uint32 u32SubnetMask

Detailed Description

This struct contains the static IP configuration.

Note
All member IP addresses are expressed in Network Byte Order (eg. "192.168.10.1" will be expressed as 0x010AA8C0).

Field Documentation

◆ u32StaticIP

uint32 u32StaticIP

The static IP assigned to the device.

◆ u32Gateway

uint32 u32Gateway

IP of the default internet gateway.

◆ u32DNS

uint32 u32DNS

IP for the DNS server.

◆ u32SubnetMask

uint32 u32SubnetMask

Subnet mask for the local area network.


WINC3400 IoT Software APIs: tstrM2mIpCtrlBuf Struct Reference

Data Fields
tstrM2mIpCtrlBuf Struct Reference

Data Fields

uint16 u16DataSize
uint16 u16RemainigDataSize

Detailed Description

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.

The application is expected to use this structure's information to determine if there is still incoming data to be received from the firmware.

See also
tpfAppEthCb tstrEthInitParam
Warning
Make sure that bypass mode is defined before using tstrM2mIpCtrlBuf

Field Documentation

◆ u16DataSize

uint16 u16DataSize

Size of the received data in bytes.

◆ u16RemainigDataSize

uint16 u16RemainigDataSize

Size of the remaining data bytes to be delivered to host.


WINC3400 IoT Software APIs: tstrM2mIpRsvdPkt Struct Reference

Data Fields
tstrM2mIpRsvdPkt Struct Reference

Data Fields

uint16 u16PktSz
uint16 u16PktOffset

Detailed Description

This struct contains the size and data offset for the received packet.

Field Documentation

◆ u16PktSz

uint16 u16PktSz

◆ u16PktOffset

uint16 u16PktOffset


WINC3400 IoT Software APIs: tstrM2mLsnInt Struct Reference

Data Fields
tstrM2mLsnInt Struct Reference

Data Fields

uint16 u16LsnInt
uint8 __PAD16__ [2]

Detailed Description

This struct contains the Listen Interval. It is the value of the Wi-Fi StA Listen Interval when power save is enabled. It is given in units of Beacon period. It is the number of Beacon periods the WINC can sleep before it wakes up to receive data buffered for it in the AP.

Field Documentation

◆ u16LsnInt

uint16 u16LsnInt

Listen interval in Beacon period count.

◆ __PAD16__

uint8 __PAD16__[2]

Padding bytes for forcing 4-byte alignment


WINC3400 IoT Software APIs: tstrM2MMulticastMac Struct Reference

Data Fields
tstrM2MMulticastMac Struct Reference

Data Fields

uint8 au8macaddress [M2M_MAC_ADDRES_LEN]
uint8 u8AddRemove
uint8 __PAD8__

Detailed Description

This struct contains the information from the Multicast filter.

Field Documentation

◆ au8macaddress

uint8 au8macaddress[M2M_MAC_ADDRES_LEN]

Mac address needed to be added or removed from filter.

◆ u8AddRemove

uint8 u8AddRemove

Set by 1 to add or 0 to remove from filter.

◆ __PAD8__

uint8 __PAD8__

Padding bytes for forcing 4-byte alignment


WINC3400 IoT Software APIs: tstrM2MP2PConnect Struct Reference

Data Fields
tstrM2MP2PConnect Struct Reference

Data Fields

uint8 u8ListenChannel
uint8 __PAD24__ [3]

Detailed Description

This struct contains the Listen Channel for P2P connect.

Field Documentation

◆ u8ListenChannel

uint8 u8ListenChannel

P2P Listen Channel (1, 6 or 11)

◆ __PAD24__

uint8 __PAD24__[3]

Padding bytes for forcing 4-byte alignment


WINC3400 IoT Software APIs: tstrM2MProvisionInfo Struct Reference

Data Fields
tstrM2MProvisionInfo Struct Reference

Data Fields

uint8 au8SSID [M2M_MAX_SSID_LEN]
uint8 au8Password [M2M_MAX_PSK_LEN]
uint8 u8SecType
uint8 u8Status

Detailed Description

This struct contains the provisioning information obtained from the HTTP Provisioning server.

Field Documentation

◆ au8SSID

uint8 au8SSID[M2M_MAX_SSID_LEN]

Provisioned SSID.

◆ au8Password

uint8 au8Password[M2M_MAX_PSK_LEN]

Provisioned Password.

◆ u8SecType

uint8 u8SecType

Wifi Security type.

◆ u8Status

uint8 u8Status

Provisioning status. To be checked before reading the provisioning information. It may be

  • M2M_SUCCESS : Provision successful.
  • M2M_FAIL : Provision Failed.


WINC3400 IoT Software APIs: tstrM2MProvisionModeConfig Struct Reference

Data Fields
tstrM2MProvisionModeConfig Struct Reference

Data Fields

tstrM2MAPConfig strApConfig
char | acHttpServerDomainName [64]
uint8 u8EnableRedirect
uint8 | __PAD24__ [3]

Detailed Description

This struct contains the provisioning mode configuration.

Field Documentation

◆ strApConfig

tstrM2MAPConfig strApConfig

Configuration parameters for the WiFi AP.

◆ acHttpServerDomainName

char acHttpServerDomainName[64]

The device domain name for HTTP provisioning.

◆ u8EnableRedirect

uint8 u8EnableRedirect

A flag to enable/disable HTTP redirect feature for the HTTP provisioning server. If the redirect is enabled, all HTTP traffic (http://URL) from the device associated with WINC AP will be redirected to the HTTP Provisioning web page.

  • 0 : Disable HTTP Redirect.
  • 1 : Enable HTTP Redirect.

◆ __PAD24__

uint8 __PAD24__[3]


WINC3400 IoT Software APIs: tstrM2mPsType Struct Reference

Data Fields
tstrM2mPsType Struct Reference

Data Fields

uint8 u8PsType
uint8 u8BcastEn
uint8 __PAD16__ [2]

Detailed Description

This struct contains the Power Save configuration.

See also
tenuPowerSaveModes

Field Documentation

◆ u8PsType

uint8 u8PsType

Power save operating mode

◆ u8BcastEn

uint8 u8BcastEn

Broadcast Enable/Disable

◆ __PAD16__

uint8 __PAD16__[2]

Padding bytes for forcing 4-byte alignment


WINC3400 IoT Software APIs: tstrM2mPwrMode Struct Reference

Data Fields
tstrM2mPwrMode Struct Reference

Data Fields

uint8 u8PwrMode
uint8 __PAD24__ [3]

Field Documentation

◆ u8PwrMode

uint8 u8PwrMode

Power Save Mode

◆ __PAD24__

uint8 __PAD24__[3]

Padding bytes for forcing 4-byte alignment


WINC3400 IoT Software APIs: tstrM2mPwrState Struct Reference

tstrM2mPwrState Struct Reference

Detailed Description

This struct stores the Power Save modes.


WINC3400 IoT Software APIs: tstrM2mReqScanResult Struct Reference

Data Fields
tstrM2mReqScanResult Struct Reference

Data Fields

uint8 u8Index
uint8 __PAD24__ [3]

Detailed Description

The Wi-Fi Scan results list is stored in firmware. This struct contains the index by which the application can request a certain scan result.

Field Documentation

◆ u8Index

uint8 u8Index

Index of the desired scan result

◆ __PAD24__

uint8 __PAD24__[3]

Padding bytes for forcing 4-byte alignment


WINC3400 IoT Software APIs: tstrM2MScan Struct Reference

Data Fields
tstrM2MScan Struct Reference

Data Fields

uint8 u8ChNum
uint8 __PAD24__ [3]

Detailed Description

This struct contains the Wi-Fi scan request.

See also
tenuM2mScanCh

Field Documentation

◆ u8ChNum

uint8 u8ChNum

The Wi-Fi RF channel number

◆ __PAD24__

uint8 __PAD24__[3]

Padding bytes for forcing 4-byte alignment


WINC3400 IoT Software APIs: tstrM2mScanDone Struct Reference

Data Fields
tstrM2mScanDone Struct Reference

Data Fields

uint8 u8NumofCh
sint8 s8ScanState
uint8 __PAD16__ [2]

Detailed Description

This struct contains the Wi-Fi scan result.

Field Documentation

◆ u8NumofCh

uint8 u8NumofCh

Number of found APs

◆ s8ScanState

sint8 s8ScanState

Scan status

◆ __PAD16__

uint8 __PAD16__[2]

Padding bytes for forcing 4-byte alignment


WINC3400 IoT Software APIs: tstrM2MScanOption Struct Reference

Data Fields
tstrM2MScanOption Struct Reference

Data Fields

uint8 u8NumOfSlot
uint8 u8SlotTime
uint8 u8ProbesPerSlot
sint8 s8RssiThresh
uint16 u16PassiveScanTime
uint8 __PAD16__ [2]

Detailed Description

This struct contains the configuration options for Wi-Fi scan.

Field Documentation

◆ u8NumOfSlot

uint8 u8NumOfSlot

The number of scan slots per channel. Refers to both active and passive scan. Valid settings are in the range 0<Slots<=255. Default setting is M2M_SCAN_DEFAULT_NUM_SLOTS.

◆ u8SlotTime

uint8 u8SlotTime

The length of each scan slot in milliseconds. Refers to active scan only. The device listens for probe responses and beacons during this time. Valid settings are in the range 10<=SlotTime<=250. Default setting is M2M_SCAN_DEFAULT_SLOT_TIME.

◆ u8ProbesPerSlot

uint8 u8ProbesPerSlot

Number of probe requests to be sent each scan slot. Refers to active scan only. Valid settings are in the range 0<Probes<=2. Default setting is M2M_SCAN_DEFAULT_NUM_PROBE.

◆ s8RssiThresh

sint8 s8RssiThresh

The Received Signal Strength Indicator threshold required for (fast) reconnection to an AP without scanning all channels first. Refers to active scan as part of reconnection to a previously connected AP. The device connects to the target AP immediately if it receives a sufficiently strong probe response on the expected channel. Low thresholds facilitate fast reconnection. High thresholds facilitate connection to the strongest signal. Valid settings are in the range -128<=Thresh<0. Default setting is M2M_FASTCONNECT_DEFAULT_RSSI_THRESH.

◆ u16PassiveScanTime

uint16 u16PassiveScanTime

The length of each scan slot in milliseconds. Refers to passive scan only. The device listens for beacons during this time. Valid settings are in the range 10<=PassiveScanTime<=1200. Default setting is M2M_SCAN_DEFAULT_PASSIVE_SLOT_TIME.

◆ __PAD16__

uint8 __PAD16__[2]

Padding bytes for forcing 4-byte alignment


WINC3400 IoT Software APIs: tstrM2MScanRegion Struct Reference

Data Fields
tstrM2MScanRegion Struct Reference

Data Fields

uint16 u16ScanRegion
uint8 __PAD16__ [2]

Detailed Description

This struct contains the Wi-Fi information for the channel regions.

See also
tenuM2mScanRegion

Field Documentation

◆ u16ScanRegion

uint16 u16ScanRegion

◆ __PAD16__

uint8 __PAD16__[2]

Padding bytes for forcing 4-byte alignment


WINC3400 IoT Software APIs: tstrM2Mservercmd Struct Reference

Data Fields
tstrM2Mservercmd Struct Reference

Data Fields

uint8 u8cmd
uint8 __PAD24__ [3]

Detailed Description

This struct contains the information for the PS Server command.

Field Documentation

◆ u8cmd

uint8 u8cmd

PS Server Cmd

◆ __PAD24__

uint8 __PAD24__[3]

Padding bytes for forcing 4-byte alignment


WINC3400 IoT Software APIs: tstrM2mServerInit Struct Reference

Data Fields
tstrM2mServerInit Struct Reference

Data Fields

uint8 u8Channel
uint8 __PAD24__ [3]

Detailed Description

This struct contains the information for the PS Server initialization.

Field Documentation

◆ u8Channel

uint8 u8Channel

Server Listen channel

◆ __PAD24__

uint8 __PAD24__[3]

Padding bytes for forcing 4-byte alignment


WINC3400 IoT Software APIs: tstrM2mSetMacAddress Struct Reference

Data Fields
tstrM2mSetMacAddress Struct Reference

Data Fields

uint8 | au8Mac [6]
uint8 | __PAD16__ [2]

Detailed Description

This struct contains the MAC address to be used. The WINC loads the mac address from the efuse by default to the WINC configuration memory, however, the application can overwrite the configuration memory with the mac address indicated from the Host.

Note
It's recommended to call this only once before calling connect request and after the m2m_wifi_init

Field Documentation

◆ au8Mac

uint8 au8Mac[6]

MAC address

◆ __PAD16__

uint8 __PAD16__[2]

Padding bytes for forcing 4-byte alignment


WINC3400 IoT Software APIs: tstrM2mSlpReqTime Struct Reference

Data Fields
tstrM2mSlpReqTime Struct Reference

Data Fields

uint32 u32SleepTime

Detailed Description

This struct contains the sleep time for the Power Save request.

Field Documentation

◆ u32SleepTime

uint32 u32SleepTime

Sleep time in ms

Generated on Fri Aug 18 2017 00:42:03 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: tstrM2mTxPwrLevel Struct Reference

Data Fields
tstrM2mTxPwrLevel Struct Reference

Data Fields

uint8 u8TxPwrLevel
uint8 __PAD24__ [3]

Detailed Description

This struct stores the Tx Power levels.

Field Documentation

◆ u8TxPwrLevel

uint8 u8TxPwrLevel

Tx power level

◆ __PAD24__

uint8 __PAD24__[3]

Padding bytes for forcing 4-byte alignment


WINC3400 IoT Software APIs: tstrM2mWifiConnect Struct Reference

Data Fields
tstrM2mWifiConnect Struct Reference

Data Fields

tstrM2MWifiSecInfo strSec
uint16 u16Ch
uint8 au8SSID [M2M_MAX_SSID_LEN]
uint8 u8NoSaveCred
uint8 __PAD__ [__CONN_PAD_SIZE__]

Detailed Description

This struct stores the Wi-Fi connect request.

Field Documentation

◆ strSec

tstrM2MWifiSecInfo strSec

Security parameters for authenticating with the AP.

◆ u16Ch

uint16 u16Ch

RF Channel for the target SSID.

◆ au8SSID

uint8 au8SSID[M2M_MAX_SSID_LEN]

SSID of the desired AP. It must be NULL terminated string.

◆ u8NoSaveCred

uint8 u8NoSaveCred

◆ __PAD__

uint8 __PAD__[__CONN_PAD_SIZE__]

Padding bytes for forcing 4-byte alignment


WINC3400 IoT Software APIs: tstrM2MWifiMonitorModeCtrl Struct Reference

Data Fields
tstrM2MWifiMonitorModeCtrl Struct Reference

Data Fields

uint8 u8ChannelID
uint8 u8FrameType
uint8 u8FrameSubtype
uint8 | au8SrcMacAddress [6]
uint8 | au8DstMacAddress [6]
uint8 | au8BSSID [6]
uint8 u8EnRecvHdr
uint8 | __PAD16__ [2]

Detailed Description

This struct contains the Wi-Fi Monitor Mode Filter. It sets the filtering criteria for WLAN packets when monitoring mode is enabled. The received packets matching the filtering parameters, are passed directly to the application.

Field Documentation

◆ u8ChannelID

uint8 u8ChannelID

RF Channel ID. It must use values from tenuM2mScanCh

◆ u8FrameType

uint8 u8FrameType

It must use values from tenuWifiFrameType.

◆ u8FrameSubtype

uint8 u8FrameSubtype

It must use values from tenuSubTypes.

◆ au8SrcMacAddress

uint8 au8SrcMacAddress[6]

ZERO means DO NOT FILTER Source address.

◆ au8DstMacAddress

uint8 au8DstMacAddress[6]

ZERO means DO NOT FILTER Destination address.

◆ au8BSSID

uint8 au8BSSID[6]

ZERO means DO NOT FILTER BSSID.

◆ u8EnRecvHdr

uint8 u8EnRecvHdr

Enable recv the full header before the payload

◆ __PAD16__

uint8 __PAD16__[2]

Padding bytes for forcing 4-byte alignment

Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: tstrM2MWifiRxPacketInfo Struct Reference

Data Fields
tstrM2MWifiRxPacketInfo Struct Reference

Data Fields

uint8 u8FrameType
uint8 u8FrameSubtype
uint8 u8ServiceClass
uint8 u8Priority
uint8 u8HeaderLength
uint8 u8CipherType
uint8 | au8SrcMacAddress [6]
uint8 | au8DstMacAddress [6]
uint8 | au8BSSID [6]
uint16 u16DataLength
uint16 u16FrameLength
uint32 u32DataRateKbps
sint8 s8RSSI
uint8 | __PAD24__ [3]

Detailed Description

This struct contains the Wi-Fi RX Frame Header. The M2M application has the ability to allow Wi-Fi monitoring mode for receiving all Wi-Fi Raw frames matching a well defined filtering criteria. When a target Wi-Fi packet is received, the header information are extracted and assigned in this structure.

Field Documentation

◆ u8FrameType

uint8 u8FrameType

It must use values from tenuWifiFrameType.

◆ u8FrameSubtype

uint8 u8FrameSubtype

It must use values from tenuSubTypes.

◆ u8ServiceClass

uint8 u8ServiceClass

Service class from Wi-Fi header.

◆ u8Priority

uint8 u8Priority

Priority from Wi-Fi header.

◆ u8HeaderLength

uint8 u8HeaderLength

Frame Header length.

◆ u8CipherType

uint8 u8CipherType

Encryption type for the rx packet.

◆ au8SrcMacAddress

uint8 au8SrcMacAddress[6]

ZERO means DO NOT FILTER Source address.

◆ au8DstMacAddress

uint8 au8DstMacAddress[6]

ZERO means DO NOT FILTER Destination address.

◆ au8BSSID

uint8 au8BSSID[6]

ZERO means DO NOT FILTER BSSID.

◆ u16DataLength

uint16 u16DataLength

Data payload length (Header excluded).

◆ u16FrameLength

uint16 u16FrameLength

Total frame length (Header + Data).

◆ u32DataRateKbps

uint32 u32DataRateKbps

Data Rate in Kbps.

◆ s8RSSI

sint8 s8RSSI

RSSI.

◆ __PAD24__

uint8 __PAD24__[3]

Padding bytes for forcing 4-byte alignment

Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: tstrM2mWifiscanResult Struct Reference

Data Fields
tstrM2mWifiscanResult Struct Reference

Data Fields

uint8 u8index
sint8 s8rssi
uint8 u8AuthType
uint8 u8ch
uint8 au8BSSID [6]
uint8 au8SSID [M2M_MAX_SSID_LEN]
uint8 _PAD8_

Detailed Description

This struct contains the information corresponding to an AP in the scan result list identified by its order (index) in the list.

Field Documentation

◆ u8index

uint8 u8index

AP index in the scan result list.

◆ s8rssi

sint8 s8rssi

AP signal strength.

◆ u8AuthType

uint8 u8AuthType

AP authentication type.

◆ u8ch

uint8 u8ch

AP RF channel.

◆ au8BSSID

uint8 au8BSSID[6]

BSSID of the AP.

◆ au8SSID

uint8 au8SSID[M2M_MAX_SSID_LEN]

AP SSID.

◆ _PAD8_

uint8 _PAD8_

Padding bytes for forcing 4-byte alignment

Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: tstrM2MWifiSecInfo Struct Reference

Data Fields
tstrM2MWifiSecInfo Struct Reference

Data Fields

tuniM2MWifiAuth uniAuth
uint8 u8SecType
uint8 __PAD__ [__PADDING__]

Detailed Description

This struct stores the authentication credentials to connect to a Wi-Fi network.

Field Documentation

◆ uniAuth

tuniM2MWifiAuth uniAuth

Union holding all possible authentication parameters corresponding the current security types.

◆ u8SecType

uint8 u8SecType

Wi-Fi network security type. See tenuM2mSecType for supported security types.

◆ __PAD__

uint8 __PAD__[__PADDING__]

Padding bytes for forcing 4-byte alignment

Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: tstrM2mWifiStateChanged Struct Reference

Data Fields
tstrM2mWifiStateChanged Struct Reference

Data Fields

uint8 u8CurrState
uint8 u8ErrCode
uint8 __PAD16__ [2]

Detailed Description

This struct contains the Wi-Fi connection state.

See also
M2M_WIFI_DISCONNECTED, M2M_WIFI_CONNECTED, M2M_WIFI_REQ_CON_STATE_CHANGED

Field Documentation

◆ u8CurrState

uint8 u8CurrState

Current Wi-Fi connection state

◆ u8ErrCode

uint8 u8ErrCode

Error type

◆ __PAD16__

uint8 __PAD16__[2]

Padding bytes for forcing 4-byte alignment

Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: tstrM2MWifiTxPacketInfo Struct Reference

Data Fields
tstrM2MWifiTxPacketInfo Struct Reference

Data Fields

uint16 u16PacketSize
uint16 u16HeaderLength

Detailed Description

This struct contains the Wi-Fi TX Packet Info. The M2M Application has the ability to compose raw Wi-Fi frames (under the application responsibility). When transmitting a Wi-Fi packet, the application must supply the firmware with this structure for sending the target frame.

Field Documentation

◆ u16PacketSize

uint16 u16PacketSize

Wlan frame length.

◆ u16HeaderLength

uint16 u16HeaderLength

Wlan frame header length.

Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: tstrM2mWifiWepParams Struct Reference

Data Fields
tstrM2mWifiWepParams Struct Reference

Data Fields

uint8 u8KeyIndx
uint8 u8KeySz
uint8 | au8WepKey [WEP_104_KEY_STRING_SIZE+1]
uint8 | __PAD24__ [3]

Detailed Description

This struct stores the WEP security key parameters.

Field Documentation

◆ u8KeyIndx

uint8 u8KeyIndx

WEP key Index.

◆ u8KeySz

uint8 u8KeySz

WEP key Size.

◆ au8WepKey

uint8 au8WepKey[WEP_104_KEY_STRING_SIZE+1]

WEP Key represented as a NULL terminated ASCII string.

◆ __PAD24__

uint8 __PAD24__[3]

Padding bytes to keep the structure word alligned.

Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: tstrM2MWPSConnect Struct Reference

Data Fields
tstrM2MWPSConnect Struct Reference

Data Fields

uint8 u8TriggerType
char | acPinNumber [8]
uint8 | __PAD24__ [3]

Detailed Description

This struct stores the WPS configuration parameters.

See also
tenuWPSTrigger

Field Documentation

◆ u8TriggerType

uint8 u8TriggerType

WPS triggering method (Push button or PIN)

◆ acPinNumber

char acPinNumber[8]

WPS PIN No (for PIN method)

◆ __PAD24__

uint8 __PAD24__[3]

Padding bytes for forcing 4-byte alignment

Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: tstrM2MWPSInfo Struct Reference

Data Fields
tstrM2MWPSInfo Struct Reference

Data Fields

uint8 u8AuthType
uint8 u8Ch
uint8 au8SSID [M2M_MAX_SSID_LEN]
uint8 au8PSK [M2M_MAX_PSK_LEN]
uint8 __PAD__ [__PADDING_tstrM2MWPSInfo_]

Detailed Description

WPS Result.

This struct is passed to the application in response to a WPS request. If the WPS session is completed successfully, the structure will have Non-ZERO authentication type. If the WPS Session fails (due to error or timeout) the authentication type is set to ZERO.

See also
tenuM2mSecType

Field Documentation

◆ u8AuthType

uint8 u8AuthType

Network authentication type.

◆ u8Ch

uint8 u8Ch

RF Channel for the AP.

◆ au8SSID

uint8 au8SSID[M2M_MAX_SSID_LEN]

SSID obtained from WPS.

◆ au8PSK

uint8 au8PSK[M2M_MAX_PSK_LEN]

PSK for the network obtained from WPS.

◆ __PAD__

uint8 __PAD__[__PADDING_tstrM2MWPSInfo_]
Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: tstrOtaControlSec Struct Reference

Data Fields
tstrOtaControlSec Struct Reference

Data Fields

uint32 u32OtaMagicValue
uint32 u32OtaFormatVersion
uint32 u32OtaSequenceNumber
uint32 u32OtaLastCheckTime
uint32 u32OtaCurrentworkingImagOffset
uint32 u32OtaCurrentworkingImagFirmwareVer
uint32 u32OtaCurrentworkingImagHifVer
uint32 u32OtaRollbackImageOffset
uint32 u32OtaRollbackImageValidStatus
uint32 u32OtaRollbackImagFirmwareVer
uint32 u32OtaRollbackImagHifVer
uint32 u32OtaCortusAppWorkingOffset
uint32 u32OtaCortusAppWorkingValidSts
uint32 u32OtaCortusAppWorkingVer
uint32 u32OtaCortusAppRollbackOffset
uint32 u32OtaCortusAppRollbackValidSts
uint32 u32OtaCortusAppRollbackVer
uint32 u32OtaControlSecCrc

Detailed Description

This struct contains the Control Section. The Control Section is used to define the working image and the validity of the roll-back image and its offset, also both firmware versions is kept in that structure.

Field Documentation

◆ u32OtaMagicValue

uint32 u32OtaMagicValue

Magic value used to ensure the structure is valid or not.

◆ u32OtaFormatVersion

uint32 u32OtaFormatVersion

Control structure format version, the value will be incremented in case of structure changed or updated.

◆ u32OtaSequenceNumber

uint32 u32OtaSequenceNumber

Sequence number is used while update the control structure to keep track of how many times that section updated.

◆ u32OtaLastCheckTime

uint32 u32OtaLastCheckTime

Last time OTA check for update.

◆ u32OtaCurrentworkingImagOffset

uint32 u32OtaCurrentworkingImagOffset

Current working offset in flash.

◆ u32OtaCurrentworkingImagFirmwareVer

uint32 u32OtaCurrentworkingImagFirmwareVer

Current working image firmware version [Major/Product ID/Minor/Patch]

◆ u32OtaCurrentworkingImagHifVer

uint32 u32OtaCurrentworkingImagHifVer

Current working image HIF version

◆ u32OtaRollbackImageOffset

uint32 u32OtaRollbackImageOffset

Roll-back image offset in flash.

◆ u32OtaRollbackImageValidStatus

uint32 u32OtaRollbackImageValidStatus

Roll-back image valid status.

◆ u32OtaRollbackImagFirmwareVer

uint32 u32OtaRollbackImagFirmwareVer

Roll-back image firmware version [Major/Product ID/Minor/Patch]

◆ u32OtaRollbackImagHifVer

uint32 u32OtaRollbackImagHifVer

Roll-back working image HIF version

◆ u32OtaCortusAppWorkingOffset

uint32 u32OtaCortusAppWorkingOffset

Cortus app working offset in flash.

◆ u32OtaCortusAppWorkingValidSts

uint32 u32OtaCortusAppWorkingValidSts

Working Cortus app valid status.

◆ u32OtaCortusAppWorkingVer

uint32 u32OtaCortusAppWorkingVer

Working cortus app version (ex 1.0.1)

◆ u32OtaCortusAppRollbackOffset

uint32 u32OtaCortusAppRollbackOffset

Ccortus app rollback offset in flash.

◆ u32OtaCortusAppRollbackValidSts

uint32 u32OtaCortusAppRollbackValidSts

Roll-back cortus app valid status

◆ u32OtaCortusAppRollbackVer

uint32 u32OtaCortusAppRollbackVer

Roll-back cortus app version (ex 18.0.1)

◆ u32OtaControlSecCrc

uint32 u32OtaControlSecCrc

CRC for the control structure to ensure validity

Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: tstrOtaInitHdr Struct Reference

Data Fields
tstrOtaInitHdr Struct Reference

Data Fields

uint32 u32OtaMagicValue
uint32 u32OtaPayloadSzie

Detailed Description

This struct contains the OTA image header.

Field Documentation

◆ u32OtaMagicValue

uint32 u32OtaMagicValue

Magic value kept in the OTA image after the sha256 Digest buffer to define the Start of OTA Header.

◆ u32OtaPayloadSzie

uint32 u32OtaPayloadSzie

The Total OTA image payload size, include the sha256 key size.

Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: tstrOtaUpdateInfo Struct Reference

Data Fields
tstrOtaUpdateInfo Struct Reference

Data Fields

uint32 u8NcfUpgradeVersion
uint32 u8NcfCurrentVersion
uint32 u8NcdUpgradeVersion
uint8 u8NcdRequiredUpgrade
uint8 u8DownloadUrlOffset
uint8 u8DownloadUrlSize
uint8 __PAD8__

Detailed Description

This struct contains the OTA update information.

See also
tenuWPSTrigger

Field Documentation

◆ u8NcfUpgradeVersion

uint32 u8NcfUpgradeVersion

NCF OTA Upgrade Version

◆ u8NcfCurrentVersion

uint32 u8NcfCurrentVersion

NCF OTA Current firmware version

◆ u8NcdUpgradeVersion

uint32 u8NcdUpgradeVersion

NCD (host) upgraded version (if the u8NcdRequiredUpgrade == true)

◆ u8NcdRequiredUpgrade

uint8 u8NcdRequiredUpgrade

NCD Required upgrade to the above version

◆ u8DownloadUrlOffset

uint8 u8DownloadUrlOffset

Download URL offset in the received packet

◆ u8DownloadUrlSize

uint8 u8DownloadUrlSize

Download URL size in the received packet

◆ __PAD8__

uint8 __PAD8__

Padding bytes for forcing 4-byte alignment

Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: tstrOtaUpdateStatusResp Struct Reference

Data Fields
tstrOtaUpdateStatusResp Struct Reference

Data Fields

uint8 u8OtaUpdateStatusType
uint8 u8OtaUpdateStatus
uint8 _PAD16_ [2]

Detailed Description

This struct contains the OTA update status.

See also
tenuWPSTrigger

Field Documentation

◆ u8OtaUpdateStatusType

uint8 u8OtaUpdateStatusType

Status type tenuOtaUpdateStatusType

◆ u8OtaUpdateStatus

uint8 u8OtaUpdateStatus

OTA_SUCCESS OTA_ERR_WORKING_IMAGE_LOAD_FAIL OTA_ERR_INVAILD_CONTROL_SEC M2M_ERR_OTA_SWITCH_FAIL M2M_ERR_OTA_START_UPDATE_FAIL M2M_ERR_OTA_ROLLBACK_FAIL M2M_ERR_OTA_INVAILD_FLASH_SIZE M2M_ERR_OTA_INVAILD_ARG

◆ _PAD16_

uint8 _PAD16_[2]
Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: tstrPrng Struct Reference

Data Fields
tstrPrng Struct Reference

Data Fields

uint8 * pu8RngBuff
uint16 u16PrngSize
uint8 __PAD16__ [2]

Detailed Description

M2M Request PRNG.

Field Documentation

◆ pu8RngBuff

uint8* pu8RngBuff

< return buffer address PRNG size requested

◆ u16PrngSize

uint16 u16PrngSize

PRNG pads

◆ __PAD16__

uint8 __PAD16__[2]
Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: tstrRootCertEcdsaKeyInfo Struct Reference

Data Fields
tstrRootCertEcdsaKeyInfo Struct Reference

Data Fields

uint16 u16CurveID
uint16 u16KeySz

Detailed Description

Info about a ECDSA public key.

Field Documentation

◆ u16CurveID

uint16 u16CurveID

Elliptic curve ID.

◆ u16KeySz

uint16 u16KeySz

Elliptic curve coordinate length.

Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: tstrRootCertEntryHeader Struct Reference

Data Fields
tstrRootCertEntryHeader Struct Reference

Data Fields

uint8 au8SHA1NameHash [20]
tstrSystemTime strExpDate
tstrRootCertPubKeyInfo strPubKey

Detailed Description

Header of a root certificate entry in flash.

Field Documentation

◆ au8SHA1NameHash

uint8 au8SHA1NameHash[20]

SHA1 digest of root certificate issuer name. Used as entry identifier.

◆ strExpDate

tstrSystemTime strExpDate

Expiry date of root certificate.

◆ strPubKey

tstrRootCertPubKeyInfo strPubKey

Info about root certificate public key.

Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: tstrRootCertFlashHeader Struct Reference

Data Fields
tstrRootCertFlashHeader Struct Reference

Data Fields

uint8 au8StartPattern [16]
uint32 u32nCerts

Detailed Description

Header of the root certificate flash storage area.

Field Documentation

◆ au8StartPattern

uint8 au8StartPattern[16]

Start pattern of root certificate flash store.

◆ u32nCerts

uint32 u32nCerts

Number of entries in root certificate flash store.

Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: tstrRootCertPubKeyInfo Struct Reference

Data Fields
tstrRootCertPubKeyInfo Struct Reference

Data Fields

uint32 u32PubKeyType
union {
tstrRootCertRsaKeyInfo strRsaKeyInfo
tstrRootCertEcdsaKeyInfo strEcsdaKeyInfo
};

Detailed Description

Info about the public key contained in a root certificate.

Field Documentation

◆ u32PubKeyType

uint32 u32PubKeyType

Public key type.

See also
tenuRootCertPubKeyType.

◆ strRsaKeyInfo

tstrRootCertRsaKeyInfo strRsaKeyInfo

Info about an RSA public key.

◆ strEcsdaKeyInfo

tstrRootCertEcdsaKeyInfo strEcsdaKeyInfo

Info about an ECDSA public key.

◆ @1

union { ... }

Union of RSA / ECDSA public key info structures.

Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: tstrRootCertRsaKeyInfo Struct Reference

Data Fields
tstrRootCertRsaKeyInfo Struct Reference

Data Fields

uint16 u16NSz
uint16 u16ESz

Detailed Description

Info about a RSA public key.

Field Documentation

◆ u16NSz

uint16 u16NSz

Modulus length.

◆ u16ESz

uint16 u16ESz

Public exponent length.

Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: tstrSocketAcceptMsg Struct Reference

Data Fields
tstrSocketAcceptMsg Struct Reference

Data Fields

SOCKET sock
struct sockaddr_in strAddr

Detailed Description

Socket accept status.

Socket accept information is returned through this structure in response to the asynchronous call to the accept function. This structure together with the event SOCKET_MSG_ACCEPT are passed-in parameters to the callback function.

Field Documentation

◆ sock

SOCKET sock

On a successful accept operation, the return information is the socket ID for the accepted connection with the remote peer. Otherwise a negative error code is returned to indicate failure of the accept operation.

◆ strAddr

struct sockaddr_in strAddr

Socket address structure for the remote peer.

Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: tstrSocketBindMsg Struct Reference

Data Fields
tstrSocketBindMsg Struct Reference

Data Fields

sint8 status

Detailed Description

Socket bind status.

An asynchronous call to the bind socket operation, returns information through this structure in response. This structure together with the event SOCKET_MSG_BIND are passed in parameters to the callback function.

See also
bind

Field Documentation

◆ status

sint8 status

The result of the bind operation. Holding a value of ZERO for a successful bind or otherwise a negative error code corresponding to Error Codes.

Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: tstrSocketConnectMsg Struct Reference

Data Fields
tstrSocketConnectMsg Struct Reference

Data Fields

SOCKET sock
sint8 s8Error

Detailed Description

Socket connect status.

Socket connect information is returned through this structure in response to the asynchronous call to the connect socket function. This structure together with the event SOCKET_MSG_CONNECT are passed-in parameters to the callback function. If the application receives this structure with a negative value in s8Error, the application should call close().

Field Documentation

◆ sock

SOCKET sock

Socket ID referring to the socket passed to the connect function call.

◆ s8Error

sint8 s8Error

Connect error code. Holding a value of ZERO for a successful connect or otherwise a negative error code corresponding to the type of error.

Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: tstrSocketListenMsg Struct Reference

Data Fields
tstrSocketListenMsg Struct Reference

Data Fields

sint8 status

Detailed Description

Socket listen status.

Socket listen information is returned through this structure in response to the asynchronous call to the listen function. This structure together with the event SOCKET_MSG_LISTEN are passed-in parameters to the callback function.

See also
listen

Field Documentation

◆ status

sint8 status

Holding a value of ZERO for a successful listen or otherwise a negative error code corresponding to Error Codes.

Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: tstrSocketRecvMsg Struct Reference

Data Fields
tstrSocketRecvMsg Struct Reference

Data Fields

uint8 * pu8Buffer
sint16 s16BufferSize
uint16 u16RemainingSize
struct sockaddr_in strRemoteAddr

Detailed Description

Socket recv status.

Socket receive information is returned through this structure in response to the asynchronous call to the recv or recvfrom socket functions. This structure together with the events SOCKET_MSG_RECV or SOCKET_MSG_RECVFROM are passed-in parameters to the callback function.

Remarks
In case the received data from the remote peer is larger than the USER buffer size defined during the asynchronous call to the recv function, only data up to the buffer size is delivered to the user. The user must call recv again in order to receive the remaining data. A negative or zero buffer size indicates an error with the following code: SOCK_ERR_NO_ERROR : Socket connection closed. The application should now call close(). SOCK_ERR_CONN_ABORTED : Socket connection aborted. The application should now call close(). SOCK_ERR_TIMEOUT : Socket receive timed out. The socket connection remains open.

Field Documentation

◆ pu8Buffer

uint8* pu8Buffer

Pointer to the USER buffer (passed to recv and recvfrom function) containing the received data chunk.

◆ s16BufferSize

sint16 s16BufferSize

The received data chunk size. Holds a negative value if there is a receive error or ZERO on success upon reception of close socket message.

◆ u16RemainingSize

uint16 u16RemainingSize

The number of bytes remaining in the current recv operation.

◆ strRemoteAddr

struct sockaddr_in strRemoteAddr

Socket address structure for the remote peer. It is valid for SOCKET_MSG_RECVFROM event.

Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: tstrSslSetActiveCsList Struct Reference

Data Fields
tstrSslSetActiveCsList Struct Reference

Data Fields

uint32 u32CsBMP

Field Documentation

◆ u32CsBMP

uint32 u32CsBMP
Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: tstrSystemTime Struct Reference

Data Fields
tstrSystemTime Struct Reference

Data Fields

uint16 u16Year
uint8 u8Month
uint8 u8Day
uint8 u8Hour
uint8 u8Minute
uint8 u8Second
uint8 __PAD__ [__PADDING_tstrSystemTime_]

Detailed Description

This struct contains the system time.

Field Documentation

◆ u16Year

uint16 u16Year

Year

◆ u8Month

uint8 u8Month

Month

◆ u8Day

uint8 u8Day

Day

◆ u8Hour

uint8 u8Hour

Hour

◆ u8Minute

uint8 u8Minute

Minutes

◆ u8Second

uint8 u8Second

Seconds

◆ __PAD__

uint8 __PAD__[__PADDING_tstrSystemTime_]

Structure padding.

Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: tstrTlsSrvChunkHdr Struct Reference

Data Fields
tstrTlsSrvChunkHdr Struct Reference

Data Fields

uint16 u16Sig
uint16 u16TotalSize32
uint16 u16Offset32
uint16 u16Size32

Field Documentation

◆ u16Sig

uint16 u16Sig

◆ u16TotalSize32

uint16 u16TotalSize32

◆ u16Offset32

uint16 u16Offset32

◆ u16Size32

uint16 u16Size32
Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: tstrTlsSrvSecFileEntry Struct Reference

Data Fields
tstrTlsSrvSecFileEntry Struct Reference

Data Fields

char acFileName [TLS_FILE_NAME_MAX]
uint32 u32FileSize
uint32 u32FileAddr

Detailed Description

This struct contains a TLS certificate.

Field Documentation

◆ acFileName

char acFileName[TLS_FILE_NAME_MAX]

Name of the certificate.

◆ u32FileSize

uint32 u32FileSize

Size of the certificate.

◆ u32FileAddr

uint32 u32FileAddr

Error Code.

Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: tstrTlsSrvSecHdr Struct Reference

Data Fields
tstrTlsSrvSecHdr Struct Reference

Data Fields

uint8 au8SecStartPattern [TLS_SRV_SEC_START_PATTERN_LEN]
uint32 u32nEntries
uint32 u32NextWriteAddr
tstrTlsSrvSecFileEntry astrEntries [TLS_SRV_SEC_MAX_FILES]
uint32 u32CRC

Detailed Description

This struct contains a set of TLS certificates.

Field Documentation

◆ au8SecStartPattern

uint8 au8SecStartPattern[TLS_SRV_SEC_START_PATTERN_LEN]

Start pattern.

◆ u32nEntries

uint32 u32nEntries

Number of certificates stored in the struct.

◆ u32NextWriteAddr

uint32 u32NextWriteAddr

◆ astrEntries

tstrTlsSrvSecFileEntry astrEntries[TLS_SRV_SEC_MAX_FILES]

TLS Certificate headers.

◆ u32CRC

uint32 u32CRC

CRC32 of entire cert block, only the cert writer computes this, the FW just does a compare with replacement blocks.

Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: tstrWifiInitParam Struct Reference

Data Fields
tstrWifiInitParam Struct Reference

Data Fields

tpfAppWifiCb pfAppWifiCb
tpfAppMonCb pfAppMonCb
tstrEthInitParam strEthInitParam
uint8 GainTableIndex
uint8 __PAD24__ [3]

Detailed Description

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.

Field Documentation

◆ pfAppWifiCb

tpfAppWifiCb pfAppWifiCb

Callback for Wi-Fi notifications.

◆ pfAppMonCb

tpfAppMonCb pfAppMonCb

Callback for monitoring interface.

◆ strEthInitParam

tstrEthInitParam strEthInitParam

Structure to hold Ethernet interface parameters.

◆ GainTableIndex

uint8 GainTableIndex

Gain Table index to be used to configure the WiFi and BLE gains.

◆ __PAD24__

uint8 __PAD24__[3]

Padding bytes for forcing 4-byte alignment

Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: tuniM2MWifiAuth Union Reference

Data Fields
tuniM2MWifiAuth Union Reference

Data Fields

uint8 au8PSK [M2M_MAX_PSK_LEN]
tstr1xAuthCredentials strCred1x
tstrM2mWifiWepParams strWepInfo
uint8 __PAD__ [__PADDING_tuniM2MWifiAuth_]

Detailed Description

This struct stores the Wi-Fi Security Parameters for all supported security modes.

Field Documentation

◆ au8PSK

uint8 au8PSK[M2M_MAX_PSK_LEN]

Pre-Shared Key in case of WPA-Personal security.

◆ strCred1x

tstr1xAuthCredentials strCred1x

Credentials for RADIUS server authentication in case of WPA-Enterprise security.

◆ strWepInfo

tstrM2mWifiWepParams strWepInfo

WEP key parameters in case of WEP security.

◆ __PAD__

uint8 __PAD__[__PADDING_tuniM2MWifiAuth_]
Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: Data Fields

Here is a list of all struct and union fields with links to the structures/unions they belong to:

- _ -

  • __PAD16__ : tstrM2mBatteryVoltage , tstrM2mLsnInt , tstrM2mPsType , tstrM2mScanDone , tstrM2MScanOption , tstrM2MScanRegion , tstrM2mSetMacAddress , tstrM2MWifiMonitorModeCtrl , tstrM2mWifiStateChanged , tstrPrng
  • __PAD24__ : tstrM2MAPConfig , tstrM2mClientState , tstrM2MConnInfo , tstrM2MDefaultConnResp , tstrM2mEnableLogs , tstrM2MGainTableRsp , tstrM2MP2PConnect , tstrM2MProvisionModeConfig , tstrM2mPwrMode , tstrM2mReqScanResult , tstrM2MScan , tstrM2Mservercmd , tstrM2mServerInit , tstrM2mTxPwrLevel , tstrM2MWifiRxPacketInfo , tstrM2mWifiWepParams , tstrM2MWPSConnect , tstrWifiInitParam
  • __PAD24___ : tstrM2MGainTable
  • __PAD8__ : tstrM2MMulticastMac , tstrOtaUpdateInfo
  • __PAD__ : tstr1xAuthCredentials , tstrM2MBLEInfo , tstrM2mWifiConnect , tstrM2MWifiSecInfo , tstrM2MWPSInfo , tstrSystemTime , tuniM2MWifiAuth
  • _PAD16_ : tstrOtaUpdateStatusResp
  • _PAD8_ : tstrM2mWifiscanResult
Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: Data Fields

Here is a list of all struct and union fields with links to the structures/unions they belong to:

- a -

  • acFileName : tstrTlsSrvSecFileEntry
  • acHttpServerDomainName : tstrM2MProvisionModeConfig
  • acPinNumber : tstrM2MWPSConnect
  • acSSID : tstrM2MConnInfo
  • astrEntries : tstrTlsSrvSecHdr
  • au8BSSID : tstrM2MWifiMonitorModeCtrl , tstrM2MWifiRxPacketInfo , tstrM2mWifiscanResult
  • au8DeviceName : tstrM2MDeviceNameConfig
  • au8DHCPServerIP : tstrM2MAPConfig
  • au8DstMacAddress : tstrM2MWifiMonitorModeCtrl , tstrM2MWifiRxPacketInfo
  • au8ethRcvBuf : tstrEthInitParam
  • au8IPAddr : tstrM2MConnInfo
  • au8Mac : tstrM2mSetMacAddress
  • au8MACAddress : tstrM2MConnInfo
  • au8macaddress : tstrM2MMulticastMac
  • au8Passwd : tstr1xAuthCredentials
  • au8Password : tstrM2MProvisionInfo
  • au8PSK : tstrM2MBLEInfo , tstrM2MWPSInfo , tuniM2MWifiAuth
  • au8SecStartPattern : tstrTlsSrvSecHdr
  • au8SHA1NameHash : tstrRootCertEntryHeader
  • au8SrcMacAddress : tstrM2MWifiMonitorModeCtrl , tstrM2MWifiRxPacketInfo
  • au8SSID : tstrM2MAPConfig , tstrM2MBLEInfo , tstrM2MProvisionInfo , tstrM2mWifiConnect , tstrM2mWifiscanResult , tstrM2MWPSInfo
  • au8StartPattern : tstrRootCertFlashHeader
  • au8UserName : tstr1xAuthCredentials
  • au8WepKey : tstrM2MAPConfig , tstrM2mWifiWepParams
Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: Data Fields

Here is a list of all struct and union fields with links to the structures/unions they belong to:

- d -

  • data : tstrM2mBleApiMsg
Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: Data Fields

Here is a list of all struct and union fields with links to the structures/unions they belong to:

- e -

  • enuRW : tstrDataAccessInitParamsApp
Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: Data Fields

Here is a list of all struct and union fields with links to the structures/unions they belong to:

- g -

  • GainTableIndex : tstrWifiInitParam
Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: Data Fields

Here is a list of all struct and union fields with links to the structures/unions they belong to:

- p -

  • pfAppEthCb : tstrEthInitParam
  • pfAppMonCb : tstrWifiInitParam
  • pfAppWifiCb : tstrEthInitParam , tstrWifiInitParam
  • pu8Buffer : tstrSocketRecvMsg
  • pu8Data : tstrDataAccessParamsApp
  • pu8RngBuff : tstrPrng
Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: Data Fields

Here is a list of all struct and union fields with links to the structures/unions they belong to:

- s -

  • s16BufferSize : tstrSocketRecvMsg
  • s8Error : tstrSocketConnectMsg
  • s8ErrorCode : tstrM2MDefaultConnResp , tstrM2MGainTableRsp
  • s8RSSI : tstrM2MConnInfo , tstrM2MWifiRxPacketInfo
  • s8rssi : tstrM2mWifiscanResult
  • s8RssiThresh : tstrM2MScanOption
  • s8ScanState : tstrM2mScanDone
  • s_addr : in_addr
  • sa_data : sockaddr
  • sa_family : sockaddr
  • sin_addr : sockaddr_in
  • sin_family : sockaddr_in
  • sin_port : sockaddr_in
  • sin_zero : sockaddr_in
  • sock : tstrSocketAcceptMsg , tstrSocketConnectMsg
  • status : tstrSocketBindMsg , tstrSocketListenMsg
  • strAddr : tstrSocketAcceptMsg
  • strApConfig : tstrM2MProvisionModeConfig
  • strCred1x : tuniM2MWifiAuth
  • strEcsdaKeyInfo : tstrRootCertPubKeyInfo
  • strEthInitParam : tstrWifiInitParam
  • strExpDate : tstrRootCertEntryHeader
  • strPubKey : tstrRootCertEntryHeader
  • strRemoteAddr : tstrSocketRecvMsg
  • strRsaKeyInfo : tstrRootCertPubKeyInfo
  • strSec : tstrM2mWifiConnect
  • strWepInfo : tuniM2MWifiAuth
Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: Data Fields

Here is a list of all struct and union fields with links to the structures/unions they belong to:

- u -

  • u16BattVolt : tstrM2mBatteryVoltage
  • u16Ch : tstrM2mWifiConnect
  • u16CurveID : tstrRootCertEcdsaKeyInfo
  • u16DataLength : tstrM2MWifiRxPacketInfo
  • u16DataSize : tstrM2mIpCtrlBuf
  • u16ESz : tstrRootCertRsaKeyInfo
  • u16ethRcvBufSize : tstrEthInitParam
  • u16FrameLength : tstrM2MWifiRxPacketInfo
  • u16HeaderLength : tstrM2MWifiTxPacketInfo
  • u16KeySz : tstrRootCertEcdsaKeyInfo
  • u16LastAccessId : tstrFlashState
  • u16Len : tstrM2mBleApiMsg
  • u16LsnInt : tstrM2mLsnInt
  • u16NSz : tstrRootCertRsaKeyInfo
  • u16Offset32 : tstrTlsSrvChunkHdr
  • u16PacketSize : tstrM2MWifiTxPacketInfo
  • u16PassiveScanTime : tstrM2MScanOption
  • u16PktOffset : tstrM2mIpRsvdPkt
  • u16PktSz : tstrM2mIpRsvdPkt
  • u16PrngSize : tstrPrng
  • u16RemainigDataSize : tstrM2mIpCtrlBuf
  • u16RemainingSize : tstrSocketRecvMsg
  • u16ScanRegion : tstrM2MScanRegion
  • u16Sig : tstrTlsSrvChunkHdr
  • u16Size32 : tstrTlsSrvChunkHdr
  • u16TotalSize32 : tstrTlsSrvChunkHdr
  • u16Year : tstrSystemTime
  • u32CRC : tstrTlsSrvSecHdr
  • u32CsBMP : tstrSslSetActiveCsList
  • u32DataRateKbps : tstrM2MWifiRxPacketInfo
  • u32DataSize : tstrDataAccessParamsApp
  • u32DNS : tstrM2MIPConfig
  • u32FileAddr : tstrTlsSrvSecFileEntry
  • u32FileSize : tstrTlsSrvSecFileEntry
  • u32Gateway : tstrM2MIPConfig
  • u32nCerts : tstrRootCertFlashHeader
  • u32nEntries : tstrTlsSrvSecHdr
  • u32NextWriteAddr : tstrTlsSrvSecHdr
  • u32OtaControlSecCrc : tstrOtaControlSec
  • u32OtaCortusAppRollbackOffset : tstrOtaControlSec
  • u32OtaCortusAppRollbackValidSts : tstrOtaControlSec
  • u32OtaCortusAppRollbackVer : tstrOtaControlSec
  • u32OtaCortusAppWorkingOffset : tstrOtaControlSec
  • u32OtaCortusAppWorkingValidSts : tstrOtaControlSec
  • u32OtaCortusAppWorkingVer : tstrOtaControlSec
  • u32OtaCurrentworkingImagFirmwareVer : tstrOtaControlSec
  • u32OtaCurrentworkingImagHifVer : tstrOtaControlSec
  • u32OtaCurrentworkingImagOffset : tstrOtaControlSec
  • u32OtaFormatVersion : tstrOtaControlSec
  • u32OtaLastCheckTime : tstrOtaControlSec
  • u32OtaMagicValue : tstrOtaControlSec , tstrOtaInitHdr
  • u32OtaPayloadSzie : tstrOtaInitHdr
  • u32OtaRollbackImageOffset : tstrOtaControlSec
  • u32OtaRollbackImageValidStatus : tstrOtaControlSec
  • u32OtaRollbackImagFirmwareVer : tstrOtaControlSec
  • u32OtaRollbackImagHifVer : tstrOtaControlSec
  • u32OtaSequenceNumber : tstrOtaControlSec
  • u32PubKeyType : tstrRootCertPubKeyInfo
  • u32SleepTime : tstrM2mSlpReqTime
  • u32StaticIP : tstrM2MIPConfig
  • u32SubnetMask : tstrM2MIPConfig
  • u32TotalSize : tstrDataAccessInitParamsApp
  • u8AddRemove : tstrM2MMulticastMac
  • u8AuthType : tstrM2MBLEInfo , tstrM2mWifiscanResult , tstrM2MWPSInfo
  • u8BcastEn : tstrM2mPsType
  • u8Ch : tstrM2MBLEInfo
  • u8ch : tstrM2mWifiscanResult
  • u8Ch : tstrM2MWPSInfo
  • u8Changed : tstrFlashState
  • u8Channel : tstrM2mServerInit
  • u8ChannelID : tstrM2MWifiMonitorModeCtrl
  • u8ChNum : tstrM2MScan
  • u8CipherType : tstrM2MWifiRxPacketInfo
  • u8cmd : tstrM2Mservercmd
  • u8CurrState : tstrM2mWifiStateChanged
  • u8Day : tstrSystemTime
  • u8DownloadUrlOffset : tstrOtaUpdateInfo
  • u8DownloadUrlSize : tstrOtaUpdateInfo
  • u8Enable : tstrM2mEnableLogs
  • u8EnableRedirect : tstrM2MProvisionModeConfig
  • u8EnRecvHdr : tstrM2MWifiMonitorModeCtrl
  • u8ErrCode : tstrM2mWifiStateChanged
  • u8FrameSubtype : tstrM2MWifiMonitorModeCtrl , tstrM2MWifiRxPacketInfo
  • u8FrameType : tstrM2MWifiMonitorModeCtrl , tstrM2MWifiRxPacketInfo
  • u8GainTable : tstrM2MGainTable
  • u8HeaderLength : tstrM2MWifiRxPacketInfo
  • u8Hour : tstrSystemTime
  • u8Index : tstrM2mReqScanResult
  • u8index : tstrM2mWifiscanResult
  • u8Init : tstrFlashState
  • u8KeyIndx : tstrM2MAPConfig , tstrM2mWifiWepParams
  • u8KeySz : tstrM2MAPConfig , tstrM2mWifiWepParams
  • u8ListenChannel : tstrM2MAPConfig , tstrM2MP2PConnect
  • u8Minute : tstrSystemTime
  • u8Month : tstrSystemTime
  • u8NcdRequiredUpgrade : tstrOtaUpdateInfo
  • u8NcdUpgradeVersion : tstrOtaUpdateInfo
  • u8NcfCurrentVersion : tstrOtaUpdateInfo
  • u8NcfUpgradeVersion : tstrOtaUpdateInfo
  • u8NoSaveCred : tstrM2mWifiConnect
  • u8NumofCh : tstrM2mScanDone
  • u8NumOfSlot : tstrM2MScanOption
  • u8OtaUpdateStatus : tstrOtaUpdateStatusResp
  • u8OtaUpdateStatusType : tstrOtaUpdateStatusResp
  • u8Priority : tstrM2MWifiRxPacketInfo
  • u8ProbesPerSlot : tstrM2MScanOption
  • u8PsType : tstrM2mPsType
  • u8PwrMode : tstrM2mPwrMode
  • u8Reset : tstrFlashState
  • u8Second : tstrSystemTime
  • u8SecType : tstrM2MAPConfig , tstrM2MConnInfo , tstrM2MProvisionInfo , tstrM2MWifiSecInfo
  • u8ServiceClass : tstrM2MWifiRxPacketInfo
  • u8SlotTime : tstrM2MScanOption
  • u8SsidHide : tstrM2MAPConfig
  • u8State : tstrM2mClientState
  • u8Status : tstrM2MProvisionInfo
  • u8Success : tstrFlashState
  • u8TriggerType : tstrM2MWPSConnect
  • u8TxPwrLevel : tstrM2mTxPwrLevel
  • uniAuth : tstrM2MWifiSecInfo
Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: Data Fields - Variables

- _ -

  • __PAD16__ : tstrM2mBatteryVoltage , tstrM2mLsnInt , tstrM2mPsType , tstrM2mScanDone , tstrM2MScanOption , tstrM2MScanRegion , tstrM2mSetMacAddress , tstrM2MWifiMonitorModeCtrl , tstrM2mWifiStateChanged , tstrPrng
  • __PAD24__ : tstrM2MAPConfig , tstrM2mClientState , tstrM2MConnInfo , tstrM2MDefaultConnResp , tstrM2mEnableLogs , tstrM2MGainTableRsp , tstrM2MP2PConnect , tstrM2MProvisionModeConfig , tstrM2mPwrMode , tstrM2mReqScanResult , tstrM2MScan , tstrM2Mservercmd , tstrM2mServerInit , tstrM2mTxPwrLevel , tstrM2MWifiRxPacketInfo , tstrM2mWifiWepParams , tstrM2MWPSConnect , tstrWifiInitParam
  • __PAD24___ : tstrM2MGainTable
  • __PAD8__ : tstrM2MMulticastMac , tstrOtaUpdateInfo
  • __PAD__ : tstr1xAuthCredentials , tstrM2MBLEInfo , tstrM2mWifiConnect , tstrM2MWifiSecInfo , tstrM2MWPSInfo , tstrSystemTime , tuniM2MWifiAuth
  • _PAD16_ : tstrOtaUpdateStatusResp
  • _PAD8_ : tstrM2mWifiscanResult
Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: Data Fields - Variables

- a -

  • acFileName : tstrTlsSrvSecFileEntry
  • acHttpServerDomainName : tstrM2MProvisionModeConfig
  • acPinNumber : tstrM2MWPSConnect
  • acSSID : tstrM2MConnInfo
  • astrEntries : tstrTlsSrvSecHdr
  • au8BSSID : tstrM2MWifiMonitorModeCtrl , tstrM2MWifiRxPacketInfo , tstrM2mWifiscanResult
  • au8DeviceName : tstrM2MDeviceNameConfig
  • au8DHCPServerIP : tstrM2MAPConfig
  • au8DstMacAddress : tstrM2MWifiMonitorModeCtrl , tstrM2MWifiRxPacketInfo
  • au8ethRcvBuf : tstrEthInitParam
  • au8IPAddr : tstrM2MConnInfo
  • au8Mac : tstrM2mSetMacAddress
  • au8MACAddress : tstrM2MConnInfo
  • au8macaddress : tstrM2MMulticastMac
  • au8Passwd : tstr1xAuthCredentials
  • au8Password : tstrM2MProvisionInfo
  • au8PSK : tstrM2MBLEInfo , tstrM2MWPSInfo , tuniM2MWifiAuth
  • au8SecStartPattern : tstrTlsSrvSecHdr
  • au8SHA1NameHash : tstrRootCertEntryHeader
  • au8SrcMacAddress : tstrM2MWifiMonitorModeCtrl , tstrM2MWifiRxPacketInfo
  • au8SSID : tstrM2MAPConfig , tstrM2MBLEInfo , tstrM2MProvisionInfo , tstrM2mWifiConnect , tstrM2mWifiscanResult , tstrM2MWPSInfo
  • au8StartPattern : tstrRootCertFlashHeader
  • au8UserName : tstr1xAuthCredentials
  • au8WepKey : tstrM2MAPConfig , tstrM2mWifiWepParams
Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: Data Fields - Variables

- d -

  • data : tstrM2mBleApiMsg
Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: Data Fields - Variables

- e -

  • enuRW : tstrDataAccessInitParamsApp
Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: Data Fields - Variables

- g -

  • GainTableIndex : tstrWifiInitParam
Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: Data Fields - Variables

- p -

  • pfAppEthCb : tstrEthInitParam
  • pfAppMonCb : tstrWifiInitParam
  • pfAppWifiCb : tstrEthInitParam , tstrWifiInitParam
  • pu8Buffer : tstrSocketRecvMsg
  • pu8Data : tstrDataAccessParamsApp
  • pu8RngBuff : tstrPrng
Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: Data Fields - Variables

- s -

  • s16BufferSize : tstrSocketRecvMsg
  • s8Error : tstrSocketConnectMsg
  • s8ErrorCode : tstrM2MDefaultConnResp , tstrM2MGainTableRsp
  • s8RSSI : tstrM2MConnInfo , tstrM2MWifiRxPacketInfo
  • s8rssi : tstrM2mWifiscanResult
  • s8RssiThresh : tstrM2MScanOption
  • s8ScanState : tstrM2mScanDone
  • s_addr : in_addr
  • sa_data : sockaddr
  • sa_family : sockaddr
  • sin_addr : sockaddr_in
  • sin_family : sockaddr_in
  • sin_port : sockaddr_in
  • sin_zero : sockaddr_in
  • sock : tstrSocketAcceptMsg , tstrSocketConnectMsg
  • status : tstrSocketBindMsg , tstrSocketListenMsg
  • strAddr : tstrSocketAcceptMsg
  • strApConfig : tstrM2MProvisionModeConfig
  • strCred1x : tuniM2MWifiAuth
  • strEcsdaKeyInfo : tstrRootCertPubKeyInfo
  • strEthInitParam : tstrWifiInitParam
  • strExpDate : tstrRootCertEntryHeader
  • strPubKey : tstrRootCertEntryHeader
  • strRemoteAddr : tstrSocketRecvMsg
  • strRsaKeyInfo : tstrRootCertPubKeyInfo
  • strSec : tstrM2mWifiConnect
  • strWepInfo : tuniM2MWifiAuth
Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: Data Fields - Variables

- u -

  • u16BattVolt : tstrM2mBatteryVoltage
  • u16Ch : tstrM2mWifiConnect
  • u16CurveID : tstrRootCertEcdsaKeyInfo
  • u16DataLength : tstrM2MWifiRxPacketInfo
  • u16DataSize : tstrM2mIpCtrlBuf
  • u16ESz : tstrRootCertRsaKeyInfo
  • u16ethRcvBufSize : tstrEthInitParam
  • u16FrameLength : tstrM2MWifiRxPacketInfo
  • u16HeaderLength : tstrM2MWifiTxPacketInfo
  • u16KeySz : tstrRootCertEcdsaKeyInfo
  • u16LastAccessId : tstrFlashState
  • u16Len : tstrM2mBleApiMsg
  • u16LsnInt : tstrM2mLsnInt
  • u16NSz : tstrRootCertRsaKeyInfo
  • u16Offset32 : tstrTlsSrvChunkHdr
  • u16PacketSize : tstrM2MWifiTxPacketInfo
  • u16PassiveScanTime : tstrM2MScanOption
  • u16PktOffset : tstrM2mIpRsvdPkt
  • u16PktSz : tstrM2mIpRsvdPkt
  • u16PrngSize : tstrPrng
  • u16RemainigDataSize : tstrM2mIpCtrlBuf
  • u16RemainingSize : tstrSocketRecvMsg
  • u16ScanRegion : tstrM2MScanRegion
  • u16Sig : tstrTlsSrvChunkHdr
  • u16Size32 : tstrTlsSrvChunkHdr
  • u16TotalSize32 : tstrTlsSrvChunkHdr
  • u16Year : tstrSystemTime
  • u32CRC : tstrTlsSrvSecHdr
  • u32CsBMP : tstrSslSetActiveCsList
  • u32DataRateKbps : tstrM2MWifiRxPacketInfo
  • u32DataSize : tstrDataAccessParamsApp
  • u32DNS : tstrM2MIPConfig
  • u32FileAddr : tstrTlsSrvSecFileEntry
  • u32FileSize : tstrTlsSrvSecFileEntry
  • u32Gateway : tstrM2MIPConfig
  • u32nCerts : tstrRootCertFlashHeader
  • u32nEntries : tstrTlsSrvSecHdr
  • u32NextWriteAddr : tstrTlsSrvSecHdr
  • u32OtaControlSecCrc : tstrOtaControlSec
  • u32OtaCortusAppRollbackOffset : tstrOtaControlSec
  • u32OtaCortusAppRollbackValidSts : tstrOtaControlSec
  • u32OtaCortusAppRollbackVer : tstrOtaControlSec
  • u32OtaCortusAppWorkingOffset : tstrOtaControlSec
  • u32OtaCortusAppWorkingValidSts : tstrOtaControlSec
  • u32OtaCortusAppWorkingVer : tstrOtaControlSec
  • u32OtaCurrentworkingImagFirmwareVer : tstrOtaControlSec
  • u32OtaCurrentworkingImagHifVer : tstrOtaControlSec
  • u32OtaCurrentworkingImagOffset : tstrOtaControlSec
  • u32OtaFormatVersion : tstrOtaControlSec
  • u32OtaLastCheckTime : tstrOtaControlSec
  • u32OtaMagicValue : tstrOtaControlSec , tstrOtaInitHdr
  • u32OtaPayloadSzie : tstrOtaInitHdr
  • u32OtaRollbackImageOffset : tstrOtaControlSec
  • u32OtaRollbackImageValidStatus : tstrOtaControlSec
  • u32OtaRollbackImagFirmwareVer : tstrOtaControlSec
  • u32OtaRollbackImagHifVer : tstrOtaControlSec
  • u32OtaSequenceNumber : tstrOtaControlSec
  • u32PubKeyType : tstrRootCertPubKeyInfo
  • u32SleepTime : tstrM2mSlpReqTime
  • u32StaticIP : tstrM2MIPConfig
  • u32SubnetMask : tstrM2MIPConfig
  • u32TotalSize : tstrDataAccessInitParamsApp
  • u8AddRemove : tstrM2MMulticastMac
  • u8AuthType : tstrM2MBLEInfo , tstrM2mWifiscanResult , tstrM2MWPSInfo
  • u8BcastEn : tstrM2mPsType
  • u8Ch : tstrM2MBLEInfo
  • u8ch : tstrM2mWifiscanResult
  • u8Ch : tstrM2MWPSInfo
  • u8Changed : tstrFlashState
  • u8Channel : tstrM2mServerInit
  • u8ChannelID : tstrM2MWifiMonitorModeCtrl
  • u8ChNum : tstrM2MScan
  • u8CipherType : tstrM2MWifiRxPacketInfo
  • u8cmd : tstrM2Mservercmd
  • u8CurrState : tstrM2mWifiStateChanged
  • u8Day : tstrSystemTime
  • u8DownloadUrlOffset : tstrOtaUpdateInfo
  • u8DownloadUrlSize : tstrOtaUpdateInfo
  • u8Enable : tstrM2mEnableLogs
  • u8EnableRedirect : tstrM2MProvisionModeConfig
  • u8EnRecvHdr : tstrM2MWifiMonitorModeCtrl
  • u8ErrCode : tstrM2mWifiStateChanged
  • u8FrameSubtype : tstrM2MWifiMonitorModeCtrl , tstrM2MWifiRxPacketInfo
  • u8FrameType : tstrM2MWifiMonitorModeCtrl , tstrM2MWifiRxPacketInfo
  • u8GainTable : tstrM2MGainTable
  • u8HeaderLength : tstrM2MWifiRxPacketInfo
  • u8Hour : tstrSystemTime
  • u8Index : tstrM2mReqScanResult
  • u8index : tstrM2mWifiscanResult
  • u8Init : tstrFlashState
  • u8KeyIndx : tstrM2MAPConfig , tstrM2mWifiWepParams
  • u8KeySz : tstrM2MAPConfig , tstrM2mWifiWepParams
  • u8ListenChannel : tstrM2MAPConfig , tstrM2MP2PConnect
  • u8Minute : tstrSystemTime
  • u8Month : tstrSystemTime
  • u8NcdRequiredUpgrade : tstrOtaUpdateInfo
  • u8NcdUpgradeVersion : tstrOtaUpdateInfo
  • u8NcfCurrentVersion : tstrOtaUpdateInfo
  • u8NcfUpgradeVersion : tstrOtaUpdateInfo
  • u8NoSaveCred : tstrM2mWifiConnect
  • u8NumofCh : tstrM2mScanDone
  • u8NumOfSlot : tstrM2MScanOption
  • u8OtaUpdateStatus : tstrOtaUpdateStatusResp
  • u8OtaUpdateStatusType : tstrOtaUpdateStatusResp
  • u8Priority : tstrM2MWifiRxPacketInfo
  • u8ProbesPerSlot : tstrM2MScanOption
  • u8PsType : tstrM2mPsType
  • u8PwrMode : tstrM2mPwrMode
  • u8Reset : tstrFlashState
  • u8Second : tstrSystemTime
  • u8SecType : tstrM2MAPConfig , tstrM2MConnInfo , tstrM2MProvisionInfo , tstrM2MWifiSecInfo
  • u8ServiceClass : tstrM2MWifiRxPacketInfo
  • u8SlotTime : tstrM2MScanOption
  • u8SsidHide : tstrM2MAPConfig
  • u8State : tstrM2mClientState
  • u8Status : tstrM2MProvisionInfo
  • u8Success : tstrFlashState
  • u8TriggerType : tstrM2MWPSConnect
  • u8TxPwrLevel : tstrM2mTxPwrLevel
  • uniAuth : tstrM2MWifiSecInfo
Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: Data Structure Index

Data Structure Index
i | s | t
i
tstrM2mBleApiMsg tstrM2MProvisionModeConfig tstrM2MWifiRxPacketInfo tstrRootCertPubKeyInfo
tstrM2MBLEInfo tstrM2mPsType tstrM2mWifiscanResult tstrRootCertRsaKeyInfo
in_addr tstrM2mClientState tstrM2mPwrMode tstrM2MWifiSecInfo tstrSocketAcceptMsg
s
tstrM2MConnInfo tstrM2mPwrState tstrM2mWifiStateChanged tstrSocketBindMsg
tstrM2MDefaultConnResp tstrM2mReqScanResult tstrM2MWifiTxPacketInfo tstrSocketConnectMsg
sockaddr tstrM2MDeviceNameConfig tstrM2MScan tstrM2mWifiWepParams tstrSocketListenMsg
sockaddr_in tstrM2mEnableLogs tstrM2mScanDone tstrM2MWPSConnect tstrSocketRecvMsg
t
tstrM2MGainTable tstrM2MScanOption tstrM2MWPSInfo tstrSslSetActiveCsList
tstrM2MGainTableRsp tstrM2MScanRegion tstrOtaControlSec tstrSystemTime
tstr1xAuthCredentials tstrM2MIPConfig tstrM2Mservercmd tstrOtaInitHdr tstrTlsSrvChunkHdr
tstrDataAccessInitParamsApp tstrM2mIpCtrlBuf tstrM2mServerInit tstrOtaUpdateInfo tstrTlsSrvSecFileEntry
tstrDataAccessParamsApp tstrM2mIpRsvdPkt tstrM2mSetMacAddress tstrOtaUpdateStatusResp tstrTlsSrvSecHdr
tstrEthInitParam tstrM2mLsnInt tstrM2mSlpReqTime tstrPrng tstrWifiInitParam
tstrFlashState tstrM2MMulticastMac tstrM2mTxPwrLevel tstrRootCertEcdsaKeyInfo tuniM2MWifiAuth
tstrM2MAPConfig tstrM2MP2PConnect tstrM2mWifiConnect tstrRootCertEntryHeader
tstrM2mBatteryVoltage tstrM2MProvisionInfo tstrM2MWifiMonitorModeCtrl tstrRootCertFlashHeader
i | s | t
Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: m2m_flash.h Source File

m2m_flash.h
1
45 #ifndef __M2M_FLASH_H__
46 #define __M2M_FLASH_H__
47
48 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
49 INCLUDES
50 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
51 #include "common/include/nm_common.h"
52 #include "driver/include/m2m_types.h"
53
61 #define FLASH_UPDATEIMAGE_OPTION_UPDATE NBIT0
62
65 #define FLASH_UPDATEIMAGE_OPTION_VALIDATE NBIT1
66
69 #define FLASH_UPDATEIMAGE_OPTION_SWITCH NBIT2
70
72 #define FLASH_SUCCESS 0
73
74 #define FLASH_ERR_PARAM (-1)
75
76 #define FLASH_ERR_LOCAL_ACCESS (-2)
77
78 #define FLASH_ERR_WINC_ACCESS (-3)
79
80 #define FLASH_ERR_SIZE (-4)
81
85 #define FLASH_ERR_WINC_CONFLICT (-5)
86
87 #define FLASH_ERR_UNINIT (-6)
88
89 #define FLASH_ERR_INTERNAL (-7)
90
102 typedef enum {
105 FLASH_DATA_FN_INITIALIZE,
107 FLASH_DATA_FN_DATA,
109 FLASH_DATA_FN_TERMINATE,
111 FLASH_DATA_FN_COMPLETE
112 }tenuFlashDataFnCtl;
113
119 typedef enum {
121 FLASH_DATA_FN_READ,
123 FLASH_DATA_FN_WRITE
124 }tenuDataFnRW;
125
131 typedef enum {
133 FLASH_IMAGE_INACTIVE,
135 FLASH_IMAGE_ACTIVE
136 }tenuImageId;
137
138
237 typedef sint8 (*tpfDataAccessFn) (tenuFlashDataFnCtl enuCtl, void *pvStr);
238
247 typedef struct {
249 uint32 u32TotalSize;
251 tenuDataFnRW enuRW;
252 }tstrDataAccessInitParamsApp;
253
261 typedef struct {
263 uint8 *pu8Data;
265 uint32 u32DataSize;
266 }tstrDataAccessParamsApp;
267
275 typedef struct {
277 uint16 u16LastAccessId;
279 uint8 u8Success;
281 uint8 u8Changed;
283 uint8 u8Init;
285 uint8 u8Reset;
286 }tstrFlashState;
287
291 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
292 FUNCTION PROTOTYPES
293 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
321 sint8 m2m_flash_updateimage(uint8 u8Options, uint16 u16Id, tpfDataAccessFn pfSourceFn, uint32 u32SourceSize);
340 sint8 m2m_flash_readimage(tenuImageId enuImageId, uint16 u16Id, tpfDataAccessFn pfDestFn, uint32 u32DestSize);
382 sint8 m2m_flash_rootcert_add(uint16 u16Id, tpfDataAccessFn pfFn, uint32 u32Size);
383
400 sint8 m2m_flash_rootcert_remove(uint16 u16Id, uint8 *pu8Identifier, uint32 u32IdentifierSz);
421 sint8 m2m_flash_rootcert_read(uint16 u16Id, tpfDataAccessFn pfDestFn, uint32 u32DestSize, uint8 *pu8Identifier, uint32 u32IdentifierSz);
440 sint8 m2m_flash_rootcert_readidx(uint16 u16Id, tpfDataAccessFn pfDestFn, uint32 u32DestSize, uint8 u8Index);
441
453 void m2m_flash_get_state(tstrFlashState *pstrState);
454
455
515 sint8 m2m_flash_init(void);
516
518 #endif /* __M2M_FLASH_H__ */
tenuFlashDataFnCtl
tenuFlashDataFnCtl
Control parameter for tpfDataAccessFn.
Definition: m2m_flash.h:101
tstrDataAccessParamsApp
This structure contains data for local data access (read or write).
Definition: m2m_flash.h:260
m2m_flash_updateimage
sint8 m2m_flash_updateimage(uint8 u8Options, uint16 u16Id, tpfDataAccessFn pfSourceFn, uint32 u32SourceSize)
Write/validate/switch a WINC firmware image.
m2m_flash_get_state
void m2m_flash_get_state(tstrFlashState *pstrState)
Get information about the module current state and about the most recent access attempt.
tpfDataAccessFn
sint8(* tpfDataAccessFn)(tenuFlashDataFnCtl enuCtl, void *pvStr)
A function of this type is used for local data access. It can be implemented to handle simple RAM acc...
Definition: m2m_flash.h:236
FLASH_DATA_FN_READ
Definition: m2m_flash.h:120
tstrDataAccessInitParamsApp
This structure contains parameters for initializing a local data access (read or write).
Definition: m2m_flash.h:246
FLASH_DATA_FN_INITIALIZE
Definition: m2m_flash.h:104
tstrFlashState
This structure contains information about an attempted transfer.
Definition: m2m_flash.h:274
FLASH_DATA_FN_DATA
Definition: m2m_flash.h:106
m2m_flash_rootcert_add
sint8 m2m_flash_rootcert_add(uint16 u16Id, tpfDataAccessFn pfFn, uint32 u32Size)
Add an entry to the WINC TLS root certificate store.
uint32
unsigned long uint32
Range of values between 0 to 4294967295.
Definition: nm_bsp.h:110
m2m_flash_rootcert_remove
sint8 m2m_flash_rootcert_remove(uint16 u16Id, uint8 *pu8Identifier, uint32 u32IdentifierSz)
Remove an entry from the WINC TLS root certificate store.
FLASH_DATA_FN_TERMINATE
Definition: m2m_flash.h:108
m2m_flash_rootcert_read
sint8 m2m_flash_rootcert_read(uint16 u16Id, tpfDataAccessFn pfDestFn, uint32 u32DestSize, uint8 *pu8Identifier, uint32 u32IdentifierSz)
Read an entry from the WINC TLS root certificate store, referenced by entry identifier.
m2m_flash_readimage
sint8 m2m_flash_readimage(tenuImageId enuImageId, uint16 u16Id, tpfDataAccessFn pfDestFn, uint32 u32DestSize)
Read a WINC firmware image.
FLASH_IMAGE_ACTIVE
Definition: m2m_flash.h:134
tenuDataFnRW
tenuDataFnRW
Indicates whether data is to be read or written.
Definition: m2m_flash.h:118
tenuImageId
tenuImageId
Indicates which image to access in WINC flash.
Definition: m2m_flash.h:130
sint8
signed char sint8
Range of values between -128 to 127.
Definition: nm_bsp.h:118
m2m_flash_init
sint8 m2m_flash_init(void)
Initialize the module.
m2m_flash_rootcert_readidx
sint8 m2m_flash_rootcert_readidx(uint16 u16Id, tpfDataAccessFn pfDestFn, uint32 u32DestSize, uint8 u8Index)
Read an entry from the WINC TLS root certificate store, referenced by entry index.
FLASH_DATA_FN_WRITE
Definition: m2m_flash.h:122
FLASH_DATA_FN_COMPLETE
Definition: m2m_flash.h:110
FLASH_IMAGE_INACTIVE
Definition: m2m_flash.h:132
uint8
unsigned char uint8
Range of values between 0 to 255.
Definition: nm_bsp.h:96
uint16
unsigned short uint16
Range of values between 0 to 65535.
Definition: nm_bsp.h:103
Generated on Fri Aug 18 2017 00:42:03 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: m2m_ota.h Source File

m2m_ota.h
1
45 #ifndef __M2M_OTA_H__
46 #define __M2M_OTA_H__
47
48 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
49 INCLUDES
50 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
51
52 #include "common/include/nm_common.h"
53 #include "driver/include/m2m_types.h"
54 #include "driver/source/nmdrv.h"
55
75 typedef void (*tpfOtaNotifCb) (tstrOtaUpdateInfo * pstrOtaUpdateInfo);
76
77
97 typedef void (*tpfOtaUpdateCb) (uint8 u8OtaUpdateStatusType ,uint8 u8OtaUpdateStatus);
100 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
101 FUNCTION PROTOTYPES
102 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
106 #ifdef __cplusplus
107 extern "C" {
108 #endif
109
126 NMI_API sint8 m2m_ota_init(tpfOtaUpdateCb pfOtaUpdateCb,tpfOtaNotifCb pfOtaNotifCb);
143 NMI_API sint8 m2m_ota_notif_set_url(uint8 * u8Url);
158 NMI_API sint8 m2m_ota_notif_check_for_update(void);
178 NMI_API sint8 m2m_ota_notif_sched(uint32 u32Period);
319 NMI_API sint8 m2m_ota_start_update(uint8 * u8DownloadUrl);
344 NMI_API sint8 m2m_ota_rollback(void);
356 NMI_API sint8 m2m_ota_abort(void);
381 NMI_API sint8 m2m_ota_switch_firmware(void);
382
383 #if 0
384 NMI_API sint8 m2m_ota_test(void);
385 #endif
386
387 #ifdef __cplusplus
388 }
389 #endif
390 #endif /* __M2M_OTA_H__ */
m2m_ota_notif_set_url
NMI_API sint8 m2m_ota_notif_set_url(uint8 *u8Url)
m2m_ota_init
NMI_API sint8 m2m_ota_init(tpfOtaUpdateCb pfOtaUpdateCb, tpfOtaNotifCb pfOtaNotifCb)
tstrOtaUpdateInfo
This struct contains the OTA update information.
Definition: m2m_types.h:2189
tpfOtaNotifCb
void(* tpfOtaNotifCb)(tstrOtaUpdateInfo *pstrOtaUpdateInfo)
A callback to get notification about a potential OTA update.
Definition: m2m_ota.h:75
m2m_ota_switch_firmware
NMI_API sint8 m2m_ota_switch_firmware(void)
m2m_ota_rollback
NMI_API sint8 m2m_ota_rollback(void)
uint32
unsigned long uint32
Range of values between 0 to 4294967295.
Definition: nm_bsp.h:110
tpfOtaUpdateCb
void(* tpfOtaUpdateCb)(uint8 u8OtaUpdateStatusType, uint8 u8OtaUpdateStatus)
A callback to get OTA status update, the callback provides the download status, the switch to the dow...
Definition: m2m_ota.h:97
NMI_API
#define NMI_API
Definition: nm_bsp.h:52
m2m_ota_abort
NMI_API sint8 m2m_ota_abort(void)
sint8
signed char sint8
Range of values between -128 to 127.
Definition: nm_bsp.h:118
m2m_ota_notif_sched
NMI_API sint8 m2m_ota_notif_sched(uint32 u32Period)
m2m_ota_start_update
NMI_API sint8 m2m_ota_start_update(uint8 *u8DownloadUrl)
m2m_ota_notif_check_for_update
NMI_API sint8 m2m_ota_notif_check_for_update(void)
uint8
unsigned char uint8
Range of values between 0 to 255.
Definition: nm_bsp.h:96
Generated on Fri Aug 18 2017 00:42:03 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: m2m_ssl.h Source File

m2m_ssl.h
1
45 #ifndef __M2M_SSL_H__
46 #define __M2M_SSL_H__
47
48 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
49 INCLUDES
50 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
51
52 #include "common/include/nm_common.h"
53 #include "driver/include/m2m_types.h"
54 #include "driver/source/nmdrv.h"
55 #include "ecc_types.h"
56 #include "socket/include/socket.h"
57
71 typedef void (*tpfAppSSLCb) (uint8 u8MsgType, void * pvMsg);
72
76 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
77 FUNCTION PROTOTYPES
78 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
91 NMI_API sint8 m2m_ssl_init(tpfAppSSLCb pfAppSSLCb);
92
104 NMI_API sint8 m2m_ssl_handshake_rsp(tstrEccReqInfo* strECCResp, uint8* pu8RspDataBuff, uint16 u16RspDataSz);
105
115 NMI_API sint8 m2m_ssl_send_certs_to_winc(uint8* pu8Buffer, uint32 u32BufferSz);
116
130 NMI_API sint8 m2m_ssl_retrieve_cert(uint16* pu16CurveType, uint8* pu8Hash, uint8* pu8Sig, tstrECPoint* pu8Key);
131
141 NMI_API sint8 m2m_ssl_retrieve_hash(uint8* pu8Hash, uint16 u16HashSz);
142
149 NMI_API void m2m_ssl_stop_processing_certs(void);
150
157 NMI_API void m2m_ssl_ecc_process_done(void);
158
179 sint8 m2m_ssl_set_active_ciphersuites(uint32 u32SslCsBMP);
180
182 #endif /* __M2M_SSL_H__ */
m2m_ssl_retrieve_hash
NMI_API sint8 m2m_ssl_retrieve_hash(uint8 *pu8Hash, uint16 u16HashSz)
Retrieve the certificate hash.
m2m_ssl_handshake_rsp
NMI_API sint8 m2m_ssl_handshake_rsp(tstrEccReqInfo *strECCResp, uint8 *pu8RspDataBuff, uint16 u16RspDataSz)
Sends ECC responses to the WINC.
m2m_ssl_set_active_ciphersuites
sint8 m2m_ssl_set_active_ciphersuites(uint32 u32SslCsBMP)
m2m_ssl_retrieve_cert
NMI_API sint8 m2m_ssl_retrieve_cert(uint16 *pu16CurveType, uint8 *pu8Hash, uint8 *pu8Sig, tstrECPoint *pu8Key)
Retrieve the ECDSA certificate to be verified from the WINC.
uint32
unsigned long uint32
Range of values between 0 to 4294967295.
Definition: nm_bsp.h:110
m2m_ssl_send_certs_to_winc
NMI_API sint8 m2m_ssl_send_certs_to_winc(uint8 *pu8Buffer, uint32 u32BufferSz)
Sends certificates to the WINC.
m2m_ssl_init
NMI_API sint8 m2m_ssl_init(tpfAppSSLCb pfAppSSLCb)
m2m_ssl_stop_processing_certs
NMI_API void m2m_ssl_stop_processing_certs(void)
Allow ssl driver to tidy up in case application does not read all available certificates.
NMI_API
#define NMI_API
Definition: nm_bsp.h:52
sint8
signed char sint8
Range of values between -128 to 127.
Definition: nm_bsp.h:118
tpfAppSSLCb
void(* tpfAppSSLCb)(uint8 u8MsgType, void *pvMsg)
A callback to get SSL notifications.
Definition: m2m_ssl.h:71
m2m_ssl_ecc_process_done
NMI_API void m2m_ssl_ecc_process_done(void)
Allow ssl driver to tidy up after application has finished processing ecc message.
uint8
unsigned char uint8
Range of values between 0 to 255.
Definition: nm_bsp.h:96
uint16
unsigned short uint16
Range of values between 0 to 65535.
Definition: nm_bsp.h:103
Generated on Fri Aug 18 2017 00:42:03 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: m2m_types.h Source File

m2m_types.h
1
42 #ifndef __M2M_WIFI_TYPES_H__
43 #define __M2M_WIFI_TYPES_H__
44
45
46 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
47 INCLUDES
48 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
49
50 #ifndef _BOOT_
51 #ifndef _FIRMWARE_
52 #include "common/include/nm_common.h"
53 #else
54 #include "m2m_common.h"
55 #endif
56 #endif
57
58
59 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
60 MACROS
61 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
70 /*
71 Layout of HIF_LEVEL fields
72 | x x x x x x | x x x x x x x x |
73 | 13:8 | 7:0 |
74 | HIF_MAJOR | HIF_MINOR |
75 | HIF_LEVEL |
76
77 HIF compatibility (checked by driver after wifi boot).
78
79 Check Firmware HIF_MAJOR
80 |___
81 | Does not match Driver - Recommend either:
82 | > checking compatibility of Cortus image stored in inactive partition
83 | (m2m_wifi_check_ota_rb()) then swapping to it using OTA rollback or switch.
84 | > updating Host with out of band method.
85 |___
86 Matches Driver - All APIs can be attempted.
87 | - Cortus image can be updated (OTA download)
88 | - New Host image can be retrieved (socket recv)
89 |
90 Check Firmware HIF_MINOR
91 |___
92 | Less than Driver - Driver may refuse to execute some APIs (API would return M2M_ERR_SEND).
93 | - Recommend updating Cortus image using OTA download to use newer Firmware.
94 |___
95 | Equal to Driver - Driver supports all APIs.
96 |___
97 Greater than Driver - Driver supports all APIs.
98 - Recommend reviewing potential benefit of updating Host to use newer Driver.
99
100 When an OTA update involving HIF_MAJOR change is required, the following order is recommended:
101 1. m2m_ota_start_update() to store new Cortus image in inactive partition.
102 2. Socket recv() to retrieve new Host image (including new WINC Driver).
103 3. Application code to make Host image available in host flash.
104 4. m2m_ota_switch_firmware() to switch active/inactive partition (will take effect after system_reset()).
105 5. system_reset() to restart with new WINC Driver / Firmware.
106 Note that in the event of (unintentional) system reset after step (3), the remaining steps (4) and (5) should still be
107 run after the reset.
108 */
109 /* Selection of HIF_INFO
110 */
111 #define M2M_HIF_INFO_SHIFT (0)
112 #define M2M_HIF_INFO_MASK (0xffff)
113 /* Subdivision of HIF_INFO
114 */
115 #define M2M_HIF_BLOCK_SHIFT (14)
116 #define M2M_HIF_BLOCK_MASK (0x3)
117 #define M2M_HIF_LEVEL_SHIFT (0)
118 #define M2M_HIF_LEVEL_MASK (0x3fff)
119 /* Subdivision of HIF_LEVEL
120 */
121 #define M2M_HIF_MAJOR_SHIFT (8)
122 #define M2M_HIF_MAJOR_MASK (0x3f)
123 #define M2M_HIF_MINOR_SHIFT (0)
124 #define M2M_HIF_MINOR_MASK (0xff)
125
126 #define M2M_GET_HIF_INFO(hif_ver) ((uint16)(((hif_ver) >> M2M_HIF_INFO_SHIFT) & M2M_HIF_INFO_MASK))
127 #define M2M_GET_HIF_BLOCK(hif_info) ((uint8)(((hif_info) >> M2M_HIF_BLOCK_SHIFT) & M2M_HIF_BLOCK_MASK))
128 #define M2M_GET_HIF_LEVEL(hif_info) ((uint16)(((hif_info) >> M2M_HIF_LEVEL_SHIFT) & M2M_HIF_LEVEL_MASK))
129 #define M2M_GET_HIF_MAJOR(hif_info) ((uint8)(((hif_info) >> M2M_HIF_MAJOR_SHIFT) & M2M_HIF_MAJOR_MASK))
130 #define M2M_GET_HIF_MINOR(hif_info) ((uint8)(((hif_info) >> M2M_HIF_MINOR_SHIFT) & M2M_HIF_MINOR_MASK))
131
132 #define M2M_MAKE_HIF_INFO(hif_level) ( \
133 (((uint16)(hif_level) & M2M_HIF_LEVEL_MASK) << M2M_HIF_LEVEL_SHIFT) | \
134 (((uint16)M2M_HIF_BLOCK_VALUE & M2M_HIF_BLOCK_MASK) << M2M_HIF_BLOCK_SHIFT) )
135
136 /*======*======*======*======*
137 HIF LEVEL
138 *======*======*======*======*/
139
140 #define M2M_HIF_BLOCK_VALUE (2)
141
143 #define M2M_HIF_MAJOR_VALUE (1)
144
146 #define M2M_HIF_MINOR_VALUE (3)
147
149 #define M2M_HIF_LEVEL ( \
150 ((M2M_HIF_MAJOR_VALUE & M2M_HIF_MAJOR_MASK) << M2M_HIF_MAJOR_SHIFT) | \
151 ((M2M_HIF_MINOR_VALUE & M2M_HIF_MINOR_MASK) << M2M_HIF_MINOR_SHIFT) \
152 )
153
156 /*======*======*======*======*
157 DRIVER VERSION NO INFO
158 *======*======*======*======*/
159
160 #define M2M_DRIVER_VERSION_MAJOR_NO (1)
161
163 #define M2M_DRIVER_VERSION_MINOR_NO (0)
164
166 #define M2M_DRIVER_VERSION_PATCH_NO (8)
167
177 #define M2M_BUFFER_MAX_SIZE (1600UL - 4)
178
182 #define M2M_MAC_ADDRES_LEN 6
183
186 #define M2M_ETHERNET_HDR_OFFSET 34
187
191 #define M2M_ETHERNET_HDR_LEN 14
192
196 #define M2M_MAX_SSID_LEN 33
197
201 #define M2M_MAX_PSK_LEN 65
202
205 #define M2M_DEVICE_NAME_MAX 48
206
210 #define M2M_LISTEN_INTERVAL 1
211
217 #define M2M_1X_USR_NAME_MAX 21
218
224 #define M2M_1X_PWD_MAX 41
225
230 #define M2M_CUST_IE_LEN_MAX 252
231
235 #define M2M_CONFIG_CMD_BASE 1
236
238 #define M2M_STA_CMD_BASE 40
239
241 #define M2M_AP_CMD_BASE 70
242
244 #define M2M_P2P_CMD_BASE 90
245
247 #define M2M_OTA_CMD_BASE 100
248
250 #define M2M_SERVER_CMD_BASE 120
251
255 #define WEP_40_KEY_STRING_SIZE ((uint8)10)
256
259 #define WEP_104_KEY_STRING_SIZE ((uint8)26)
260
262 #define WEP_KEY_MAX_INDEX ((uint8)4)
263
265 #define M2M_SCAN_DEFAULT_NUM_SLOTS (2)
266
268 #define M2M_SCAN_DEFAULT_SLOT_TIME (20)
269
271 #define M2M_SCAN_DEFAULT_PASSIVE_SLOT_TIME (300)
272
274 #define M2M_SCAN_DEFAULT_NUM_PROBE (2)
275
277 #define M2M_FASTCONNECT_DEFAULT_RSSI_THRESH (-45)
278
280 #define M2M_SCAN_FAIL ((uint8)1)
281
283 #define M2M_JOIN_FAIL ((uint8)2)
284
286 #define M2M_AUTH_FAIL ((uint8)3)
287
289 #define M2M_ASSOC_FAIL ((uint8)4)
290
293 #define M2M_SCAN_ERR_WIFI ((sint8)-2)
294
296 #define M2M_SCAN_ERR_IP ((sint8)-3)
297
299 #define M2M_SCAN_ERR_AP ((sint8)-4)
300
302 #define M2M_SCAN_ERR_P2P ((sint8)-5)
303
305 #define M2M_SCAN_ERR_WPS ((sint8)-6)
306
309 /*======*======*======*======*
310 MONTIORING MODE DEFINITIONS
311 *======*======*======*======*/
312
313 #define M2M_WIFI_FRAME_TYPE_ANY 0xFF
314
316 #define M2M_WIFI_FRAME_SUB_TYPE_ANY 0xFF
317
320 /*======*======*======*======*
321 TLS DEFINITIONS
322 *======*======*======*======*/
323 #define TLS_FILE_NAME_MAX 48
324
326 #define TLS_SRV_SEC_MAX_FILES 8
327
329 #define TLS_SRV_SEC_START_PATTERN_LEN 8
330
338 /* @{ */
339
340 /*======*======*======*======*
341 OTA DEFINITIONS
342 *======*======*======*======*/
343
344 #define OTA_STATUS_VALID (0x12526285)
345
348 #define OTA_STATUS_INVALID (0x23987718)
349
352 #define OTA_MAGIC_VALUE (0x1ABCDEF9)
353
356 #define OTA_SHA256_DIGEST_SIZE (32)
357
362 #define OTA_SUCCESS (0)
363
366 #define OTA_ERR_WORKING_IMAGE_LOAD_FAIL ((sint8)-1)
367
370 #define OTA_ERR_INVAILD_CONTROL_SEC ((sint8)-2)
371
374 #define M2M_ERR_OTA_SWITCH_FAIL ((sint8)-3)
375
378 #define M2M_ERR_OTA_START_UPDATE_FAIL ((sint8)-4)
379
383 #define M2M_ERR_OTA_ROLLBACK_FAIL ((sint8)-5)
384
387 #define M2M_ERR_OTA_INVAILD_FLASH_SIZE ((sint8)-6)
388
391 #define M2M_ERR_OTA_INVAILD_ARG ((sint8)-7)
392
408 typedef enum{
409 M2M_REQ_GROUP_MAIN = 0,
410 M2M_REQ_GROUP_WIFI,
411 M2M_REQ_GROUP_IP,
412 M2M_REQ_GROUP_HIF,
413 M2M_REQ_GROUP_OTA,
414 M2M_REQ_GROUP_SSL,
415 M2M_REQ_GROUP_SIGMA
416 }tenuM2mReqGroup;
417
424 typedef enum{
425 M2M_REQ_CONFIG_PKT,
426 M2M_REQ_DATA_PKT = 0x80 /*BIT7*/
427 }tenuM2mReqpkt;
428
436 typedef enum {
437 M2M_WIFI_WEP_KEY_INDEX_1 = ((uint8) 1),
439 M2M_WIFI_WEP_KEY_INDEX_2,
441 M2M_WIFI_WEP_KEY_INDEX_3,
443 M2M_WIFI_WEP_KEY_INDEX_4,
445 }tenuM2mWepKeyIndex;
446
454 typedef enum {
455 M2M_DEFAULT_CONN_INPROGRESS = ((sint8)-23),
457 M2M_DEFAULT_CONN_FAIL,
459 M2M_DEFAULT_CONN_SCAN_MISMATCH,
461 M2M_DEFAULT_CONN_EMPTY_LIST
463 }tenuM2mDefaultConnErrcode;
464
465
473 typedef enum {
474 M2M_ERR_SCAN_FAIL = ((uint8)1),
476 M2M_ERR_JOIN_FAIL,
478 M2M_ERR_AUTH_FAIL,
480 M2M_ERR_ASSOC_FAIL,
482 M2M_ERR_CONN_INPROGRESS,
484 }tenuM2mConnChangedErrcode;
485
486
494 typedef enum {
495 M2M_ERR_GAIN_TABLE_INVALID = ((sint8)-10),
497 M2M_ERR_READ_GAIN_TABLE,
499 }tenuM2mSetGainsErrcode;
500
508 typedef enum {
509 PWR_AUTO = ((uint8) 1),
511 PWR_LOW1,
513 PWR_LOW2,
515 PWR_HIGH,
517 }tenuM2mPwrMode;
518
526 typedef enum {
527 TX_PWR_HIGH = ((uint8) 1),
529 TX_PWR_MED,
531 TX_PWR_LOW,
533 }tenuM2mTxPwrLevel;
534
543 typedef enum {
544 M2M_WIFI_REQ_RESTART = M2M_CONFIG_CMD_BASE,
546 M2M_WIFI_REQ_SET_MAC_ADDRESS,
548 M2M_WIFI_REQ_CURRENT_RSSI,
550 M2M_WIFI_RESP_CURRENT_RSSI,
552 M2M_WIFI_REQ_RESTRICT_BLE,
554 M2M_WIFI_REQ_UNRESTRICT_BLE,
556 M2M_WIFI_REQ_GET_CONN_INFO,
558 M2M_WIFI_RESP_CONN_INFO,
560 M2M_WIFI_REQ_SET_DEVICE_NAME,
562 M2M_WIFI_REQ_START_PROVISION_MODE,
564 M2M_WIFI_RESP_PROVISION_INFO,
566 M2M_WIFI_REQ_STOP_PROVISION_MODE,
568 M2M_WIFI_REQ_SET_SYS_TIME,
570 M2M_WIFI_REQ_ENABLE_SNTP_CLIENT,
573 M2M_WIFI_REQ_DISABLE_SNTP_CLIENT,
576 M2M_WIFI_RESP_MEMORY_RECOVER,
578 M2M_WIFI_REQ_CUST_INFO_ELEMENT,
580 M2M_WIFI_REQ_SCAN,
582 M2M_WIFI_RESP_SCAN_DONE,
584 M2M_WIFI_REQ_SCAN_RESULT,
586 M2M_WIFI_RESP_SCAN_RESULT,
588 M2M_WIFI_REQ_SET_SCAN_OPTION,
590 M2M_WIFI_REQ_SET_SCAN_REGION,
592 M2M_WIFI_REQ_SET_POWER_PROFILE,
594 M2M_WIFI_REQ_SET_TX_POWER,
596 M2M_WIFI_REQ_SET_BATTERY_VOLTAGE,
598 M2M_WIFI_REQ_SET_ENABLE_LOGS,
600 M2M_WIFI_REQ_GET_SYS_TIME,
602 M2M_WIFI_RESP_GET_SYS_TIME,
604 M2M_WIFI_REQ_SEND_ETHERNET_PACKET,
606 M2M_WIFI_RESP_ETHERNET_RX_PACKET,
608 M2M_WIFI_REQ_SET_MAC_MCAST,
610 M2M_WIFI_REQ_BLE_API_SEND,
612 M2M_WIFI_RESP_BLE_API_RECV,
614 M2M_WIFI_REQ_SET_GAIN_TABLE,
616 M2M_WIFI_RESP_SET_GAIN_TABLE,
618 M2M_WIFI_REQ_PASSIVE_SCAN,
621 M2M_WIFI_MAX_CONFIG_ALL
622 }tenuM2mConfigCmd;
623
631 typedef enum {
632 M2M_WIFI_REQ_CONNECT = M2M_STA_CMD_BASE,
634 M2M_WIFI_REQ_DEFAULT_CONNECT,
636 M2M_WIFI_RESP_DEFAULT_CONNECT,
638 M2M_WIFI_REQ_DISCONNECT,
640 M2M_WIFI_RESP_CON_STATE_CHANGED,
642 M2M_WIFI_REQ_SLEEP,
644 M2M_WIFI_REQ_WPS_SCAN,
646 M2M_WIFI_REQ_WPS,
648 M2M_WIFI_REQ_START_WPS,
651 M2M_WIFI_REQ_DISABLE_WPS,
653 M2M_WIFI_REQ_DHCP_CONF,
655 M2M_WIFI_RESP_IP_CONFIGURED,
658 M2M_WIFI_RESP_IP_CONFLICT,
661 M2M_WIFI_REQ_ENABLE_MONITORING,
663 M2M_WIFI_REQ_DISABLE_MONITORING,
665 M2M_WIFI_RESP_WIFI_RX_PACKET,
667 M2M_WIFI_REQ_SEND_WIFI_PACKET,
669 M2M_WIFI_REQ_LSN_INT,
671 M2M_WIFI_REQ_DOZE,
673 M2M_WIFI_REQ_GET_PRNG,
675 M2M_WIFI_RESP_GET_PRNG,
677 M2M_WIFI_MAX_STA_ALL,
678 } tenuM2mStaCmd;
679
687 typedef enum {
688 M2M_WIFI_REQ_ENABLE_AP = M2M_AP_CMD_BASE,
690 M2M_WIFI_REQ_DISABLE_AP,
692 M2M_WIFI_MAX_AP_ALL,
693 }tenuM2mApCmd;
694
702 typedef enum {
703 M2M_WIFI_REQ_P2P_INT_CONNECT = M2M_P2P_CMD_BASE,
706 M2M_WIFI_REQ_ENABLE_P2P,
708 M2M_WIFI_REQ_DISABLE_P2P,
710 M2M_WIFI_REQ_P2P_REPOST,
714 M2M_WIFI_MAX_P2P_ALL,
715 }tenuM2mP2pCmd;
716
717
725 typedef enum {
726 M2M_WIFI_REQ_CLIENT_CTRL = M2M_SERVER_CMD_BASE,
728 M2M_WIFI_RESP_CLIENT_INFO,
730 M2M_WIFI_REQ_SERVER_INIT,
732 M2M_WIFI_MAX_SERVER_ALL
733 }tenuM2mServerCmd;
734
735
736
737
745 typedef enum {
746 M2M_IP_REQ_STATIC_IP_CONF = ((uint8) 10),
748 M2M_IP_REQ_ENABLE_DHCP,
750 M2M_IP_REQ_DISABLE_DHCP
752 } tenuM2mIpCmd;
753
761 typedef enum {
762 M2M_SIGMA_ENABLE = ((uint8) 3),
764 M2M_SIGMA_TA_START,
766 M2M_SIGMA_TA_STATS,
768 M2M_SIGMA_TA_RECEIVE_STOP,
770 M2M_SIGMA_ICMP_ARP,
772 M2M_SIGMA_ICMP_RX,
774 M2M_SIGMA_ICMP_TX,
776 M2M_SIGMA_UDP_TX,
778 M2M_SIGMA_UDP_TX_DEFER,
780 M2M_SIGMA_SECURITY_POLICY,
782 M2M_SIGMA_SET_SYSTIME
784 } tenuM2mSigmaCmd;
785
793 typedef enum{
794 M2M_SSL_REQ_CERT_VERIF,
795 M2M_SSL_REQ_ECC,
796 M2M_SSL_RESP_ECC,
797 M2M_SSL_RSV,
798 M2M_SSL_REQ_WRITE_OWN_CERTS,
799 M2M_SSL_REQ_SET_CS_LIST,
800 M2M_SSL_RESP_SET_CS_LIST,
801 M2M_SSL_RESP_WRITE_OWN_CERTS
802 }tenuM2mSslCmd;
803
804
812 typedef enum {
813 M2M_WIFI_DISCONNECTED = 0,
815 M2M_WIFI_CONNECTED,
817 M2M_WIFI_UNDEF = 0xff
819 }tenuM2mConnState;
820
828 typedef enum {
829 M2M_WIFI_SEC_INVALID = 0,
831 M2M_WIFI_SEC_OPEN,
833 M2M_WIFI_SEC_WPA_PSK,
835 M2M_WIFI_SEC_WEP,
837 M2M_WIFI_SEC_802_1X
839 }tenuM2mSecType;
840
841
849 typedef enum {
850 SSID_MODE_VISIBLE = 0,
852 SSID_MODE_HIDDEN
854 }tenuM2mSsidMode;
855
863 typedef enum {
864 M2M_WIFI_CH_1 = ((uint8) 1),
866 M2M_WIFI_CH_2,
868 M2M_WIFI_CH_3,
870 M2M_WIFI_CH_4,
872 M2M_WIFI_CH_5,
874 M2M_WIFI_CH_6,
876 M2M_WIFI_CH_7,
878 M2M_WIFI_CH_8,
880 M2M_WIFI_CH_9,
882 M2M_WIFI_CH_10,
884 M2M_WIFI_CH_11,
886 M2M_WIFI_CH_12,
888 M2M_WIFI_CH_13,
890 M2M_WIFI_CH_14,
892 M2M_WIFI_CH_ALL = ((uint8) 255)
893 }tenuM2mScanCh;
894
902 typedef enum {
903 REG_CH_1 = ((uint16) 1 << 0),
905 REG_CH_2 = ((uint16) 1 << 1),
907 REG_CH_3 = ((uint16) 1 << 2),
909 REG_CH_4 = ((uint16) 1 << 3),
911 REG_CH_5 = ((uint16) 1 << 4),
913 REG_CH_6 = ((uint16) 1 << 5),
915 REG_CH_7 = ((uint16) 1 << 6),
917 REG_CH_8 = ((uint16) 1 << 7),
919 REG_CH_9 = ((uint16) 1 << 8),
921 REG_CH_10 = ((uint16) 1 << 9),
923 REG_CH_11 = ((uint16) 1 << 10),
925 REG_CH_12 = ((uint16) 1 << 11),
927 REG_CH_13 = ((uint16) 1 << 12),
929 REG_CH_14 = ((uint16) 1 << 13),
931 REG_CH_ALL = ((uint16) 0x3FFF),
933 NORTH_AMERICA = ((uint16) 0x7FF),
935 EUROPE = ((uint16) 0x1FFF),
937 ASIA = ((uint16) 0x3FFF)
939 }tenuM2mScanRegion;
940
941
949 typedef enum {
950 M2M_NO_PS,
952 M2M_PS_AUTOMATIC,
955 M2M_PS_H_AUTOMATIC,
958 M2M_PS_DEEP_AUTOMATIC,
962 M2M_PS_MANUAL
965 }tenuPowerSaveModes;
966
974 typedef enum {
975 M2M_WIFI_MODE_NORMAL = ((uint8) 1),
978 M2M_WIFI_MODE_CONFIG,
981 }tenuM2mWifiMode;
982
990 typedef enum{
991 WPS_PIN_TRIGGER = 0,
993 WPS_PBC_TRIGGER = 4
995 }tenuWPSTrigger;
996
1004 typedef enum{
1005 ROOT_CERT_PUBKEY_RSA = 1,
1007 ROOT_CERT_PUBKEY_ECDSA = 2
1009 }tenuRootCertPubKeyType;
1019 typedef struct {
1020 uint8 u8PwrMode;
1022 uint8 __PAD24__[3];
1024 }tstrM2mPwrMode;
1025
1033 typedef struct {
1034 uint8 u8TxPwrLevel;
1036 uint8 __PAD24__[3];
1038 }tstrM2mTxPwrLevel;
1039
1047 typedef struct {
1048 uint8 u8Enable;
1050 uint8 __PAD24__[3];
1052 }tstrM2mEnableLogs;
1053
1061 typedef struct {
1062 //Note: on SAMD D21 the size of double is 8 Bytes
1063 uint16 u16BattVolt;
1065 uint8 __PAD16__[2];
1067 }tstrM2mBatteryVoltage;
1068
1076 typedef struct{
1077 uint8 u8KeyIndx;
1079 uint8 u8KeySz;
1081 uint8 au8WepKey[WEP_104_KEY_STRING_SIZE + 1];
1083 uint8 __PAD24__[3];
1085 }tstrM2mWifiWepParams;
1086
1087
1095 typedef struct{
1096 uint8 au8UserName[M2M_1X_USR_NAME_MAX];
1098 uint8 au8Passwd[M2M_1X_PWD_MAX];
1101 #define __PADDING_tstr1xAuthCredentials_ (4 - ((M2M_1X_USR_NAME_MAX + M2M_1X_PWD_MAX) % 4))
1102 uint8 __PAD__[__PADDING_tstr1xAuthCredentials_];
1103 }tstr1xAuthCredentials;
1104
1105
1113 typedef union{
1114 uint8 au8PSK[M2M_MAX_PSK_LEN];
1116 tstr1xAuthCredentials strCred1x;
1118 tstrM2mWifiWepParams strWepInfo;
1121 #define __PADDING_tuniM2MWifiAuth_ (4 - ((M2M_MAX_PSK_LEN + sizeof(tstr1xAuthCredentials) + sizeof(tstrM2mWifiWepParams)) % 4))
1122 uint8 __PAD__[__PADDING_tuniM2MWifiAuth_];
1123 }tuniM2MWifiAuth;
1124
1125
1133 typedef struct{
1134 tuniM2MWifiAuth uniAuth;
1136 uint8 u8SecType;
1138 #define __PADDING__ (4 - ((sizeof(tuniM2MWifiAuth) + 1) % 4))
1139 uint8 __PAD__[__PADDING__];
1141 }tstrM2MWifiSecInfo;
1142
1143
1151 typedef struct{
1152 tstrM2MWifiSecInfo strSec;
1154 uint16 u16Ch;
1156 uint8 au8SSID[M2M_MAX_SSID_LEN];
1158 uint8 u8NoSaveCred;
1159 #define __CONN_PAD_SIZE__ (4 - ((sizeof(tstrM2MWifiSecInfo) + M2M_MAX_SSID_LEN + 3) % 4))
1160 uint8 __PAD__[__CONN_PAD_SIZE__];
1162 }tstrM2mWifiConnect;
1163
1164
1175 typedef struct {
1176 uint8 u8TriggerType;
1178 char acPinNumber[8];
1180 uint8 __PAD24__[3];
1182 }tstrM2MWPSConnect;
1183
1184
1198 typedef struct{
1199 uint8 u8AuthType;
1201 uint8 u8Ch;
1203 uint8 au8SSID[M2M_MAX_SSID_LEN];
1205 uint8 au8PSK[M2M_MAX_PSK_LEN];
1208 #define __PADDING_tstrM2MWPSInfo_ (4 - ((2 + M2M_MAX_SSID_LEN + M2M_MAX_PSK_LEN) % 4))
1209 uint8 __PAD__[__PADDING_tstrM2MWPSInfo_];
1210 }tstrM2MWPSInfo;
1211
1225 typedef struct{
1226 uint8 u8AuthType;
1228 uint8 u8Ch;
1230 uint8 au8SSID[M2M_MAX_SSID_LEN];
1232 uint8 au8PSK[M2M_MAX_PSK_LEN];
1235 #define __PADDING_tstrM2MBLEInfo_ (4 - ((2 + M2M_MAX_SSID_LEN + M2M_MAX_PSK_LEN) % 4))
1236 uint8 __PAD__[__PADDING_tstrM2MBLEInfo_];
1237 }tstrM2MBLEInfo;
1238
1250 typedef struct{
1251 sint8 s8ErrorCode;
1257 uint8 __PAD24__[3];
1258 }tstrM2MDefaultConnResp;
1259
1268 typedef struct {
1269 uint8 u8NumOfSlot;
1274 uint8 u8SlotTime;
1280 uint8 u8ProbesPerSlot;
1285 sint8 s8RssiThresh;
1293 uint16 u16PassiveScanTime;
1299 uint8 __PAD16__[2];
1301 }tstrM2MScanOption;
1302
1313 typedef struct {
1314 uint16 u16ScanRegion;
1315 /*|< Specifies the number of channels allowed in the region (e.g. North America = 11 ... etc.).
1316 */
1317 uint8 __PAD16__[2];
1319 }tstrM2MScanRegion;
1320
1331 typedef struct {
1332 uint8 u8ChNum;
1334 uint8 __PAD24__[3];
1336 }tstrM2MScan;
1337
1338
1346 typedef struct{
1347 uint8 u8NumofCh;
1349 sint8 s8ScanState;
1351 uint8 __PAD16__[2];
1353 }tstrM2mScanDone;
1354
1355
1363 typedef struct {
1364 uint8 u8Index;
1366 uint8 __PAD24__[3];
1368 }tstrM2mReqScanResult;
1369
1370
1378 typedef struct {
1379 uint8 u8index;
1381 sint8 s8rssi;
1383 uint8 u8AuthType;
1385 uint8 u8ch;
1387 uint8 au8BSSID[6];
1389 uint8 au8SSID[M2M_MAX_SSID_LEN];
1391 uint8 _PAD8_;
1393 }tstrM2mWifiscanResult;
1394
1395
1406 typedef struct {
1407 uint8 u8CurrState;
1409 uint8 u8ErrCode;
1411 uint8 __PAD16__[2];
1413 }tstrM2mWifiStateChanged;
1414
1415
1426 typedef struct{
1427 uint8 u8PsType;
1429 uint8 u8BcastEn;
1431 uint8 __PAD16__[2];
1433 }tstrM2mPsType;
1434
1443 typedef struct {
1444 uint32 u32SleepTime;
1446 } tstrM2mSlpReqTime;
1447
1456 typedef struct {
1457 uint16 u16LsnInt;
1459 uint8 __PAD16__[2];
1461 }tstrM2mLsnInt;
1462
1463
1472 typedef struct{
1473 uint8 u8ChannelID;
1475 uint8 u8FrameType;
1477 uint8 u8FrameSubtype;
1479 uint8 au8SrcMacAddress[6];
1481 uint8 au8DstMacAddress[6];
1483 uint8 au8BSSID[6];
1485 uint8 u8EnRecvHdr;
1487 uint8 __PAD16__[2];
1490 }tstrM2MWifiMonitorModeCtrl;
1491
1492
1501 typedef struct{
1502 uint8 u8FrameType;
1504 uint8 u8FrameSubtype;
1506 uint8 u8ServiceClass;
1508 uint8 u8Priority;
1510 uint8 u8HeaderLength;
1512 uint8 u8CipherType;
1514 uint8 au8SrcMacAddress[6];
1516 uint8 au8DstMacAddress[6];
1518 uint8 au8BSSID[6];
1520 uint16 u16DataLength;
1522 uint16 u16FrameLength;
1524 uint32 u32DataRateKbps;
1526 sint8 s8RSSI;
1528 uint8 __PAD24__[3];
1530 }tstrM2MWifiRxPacketInfo;
1531
1532
1541 typedef struct{
1542 uint16 u16PacketSize;
1544 uint16 u16HeaderLength;
1546 }tstrM2MWifiTxPacketInfo;
1547
1548
1556 typedef struct {
1557 uint8 u8ListenChannel;
1559 uint8 __PAD24__[3];
1561 }tstrM2MP2PConnect;
1562
1571 typedef struct {
1572 uint8 au8SSID[M2M_MAX_SSID_LEN];
1574 uint8 u8ListenChannel;
1576 uint8 u8KeyIndx;
1578 uint8 u8KeySz;
1580 uint8 au8WepKey[WEP_104_KEY_STRING_SIZE + 1];
1582 uint8 u8SecType;
1584 uint8 u8SsidHide;
1586 uint8 au8DHCPServerIP[4];
1588 uint8 __PAD24__[3];
1590 }tstrM2MAPConfig;
1591
1599 typedef struct {
1600 uint8 u8Channel;
1602 uint8 __PAD24__[3];
1604 }tstrM2mServerInit;
1605
1606
1614 typedef struct {
1615 uint8 u8State;
1617 uint8 __PAD24__[3];
1619 }tstrM2mClientState;
1620
1621
1629 typedef struct {
1630 uint8 u8cmd;
1632 uint8 __PAD24__[3];
1634 }tstrM2Mservercmd;
1635
1636
1648 typedef struct {
1649 uint8 au8Mac[6];
1651 uint8 __PAD16__[2];
1653 }tstrM2mSetMacAddress;
1654
1655
1663 typedef struct {
1664 uint8 au8DeviceName[M2M_DEVICE_NAME_MAX];
1666 }tstrM2MDeviceNameConfig;
1667
1668
1679 typedef struct {
1680 uint32 u32StaticIP;
1682 uint32 u32Gateway;
1684 uint32 u32DNS;
1686 uint32 u32SubnetMask;
1688 } tstrM2MIPConfig;
1689
1698 typedef struct{
1699 uint16 u16PktSz;
1700 /*<! Packet Size */
1701 uint16 u16PktOffset;
1702 /*<! Packet offset */
1703 } tstrM2mIpRsvdPkt;
1704
1705
1714 typedef struct {
1715 tstrM2MAPConfig strApConfig;
1717 char acHttpServerDomainName[64];
1719 uint8 u8EnableRedirect;
1726 uint8 __PAD24__[3];
1727 }tstrM2MProvisionModeConfig;
1728
1729
1737 typedef struct{
1738 uint8 au8SSID[M2M_MAX_SSID_LEN];
1740 uint8 au8Password[M2M_MAX_PSK_LEN];
1742 uint8 u8SecType;
1744 uint8 u8Status;
1750 }tstrM2MProvisionInfo;
1751
1752
1760 typedef struct{
1761 char acSSID[M2M_MAX_SSID_LEN];
1763 uint8 u8SecType;
1765 uint8 au8IPAddr[4];
1767 uint8 au8MACAddress[6];
1769 sint8 s8RSSI;
1771 uint8 __PAD24__[3];
1773 }tstrM2MConnInfo;
1774
1782 typedef struct {
1783 uint16 u16Len;
1785 uint8 data[]; //lint !e43
1787 }tstrM2mBleApiMsg;
1788
1796 typedef struct{
1797 uint16 u16Year;
1799 uint8 u8Month;
1801 uint8 u8Day;
1803 uint8 u8Hour;
1805 uint8 u8Minute;
1807 uint8 u8Second;
1810 #define __PADDING_tstrSystemTime_ (4 - (7 % 4))
1811
1812 uint8 __PAD__[__PADDING_tstrSystemTime_];
1814 }tstrSystemTime;
1815
1823 typedef struct {
1824 uint8 au8macaddress[M2M_MAC_ADDRES_LEN];
1826 uint8 u8AddRemove;
1828 uint8 __PAD8__;
1830 }tstrM2MMulticastMac;
1831
1839 typedef struct {
1840 uint8 u8GainTable;
1842 uint8 __PAD24___[3];
1844 }tstrM2MGainTable;
1845
1853 typedef struct {
1854 sint8 s8ErrorCode;
1856 uint8 __PAD24__[3];
1858 }tstrM2MGainTableRsp;
1859
1860
1868 typedef struct{
1869 uint16 u16NSz;
1871 uint16 u16ESz;
1873 }tstrRootCertRsaKeyInfo;
1881 typedef struct{
1882 uint16 u16CurveID;
1884 uint16 u16KeySz;
1886 }tstrRootCertEcdsaKeyInfo;
1887
1895 typedef struct{
1896 uint32 u32PubKeyType;
1898 union{
1899 tstrRootCertRsaKeyInfo strRsaKeyInfo;
1901 tstrRootCertEcdsaKeyInfo strEcsdaKeyInfo;
1903 };
1905 }tstrRootCertPubKeyInfo;
1906
1914 typedef struct{
1915 uint8 au8SHA1NameHash[20];
1917 tstrSystemTime strExpDate;
1919 tstrRootCertPubKeyInfo strPubKey;
1921 }tstrRootCertEntryHeader;
1922
1930 typedef struct{
1931 uint8 au8StartPattern[16];
1933 uint32 u32nCerts;
1935 }tstrRootCertFlashHeader;
1936
1937
1945 typedef struct{
1946 char acFileName[TLS_FILE_NAME_MAX];
1948 uint32 u32FileSize;
1950 uint32 u32FileAddr;
1952 }tstrTlsSrvSecFileEntry;
1953
1961 typedef struct{
1962 uint8 au8SecStartPattern[TLS_SRV_SEC_START_PATTERN_LEN];
1964 uint32 u32nEntries;
1966 uint32 u32NextWriteAddr;
1967 /* */
1968 tstrTlsSrvSecFileEntry astrEntries[TLS_SRV_SEC_MAX_FILES];
1970 uint32 u32CRC;
1972 }tstrTlsSrvSecHdr;
1973
1974 typedef enum {
1975 TLS_FLASH_OK,
1977 TLS_FLASH_OK_NO_CHANGE,
1979 TLS_FLASH_ERR_CORRUPT,
1981 TLS_FLASH_ERR_NO_CHANGE,
1983 TLS_FLASH_ERR_UNKNOWN
1985 }tenuTlsFlashStatus;
1986
1987 #define TLS_CERTS_CHUNKED_SIG_VALUE 0x6ec8
1988 typedef struct{
1989 uint16 u16Sig;
1990 uint16 u16TotalSize32;
1991 uint16 u16Offset32;
1992 uint16 u16Size32;
1993 }tstrTlsSrvChunkHdr;
1994
1995 typedef struct{
1996 uint32 u32CsBMP;
1997 }tstrSslSetActiveCsList;
1998
2010 typedef enum {
2011 M2M_OTA_REQ_NOTIF_SET_URL = M2M_OTA_CMD_BASE,
2013 M2M_OTA_REQ_NOTIF_CHECK_FOR_UPDATE,
2015 M2M_OTA_REQ_NOTIF_SCHED,
2017 M2M_OTA_REQ_START_UPDATE,
2019 M2M_OTA_REQ_SWITCH_FIRMWARE,
2021 M2M_OTA_REQ_ROLLBACK,
2023 M2M_OTA_REQ_ABORT,
2025 M2M_OTA_RESP_NOTIF_UPDATE_INFO,
2027 M2M_OTA_RESP_UPDATE_STATUS,
2029 M2M_OTA_REQ_TEST,
2031 M2M_OTA_MAX_ALL,
2032 }tenuM2mOtaCmd;
2033
2041 typedef enum {
2042 OTA_STATUS_SUCSESS = 0,
2044 OTA_STATUS_FAIL = 1,
2046 OTA_STATUS_INVAILD_ARG = 2,
2048 OTA_STATUS_INVAILD_RB_IMAGE = 3,
2050 OTA_STATUS_INVAILD_FLASH_SIZE = 4,
2052 OTA_STATUS_AlREADY_ENABLED = 5,
2054 OTA_STATUS_UPDATE_INPROGRESS = 6,
2056 OTA_STATUS_IMAGE_VERIF_FAILED = 7,
2058 OTA_STATUS_CONNECTION_ERROR = 8,
2060 OTA_STATUS_SERVER_ERROR = 9,
2062 OTA_STATUS_ABORTED = 10,
2064 } tenuOtaUpdateStatus;
2072 typedef enum {
2073
2074 DL_STATUS = 1,
2076 SW_STATUS = 2,
2078 RB_STATUS = 3,
2080 AB_STATUS = 4,
2082 }tenuOtaUpdateStatusType;
2094 typedef struct{
2095 uint32 u32OtaMagicValue;
2098 uint32 u32OtaPayloadSzie;
2100 }tstrOtaInitHdr;
2101
2111 typedef struct {
2112 uint32 u32OtaMagicValue;
2114 uint32 u32OtaFormatVersion;
2116 uint32 u32OtaSequenceNumber;
2118 uint32 u32OtaLastCheckTime;
2120 uint32 u32OtaCurrentworkingImagOffset;
2122 uint32 u32OtaCurrentworkingImagFirmwareVer;
2124 uint32 u32OtaCurrentworkingImagHifVer;
2126 uint32 u32OtaRollbackImageOffset;
2128 uint32 u32OtaRollbackImageValidStatus;
2130 uint32 u32OtaRollbackImagFirmwareVer;
2132 uint32 u32OtaRollbackImagHifVer;
2134 uint32 u32OtaCortusAppWorkingOffset;
2136 uint32 u32OtaCortusAppWorkingValidSts;
2138 uint32 u32OtaCortusAppWorkingVer;
2140 uint32 u32OtaCortusAppRollbackOffset;
2142 uint32 u32OtaCortusAppRollbackValidSts;
2144 uint32 u32OtaCortusAppRollbackVer;
2146 uint32 u32OtaControlSecCrc;
2148 } tstrOtaControlSec;
2149
2160 typedef struct {
2161 uint8 u8OtaUpdateStatusType;
2165 uint8 u8OtaUpdateStatus;
2176 uint8 _PAD16_[2];
2177 }tstrOtaUpdateStatusResp;
2178
2189 typedef struct {
2190 uint32 u8NcfUpgradeVersion;
2192 uint32 u8NcfCurrentVersion;
2194 uint32 u8NcdUpgradeVersion;
2196 uint8 u8NcdRequiredUpgrade;
2198 uint8 u8DownloadUrlOffset;
2200 uint8 u8DownloadUrlSize;
2202 uint8 __PAD8__;
2204 } tstrOtaUpdateInfo;
2205
2213 typedef struct {
2215 uint8 *pu8RngBuff;
2217 uint16 u16PrngSize;
2219 uint8 __PAD16__[2];
2220 }tstrPrng;
2221 #endif
M2M_WIFI_CH_1
Definition: m2m_types.h:864
tstrM2MWifiRxPacketInfo::u8HeaderLength
uint8 u8HeaderLength
Definition: m2m_types.h:1510
tstrM2MWifiRxPacketInfo::u8FrameSubtype
uint8 u8FrameSubtype
Definition: m2m_types.h:1504
M2M_WIFI_CH_11
Definition: m2m_types.h:884
M2M_WIFI_MAX_P2P_ALL
Definition: m2m_types.h:714
M2M_WIFI_REQ_RESTRICT_BLE
Definition: m2m_types.h:552
tstrM2MDefaultConnResp
This struct contains the response error of m2m_default_connect.
Definition: m2m_types.h:1250
M2M_OTA_REQ_NOTIF_CHECK_FOR_UPDATE
Definition: m2m_types.h:2013
M2M_WIFI_REQ_SET_MAC_MCAST
Definition: m2m_types.h:608
tstrM2MWifiMonitorModeCtrl::u8FrameType
uint8 u8FrameType
Definition: m2m_types.h:1475
M2M_SIGMA_TA_START
Definition: m2m_types.h:764
tstrM2MProvisionInfo::u8Status
uint8 u8Status
Definition: m2m_types.h:1744
M2M_WIFI_REQ_ENABLE_SNTP_CLIENT
Definition: m2m_types.h:570
tstrOtaControlSec::u32OtaCurrentworkingImagHifVer
uint32 u32OtaCurrentworkingImagHifVer
Definition: m2m_types.h:2124
ROOT_CERT_PUBKEY_ECDSA
Definition: m2m_types.h:1007
tenuM2mStaCmd
tenuM2mStaCmd
This enum contains all the WINC commands while in Station mode.
Definition: m2m_types.h:631
tstrRootCertEcdsaKeyInfo
Info about a ECDSA public key.
Definition: m2m_types.h:1881
M2M_WIFI_REQ_SET_TX_POWER
Definition: m2m_types.h:594
tstrM2MScanRegion::u16ScanRegion
uint16 u16ScanRegion
Definition: m2m_types.h:1314
tstrM2mWifiConnect
This struct stores the Wi-Fi connect request.
Definition: m2m_types.h:1151
REG_CH_14
Definition: m2m_types.h:929
M2M_WIFI_CH_ALL
Definition: m2m_types.h:892
M2M_WIFI_RESP_PROVISION_INFO
Definition: m2m_types.h:564
tstrRootCertEcdsaKeyInfo::u16KeySz
uint16 u16KeySz
Definition: m2m_types.h:1884
tstrM2mWifiStateChanged::u8CurrState
uint8 u8CurrState
Definition: m2m_types.h:1407
tstrM2mLsnInt
This struct contains the Listen Interval. It is the value of the Wi-Fi StA Listen Interval when power...
Definition: m2m_types.h:1456
tenuWPSTrigger
tenuWPSTrigger
This enum contains the WPS triggering methods.
Definition: m2m_types.h:990
tstrM2MWifiRxPacketInfo::u16FrameLength
uint16 u16FrameLength
Definition: m2m_types.h:1522
tstrM2MP2PConnect
This struct contains the Listen Channel for P2P connect.
Definition: m2m_types.h:1556
WPS_PBC_TRIGGER
Definition: m2m_types.h:993
tstrRootCertEcdsaKeyInfo::u16CurveID
uint16 u16CurveID
Definition: m2m_types.h:1882
M2M_REQ_GROUP_OTA
Definition: m2m_types.h:413
M2M_WIFI_REQ_DHCP_CONF
Definition: m2m_types.h:653
M2M_WIFI_SEC_WPA_PSK
Definition: m2m_types.h:833
M2M_WIFI_WEP_KEY_INDEX_3
Definition: m2m_types.h:441
tstrPrng::pu8RngBuff
uint8 * pu8RngBuff
Definition: m2m_types.h:2215
tstrM2MWPSInfo::u8AuthType
uint8 u8AuthType
Definition: m2m_types.h:1199
M2M_SIGMA_TA_STATS
Definition: m2m_types.h:766
REG_CH_7
Definition: m2m_types.h:915
tstrM2mWifiWepParams::u8KeyIndx
uint8 u8KeyIndx
Definition: m2m_types.h:1077
tstrM2MScanOption::u8SlotTime
uint8 u8SlotTime
Definition: m2m_types.h:1274
tstrM2MWifiMonitorModeCtrl
This struct contains the Wi-Fi Monitor Mode Filter. It sets the filtering criteria for WLAN packets w...
Definition: m2m_types.h:1472
ASIA
Definition: m2m_types.h:937
tenuM2mOtaCmd
tenuM2mOtaCmd
This enum contains all the WINC commands used for OTA operation.
Definition: m2m_types.h:2010
tstrM2mTxPwrLevel::u8TxPwrLevel
uint8 u8TxPwrLevel
Definition: m2m_types.h:1034
M2M_DEFAULT_CONN_EMPTY_LIST
Definition: m2m_types.h:461
M2M_WIFI_SEC_OPEN
Definition: m2m_types.h:831
tstrM2mPsType
This struct contains the Power Save configuration.
Definition: m2m_types.h:1426
tstrM2mServerInit
This struct contains the information for the PS Server initialization.
Definition: m2m_types.h:1599
tstrM2MWifiRxPacketInfo::u32DataRateKbps
uint32 u32DataRateKbps
Definition: m2m_types.h:1524
M2M_WIFI_REQ_SET_MAC_ADDRESS
Definition: m2m_types.h:546
OTA_STATUS_FAIL
Definition: m2m_types.h:2044
tstrM2MIPConfig::u32DNS
uint32 u32DNS
Definition: m2m_types.h:1684
tenuM2mConnChangedErrcode
tenuM2mConnChangedErrcode
Definition: m2m_types.h:473
M2M_WIFI_CH_5
Definition: m2m_types.h:872
OTA_STATUS_AlREADY_ENABLED
Definition: m2m_types.h:2052
tstrTlsSrvChunkHdr
Definition: m2m_types.h:1988
tstrTlsSrvSecHdr::u32NextWriteAddr
uint32 u32NextWriteAddr
Definition: m2m_types.h:1966
tstrSystemTime::u8Month
uint8 u8Month
Definition: m2m_types.h:1799
tstrM2mServerInit::u8Channel
uint8 u8Channel
Definition: m2m_types.h:1600
M2M_WIFI_RESP_GET_SYS_TIME
Definition: m2m_types.h:602
tenuPowerSaveModes
tenuPowerSaveModes
This enum contains all the supported Wi-Fi Power Save modes.
Definition: m2m_types.h:949
M2M_ERR_JOIN_FAIL
Definition: m2m_types.h:476
tenuM2mConfigCmd
tenuM2mConfigCmd
This enum contains all the host commands used to configure the WINC board.
Definition: m2m_types.h:543
tstrM2mScanDone::u8NumofCh
uint8 u8NumofCh
Definition: m2m_types.h:1347
tstrM2Mservercmd::u8cmd
uint8 u8cmd
Definition: m2m_types.h:1630
tstrM2mPwrMode::u8PwrMode
uint8 u8PwrMode
Definition: m2m_types.h:1020
M2M_MAC_ADDRES_LEN
#define M2M_MAC_ADDRES_LEN
Definition: m2m_types.h:182
NORTH_AMERICA
Definition: m2m_types.h:933
M2M_WIFI_REQ_ENABLE_MONITORING
Definition: m2m_types.h:661
M2M_WIFI_REQ_SET_DEVICE_NAME
Definition: m2m_types.h:560
tstrOtaInitHdr::u32OtaMagicValue
uint32 u32OtaMagicValue
Definition: m2m_types.h:2095
tstrTlsSrvChunkHdr::u16Offset32
uint16 u16Offset32
Definition: m2m_types.h:1991
tstrM2mWifiscanResult::u8index
uint8 u8index
Definition: m2m_types.h:1379
M2M_OTA_REQ_NOTIF_SET_URL
Definition: m2m_types.h:2011
tstrSystemTime::u8Minute
uint8 u8Minute
Definition: m2m_types.h:1805
M2M_OTA_REQ_START_UPDATE
Definition: m2m_types.h:2017
REG_CH_5
Definition: m2m_types.h:911
tstrM2mPwrMode
Definition: m2m_types.h:1019
tenuOtaUpdateStatus
tenuOtaUpdateStatus
This struct contains the OTA return status.
Definition: m2m_types.h:2041
M2M_NO_PS
Definition: m2m_types.h:950
tstrOtaControlSec::u32OtaCortusAppWorkingVer
uint32 u32OtaCortusAppWorkingVer
Definition: m2m_types.h:2138
tstrPrng
M2M Request PRNG.
Definition: m2m_types.h:2213
M2M_WIFI_REQ_CUST_INFO_ELEMENT
Definition: m2m_types.h:578
tstrM2MScanOption::s8RssiThresh
sint8 s8RssiThresh
Definition: m2m_types.h:1285
tstrM2mWifiConnect::strSec
tstrM2MWifiSecInfo strSec
Definition: m2m_types.h:1152
tstrM2mWifiscanResult::u8AuthType
uint8 u8AuthType
Definition: m2m_types.h:1383
OTA_STATUS_SERVER_ERROR
Definition: m2m_types.h:2060
tstrM2MScan
This struct contains the Wi-Fi scan request.
Definition: m2m_types.h:1331
tenuM2mWepKeyIndex
tenuM2mWepKeyIndex
Definition: m2m_types.h:436
tstrM2MScanOption::u8ProbesPerSlot
uint8 u8ProbesPerSlot
Definition: m2m_types.h:1280
tstrM2mBatteryVoltage::u16BattVolt
uint16 u16BattVolt
Definition: m2m_types.h:1063
M2M_WIFI_REQ_WPS
Definition: m2m_types.h:646
tstrM2mReqScanResult
The Wi-Fi Scan results list is stored in firmware. This struct contains the index by which the applic...
Definition: m2m_types.h:1363
tstrSystemTime::u8Second
uint8 u8Second
Definition: m2m_types.h:1807
SW_STATUS
Definition: m2m_types.h:2076
tstrM2MWifiSecInfo::uniAuth
tuniM2MWifiAuth uniAuth
Definition: m2m_types.h:1134
tuniM2MWifiAuth
This struct stores the Wi-Fi Security Parameters for all supported security modes.
Definition: m2m_types.h:1113
M2M_WIFI_RESP_DEFAULT_CONNECT
Definition: m2m_types.h:636
M2M_OTA_REQ_ABORT
Definition: m2m_types.h:2023
M2M_OTA_RESP_NOTIF_UPDATE_INFO
Definition: m2m_types.h:2025
M2M_WIFI_WEP_KEY_INDEX_2
Definition: m2m_types.h:439
tenuM2mSetGainsErrcode
tenuM2mSetGainsErrcode
Definition: m2m_types.h:494
tstrOtaControlSec::u32OtaMagicValue
uint32 u32OtaMagicValue
Definition: m2m_types.h:2112
WEP_104_KEY_STRING_SIZE
#define WEP_104_KEY_STRING_SIZE
Definition: m2m_types.h:259
TX_PWR_MED
Definition: m2m_types.h:529
tstrOtaControlSec::u32OtaRollbackImagFirmwareVer
uint32 u32OtaRollbackImagFirmwareVer
Definition: m2m_types.h:2130
tstrOtaControlSec::u32OtaRollbackImageValidStatus
uint32 u32OtaRollbackImageValidStatus
Definition: m2m_types.h:2128
tstrM2MConnInfo::s8RSSI
sint8 s8RSSI
Definition: m2m_types.h:1769
tenuM2mSsidMode
tenuM2mSsidMode
Definition: m2m_types.h:849
M2M_WIFI_REQ_UNRESTRICT_BLE
Definition: m2m_types.h:554
tstrM2MBLEInfo::u8Ch
uint8 u8Ch
Definition: m2m_types.h:1228
tstrM2mScanDone::s8ScanState
sint8 s8ScanState
Definition: m2m_types.h:1349
PWR_AUTO
Definition: m2m_types.h:509
tstrTlsSrvSecFileEntry::u32FileSize
uint32 u32FileSize
Definition: m2m_types.h:1948
OTA_STATUS_INVAILD_FLASH_SIZE
Definition: m2m_types.h:2050
M2M_OTA_CMD_BASE
#define M2M_OTA_CMD_BASE
Definition: m2m_types.h:247
tstrM2MMulticastMac::u8AddRemove
uint8 u8AddRemove
Definition: m2m_types.h:1826
M2M_WIFI_REQ_SCAN_RESULT
Definition: m2m_types.h:584
M2M_WIFI_REQ_P2P_REPOST
Definition: m2m_types.h:710
tstrRootCertRsaKeyInfo
Info about a RSA public key.
Definition: m2m_types.h:1868
tstrSystemTime
This struct contains the system time.
Definition: m2m_types.h:1796
M2M_REQ_GROUP_IP
Definition: m2m_types.h:411
tstrOtaUpdateInfo
This struct contains the OTA update information.
Definition: m2m_types.h:2189
M2M_REQ_GROUP_SIGMA
Definition: m2m_types.h:415
M2M_WIFI_REQ_DISABLE_SNTP_CLIENT
Definition: m2m_types.h:573
tstrRootCertRsaKeyInfo::u16NSz
uint16 u16NSz
Definition: m2m_types.h:1869
M2M_WIFI_REQ_DISCONNECT
Definition: m2m_types.h:638
M2M_WIFI_UNDEF
Definition: m2m_types.h:817
tstrSslSetActiveCsList::u32CsBMP
uint32 u32CsBMP
Definition: m2m_types.h:1996
tstrSslSetActiveCsList
Definition: m2m_types.h:1995
M2M_WIFI_CH_7
Definition: m2m_types.h:876
tstrOtaControlSec::u32OtaCortusAppRollbackValidSts
uint32 u32OtaCortusAppRollbackValidSts
Definition: m2m_types.h:2142
tenuOtaUpdateStatusType
tenuOtaUpdateStatusType
This struct contains the OTA update status type.
Definition: m2m_types.h:2072
REG_CH_4
Definition: m2m_types.h:909
M2M_ERR_SCAN_FAIL
Definition: m2m_types.h:474
tstrM2mWifiscanResult::_PAD8_
uint8 _PAD8_
Definition: m2m_types.h:1391
tenuM2mSslCmd
tenuM2mSslCmd
This enum contains WINC commands related to TLS handshake.
Definition: m2m_types.h:793
tstrTlsSrvSecHdr::u32CRC
uint32 u32CRC
Definition: m2m_types.h:1970
M2M_REQ_GROUP_WIFI
Definition: m2m_types.h:410
M2M_WIFI_REQ_START_WPS
Definition: m2m_types.h:648
M2M_SSL_REQ_ECC
Definition: m2m_types.h:795
M2M_WIFI_REQ_DOZE
Definition: m2m_types.h:671
M2M_WIFI_REQ_CURRENT_RSSI
Definition: m2m_types.h:548
M2M_WIFI_MODE_NORMAL
Definition: m2m_types.h:975
REG_CH_3
Definition: m2m_types.h:907
M2M_OTA_MAX_ALL
Definition: m2m_types.h:2031
tstrOtaControlSec::u32OtaLastCheckTime
uint32 u32OtaLastCheckTime
Definition: m2m_types.h:2118
M2M_ERR_READ_GAIN_TABLE
Definition: m2m_types.h:497
M2M_WIFI_REQ_SERVER_INIT
Definition: m2m_types.h:730
tuniM2MWifiAuth::strWepInfo
tstrM2mWifiWepParams strWepInfo
Definition: m2m_types.h:1118
tstrM2MMulticastMac
This struct contains the information from the Multicast filter.
Definition: m2m_types.h:1823
tstrM2MWifiSecInfo::u8SecType
uint8 u8SecType
Definition: m2m_types.h:1136
M2M_WIFI_RESP_SCAN_DONE
Definition: m2m_types.h:582
tstrM2mWifiStateChanged
This struct contains the Wi-Fi connection state.
Definition: m2m_types.h:1406
tstrOtaUpdateInfo::u8NcfCurrentVersion
uint32 u8NcfCurrentVersion
Definition: m2m_types.h:2192
M2M_SIGMA_SECURITY_POLICY
Definition: m2m_types.h:780
tstrM2mPsType::u8BcastEn
uint8 u8BcastEn
Definition: m2m_types.h:1429
tenuM2mTxPwrLevel
tenuM2mTxPwrLevel
Definition: m2m_types.h:526
M2M_ERR_AUTH_FAIL
Definition: m2m_types.h:478
M2M_WIFI_CH_4
Definition: m2m_types.h:870
tstrM2MWPSConnect
This struct stores the WPS configuration parameters.
Definition: m2m_types.h:1175
M2M_AP_CMD_BASE
#define M2M_AP_CMD_BASE
Definition: m2m_types.h:241
M2M_SSL_REQ_WRITE_OWN_CERTS
Definition: m2m_types.h:798
tstrPrng::u16PrngSize
uint16 u16PrngSize
Definition: m2m_types.h:2217
tstrOtaInitHdr::u32OtaPayloadSzie
uint32 u32OtaPayloadSzie
Definition: m2m_types.h:2098
M2M_WIFI_REQ_SET_SCAN_OPTION
Definition: m2m_types.h:588
M2M_REQ_GROUP_MAIN
Definition: m2m_types.h:409
M2M_SSL_RESP_ECC
Definition: m2m_types.h:796
M2M_WIFI_REQ_DISABLE_AP
Definition: m2m_types.h:690
M2M_WIFI_REQ_DEFAULT_CONNECT
Definition: m2m_types.h:634
tstrM2mSetMacAddress
This struct contains the MAC address to be used. The WINC loads the mac address from the efuse by def...
Definition: m2m_types.h:1648
PWR_LOW2
Definition: m2m_types.h:513
PWR_HIGH
Definition: m2m_types.h:515
TLS_SRV_SEC_MAX_FILES
#define TLS_SRV_SEC_MAX_FILES
Definition: m2m_types.h:326
tstrM2MProvisionModeConfig::u8EnableRedirect
uint8 u8EnableRedirect
Definition: m2m_types.h:1719
tstrOtaControlSec::u32OtaSequenceNumber
uint32 u32OtaSequenceNumber
Definition: m2m_types.h:2116
M2M_SSL_RSV
Definition: m2m_types.h:797
REG_CH_8
Definition: m2m_types.h:917
OTA_STATUS_INVAILD_RB_IMAGE
Definition: m2m_types.h:2048
tstrRootCertEntryHeader
Header of a root certificate entry in flash.
Definition: m2m_types.h:1914
tstrM2mWifiConnect::u16Ch
uint16 u16Ch
Definition: m2m_types.h:1154
tstrM2mWifiscanResult
This struct contains the information corresponding to an AP in the scan result list identified by its...
Definition: m2m_types.h:1378
tstrM2MConnInfo::u8SecType
uint8 u8SecType
Definition: m2m_types.h:1763
tstrOtaUpdateInfo::u8DownloadUrlOffset
uint8 u8DownloadUrlOffset
Definition: m2m_types.h:2198
tstrM2mSlpReqTime::u32SleepTime
uint32 u32SleepTime
Definition: m2m_types.h:1444
tstrM2mBleApiMsg
This struct contains a BLE message.
Definition: m2m_types.h:1782
M2M_SSL_REQ_SET_CS_LIST
Definition: m2m_types.h:799
tenuM2mConnState
tenuM2mConnState
This enum contains all the Wi-Fi connection states.
Definition: m2m_types.h:812
M2M_WIFI_REQ_RESTART
Definition: m2m_types.h:544
tstrM2mWifiscanResult::s8rssi
sint8 s8rssi
Definition: m2m_types.h:1381
tstrRootCertRsaKeyInfo::u16ESz
uint16 u16ESz
Definition: m2m_types.h:1871
tstrRootCertFlashHeader::u32nCerts
uint32 u32nCerts
Definition: m2m_types.h:1933
SSID_MODE_VISIBLE
Definition: m2m_types.h:850
M2M_WIFI_REQ_BLE_API_SEND
Definition: m2m_types.h:610
OTA_STATUS_CONNECTION_ERROR
Definition: m2m_types.h:2058
tenuM2mReqGroup
tenuM2mReqGroup
Definition: m2m_types.h:408
PWR_LOW1
Definition: m2m_types.h:511
tstrM2MIPConfig
This struct contains the static IP configuration.
Definition: m2m_types.h:1679
tstrOtaControlSec::u32OtaCortusAppWorkingOffset
uint32 u32OtaCortusAppWorkingOffset
Definition: m2m_types.h:2134
M2M_IP_REQ_ENABLE_DHCP
Definition: m2m_types.h:748
tstrM2MProvisionModeConfig
This struct contains the provisioning mode configuration.
Definition: m2m_types.h:1714
TLS_SRV_SEC_START_PATTERN_LEN
#define TLS_SRV_SEC_START_PATTERN_LEN
Definition: m2m_types.h:329
M2M_WIFI_REQ_DISABLE_WPS
Definition: m2m_types.h:651
M2M_WIFI_REQ_CLIENT_CTRL
Definition: m2m_types.h:726
M2M_WIFI_SEC_802_1X
Definition: m2m_types.h:837
tenuM2mPwrMode
tenuM2mPwrMode
Definition: m2m_types.h:508
tstrM2mIpRsvdPkt::u16PktSz
uint16 u16PktSz
Definition: m2m_types.h:1699
tstrM2mSlpReqTime
This struct contains the sleep time for the Power Save request.
Definition: m2m_types.h:1443
REG_CH_11
Definition: m2m_types.h:923
M2M_WIFI_RESP_CURRENT_RSSI
Definition: m2m_types.h:550
tstrM2MProvisionInfo
This struct contains the provisioning information obtained from the HTTP Provisioning server...
Definition: m2m_types.h:1737
M2M_WIFI_REQ_ENABLE_P2P
Definition: m2m_types.h:706
M2M_WIFI_RESP_CONN_INFO
Definition: m2m_types.h:558
TX_PWR_LOW
Definition: m2m_types.h:531
tstrOtaControlSec::u32OtaRollbackImageOffset
uint32 u32OtaRollbackImageOffset
Definition: m2m_types.h:2126
tstrRootCertPubKeyInfo::u32PubKeyType
uint32 u32PubKeyType
Definition: m2m_types.h:1896
tstrSystemTime::u8Hour
uint8 u8Hour
Definition: m2m_types.h:1803
M2M_WIFI_MODE_CONFIG
Definition: m2m_types.h:978
M2M_WIFI_CH_3
Definition: m2m_types.h:868
tstrM2MWifiRxPacketInfo::u8ServiceClass
uint8 u8ServiceClass
Definition: m2m_types.h:1506
REG_CH_13
Definition: m2m_types.h:927
tstrTlsSrvSecHdr::u32nEntries
uint32 u32nEntries
Definition: m2m_types.h:1964
M2M_SIGMA_ICMP_TX
Definition: m2m_types.h:774
AB_STATUS
Definition: m2m_types.h:2080
tenuM2mWifiMode
tenuM2mWifiMode
This enum contains all the supported Wi-Fi Operation Modes.
Definition: m2m_types.h:974
M2M_WIFI_CH_2
Definition: m2m_types.h:866
M2M_WIFI_MAX_CONFIG_ALL
Definition: m2m_types.h:621
M2M_WIFI_REQ_SET_ENABLE_LOGS
Definition: m2m_types.h:598
tstrOtaControlSec
This struct contains the Control Section. The Control Section is used to define the working image and...
Definition: m2m_types.h:2111
tstrOtaUpdateInfo::u8NcfUpgradeVersion
uint32 u8NcfUpgradeVersion
Definition: m2m_types.h:2190
tenuM2mSecType
tenuM2mSecType
This enum contains all the supported Wi-Fi security types.
Definition: m2m_types.h:828
tstrOtaControlSec::u32OtaRollbackImagHifVer
uint32 u32OtaRollbackImagHifVer
Definition: m2m_types.h:2132
M2M_WIFI_REQ_ENABLE_AP
Definition: m2m_types.h:688
M2M_WIFI_REQ_GET_PRNG
Definition: m2m_types.h:673
M2M_WIFI_REQ_SET_BATTERY_VOLTAGE
Definition: m2m_types.h:596
M2M_SSL_REQ_CERT_VERIF
Definition: m2m_types.h:794
tstrRootCertEntryHeader::strExpDate
tstrSystemTime strExpDate
Definition: m2m_types.h:1917
tstrTlsSrvSecHdr
This struct contains a set of TLS certificates.
Definition: m2m_types.h:1961
tstrM2MScan::u8ChNum
uint8 u8ChNum
Definition: m2m_types.h:1332
tstrM2MAPConfig::u8ListenChannel
uint8 u8ListenChannel
Definition: m2m_types.h:1574
tstrM2MAPConfig::u8SsidHide
uint8 u8SsidHide
Definition: m2m_types.h:1584
M2M_WIFI_RESP_IP_CONFLICT
Definition: m2m_types.h:658
M2M_DEFAULT_CONN_FAIL
Definition: m2m_types.h:457
tstrOtaControlSec::u32OtaCortusAppRollbackVer
uint32 u32OtaCortusAppRollbackVer
Definition: m2m_types.h:2144
tstrM2MWifiRxPacketInfo::u16DataLength
uint16 u16DataLength
Definition: m2m_types.h:1520
uint32
unsigned long uint32
Range of values between 0 to 4294967295.
Definition: nm_bsp.h:110
RB_STATUS
Definition: m2m_types.h:2078
tstrM2mIpRsvdPkt
This struct contains the size and data offset for the received packet.
Definition: m2m_types.h:1698
tenuM2mDefaultConnErrcode
tenuM2mDefaultConnErrcode
Definition: m2m_types.h:454
tstrTlsSrvSecFileEntry
This struct contains a TLS certificate.
Definition: m2m_types.h:1945
tstrM2MIPConfig::u32Gateway
uint32 u32Gateway
Definition: m2m_types.h:1682
tstrOtaUpdateInfo::__PAD8__
uint8 __PAD8__
Definition: m2m_types.h:2202
M2M_SIGMA_UDP_TX_DEFER
Definition: m2m_types.h:778
M2M_OTA_REQ_NOTIF_SCHED
Definition: m2m_types.h:2015
M2M_SIGMA_ICMP_ARP
Definition: m2m_types.h:770
M2M_WIFI_CH_10
Definition: m2m_types.h:882
tenuRootCertPubKeyType
tenuRootCertPubKeyType
This enum contains the supported public key types for TLS root certificates.
Definition: m2m_types.h:1004
EUROPE
Definition: m2m_types.h:935
tstrOtaControlSec::u32OtaControlSecCrc
uint32 u32OtaControlSecCrc
Definition: m2m_types.h:2146
tstrM2mTxPwrLevel
This struct stores the Tx Power levels.
Definition: m2m_types.h:1033
M2M_WIFI_REQ_SCAN
Definition: m2m_types.h:580
M2M_WIFI_WEP_KEY_INDEX_4
Definition: m2m_types.h:443
M2M_WIFI_REQ_START_PROVISION_MODE
Definition: m2m_types.h:562
tstrM2MScanOption::u16PassiveScanTime
uint16 u16PassiveScanTime
Definition: m2m_types.h:1293
M2M_WIFI_REQ_SLEEP
Definition: m2m_types.h:642
M2M_IP_REQ_DISABLE_DHCP
Definition: m2m_types.h:750
tstrM2mWifiConnect::u8NoSaveCred
uint8 u8NoSaveCred
Definition: m2m_types.h:1158
tstrM2MWifiRxPacketInfo::u8FrameType
uint8 u8FrameType
Definition: m2m_types.h:1502
M2M_DEFAULT_CONN_INPROGRESS
Definition: m2m_types.h:455
M2M_SSL_RESP_WRITE_OWN_CERTS
Definition: m2m_types.h:801
tuniM2MWifiAuth::strCred1x
tstr1xAuthCredentials strCred1x
Definition: m2m_types.h:1116
tstrM2mWifiWepParams::u8KeySz
uint8 u8KeySz
Definition: m2m_types.h:1079
M2M_WIFI_RESP_MEMORY_RECOVER
Definition: m2m_types.h:576
M2M_OTA_RESP_UPDATE_STATUS
Definition: m2m_types.h:2027
REG_CH_2
Definition: m2m_types.h:905
tstrM2MAPConfig::u8SecType
uint8 u8SecType
Definition: m2m_types.h:1582
tstrM2MProvisionModeConfig::strApConfig
tstrM2MAPConfig strApConfig
Definition: m2m_types.h:1715
M2M_WIFI_REQ_SET_SCAN_REGION
Definition: m2m_types.h:590
tstrM2mBleApiMsg::u16Len
uint16 u16Len
Definition: m2m_types.h:1783
tstrM2MWPSInfo
WPS Result.
Definition: m2m_types.h:1198
M2M_WIFI_REQ_SEND_WIFI_PACKET
Definition: m2m_types.h:667
tstrM2MWifiRxPacketInfo::s8RSSI
sint8 s8RSSI
Definition: m2m_types.h:1526
M2M_WIFI_REQ_STOP_PROVISION_MODE
Definition: m2m_types.h:566
M2M_WIFI_MAX_STA_ALL
Definition: m2m_types.h:677
tstrM2MWifiRxPacketInfo::u8CipherType
uint8 u8CipherType
Definition: m2m_types.h:1512
tstrM2MAPConfig
This structure holds the configuration parameters for the AP mode. It should be set by the applicatio...
Definition: m2m_types.h:1571
M2M_WIFI_REQ_SET_POWER_PROFILE
Definition: m2m_types.h:592
M2M_WIFI_REQ_SET_SYS_TIME
Definition: m2m_types.h:568
tstrRootCertPubKeyInfo::strRsaKeyInfo
tstrRootCertRsaKeyInfo strRsaKeyInfo
Definition: m2m_types.h:1899
tstrOtaControlSec::u32OtaCortusAppWorkingValidSts
uint32 u32OtaCortusAppWorkingValidSts
Definition: m2m_types.h:2136
M2M_DEVICE_NAME_MAX
#define M2M_DEVICE_NAME_MAX
Definition: m2m_types.h:205
tstrM2MWifiTxPacketInfo::u16HeaderLength
uint16 u16HeaderLength
Definition: m2m_types.h:1544
M2M_WIFI_REQ_GET_CONN_INFO
Definition: m2m_types.h:556
tstrM2MWifiRxPacketInfo
This struct contains the Wi-Fi RX Frame Header. The M2M application has the ability to allow Wi-Fi mo...
Definition: m2m_types.h:1501
tstrM2mWifiWepParams
This struct stores the WEP security key parameters.
Definition: m2m_types.h:1076
tstrM2MIPConfig::u32SubnetMask
uint32 u32SubnetMask
Definition: m2m_types.h:1686
tstrM2MConnInfo
This struct contains the connection information.
Definition: m2m_types.h:1760
tstrOtaUpdateStatusResp::u8OtaUpdateStatusType
uint8 u8OtaUpdateStatusType
Definition: m2m_types.h:2161
tstrOtaInitHdr
This struct contains the OTA image header.
Definition: m2m_types.h:2094
M2M_REQ_GROUP_HIF
Definition: m2m_types.h:412
tstrM2MProvisionInfo::u8SecType
uint8 u8SecType
Definition: m2m_types.h:1742
tstrRootCertEntryHeader::strPubKey
tstrRootCertPubKeyInfo strPubKey
Definition: m2m_types.h:1919
M2M_WIFI_REQ_P2P_INT_CONNECT
Definition: m2m_types.h:703
M2M_ERR_ASSOC_FAIL
Definition: m2m_types.h:480
M2M_SIGMA_SET_SYSTIME
Definition: m2m_types.h:782
tstrTlsSrvSecFileEntry::u32FileAddr
uint32 u32FileAddr
Definition: m2m_types.h:1950
M2M_WIFI_REQ_PASSIVE_SCAN
Definition: m2m_types.h:618
M2M_1X_USR_NAME_MAX
#define M2M_1X_USR_NAME_MAX
Definition: m2m_types.h:217
tstrOtaUpdateInfo::u8NcdRequiredUpgrade
uint8 u8NcdRequiredUpgrade
Definition: m2m_types.h:2196
tstrOtaControlSec::u32OtaCurrentworkingImagFirmwareVer
uint32 u32OtaCurrentworkingImagFirmwareVer
Definition: m2m_types.h:2122
sint8
signed char sint8
Range of values between -128 to 127.
Definition: nm_bsp.h:118
tstrM2MP2PConnect::u8ListenChannel
uint8 u8ListenChannel
Definition: m2m_types.h:1557
M2M_WIFI_CH_8
Definition: m2m_types.h:878
M2M_WIFI_REQ_DISABLE_P2P
Definition: m2m_types.h:708
SSID_MODE_HIDDEN
Definition: m2m_types.h:852
M2M_MAX_SSID_LEN
#define M2M_MAX_SSID_LEN
Definition: m2m_types.h:196
M2M_SIGMA_ENABLE
Definition: m2m_types.h:762
tstrM2MWifiMonitorModeCtrl::u8EnRecvHdr
uint8 u8EnRecvHdr
Definition: m2m_types.h:1485
M2M_WIFI_CH_6
Definition: m2m_types.h:874
M2M_ERR_CONN_INPROGRESS
Definition: m2m_types.h:482
REG_CH_ALL
Definition: m2m_types.h:931
tstrM2Mservercmd
This struct contains the information for the PS Server command.
Definition: m2m_types.h:1629
M2M_DEFAULT_CONN_SCAN_MISMATCH
Definition: m2m_types.h:459
tstrOtaUpdateInfo::u8DownloadUrlSize
uint8 u8DownloadUrlSize
Definition: m2m_types.h:2200
tstrM2MBLEInfo::u8AuthType
uint8 u8AuthType
Definition: m2m_types.h:1226
tstrOtaUpdateInfo::u8NcdUpgradeVersion
uint32 u8NcdUpgradeVersion
Definition: m2m_types.h:2194
M2M_SSL_RESP_SET_CS_LIST
Definition: m2m_types.h:800
M2M_WIFI_REQ_LSN_INT
Definition: m2m_types.h:669
M2M_PS_H_AUTOMATIC
Definition: m2m_types.h:955
M2M_PS_DEEP_AUTOMATIC
Definition: m2m_types.h:958
M2M_WIFI_MAX_SERVER_ALL
Definition: m2m_types.h:732
REG_CH_9
Definition: m2m_types.h:919
tstrM2MScanRegion
This struct contains the Wi-Fi information for the channel regions.
Definition: m2m_types.h:1313
M2M_SIGMA_UDP_TX
Definition: m2m_types.h:776
M2M_SERVER_CMD_BASE
#define M2M_SERVER_CMD_BASE
Definition: m2m_types.h:250
tstrM2mScanDone
This struct contains the Wi-Fi scan result.
Definition: m2m_types.h:1346
tstrM2MAPConfig::u8KeySz
uint8 u8KeySz
Definition: m2m_types.h:1578
tstrM2MWifiTxPacketInfo
This struct contains the Wi-Fi TX Packet Info. The M2M Application has the ability to compose raw Wi-...
Definition: m2m_types.h:1541
TLS_FILE_NAME_MAX
#define TLS_FILE_NAME_MAX
Definition: m2m_types.h:323
M2M_OTA_REQ_SWITCH_FIRMWARE
Definition: m2m_types.h:2019
tstrM2mClientState
This struct contains the information for the PS Client state.
Definition: m2m_types.h:1614
tstrM2MScanOption
This struct contains the configuration options for Wi-Fi scan.
Definition: m2m_types.h:1268
tstrTlsSrvChunkHdr::u16Sig
uint16 u16Sig
Definition: m2m_types.h:1989
M2M_OTA_REQ_TEST
Definition: m2m_types.h:2029
tstrM2MWifiSecInfo
This struct stores the authentication credentials to connect to a Wi-Fi network.
Definition: m2m_types.h:1133
M2M_SIGMA_TA_RECEIVE_STOP
Definition: m2m_types.h:768
M2M_WIFI_REQ_WPS_SCAN
Definition: m2m_types.h:644
tstrM2MGainTable::u8GainTable
uint8 u8GainTable
Definition: m2m_types.h:1840
tstrOtaControlSec::u32OtaFormatVersion
uint32 u32OtaFormatVersion
Definition: m2m_types.h:2114
tstrM2MGainTableRsp::s8ErrorCode
sint8 s8ErrorCode
Definition: m2m_types.h:1854
tstrOtaControlSec::u32OtaCurrentworkingImagOffset
uint32 u32OtaCurrentworkingImagOffset
Definition: m2m_types.h:2120
M2M_REQ_CONFIG_PKT
Definition: m2m_types.h:425
M2M_REQ_DATA_PKT
Definition: m2m_types.h:426
tstrM2MWifiTxPacketInfo::u16PacketSize
uint16 u16PacketSize
Definition: m2m_types.h:1542
tenuM2mApCmd
tenuM2mApCmd
This enum contains all the WINC commands while in AP mode.
Definition: m2m_types.h:687
M2M_WIFI_REQ_CONNECT
Definition: m2m_types.h:632
tstrRootCertPubKeyInfo
Info about the public key contained in a root certificate.
Definition: m2m_types.h:1895
M2M_WIFI_REQ_GET_SYS_TIME
Definition: m2m_types.h:600
M2M_WIFI_CONNECTED
Definition: m2m_types.h:815
tstrM2mEnableLogs
This struct stores logging information.
Definition: m2m_types.h:1047
M2M_WIFI_DISCONNECTED
Definition: m2m_types.h:813
tstrOtaUpdateStatusResp
This struct contains the OTA update status.
Definition: m2m_types.h:2160
tstrM2MAPConfig::u8KeyIndx
uint8 u8KeyIndx
Definition: m2m_types.h:1576
tstrSystemTime::u16Year
uint16 u16Year
Definition: m2m_types.h:1797
M2M_WIFI_SEC_INVALID
Definition: m2m_types.h:829
ROOT_CERT_PUBKEY_RSA
Definition: m2m_types.h:1005
tstrM2mBatteryVoltage
This struct stores the battery voltage.
Definition: m2m_types.h:1061
M2M_IP_REQ_STATIC_IP_CONF
Definition: m2m_types.h:746
tstrOtaUpdateStatusResp::u8OtaUpdateStatus
uint8 u8OtaUpdateStatus
Definition: m2m_types.h:2165
REG_CH_1
Definition: m2m_types.h:903
tstrSystemTime::u8Day
uint8 u8Day
Definition: m2m_types.h:1801
tenuM2mServerCmd
tenuM2mServerCmd
These commands are currently not supported.
Definition: m2m_types.h:725
M2M_WIFI_CH_13
Definition: m2m_types.h:888
M2M_STA_CMD_BASE
#define M2M_STA_CMD_BASE
Definition: m2m_types.h:238
M2M_WIFI_RESP_CLIENT_INFO
Definition: m2m_types.h:728
M2M_ERR_GAIN_TABLE_INVALID
Definition: m2m_types.h:495
M2M_PS_AUTOMATIC
Definition: m2m_types.h:952
tstrM2mPsType::u8PsType
uint8 u8PsType
Definition: m2m_types.h:1427
tenuM2mReqpkt
tenuM2mReqpkt
Definition: m2m_types.h:424
REG_CH_10
Definition: m2m_types.h:921
M2M_WIFI_RESP_ETHERNET_RX_PACKET
Definition: m2m_types.h:606
tstrM2mWifiscanResult::u8ch
uint8 u8ch
Definition: m2m_types.h:1385
tenuM2mScanRegion
tenuM2mScanRegion
This enum contains all the Wi-Fi channel regions.
Definition: m2m_types.h:902
tstrOtaControlSec::u32OtaCortusAppRollbackOffset
uint32 u32OtaCortusAppRollbackOffset
Definition: m2m_types.h:2140
M2M_WIFI_CH_12
Definition: m2m_types.h:886
M2M_WIFI_CH_14
Definition: m2m_types.h:890
TX_PWR_HIGH
Definition: m2m_types.h:527
M2M_MAX_PSK_LEN
#define M2M_MAX_PSK_LEN
Definition: m2m_types.h:201
tstrM2MDeviceNameConfig
This struct contains the Device Name of the WINC. It is used mainly for Wi-Fi Direct device discovery...
Definition: m2m_types.h:1663
tstrM2MGainTable
This struct contains the information of the gain table index from flash to be used.
Definition: m2m_types.h:1839
tstrM2MWifiMonitorModeCtrl::u8FrameSubtype
uint8 u8FrameSubtype
Definition: m2m_types.h:1477
tstrTlsSrvChunkHdr::u16Size32
uint16 u16Size32
Definition: m2m_types.h:1992
M2M_SIGMA_ICMP_RX
Definition: m2m_types.h:772
tstrRootCertPubKeyInfo::strEcsdaKeyInfo
tstrRootCertEcdsaKeyInfo strEcsdaKeyInfo
Definition: m2m_types.h:1901
M2M_PS_MANUAL
Definition: m2m_types.h:962
M2M_WIFI_WEP_KEY_INDEX_1
Definition: m2m_types.h:437
M2M_WIFI_REQ_DISABLE_MONITORING
Definition: m2m_types.h:663
M2M_WIFI_SEC_WEP
Definition: m2m_types.h:835
M2M_CONFIG_CMD_BASE
#define M2M_CONFIG_CMD_BASE
Definition: m2m_types.h:235
tenuM2mIpCmd
tenuM2mIpCmd
This enum contains all the WINC commands related to IP.
Definition: m2m_types.h:745
tstrM2MIPConfig::u32StaticIP
uint32 u32StaticIP
Definition: m2m_types.h:1680
tstrRootCertFlashHeader
Header of the root certificate flash storage area.
Definition: m2m_types.h:1930
M2M_WIFI_RESP_IP_CONFIGURED
Definition: m2m_types.h:655
DL_STATUS
Definition: m2m_types.h:2074
M2M_WIFI_REQ_SEND_ETHERNET_PACKET
Definition: m2m_types.h:604
M2M_WIFI_REQ_SET_GAIN_TABLE
Definition: m2m_types.h:614
M2M_REQ_GROUP_SSL
Definition: m2m_types.h:414
OTA_STATUS_ABORTED
Definition: m2m_types.h:2062
tstrM2mReqScanResult::u8Index
uint8 u8Index
Definition: m2m_types.h:1364
WPS_PIN_TRIGGER
Definition: m2m_types.h:991
M2M_WIFI_RESP_BLE_API_RECV
Definition: m2m_types.h:612
tstrM2MScanOption::u8NumOfSlot
uint8 u8NumOfSlot
Definition: m2m_types.h:1269
OTA_STATUS_UPDATE_INPROGRESS
Definition: m2m_types.h:2054
tstrM2MBLEInfo
BLE Result.
Definition: m2m_types.h:1225
tstrM2MWPSInfo::u8Ch
uint8 u8Ch
Definition: m2m_types.h:1201
OTA_STATUS_IMAGE_VERIF_FAILED
Definition: m2m_types.h:2056
tstrM2MMulticastMac::__PAD8__
uint8 __PAD8__
Definition: m2m_types.h:1828
tstrM2mClientState::u8State
uint8 u8State
Definition: m2m_types.h:1615
M2M_WIFI_RESP_SET_GAIN_TABLE
Definition: m2m_types.h:616
tstrM2MWifiRxPacketInfo::u8Priority
uint8 u8Priority
Definition: m2m_types.h:1508
M2M_WIFI_CH_9
Definition: m2m_types.h:880
M2M_WIFI_RESP_GET_PRNG
Definition: m2m_types.h:675
M2M_WIFI_RESP_SCAN_RESULT
Definition: m2m_types.h:586
REG_CH_12
Definition: m2m_types.h:925
M2M_WIFI_RESP_WIFI_RX_PACKET
Definition: m2m_types.h:665
tenuM2mP2pCmd
tenuM2mP2pCmd
This enum contains all the WINC commands while in P2P mode.
Definition: m2m_types.h:702
uint8
unsigned char uint8
Range of values between 0 to 255.
Definition: nm_bsp.h:96
M2M_WIFI_MAX_AP_ALL
Definition: m2m_types.h:692
tstr1xAuthCredentials
This struct stores the credentials for the user to authenticate with the AAA server (WPA-Enterprise M...
Definition: m2m_types.h:1095
tstrM2mWifiStateChanged::u8ErrCode
uint8 u8ErrCode
Definition: m2m_types.h:1409
tenuM2mScanCh
tenuM2mScanCh
This enum contains all the Wi-Fi RF channels.
Definition: m2m_types.h:863
tstrM2MWifiMonitorModeCtrl::u8ChannelID
uint8 u8ChannelID
Definition: m2m_types.h:1473
uint16
unsigned short uint16
Range of values between 0 to 65535.
Definition: nm_bsp.h:103
tstrM2MDefaultConnResp::s8ErrorCode
sint8 s8ErrorCode
Definition: m2m_types.h:1251
M2M_1X_PWD_MAX
#define M2M_1X_PWD_MAX
Definition: m2m_types.h:224
REG_CH_6
Definition: m2m_types.h:913
tstrTlsSrvChunkHdr::u16TotalSize32
uint16 u16TotalSize32
Definition: m2m_types.h:1990
tstrM2mIpRsvdPkt::u16PktOffset
uint16 u16PktOffset
Definition: m2m_types.h:1701
OTA_STATUS_SUCSESS
Definition: m2m_types.h:2042
OTA_STATUS_INVAILD_ARG
Definition: m2m_types.h:2046
M2M_WIFI_RESP_CON_STATE_CHANGED
Definition: m2m_types.h:640
tstrM2MWPSConnect::u8TriggerType
uint8 u8TriggerType
Definition: m2m_types.h:1176
tstrM2MGainTableRsp
This struct contains response when the firmware has failed to configure the gains from flash...
Definition: m2m_types.h:1853
tstrM2mEnableLogs::u8Enable
uint8 u8Enable
Definition: m2m_types.h:1048
tstrM2mLsnInt::u16LsnInt
uint16 u16LsnInt
Definition: m2m_types.h:1457
tenuM2mSigmaCmd
tenuM2mSigmaCmd
This enum contains all the WINC commands related to Sigma.
Definition: m2m_types.h:761
M2M_OTA_REQ_ROLLBACK
Definition: m2m_types.h:2021
M2M_P2P_CMD_BASE
#define M2M_P2P_CMD_BASE
Definition: m2m_types.h:244
Generated on Fri Aug 18 2017 00:42:03 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: m2m_wifi.h Source File

m2m_wifi.h
1
45 #ifndef __M2M_WIFI_H__
46 #define __M2M_WIFI_H__
47
48 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
49 INCLUDES
50 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
51
52 #include "common/include/nm_common.h"
53 #include "driver/include/m2m_types.h"
54 #include "driver/source/nmdrv.h"
55
56 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
57 MACROS
58 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
81 typedef enum {
82 MANAGEMENT = 0x00,
83 CONTROL = 0x04,
84 DATA_BASICTYPE = 0x08,
85 RESERVED = 0x0C
86 }tenuWifiFrameType;
87
88
107 typedef enum {
108 /* Sub-Types related to Management */
109 ASSOC_REQ = 0x00,
110 ASSOC_RSP = 0x10,
111 REASSOC_REQ = 0x20,
112 REASSOC_RSP = 0x30,
113 PROBE_REQ = 0x40,
114 PROBE_RSP = 0x50,
115 BEACON = 0x80,
116 ATIM = 0x90,
117 DISASOC = 0xA0,
118 AUTH = 0xB0,
119 DEAUTH = 0xC0,
120 ACTION = 0xD0,
122 /* Sub-Types related to Control */
123 PS_POLL = 0xA4,
124 RTS = 0xB4,
125 CTS = 0xC4,
126 ACK = 0xD4,
127 CFEND = 0xE4,
128 CFEND_ACK = 0xF4,
129 BLOCKACK_REQ = 0x84,
130 BLOCKACK = 0x94,
132 /* Sub-Types related to Data */
133 DATA = 0x08,
134 DATA_ACK = 0x18,
135 DATA_POLL = 0x28,
136 DATA_POLL_ACK = 0x38,
137 NULL_FRAME = 0x48,
138 CFACK = 0x58,
139 CFPOLL = 0x68,
140 CFPOLL_ACK = 0x78,
141 QOS_DATA = 0x88,
142 QOS_DATA_ACK = 0x98,
143 QOS_DATA_POLL = 0xA8,
144 QOS_DATA_POLL_ACK = 0xB8,
145 QOS_NULL_FRAME = 0xC8,
146 QOS_CFPOLL = 0xE8,
147 QOS_CFPOLL_ACK = 0xF8
148 }tenuSubTypes;
149
150
164 typedef enum {
165 ISSID = 0,
166 ISUPRATES = 1,
167 IFHPARMS = 2,
168 IDSPARMS = 3,
169 ICFPARMS = 4,
170 ITIM = 5,
171 IIBPARMS = 6,
172 ICOUNTRY = 7,
173 IEDCAPARAMS = 12,
174 ITSPEC = 13,
175 ITCLAS = 14,
176 ISCHED = 15,
177 ICTEXT = 16,
178 IPOWERCONSTRAINT = 32,
179 IPOWERCAPABILITY = 33,
180 ITPCREQUEST = 34,
181 ITPCREPORT = 35,
182 ISUPCHANNEL = 36,
183 ICHSWANNOUNC = 37,
184 IMEASUREMENTREQUEST = 38,
185 IMEASUREMENTREPORT = 39,
186 IQUIET = 40,
187 IIBSSDFS = 41,
188 IERPINFO = 42,
189 ITSDELAY = 43,
190 ITCLASPROCESS = 44,
191 IHTCAP = 45,
192 IQOSCAP = 46,
193 IRSNELEMENT = 48,
194 IEXSUPRATES = 50,
195 IEXCHSWANNOUNC = 60,
196 IHTOPERATION = 61,
197 ISECCHOFF = 62,
198 I2040COEX = 72,
199 I2040INTOLCHREPORT = 73,
200 IOBSSSCAN = 74,
201 IEXTCAP = 127,
202 IWMM = 221,
203 IWPAELEMENT = 221
204 }tenuInfoElementId;
205
220 typedef enum{
221 ESS = 0x01,
222 IBSS = 0x02,
223 POLLABLE = 0x04,
224 POLLREQ = 0x08,
225 PRIVACY = 0x10,
226 SHORTPREAMBLE = 0x20,
227 SHORTSLOT = 0x400,
228 PBCC = 0x40,
229 CHANNELAGILITY = 0x80,
230 SPECTRUM_MGMT = 0x100,
231 DSSS_OFDM = 0x2000
232 }tenuWifiCapability;
233
234
278 typedef void (*tpfAppWifiCb) (uint8 u8MsgType, void * pvMsg);
279
307 typedef void (*tpfAppEthCb) (uint8 u8MsgType, void * pvMsg,void * pvCtrlBuf);
308
337 typedef void (*tpfAppMonCb) (tstrM2MWifiRxPacketInfo *pstrWifiRxPacket, uint8 * pu8Payload, uint16 u16PayloadSize);
338
357 typedef struct {
358 tpfAppWifiCb pfAppWifiCb;
359 tpfAppEthCb pfAppEthCb;
360 uint8 * au8ethRcvBuf;
361 uint16 u16ethRcvBufSize;
362 } tstrEthInitParam;
363
386 typedef struct{
387 uint16 u16DataSize;
388 uint16 u16RemainigDataSize;
389 } tstrM2mIpCtrlBuf;
390
391
405 typedef struct {
406 tpfAppWifiCb pfAppWifiCb;
407 tpfAppMonCb pfAppMonCb;
408 tstrEthInitParam strEthInitParam ;
409 uint8 GainTableIndex;
410 uint8 __PAD24__[3];
411 } tstrWifiInitParam;
412
413
414 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
415 FUNCTION PROTOTYPES
416 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
420 #ifdef __cplusplus
421 extern "C" {
422 #endif
423
439 NMI_API sint8 m2m_wifi_download_mode(void);
440
492 NMI_API sint8 m2m_wifi_init(tstrWifiInitParam * pWifiInitParam);
493
513 NMI_API sint8 m2m_wifi_deinit(void * arg);
514
525 sint8 m2m_wifi_init_hold(void);
539 sint8 m2m_wifi_init_start(tstrWifiInitParam * param);
540
550 sint8 m2m_wifi_reinit(tstrWifiInitParam * param);
560 sint8 m2m_wifi_reinit_hold(void);
561
571 sint8 m2m_wifi_reinit_start(tstrWifiInitParam * param);
572
596 NMI_API void m2m_wifi_yield(void);
610 NMI_API sint8 m2m_wifi_handle_events(void * arg);
611
646 NMI_API sint8 m2m_wifi_default_connect(void);
647
712 NMI_API sint8 m2m_wifi_connect(char *pcSsid, uint8 u8SsidLen, uint8 u8SecType, void *pvAuthInfo, uint16 u16Ch);
713
785 NMI_API sint8 m2m_wifi_connect_sc(char *pcSsid, uint8 u8SsidLen, uint8 u8SecType, void *pvAuthInfo, uint16 u16Ch, uint8 u8SaveCred);
786
812 NMI_API sint8 m2m_wifi_disconnect(void);
813
937 NMI_API sint8 m2m_wifi_start_provision_mode(tstrM2MAPConfig *pstrAPConfig, char *pcHttpServerDomainName, uint8 bEnableHttpRedirect);
938
958 NMI_API sint8 m2m_wifi_stop_provision_mode(void);
959
1049 NMI_API sint8 m2m_wifi_get_connection_info(void);
1050
1071 NMI_API sint8 m2m_wifi_set_mac_address(uint8 au8MacAddress[6]);
1072
1174 NMI_API sint8 m2m_wifi_ble_set_gain_table(uint8 table_idx);
1187 NMI_API sint8 m2m_wifi_wps(uint8 u8TriggerType,const char *pcPinNumber);
1188
1200 NMI_API sint8 m2m_wifi_wps_disable(void);
1201
1287 NMI_API sint8 m2m_wifi_p2p(uint8 u8Channel);
1288
1303 NMI_API sint8 m2m_wifi_p2p_disconnect(void);
1304
1398 NMI_API sint8 m2m_wifi_enable_ap(CONST tstrM2MAPConfig* pstrM2MAPConfig);
1399
1414 NMI_API sint8 m2m_wifi_disable_ap(void);
1415
1447 NMI_API sint8 m2m_wifi_set_static_ip(tstrM2MIPConfig * pstrStaticIPConf);
1448
1466 NMI_API sint8 m2m_wifi_request_dhcp_client(void);
1467
1487 NMI_API sint8 m2m_wifi_request_dhcp_server(uint8* addr);
1488
1516 NMI_API sint8 m2m_wifi_enable_dhcp(uint8 u8DhcpEn );
1517
1518
1542 NMI_API sint8 m2m_wifi_set_scan_options(tstrM2MScanOption* ptstrM2MScanOption);
1543
1567 NMI_API sint8 m2m_wifi_set_scan_region(uint16 ScanRegion);
1568
1698 NMI_API sint8 m2m_wifi_request_scan(uint8 ch);
1699
1732 sint8 m2m_wifi_request_scan_passive(uint8 ch);
1733
1844 NMI_API uint8 m2m_wifi_get_num_ap_found(void);
1845
1972 NMI_API sint8 m2m_wifi_req_scan_result(uint8 index);
1973
2036 NMI_API sint8 m2m_wifi_req_curr_rssi(void);
2037
2055 NMI_API sint8 m2m_wifi_req_restrict_ble(void);
2056
2073 NMI_API sint8 m2m_wifi_req_unrestrict_ble(void);
2074
2101 NMI_API sint8 m2m_wifi_get_otp_mac_address(uint8 *pu8MacAddr, uint8 * pu8IsValid);
2102
2124 NMI_API sint8 m2m_wifi_get_mac_address(uint8 *pu8MacAddr);
2125
2149 NMI_API sint8 m2m_wifi_set_sleep_mode(uint8 PsTyp, uint8 BcastEn);
2150
2174 NMI_API sint8 m2m_wifi_request_sleep(uint32 u32SlpReqTime);
2175
2190 NMI_API uint8 m2m_wifi_get_sleep_mode(void);
2191
2192 #if 0
2193 /*
2194 * These two functions are for a mode in which two WINC ICs communicate with each other
2195 * via probe request and probe response frames. This mode is not supported in WINC fw.
2196 */
2197 NMI_API sint8 m2m_wifi_req_client_ctrl(uint8 cmd);
2198 NMI_API sint8 m2m_wifi_req_server_init(uint8 ch);
2199 #endif
2200
2217 NMI_API sint8 m2m_wifi_set_device_name(uint8 *pu8DeviceName, uint8 u8DeviceNameLength);
2218
2239 NMI_API sint8 m2m_wifi_set_lsn_int(tstrM2mLsnInt *pstrM2mLsnInt);
2240
2343 NMI_API sint8 m2m_wifi_enable_monitoring_mode(tstrM2MWifiMonitorModeCtrl *pstrMtrCtrl, uint8 *pu8PayloadBuffer,
2344 uint16 u16BufferSize, uint16 u16DataOffset);
2345
2359 NMI_API sint8 m2m_wifi_disable_monitoring_mode(void);
2360
2387 NMI_API sint8 m2m_wifi_send_wlan_pkt(uint8 *pu8WlanPacket, uint16 u16WlanHeaderLength, uint16 u16WlanPktSize);
2388
2412 NMI_API sint8 m2m_wifi_send_ethernet_pkt(uint8* pu8Packet,uint16 u16PacketSize);
2413
2444 NMI_API sint8 m2m_wifi_enable_sntp(uint8 bEnable);
2445
2467 NMI_API sint8 m2m_wifi_set_sytem_time(uint32 u32UTCSeconds);
2468
2494 NMI_API sint8 m2m_wifi_get_sytem_time(void);
2495
2559 NMI_API sint8 m2m_wifi_set_cust_InfoElement(uint8* pau8M2mCustInfoElement);
2560
2579 sint8 m2m_wifi_set_power_profile(uint8 u8PwrMode);
2580
2594 sint8 m2m_wifi_set_tx_power(uint8 u8TxPwrLevel);
2595
2612 sint8 m2m_wifi_enable_firmware_logs(uint8 u8Enable);
2625 sint8 m2m_wifi_set_battery_voltage(uint16 u16BattVoltx100);
2626
2643 NMI_API sint8 m2m_wifi_ble_api_send(uint8* msg, uint32 len);
2644
2645
2674 NMI_API sint8 m2m_wifi_enable_mac_mcast(uint8* pu8MulticastMacAddress, uint8 u8AddRemove);
2675
2696 NMI_API sint8 m2m_wifi_set_receive_buffer(void* pvBuffer,uint16 u16BufferLen);
2697
2715 uint32 m2m_wifi_get_chipId(void);
2727 sint8 m2m_wifi_check_ota_rb(void);
2740 sint8 m2m_wifi_get_firmware_version(tstrM2mRev *pstrRev);
2741
2757 NMI_API sint8 m2m_ota_get_firmware_version(tstrM2mRev *pstrRev);
2758
2771 sint8 m2m_wifi_prng_get_random_bytes(uint8 * pu8PrngBuff,uint16 u16PrngSize);
2772
2773 #ifdef __cplusplus
2774 }
2775 #endif
2776 #endif /* __M2M_WIFI_H__ */
2777
IHTOPERATION
Definition: m2m_wifi.h:196
IHTCAP
Definition: m2m_wifi.h:191
tstrM2mLsnInt
This struct contains the Listen Interval. It is the value of the Wi-Fi StA Listen Interval when power...
Definition: m2m_types.h:1456
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.
Definition: m2m_wifi.h:405
tenuInfoElementId
tenuInfoElementId
Enumeration for the Wi-Fi Information Element(IE) IDs, which indicates the specific type of IEs...
Definition: m2m_wifi.h:164
IEXSUPRATES
Definition: m2m_wifi.h:194
QOS_NULL_FRAME
Definition: m2m_wifi.h:145
BLOCKACK
Definition: m2m_wifi.h:130
CFPOLL_ACK
Definition: m2m_wifi.h:140
CFEND_ACK
Definition: m2m_wifi.h:128
tstrM2MWifiMonitorModeCtrl
This struct contains the Wi-Fi Monitor Mode Filter. It sets the filtering criteria for WLAN packets w...
Definition: m2m_types.h:1472
m2m_wifi_init
NMI_API sint8 m2m_wifi_init(tstrWifiInitParam *pWifiInitParam)
Synchronous API that initialises the WINC driver.
tstrEthInitParam::pfAppWifiCb
tpfAppWifiCb pfAppWifiCb
Definition: m2m_wifi.h:358
m2m_wifi_set_receive_buffer
NMI_API sint8 m2m_wifi_set_receive_buffer(void *pvBuffer, uint16 u16BufferLen)
Asynchronous API to set or change the size of the WINC IC&#39;s receive buffer.
tenuSubTypes
tenuSubTypes
Enumeration for Wi-Fi MAC Frame subtype code (6-bit). The frame subtypes fall into one of the three f...
Definition: m2m_wifi.h:107
RESERVED
Definition: m2m_wifi.h:85
ITPCREPORT
Definition: m2m_wifi.h:181
QOS_DATA_POLL
Definition: m2m_wifi.h:143
DATA_POLL
Definition: m2m_wifi.h:135
tpfAppEthCb
void(* tpfAppEthCb)(uint8 u8MsgType, void *pvMsg, void *pvCtrlBuf)
Ethernet (Bypass mode) notification callback function receiving Bypass mode events as defined in the ...
Definition: m2m_wifi.h:307
tstrEthInitParam::u16ethRcvBufSize
uint16 u16ethRcvBufSize
Definition: m2m_wifi.h:361
m2m_wifi_req_curr_rssi
NMI_API sint8 m2m_wifi_req_curr_rssi(void)
Asynchronous API to request the current Receive Signal Strength (RSSI) of the current connection...
PRIVACY
Definition: m2m_wifi.h:225
m2m_wifi_get_num_ap_found
NMI_API uint8 m2m_wifi_get_num_ap_found(void)
Synchronous API to retrieve the number of AP&#39;s found during the last scan operation.
ACK
Definition: m2m_wifi.h:126
m2m_wifi_set_cust_InfoElement
NMI_API sint8 m2m_wifi_set_cust_InfoElement(uint8 *pau8M2mCustInfoElement)
Asynchronous API to add or remove a user-defined Information Element.
m2m_wifi_set_power_profile
sint8 m2m_wifi_set_power_profile(uint8 u8PwrMode)
Change the power profile mode.
tpfAppMonCb
void(* tpfAppMonCb)(tstrM2MWifiRxPacketInfo *pstrWifiRxPacket, uint8 *pu8Payload, uint16 u16PayloadSize)
Wi-Fi monitoring mode callback function. This function delivers all received wi-Fi packets to the app...
Definition: m2m_wifi.h:337
IDSPARMS
Definition: m2m_wifi.h:168
BEACON
Definition: m2m_wifi.h:115
ASSOC_REQ
Definition: m2m_wifi.h:109
PBCC
Definition: m2m_wifi.h:228
ASSOC_RSP
Definition: m2m_wifi.h:110
m2m_wifi_req_restrict_ble
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 po...
m2m_wifi_enable_firmware_logs
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...
ITIM
Definition: m2m_wifi.h:170
tstrM2mIpCtrlBuf
Structure holding the incoming buffer&#39;s data size information, indicating the data size of the buffer...
Definition: m2m_wifi.h:386
ISECCHOFF
Definition: m2m_wifi.h:197
m2m_wifi_set_lsn_int
NMI_API sint8 m2m_wifi_set_lsn_int(tstrM2mLsnInt *pstrM2mLsnInt)
Asynchronous API to set Wi-Fi listen interval for power save operation.
IWPAELEMENT
Definition: m2m_wifi.h:203
PROBE_RSP
Definition: m2m_wifi.h:114
ITSDELAY
Definition: m2m_wifi.h:189
m2m_wifi_get_mac_address
NMI_API sint8 m2m_wifi_get_mac_address(uint8 *pu8MacAddr)
Synchronous API to retrieve the MAC address currently in use on the device.
IERPINFO
Definition: m2m_wifi.h:188
m2m_wifi_request_sleep
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.
tstrEthInitParam::pfAppEthCb
tpfAppEthCb pfAppEthCb
Definition: m2m_wifi.h:359
m2m_wifi_set_static_ip
NMI_API sint8 m2m_wifi_set_static_ip(tstrM2MIPConfig *pstrStaticIPConf)
Synchronous API to manually assign a (static) IP address to the WINC IC.
DSSS_OFDM
Definition: m2m_wifi.h:231
ITSPEC
Definition: m2m_wifi.h:174
m2m_wifi_p2p
NMI_API sint8 m2m_wifi_p2p(uint8 u8Channel)
Asynchronous API for enabling Wi-Fi Direct (P2P) mode in the WINC IC.
SHORTSLOT
Definition: m2m_wifi.h:227
ICOUNTRY
Definition: m2m_wifi.h:172
m2m_wifi_request_dhcp_client
NMI_API sint8 m2m_wifi_request_dhcp_client(void)
Legacy (deprecated) Asynchronous API for starting a DHCP client on the WINC IC.
CTS
Definition: m2m_wifi.h:125
IOBSSSCAN
Definition: m2m_wifi.h:200
BLOCKACK_REQ
Definition: m2m_wifi.h:129
CFACK
Definition: m2m_wifi.h:138
IEXCHSWANNOUNC
Definition: m2m_wifi.h:195
CONST
#define CONST
Definition: nm_bsp.h:56
tpfAppWifiCb
void(* tpfAppWifiCb)(uint8 u8MsgType, void *pvMsg)
This is the main callback function for the Wi-Fi driver and is responsible for processing any M2M_WIF...
Definition: m2m_wifi.h:278
ICFPARMS
Definition: m2m_wifi.h:169
m2m_wifi_connect
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.
m2m_wifi_yield
NMI_API void m2m_wifi_yield(void)
Yield from processing more synchronous M2M events.
m2m_ota_get_firmware_version
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...
m2m_wifi_get_firmware_version
sint8 m2m_wifi_get_firmware_version(tstrM2mRev *pstrRev)
Synchronous API to obtain the firmware version currently running on the WINC IC.
m2m_wifi_deinit
NMI_API sint8 m2m_wifi_deinit(void *arg)
Synchronous API that de-initialises the WINC driver.
CFEND
Definition: m2m_wifi.h:127
DISASOC
Definition: m2m_wifi.h:117
tstrWifiInitParam::GainTableIndex
uint8 GainTableIndex
Definition: m2m_wifi.h:409
m2m_wifi_ble_set_gain_table
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 confi...
SHORTPREAMBLE
Definition: m2m_wifi.h:226
POLLABLE
Definition: m2m_wifi.h:223
QOS_DATA
Definition: m2m_wifi.h:141
CONTROL
Definition: m2m_wifi.h:83
AUTH
Definition: m2m_wifi.h:118
NULL_FRAME
Definition: m2m_wifi.h:137
DATA
Definition: m2m_wifi.h:133
m2m_wifi_init_start
sint8 m2m_wifi_init_start(tstrWifiInitParam *param)
Second part of m2m_wifi_init, continuing from where m2m_wifi_init_hold left off.
m2m_wifi_disable_ap
NMI_API sint8 m2m_wifi_disable_ap(void)
Synchronous API to disable access point mode on the WINC IC.
tstrWifiInitParam::strEthInitParam
tstrEthInitParam strEthInitParam
Definition: m2m_wifi.h:408
m2m_wifi_req_scan_result
NMI_API sint8 m2m_wifi_req_scan_result(uint8 index)
Asynchronous API to request the information of an access point discovered via scanning.
tstrM2MIPConfig
This struct contains the static IP configuration.
Definition: m2m_types.h:1679
m2m_wifi_set_tx_power
sint8 m2m_wifi_set_tx_power(uint8 u8TxPwrLevel)
set the TX power tenuM2mTxPwrLevel
tstrEthInitParam
Structure to hold Ethernet interface parameters. Structure is to be defined and have its attributes s...
Definition: m2m_wifi.h:357
m2m_wifi_reinit
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.
m2m_wifi_set_sytem_time
NMI_API sint8 m2m_wifi_set_sytem_time(uint32 u32UTCSeconds)
Asynchronous function for setting the system time within the WINC IC.
ICTEXT
Definition: m2m_wifi.h:177
m2m_wifi_set_sleep_mode
NMI_API sint8 m2m_wifi_set_sleep_mode(uint8 PsTyp, uint8 BcastEn)
Synchronous API to set the power-save mode of the WINC IC.
m2m_wifi_set_scan_region
NMI_API sint8 m2m_wifi_set_scan_region(uint16 ScanRegion)
Synchronous API for configuring the regulatory restrictions that may affect the WINC ICs scanning beh...
m2m_wifi_set_mac_address
NMI_API sint8 m2m_wifi_set_mac_address(uint8 au8MacAddress[6])
Synchronous API for assigning a MAC address to the WINC IC.
QOS_CFPOLL
Definition: m2m_wifi.h:146
tstrEthInitParam::au8ethRcvBuf
uint8 * au8ethRcvBuf
Definition: m2m_wifi.h:360
m2m_wifi_set_device_name
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.
DATA_BASICTYPE
Definition: m2m_wifi.h:84
PROBE_REQ
Definition: m2m_wifi.h:113
m2m_wifi_enable_dhcp
NMI_API sint8 m2m_wifi_enable_dhcp(uint8 u8DhcpEn)
Asynchronous function to control the DHCP client functionality within the WINC IC.
IPOWERCAPABILITY
Definition: m2m_wifi.h:179
CHANNELAGILITY
Definition: m2m_wifi.h:229
CFPOLL
Definition: m2m_wifi.h:139
QOS_CFPOLL_ACK
Definition: m2m_wifi.h:147
m2m_wifi_init_hold
sint8 m2m_wifi_init_hold(void)
First part of m2m_wifi_init, up to the point of initializing spi for flash access.
m2m_wifi_check_ota_rb
sint8 m2m_wifi_check_ota_rb(void)
Synchronous API to check presence and compatibility of the WINC image that is stored in the inactive ...
IIBPARMS
Definition: m2m_wifi.h:171
IFHPARMS
Definition: m2m_wifi.h:167
ITPCREQUEST
Definition: m2m_wifi.h:180
uint32
unsigned long uint32
Range of values between 0 to 4294967295.
Definition: nm_bsp.h:110
QOS_DATA_POLL_ACK
Definition: m2m_wifi.h:144
m2m_wifi_get_sleep_mode
NMI_API uint8 m2m_wifi_get_sleep_mode(void)
Synchronous API to retrieve the current power save mode of the WINC IC.
REASSOC_REQ
Definition: m2m_wifi.h:111
I2040COEX
Definition: m2m_wifi.h:198
ICHSWANNOUNC
Definition: m2m_wifi.h:183
ISUPCHANNEL
Definition: m2m_wifi.h:182
m2m_wifi_ble_api_send
NMI_API sint8 m2m_wifi_ble_api_send(uint8 *msg, uint32 len)
m2m_wifi_get_sytem_time
NMI_API sint8 m2m_wifi_get_sytem_time(void)
Asynchronous API to obtain the system time in use by the WINC IC.
m2m_wifi_connect_sc
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...
QOS_DATA_ACK
Definition: m2m_wifi.h:142
IWMM
Definition: m2m_wifi.h:202
RTS
Definition: m2m_wifi.h:124
tstrM2MAPConfig
This structure holds the configuration parameters for the AP mode. It should be set by the applicatio...
Definition: m2m_types.h:1571
NMI_API
#define NMI_API
Definition: nm_bsp.h:52
tstrM2MWifiRxPacketInfo
This struct contains the Wi-Fi RX Frame Header. The M2M application has the ability to allow Wi-Fi mo...
Definition: m2m_types.h:1501
tstrM2mIpCtrlBuf::u16DataSize
uint16 u16DataSize
Definition: m2m_wifi.h:387
m2m_wifi_get_otp_mac_address
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. ...
IEDCAPARAMS
Definition: m2m_wifi.h:173
m2m_wifi_wps_disable
NMI_API sint8 m2m_wifi_wps_disable(void)
Synchronous API that disables Wi-Fi Protected Setup mode in the WINC IC.
IMEASUREMENTREPORT
Definition: m2m_wifi.h:185
DATA_ACK
Definition: m2m_wifi.h:134
sint8
signed char sint8
Range of values between -128 to 127.
Definition: nm_bsp.h:118
IQOSCAP
Definition: m2m_wifi.h:192
m2m_wifi_reinit_hold
sint8 m2m_wifi_reinit_hold(void)
First part of m2m_wifi_reinit, up to the point of initializing spi for flash access.
tstrWifiInitParam::pfAppMonCb
tpfAppMonCb pfAppMonCb
Definition: m2m_wifi.h:407
m2m_wifi_reinit_start
sint8 m2m_wifi_reinit_start(tstrWifiInitParam *param)
Second part of m2m_wifi_reinit, continuing from where m2m_wifi_reinit_hold left off.
tenuWifiCapability
tenuWifiCapability
Enumeration for capability Information field bit. The value of the capability information field from ...
Definition: m2m_wifi.h:220
m2m_wifi_send_wlan_pkt
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.
m2m_wifi_disable_monitoring_mode
NMI_API sint8 m2m_wifi_disable_monitoring_mode(void)
Asynchronous API to disable Wi-Fi monitoring (promiscuous receive) mode.
ATIM
Definition: m2m_wifi.h:116
m2m_wifi_stop_provision_mode
NMI_API sint8 m2m_wifi_stop_provision_mode(void)
Synchronous API for terminating provisioning mode on the WINC IC.
m2m_wifi_enable_mac_mcast
NMI_API sint8 m2m_wifi_enable_mac_mcast(uint8 *pu8MulticastMacAddress, uint8 u8AddRemove)
Asynchronous API to add or remove MAC addresses in the multicast filter.
tstrM2mIpCtrlBuf::u16RemainigDataSize
uint16 u16RemainigDataSize
Definition: m2m_wifi.h:388
m2m_wifi_enable_sntp
NMI_API sint8 m2m_wifi_enable_sntp(uint8 bEnable)
Asynchronous API to enable or disable the SNTP client running on the WINC IC.
m2m_wifi_get_connection_info
NMI_API sint8 m2m_wifi_get_connection_info(void)
Asynchronous API for retrieving the WINC IC&#39;s connection status.
POLLREQ
Definition: m2m_wifi.h:224
DATA_POLL_ACK
Definition: m2m_wifi.h:136
tstrM2MScanOption
This struct contains the configuration options for Wi-Fi scan.
Definition: m2m_types.h:1268
IPOWERCONSTRAINT
Definition: m2m_wifi.h:178
ACTION
Definition: m2m_wifi.h:120
m2m_wifi_set_scan_options
NMI_API sint8 m2m_wifi_set_scan_options(tstrM2MScanOption *ptstrM2MScanOption)
Synchronous API for configuring the behaviour of the WINC IC&#39;s network scanning functions.
m2m_wifi_request_scan
NMI_API sint8 m2m_wifi_request_scan(uint8 ch)
Asynchronous API to request the WINC IC perform a scan for networks.
m2m_wifi_get_chipId
uint32 m2m_wifi_get_chipId(void)
Synchronous API to obtain the firmware WINC chip ID.
m2m_wifi_p2p_disconnect
NMI_API sint8 m2m_wifi_p2p_disconnect(void)
Synchronous API to disable Wi-Fi Direct (P2P) Mode on the WINC IC.
ISSID
Definition: m2m_wifi.h:165
tenuWifiFrameType
tenuWifiFrameType
Enumeration for Wi-Fi MAC frame type codes (2-bit) The following types are used to identify the type ...
Definition: m2m_wifi.h:81
IRSNELEMENT
Definition: m2m_wifi.h:193
m2m_wifi_download_mode
NMI_API sint8 m2m_wifi_download_mode(void)
Synchronous API that prepares the WINC IC to enter firmware or certificate download mode...
SPECTRUM_MGMT
Definition: m2m_wifi.h:230
IMEASUREMENTREQUEST
Definition: m2m_wifi.h:184
ITCLASPROCESS
Definition: m2m_wifi.h:190
IQUIET
Definition: m2m_wifi.h:186
m2m_wifi_enable_monitoring_mode
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.
m2m_wifi_send_ethernet_pkt
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.
IBSS
Definition: m2m_wifi.h:222
ESS
Definition: m2m_wifi.h:221
m2m_wifi_set_battery_voltage
sint8 m2m_wifi_set_battery_voltage(uint16 u16BattVoltx100)
ISUPRATES
Definition: m2m_wifi.h:166
DEAUTH
Definition: m2m_wifi.h:119
m2m_wifi_enable_ap
NMI_API sint8 m2m_wifi_enable_ap(CONST tstrM2MAPConfig *pstrM2MAPConfig)
Asynchronous API to enable access point (AKA "hot-spot") mode on the WINC IC.
MANAGEMENT
Definition: m2m_wifi.h:82
IEXTCAP
Definition: m2m_wifi.h:201
ITCLAS
Definition: m2m_wifi.h:175
tstrWifiInitParam::pfAppWifiCb
tpfAppWifiCb pfAppWifiCb
Definition: m2m_wifi.h:406
m2m_wifi_wps
NMI_API sint8 m2m_wifi_wps(uint8 u8TriggerType, const char *pcPinNumber)
Asynchronous API to engage the WINC IC&#39;s Wi-Fi Protected Setup (enrolee) function.
m2m_wifi_request_dhcp_server
NMI_API sint8 m2m_wifi_request_dhcp_server(uint8 *addr)
Legacy (deprecated) Asynchronous function to start a DHCP client on the WINC IC.
IIBSSDFS
Definition: m2m_wifi.h:187
ISCHED
Definition: m2m_wifi.h:176
m2m_wifi_handle_events
NMI_API sint8 m2m_wifi_handle_events(void *arg)
Synchronous M2M event handler function.
m2m_wifi_start_provision_mode
NMI_API sint8 m2m_wifi_start_provision_mode(tstrM2MAPConfig *pstrAPConfig, char *pcHttpServerDomainName, uint8 bEnableHttpRedirect)
Asynchronous API for control of Wi-Fi provisioning functionality.
uint8
unsigned char uint8
Range of values between 0 to 255.
Definition: nm_bsp.h:96
m2m_wifi_req_unrestrict_ble
NMI_API sint8 m2m_wifi_req_unrestrict_ble(void)
Asynchronous API to request un-restricting of BLE functionality by reverting the BLE processor to ful...
PS_POLL
Definition: m2m_wifi.h:123
uint16
unsigned short uint16
Range of values between 0 to 65535.
Definition: nm_bsp.h:103
REASSOC_RSP
Definition: m2m_wifi.h:112
m2m_wifi_request_scan_passive
sint8 m2m_wifi_request_scan_passive(uint8 ch)
m2m_wifi_default_connect
NMI_API sint8 m2m_wifi_default_connect(void)
Asynchronous API that attempts to reconnect to the last-associated access point.
m2m_wifi_disconnect
NMI_API sint8 m2m_wifi_disconnect(void)
Synchronous API to request disconnection from a network.
I2040INTOLCHREPORT
Definition: m2m_wifi.h:199
Generated on Fri Aug 18 2017 00:42:03 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: nm_bsp.h Source File

nm_bsp.h
1
49 #ifndef _NM_BSP_H_
50 #define _NM_BSP_H_
51
52 #define NMI_API
53
56 #define CONST const
57
58 #ifndef NULL
59 #define NULL ((void*)0)
60 #endif
61
66 #define BSP_MIN(x,y) ((x)>(y)?(y):(x))
67
72
88 typedef void (*tpfNmBspIsr)(void);
89
95 typedef unsigned char uint8;
96
102 typedef unsigned short uint16;
103
109 typedef unsigned long uint32;
110
111
117 typedef signed char sint8;
118
124 typedef signed short sint16;
125
132 typedef signed long sint32;
134
135 #ifndef CORTUS_APP
136
137
138 #ifdef __cplusplus
139 extern "C"{
140 #endif
141
157 sint8 nm_bsp_init(void);
168 sint8 nm_bsp_deinit(void);
179 void nm_bsp_reset(void);
193 void nm_bsp_sleep(uint32 u32TimeMsec);
206 void nm_bsp_register_isr(tpfNmBspIsr pfIsr);
218 void nm_bsp_interrupt_ctrl(uint8 u8Enable);
221 #ifdef __cplusplus
222 }
223 #endif
224
225 #endif
226
232 #ifdef _NM_BSP_BIG_END
233
234 #define NM_BSP_B_L_32(x) \
235 ((((x) & 0x000000FF) << 24) + \
236 (((x) & 0x0000FF00) << 8) + \
237 (((x) & 0x00FF0000) >> 8) + \
238 (((x) & 0xFF000000) >> 24))
239
240 #define NM_BSP_B_L_16(x) \
241 ((((x) & 0x00FF) << 8) + \
242 (((x) & 0xFF00) >> 8))
243 #else
244
245 #define NM_BSP_B_L_32(x) (x)
246
247 #define NM_BSP_B_L_16(x) (x)
248 #endif
249
253 #endif /*_NM_BSP_H_*/
nm_bsp_reset
void nm_bsp_reset(void)
nm_bsp_sleep
void nm_bsp_sleep(uint32 u32TimeMsec)
uint32
unsigned long uint32
Range of values between 0 to 4294967295.
Definition: nm_bsp.h:110
nm_bsp_deinit
sint8 nm_bsp_deinit(void)
sint32
signed long sint32
Range of values between -2147483648 to 2147483647.
Definition: nm_bsp.h:133
sint8
signed char sint8
Range of values between -128 to 127.
Definition: nm_bsp.h:118
sint16
signed short sint16
Range of values between -32768 to 32767.
Definition: nm_bsp.h:125
nm_bsp_register_isr
void nm_bsp_register_isr(tpfNmBspIsr pfIsr)
uint8
unsigned char uint8
Range of values between 0 to 255.
Definition: nm_bsp.h:96
tpfNmBspIsr
void(* tpfNmBspIsr)(void)
Pointer to function. Used as a data type of ISR function registered by nm_bsp_register_isr.
Definition: nm_bsp.h:89
uint16
unsigned short uint16
Range of values between 0 to 65535.
Definition: nm_bsp.h:103
nm_bsp_init
sint8 nm_bsp_init(void)
nm_bsp_interrupt_ctrl
void nm_bsp_interrupt_ctrl(uint8 u8Enable)
Enable/Disable interrupts.


WINC3400 IoT Software APIs: nm_common.h Source File

nm_common.h
1
45 #ifndef _NM_COMMON_H_
46 #define _NM_COMMON_H_
47
48 #include "bsp/include/nm_bsp.h"
49 #include "common/include/nm_debug.h"
50
55 #define M2M_TIME_OUT_DELAY 10000
56
57 /*states*/
58 #define M2M_SUCCESS ((sint8)0)
59 #define M2M_ERR_SEND ((sint8)-1)
60 #define M2M_ERR_RCV ((sint8)-2)
61 #define M2M_ERR_MEM_ALLOC ((sint8)-3)
62 #define M2M_ERR_TIME_OUT ((sint8)-4)
63 #define M2M_ERR_INIT ((sint8)-5)
64 #define M2M_ERR_BUS_FAIL ((sint8)-6)
65 #define M2M_NOT_YET ((sint8)-7)
66 #define M2M_ERR_FIRMWARE ((sint8)-8)
67 #define M2M_SPI_FAIL ((sint8)-9)
68 #define M2M_ERR_FIRMWARE_bURN ((sint8)-10)
69 #define M2M_ACK ((sint8)-11)
70 #define M2M_ERR_FAIL ((sint8)-12)
71 #define M2M_ERR_FW_VER_MISMATCH ((sint8)-13)
72 #define M2M_ERR_SCAN_IN_PROGRESS ((sint8)-14)
73 /*
74 Invalid argument
75 */
76 #define M2M_ERR_INVALID_ARG ((sint8)-15)
77
78 /*i2c MAASTER ERR*/
79 #define I2C_ERR_LARGE_ADDRESS 0xE1UL
80 #define I2C_ERR_TX_ABRT 0xE2UL
81 #define I2C_ERR_OVER_SIZE 0xE3UL
82 #define ERR_PREFIX_NMIS 0xE4UL
83 #define ERR_FIRMEWARE_EXCEED_SIZE 0xE5UL
84
85 #define PROGRAM_START 0x26961735UL
86 #define BOOT_SUCCESS 0x10add09eUL
87 #define BOOT_START 0x12345678UL
88
89
90 #define NBIT31 (0x80000000)
91 #define NBIT30 (0x40000000)
92 #define NBIT29 (0x20000000)
93 #define NBIT28 (0x10000000)
94 #define NBIT27 (0x08000000)
95 #define NBIT26 (0x04000000)
96 #define NBIT25 (0x02000000)
97 #define NBIT24 (0x01000000)
98 #define NBIT23 (0x00800000)
99 #define NBIT22 (0x00400000)
100 #define NBIT21 (0x00200000)
101 #define NBIT20 (0x00100000)
102 #define NBIT19 (0x00080000)
103 #define NBIT18 (0x00040000)
104 #define NBIT17 (0x00020000)
105 #define NBIT16 (0x00010000)
106 #define NBIT15 (0x00008000)
107 #define NBIT14 (0x00004000)
108 #define NBIT13 (0x00002000)
109 #define NBIT12 (0x00001000)
110 #define NBIT11 (0x00000800)
111 #define NBIT10 (0x00000400)
112 #define NBIT9 (0x00000200)
113 #define NBIT8 (0x00000100)
114 #define NBIT7 (0x00000080)
115 #define NBIT6 (0x00000040)
116 #define NBIT5 (0x00000020)
117 #define NBIT4 (0x00000010)
118 #define NBIT3 (0x00000008)
119 #define NBIT2 (0x00000004)
120 #define NBIT1 (0x00000002)
121 #define NBIT0 (0x00000001)
122
124 #define M2M_MAX(A,B) ((A) > (B) ? (A) : (B))
125
126 #define M2M_SEL(x,m1,m2,m3) ((x>1)?((x>2)?(m3):(m2)):(m1))
127
128 #define WORD_ALIGN(val) (((val) & 0x03) ? ((val) + 4 - ((val) & 0x03)) : (val))
129
130
131
132 #define DATA_PKT_OFFSET 4
133
134 #ifndef BIG_ENDIAN
135
136 #define BYTE_0(word) ((uint8)(((word) >> 0 ) & 0x000000FFUL))
137
138 #define BYTE_1(word) ((uint8)(((word) >> 8 ) & 0x000000FFUL))
139
140 #define BYTE_2(word) ((uint8)(((word) >> 16) & 0x000000FFUL))
141
142 #define BYTE_3(word) ((uint8)(((word) >> 24) & 0x000000FFUL))
143 #else
144
145 #define BYTE_0(word) ((uint8)(((word) >> 24) & 0x000000FFUL))
146
147 #define BYTE_1(word) ((uint8)(((word) >> 16) & 0x000000FFUL))
148
149 #define BYTE_2(word) ((uint8)(((word) >> 8 ) & 0x000000FFUL))
150
151 #define BYTE_3(word) ((uint8)(((word) >> 0 ) & 0x000000FFUL))
152 #endif
153
155 #ifdef __cplusplus
156 extern "C" {
157 #endif
158
174 NMI_API void m2m_memcpy(uint8* pDst,uint8* pSrc,uint32 sz);
186 NMI_API void m2m_memset(uint8* pBuf,uint8 val,uint32 sz);
194 NMI_API uint16 m2m_strlen(uint8 * pcStr);
206 NMI_API sint8 m2m_memcmp(uint8 *pu8Buff1,uint8 *pu8Buff2 ,uint32 u32Size);
218 NMI_API uint8 m2m_strncmp(uint8 *pcS1, uint8 *pcS2, uint16 u16Len);
228 NMI_API uint8 * m2m_strstr(uint8 *pcIn, uint8 *pcStr);
238 NMI_API uint8 m2m_checksum(uint8* buf, int sz);
239
244 NMI_API void (*at_sb_printf)(const char *_format, ...);
246 #ifdef __cplusplus
247 }
248 #endif
249 #endif /*_NM_COMMON_H_*/
at_sb_printf
NMI_API void(* at_sb_printf)(const char *_format,...)
chooses which function to use in order to output debug
Definition: nm_common.h:244
m2m_memcpy
NMI_API void m2m_memcpy(uint8 *pDst, uint8 *pSrc, uint32 sz)
Copy specified number of bytes from source buffer to destination buffer.
m2m_memset
NMI_API void m2m_memset(uint8 *pBuf, uint8 val, uint32 sz)
Set specified number of data bytes in specified data buffer to specified value.
m2m_strstr
NMI_API uint8 * m2m_strstr(uint8 *pcIn, uint8 *pcStr)
Find the occurrence of pcStr string in pcIn string.
m2m_checksum
NMI_API uint8 m2m_checksum(uint8 *buf, int sz)
calculates checksum for the specified number of data bytes in specified data buffer ...
uint32
unsigned long uint32
Range of values between 0 to 4294967295.
Definition: nm_bsp.h:110
m2m_memcmp
NMI_API sint8 m2m_memcmp(uint8 *pu8Buff1, uint8 *pu8Buff2, uint32 u32Size)
Compare specified number of data bytes in pu8Buff1 and pu8Buff2 and decide if they all match...
NMI_API
#define NMI_API
Definition: nm_bsp.h:52
m2m_strlen
NMI_API uint16 m2m_strlen(uint8 *pcStr)
Returns the string length of a null terminated string buffer.
sint8
signed char sint8
Range of values between -128 to 127.
Definition: nm_bsp.h:118
m2m_strncmp
NMI_API uint8 m2m_strncmp(uint8 *pcS1, uint8 *pcS2, uint16 u16Len)
Compare specified number of data bytes in string buffers pcS1 and pcS2.
uint8
unsigned char uint8
Range of values between 0 to 255.
Definition: nm_bsp.h:96
uint16
unsigned short uint16
Range of values between 0 to 65535.
Definition: nm_bsp.h:103
Generated on Fri Aug 18 2017 00:42:03 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: Related Pages

Related Pages
Here is a list of all related documentation pages:
License
Generated on Fri Aug 18 2017 00:42:04 for WINC3400 IoT Software APIs by doxygen 1.8.13


WINC3400 IoT Software APIs: socket.h Source File

socket.h
1
45 #ifndef __SOCKET_H__
46 #define __SOCKET_H__
47
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51
52 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
53 INCLUDES
54 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
55
56 #include "driver/include/m2m_types.h"
57
58 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
59 MACROS
60 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
66 #define HOSTNAME_MAX_SIZE 100
67
73 #define SOCKET_BUFFER_MAX_LENGTH 1400
74
79 #define AF_INET 2
80
86 #define SOCK_STREAM 1
87
92 #define SOCK_DGRAM 2
93
99 #define SOCKET_FLAGS_SSL 0x01
100
104 #define TCP_SOCK_MAX (7)
105
109 #define UDP_SOCK_MAX 4
110
114 #define MAX_SOCKET (TCP_SOCK_MAX + UDP_SOCK_MAX)
115
119 #define SOL_SOCKET 1
120
125 #define SO_SET_UDP_SEND_CALLBACK 0x00
126
132 #define IP_ADD_MEMBERSHIP 0x01
133
139 #define IP_DROP_MEMBERSHIP 0x02
140
146 // SSL Socket options
147
148 #define SOL_SSL_SOCKET 2
149
155 #define SO_SSL_BYPASS_X509_VERIF 0x01
156
167 #define SO_SSL_SNI 0x02
168
177 #define SO_SSL_ENABLE_SESSION_CACHING 0x03
178
187 #define SO_SSL_ENABLE_CERTNAME_VALIDATION 0x04
188
197 #define SO_SSL_ENABLE_SNI_VALIDATION 0x04
198
204
213 #define SSL_CIPHER_RSA_WITH_AES_128_CBC_SHA NBIT0
214 #define SSL_CIPHER_RSA_WITH_AES_128_CBC_SHA256 NBIT1
215 #define SSL_CIPHER_DHE_RSA_WITH_AES_128_CBC_SHA NBIT2
216 #define SSL_CIPHER_DHE_RSA_WITH_AES_128_CBC_SHA256 NBIT3
217 #define SSL_CIPHER_RSA_WITH_AES_128_GCM_SHA256 NBIT4
218 #define SSL_CIPHER_DHE_RSA_WITH_AES_128_GCM_SHA256 NBIT5
219 #define SSL_CIPHER_RSA_WITH_AES_256_CBC_SHA NBIT6
220 #define SSL_CIPHER_RSA_WITH_AES_256_CBC_SHA256 NBIT7
221 #define SSL_CIPHER_DHE_RSA_WITH_AES_256_CBC_SHA NBIT8
222 #define SSL_CIPHER_DHE_RSA_WITH_AES_256_CBC_SHA256 NBIT9
223 #define SSL_CIPHER_ECDHE_RSA_WITH_AES_128_CBC_SHA NBIT10
224 #define SSL_CIPHER_ECDHE_RSA_WITH_AES_256_CBC_SHA NBIT11
225 #define SSL_CIPHER_ECDHE_RSA_WITH_AES_128_CBC_SHA256 NBIT12
226 #define SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 NBIT13
227 #define SSL_CIPHER_ECDHE_RSA_WITH_AES_128_GCM_SHA256 NBIT14
228 #define SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 NBIT15
229
230
231 #define SSL_ECC_ONLY_CIPHERS \
232 (\
233 SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 | \
234 SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 \
235 )
236
242 #define SSL_DEFAULT_CIPHERS \
243 (\
244 SSL_CIPHER_RSA_WITH_AES_128_CBC_SHA | \
245 SSL_CIPHER_RSA_WITH_AES_128_CBC_SHA256 | \
246 SSL_CIPHER_DHE_RSA_WITH_AES_128_CBC_SHA | \
247 SSL_CIPHER_DHE_RSA_WITH_AES_128_CBC_SHA256 | \
248 SSL_CIPHER_RSA_WITH_AES_128_GCM_SHA256 | \
249 SSL_CIPHER_DHE_RSA_WITH_AES_128_GCM_SHA256 | \
250 SSL_CIPHER_RSA_WITH_AES_256_CBC_SHA | \
251 SSL_CIPHER_RSA_WITH_AES_256_CBC_SHA256 | \
252 SSL_CIPHER_DHE_RSA_WITH_AES_256_CBC_SHA | \
253 SSL_CIPHER_DHE_RSA_WITH_AES_256_CBC_SHA256 \
254 )
255
260
265 #ifdef _NM_BSP_BIG_END
266 #define _htonl(m) (m)
267
270 #define _htons(A) (A)
271
274 #else
275 #define _htonl(m) \
276 (uint32)(((uint32)(m << 24)) | ((uint32)((m & 0x0000FF00) << 8)) | ((uint32)((m & 0x00FF0000) >> 8)) | ((uint32)(((uint32)m) >> 24)))
277
281 #define _htons(A) (uint16)((((uint16) (A)) << 8) | (((uint16) (A)) >> 8))
282
285 #endif
286
287
288 #define _ntohl _htonl
289
294 #define _ntohs _htons
295
299
300 /**************
301 Socket Errors
302 **************/
309 #define SOCK_ERR_NO_ERROR 0
310
316 #define SOCK_ERR_INVALID_ADDRESS -1
317
323 #define SOCK_ERR_ADDR_ALREADY_IN_USE -2
324
330 #define SOCK_ERR_MAX_TCP_SOCK -3
331
337 #define SOCK_ERR_MAX_UDP_SOCK -4
338
344 #define SOCK_ERR_INVALID_ARG -6
345
350 #define SOCK_ERR_MAX_LISTEN_SOCK -7
351
357 #define SOCK_ERR_INVALID -9
358
364 #define SOCK_ERR_ADDR_IS_REQUIRED -11
365
371 #define SOCK_ERR_CONN_ABORTED -12
372
377 #define SOCK_ERR_TIMEOUT -13
378
383 #define SOCK_ERR_BUFFER_FULL -14
384
389
390 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
391 DATA TYPES
392 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
393
407 typedef sint8 SOCKET;
409
421 typedef struct{
422 uint32 s_addr;
427 }in_addr;
428
429
440 struct sockaddr{
441 uint16 sa_family;
445 uint8 sa_data[14];
449 };
450
459 struct sockaddr_in{
460 uint16 sin_family;
466 uint16 sin_port;
473 in_addr sin_addr;
479 uint8 sin_zero[8];
483 };
484
509 typedef enum{
510 SOCKET_MSG_BIND = 1,
514 SOCKET_MSG_LISTEN,
518 SOCKET_MSG_DNS_RESOLVE,
522 SOCKET_MSG_ACCEPT,
526 SOCKET_MSG_CONNECT,
530 SOCKET_MSG_RECV,
534 SOCKET_MSG_SEND,
538 SOCKET_MSG_SENDTO,
542 SOCKET_MSG_RECVFROM
546 }tenuSocketCallbackMsgType;
547 // @}
548
549
562 typedef struct{
563 sint8 status;
569 }tstrSocketBindMsg;
570
571
583 typedef struct{
584 sint8 status;
589 }tstrSocketListenMsg;
590
591
592
602 typedef struct{
603 SOCKET sock;
608 struct sockaddr_in strAddr;
612 }tstrSocketAcceptMsg;
613
614
625 typedef struct{
626 SOCKET sock;
630 sint8 s8Error;
636 }tstrSocketConnectMsg;
637
638
655 typedef struct{
656 uint8 *pu8Buffer;
660 sint16 s16BufferSize;
665 uint16 u16RemainingSize;
669 struct sockaddr_in strRemoteAddr;
673 }tstrSocketRecvMsg;
674
718 typedef void (*tpfAppSocketCb) (SOCKET sock, uint8 u8Msg, void * pvMsg);
719
720
736 typedef void (*tpfAppResolveCb) (uint8* pu8DomainName, uint32 u32ServerIP);
737
759 typedef void (*tpfPingCb)(uint32 u32IPAddr, uint32 u32RTT, uint8 u8ErrorCode);
760
762 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
763 FUNCTION PROTOTYPES
764 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
814 NMI_API void socketInit(void);
815
825 NMI_API void socketDeinit(void);
889 NMI_API void registerSocketCallback(tpfAppSocketCb socket_cb, tpfAppResolveCb resolve_cb);
951 NMI_API SOCKET socket(uint16 u16Domain, uint8 u8Type, uint8 u8Flags);
1025 NMI_API sint8 bind(SOCKET sock, struct sockaddr *pstrAddr, uint8 u8AddrLen);
1141 NMI_API sint8 listen(SOCKET sock, uint8 backlog);
1165 NMI_API sint8 accept(SOCKET sock, struct sockaddr *addr, uint8 *addrlen);
1262 NMI_API sint8 connect(SOCKET sock, struct sockaddr *pstrAddr, uint8 u8AddrLen);
1364 NMI_API sint16 recv(SOCKET sock, void *pvRecvBuf, uint16 u16BufLen, uint32 u32Timeoutmsec);
1471 NMI_API sint16 recvfrom(SOCKET sock, void *pvRecvBuf, uint16 u16BufLen, uint32 u32Timeoutmsec);
1528 NMI_API sint16 send(SOCKET sock, void *pvSendBuffer, uint16 u16SendLength, uint16 u16Flags);
1583 NMI_API sint16 sendto(SOCKET sock, void *pvSendBuffer, uint16 u16SendLength, uint16 flags, struct sockaddr *pstrDestAddr, uint8 u8AddrLen);
1608 NMI_API sint8 close(SOCKET sock);
1627 NMI_API uint32 nmi_inet_addr(char *pcIpAddr);
1649 NMI_API sint8 gethostbyname(uint8 * pcHostName);
1650
1696 NMI_API sint8 setsockopt(SOCKET socket, uint8 u8Level, uint8 option_name,
1697 const void *option_value, uint16 u16OptionLen);
1719 NMI_API sint8 getsockopt(SOCKET sock, uint8 u8Level, uint8 u8OptName, const void *pvOptValue, uint8* pu8OptLen);
1739 NMI_API sint8 m2m_ping_req(uint32 u32DstIP, uint8 u8TTL, tpfPingCb fpPingCb);
1743 #ifdef __cplusplus
1744 }
1745 #endif /* __cplusplus */
1746
1747 #endif /* __SOCKET_H__ */
SOCKET_MSG_DNS_RESOLVE
Definition: socket.h:521
SOCKET_MSG_ACCEPT
Definition: socket.h:525
SOCKET_MSG_SEND
Definition: socket.h:537
setsockopt
NMI_API sint8 setsockopt(SOCKET socket, uint8 u8Level, uint8 option_name, const void *option_value, uint16 u16OptionLen)
tstrSocketBindMsg
Socket bind status.
Definition: socket.h:565
tenuSocketCallbackMsgType
tenuSocketCallbackMsgType
Asynchronous APIs make use of callback functions in-order to return back the results once the corresp...
Definition: socket.h:512
tstrSocketRecvMsg
Socket recv status.
Definition: socket.h:658
close
NMI_API sint8 close(SOCKET sock)
getsockopt
NMI_API sint8 getsockopt(SOCKET sock, uint8 u8Level, uint8 u8OptName, const void *pvOptValue, uint8 *pu8OptLen)
SOCKET_MSG_RECVFROM
Definition: socket.h:545
socketInit
NMI_API void socketInit(void)
sockaddr_in
Socket address structure for IPV4 addresses. Used to specify socket address information to connect to...
Definition: socket.h:462
listen
NMI_API sint8 listen(SOCKET sock, uint8 backlog)
sendto
NMI_API sint16 sendto(SOCKET sock, void *pvSendBuffer, uint16 u16SendLength, uint16 flags, struct sockaddr *pstrDestAddr, uint8 u8AddrLen)
nmi_inet_addr
NMI_API uint32 nmi_inet_addr(char *pcIpAddr)
SOCKET_MSG_SENDTO
Definition: socket.h:541
tstrSocketAcceptMsg
Socket accept status.
Definition: socket.h:605
SOCKET
sint8 SOCKET
Definition for socket handler data type. Socket ID,used with all socket operations to uniquely identi...
Definition: socket.h:410
tstrSocketListenMsg
Socket listen status.
Definition: socket.h:586
m2m_ping_req
NMI_API sint8 m2m_ping_req(uint32 u32DstIP, uint8 u8TTL, tpfPingCb fpPingCb)
send
NMI_API sint16 send(SOCKET sock, void *pvSendBuffer, uint16 u16SendLength, uint16 u16Flags)
sockaddr
Generic socket address structure.
Definition: socket.h:443
uint32
unsigned long uint32
Range of values between 0 to 4294967295.
Definition: nm_bsp.h:110
in_addr
IPv4 address representation.
Definition: socket.h:424
tpfAppSocketCb
void(* tpfAppSocketCb)(SOCKET sock, uint8 u8Msg, void *pvMsg)
The main socket application callback function. Applications register their main socket application ca...
Definition: socket.h:721
registerSocketCallback
NMI_API void registerSocketCallback(tpfAppSocketCb socket_cb, tpfAppResolveCb resolve_cb)
NMI_API
#define NMI_API
Definition: nm_bsp.h:52
sockaddr::sa_data
uint8 sa_data[14]
Definition: socket.h:448
sint8
signed char sint8
Range of values between -128 to 127.
Definition: nm_bsp.h:118
tstrSocketConnectMsg
Socket connect status.
Definition: socket.h:628
sint16
signed short sint16
Range of values between -32768 to 32767.
Definition: nm_bsp.h:125
SOCKET_MSG_RECV
Definition: socket.h:533
tpfPingCb
void(* tpfPingCb)(uint32 u32IPAddr, uint32 u32RTT, uint8 u8ErrorCode)
PING Callback.
Definition: socket.h:762
recv
NMI_API sint16 recv(SOCKET sock, void *pvRecvBuf, uint16 u16BufLen, uint32 u32Timeoutmsec)
accept
NMI_API sint8 accept(SOCKET sock, struct sockaddr *addr, uint8 *addrlen)
connect
NMI_API sint8 connect(SOCKET sock, struct sockaddr *pstrAddr, uint8 u8AddrLen)
tpfAppResolveCb
void(* tpfAppResolveCb)(uint8 *pu8DomainName, uint32 u32ServerIP)
DNS resolution callback function. Applications requiring DNS resolution should register their callb...
Definition: socket.h:739
recvfrom
NMI_API sint16 recvfrom(SOCKET sock, void *pvRecvBuf, uint16 u16BufLen, uint32 u32Timeoutmsec)
bind
NMI_API sint8 bind(SOCKET sock, struct sockaddr *pstrAddr, uint8 u8AddrLen)
socketDeinit
NMI_API void socketDeinit(void)
Socket Layer De-initialization.
SOCKET_MSG_BIND
Definition: socket.h:513
gethostbyname
NMI_API sint8 gethostbyname(uint8 *pcHostName)
SOCKET_MSG_LISTEN
Definition: socket.h:517
socket
NMI_API SOCKET socket(uint16 u16Domain, uint8 u8Type, uint8 u8Flags)
sockaddr::sa_family
uint16 sa_family
Definition: socket.h:444
SOCKET_MSG_CONNECT
Definition: socket.h:529
uint8
unsigned char uint8
Range of values between 0 to 255.
Definition: nm_bsp.h:96
uint16
unsigned short uint16
Range of values between 0 to 65535.
Definition: nm_bsp.h:103
Generated on Fri Aug 18 2017 00:42:03 for WINC3400 IoT Software APIs by doxygen 1.8.13