WINC1500 IoT Software APIs: WINC1500 API Reference Manual

WINC1500 IoT Software APIs 19.7.7
WINC1500 Software API Reference Manual
WINC1500 API Reference Manual

Table of Contents

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

Introduction

[General Architecture of WINC1500 SoC]

The ATWINC1500 provides a single chip solution for internet connectivity to microcontroller-based applications. It provides the host microcontroller with methods to perform WLAN management (e.g. association, disassociation, etc) as well as BSD compatible socket interface for modern industry standard networking applications, as well as BSD compatible socket interface via I2C/SPI interfaces.

The WINC1500 runs firmware on chip which provides IEEE 802.11 b/g/n MAC functionality. The 802.11 MAC soft-ware in firmware works closely with WINC1500 802.11 MAC hardware accelerators on ASIC to provide Wi-Fi station mode, Access point mode and Wi-Fi direct mode. The firmware provides networking protocols on top of MAC software such as TCP/IP, UDP, DNS resolver DHCP client, DHCP server, TLS v1.0 and WPS. The WINC1500 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 subsections following will provide an overview of the basic building blocks of the WINC1500 architecture, together with Application Interface(API) details.

WINC1500 ASIC

[WINC1500 ASICs]
The WINC1500 SoC features 802.11 b/g/n RF, PHY and MAC hardware. The SoC contains APS3 Cortus controller running at clock speed 40MHz with 128KB program memory and 64KB data memory. The Cortus and 802.11 MAC share 128KB of shared memory for Wi-Fi packet transmit/receive. The SoC communicates with external host controller via I2C, SPI and UART serial interfaces. The device is equipped with 512KB flash (flash size may vary on selected versions) for firmware and configuration parameters storage.

WINC1500 Firmware Driver Architecture

[WINC1500 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 WINC1500 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.
  • 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_hif module : provides data transport to socket and m2m_wifi modules over interface over serial bus (I2C/SPI). It utilizes an interrupt handler from BSP module.
  • nmdrv module : provides device specific initialization to m2m_wifi module.
  • nmasic module : provides various WINC1500 device specific functions shared by all other modules.
  • nmbus module : Provides WINC1500 device specific low-level communication protocol to do register read/write and memory read/write. nmbus module depends, respectively, on nmispi, nmi2c or nmuart modules when SPI, I2C or UART serial interfaces are used. This module depends on the Host platform bus wrapper module.

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

  • BSP module : provides Firmware driver with the following interfaces:
  • WINC1500 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 I2C/SPI/UART.

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 WINC1500 through a serial interface.

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

Wi-Fi Software API Files

The table below lists the main files from the Wi-Fi Software API, which will be explained in more details through this reference manual with reference examples

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 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 Tue Sep 27 2022 16:17:30 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Modules

Modules
Here is a list of all modules:
[detail level 123]
▼ OTA | The WINC supports OTA (Over-The-Air) updates. Using the APIs described in this module, it is possible to request an ATWINC15x0 to update its firmware image, or safely rollback to the previous firmware image. Note that it is NOT possible to update other areas of the WINC flash (e.g. the HTTP file area) using the OTA mechanism. There are also APIs to download files and store them in the WINC's Flash (supported by ATWINC1510 only), which can be used for Host MCU OTA updates or accessing information stored remotely
Callbacks | Lists the different callbacks that can be used during OTA updates. Callbacks of type tpfOtaNotifCb and tpfOtaUpdateCb should be passed onto m2m_ota_init at system initialization. Other callbacks are provided to handle the various steps of Host File Download
Defines | Specifies the macros and defines used by the OTA APIs
Enumerations and Typedefs | Specifies the enums and Data Structures used by the OTA APIs
▼ Functions | Lists the full set of available APIs to manage OTA updates and Host File Downloads
Common |
WINC |
HFD |
▼ SSL | Provides a description of the SSL Layer
Callbacks | Provides detail on the available callbacks for the SSL Layer
Enumerations and Typedefs | Specifies the enums and Data Structures used by the SSL APIs
Functions | Provides detail on the available APIs for the SSL Layer
▼ TLS Defines |
TLS Socket Options |
Legacy names for TLS Cipher Suite IDs |
TLS Cipher Suite IDs |
▼ WLAN |
Callbacks | Provides detail on the available callbacks for the Wlan APIs
Defines | Specifies the macros and defines used by the Wlan APIs
Enumerations and Typedefs | Specifies the enums and Data Structures used by the Wlan APIs
▼ Functions | Here are listed all the functions that implement the Wlan APIs
Initialization | Here are listed all the functions that implement the Wlan Initialization APIs
Wlan Events | Here are listed all the functions that implement the Wlan Events APIs
Connection | Here are listed all the functions that implement the Wifi Connection APIs
Scanning | Here are listed all the functions that implement the Wifi Scanning APIs
Hot-Spot (Access-Point) | Here are listed all the functions that implement the Wifi Hot-Spot (Access-Point) APIs
Bypass Mode | Here are listed all the functions that implement the Bypass Mode APIs
Roaming | Here are listed all the functions that implement the Wifi Roaming APIs
Power Save | Here are listed all the functions that implement the Power-Save APIs
Configuration | Here are listed all the functions that implement the Wlan Configuration APIs
System Time | Here are listed all the functions that implement the System Time APIs
Provisioning | Here are listed all the functions that implement the Wifi Provisioning APIs
Crypto | Here are listed all the functions that implement the Wifi Crypto APIs
▼ Version | Describes the APIs for reading the version information of the WINC firmware
Defines | Specifies the macros and defines used by the version APIs
Functions | Lists the APIs for reading the version information of the WINC firmware
▼ BSP | Description of the BSP (Board Support Package) module
Data Types |
Defines |
▼ Functions | Lists the available BSP (Board Support Package) APIs
nm_bsp_init |
nm_bsp_deinit |
nm_bsp_reset |
nm_bsp_sleep |
nm_bsp_register_isr |
nm_bsp_interrupt_ctrl |
▼ Common |
Defines |
Functions |
▼ Socket |
▼ Defines |
TCP/IP Defines |
Error Codes |
▼ DataTypes |
Asynchronous Events |
Callbacks |
▼ Functions |
socketInit |
socketDeInit |
socketState |
registerSocketCallback |
socket |
bind |
listen |
accept |
connect |
secure |
recv |
recvfrom |
send |
sendto |
close |
nmi_inet_addr |
gethostbyname |
sslEnableCertExpirationCheck |
setsockopt |
getsockopt |
m2m_ping_req |
Byte Order |
Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: OTA

Modules
OTA

Modules

Callbacks
Defines
Enumerations and Typedefs
Functions

Detailed Description

The WINC supports OTA (Over-The-Air) updates. Using the APIs described in this module, it is possible to request an ATWINC15x0 to update its firmware image, or safely rollback to the previous firmware image.
Note that it is NOT possible to update other areas of the WINC flash (e.g. the HTTP file area) using the OTA mechanism.

There are also APIs to download files and store them in the WINC's Flash (supported by ATWINC1510 only), which can be used for Host MCU OTA updates or accessing information stored remotely.

Generated on Tue Sep 27 2022 16:17:30 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Callbacks

Typedefs
Callbacks
OTA

Typedefs

typedef void(* | tpfOtaNotifCb) (tstrOtaUpdateInfo *pstrOtaUpdateInfo)
typedef void(* | tpfOtaUpdateCb) (uint8 u8OtaUpdateStatusType, uint8 u8OtaUpdateStatus)
typedef void(* | tpfFileGetCb) (uint8 u8Status, uint8 u8Handler, uint32 u32Size)
typedef void(* | tpfFileReadCb) (uint8 u8Status, void *pBuff, uint32 u32Size)
typedef void(* | tpfFileEraseCb) (uint8 u8Status)

Detailed Description

Lists the different callbacks that can be used during OTA updates.
Callbacks of type tpfOtaNotifCb and tpfOtaUpdateCb should be passed onto m2m_ota_init at system initialization. Other callbacks are provided to handle the various steps of Host File Download.

Typedef Documentation

void(* tpfOtaNotifCb)(tstrOtaUpdateInfo *pstrOtaUpdateInfo)

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)
void(* tpfOtaUpdateCb)(uint8 u8OtaUpdateStatusType,uint8 u8OtaUpdateStatus)

A callback to get OTA status update, the callback provides the status type and its status.
The OTA callback provides the download status, the switch to the downloaded firmware status, roll-back status and Host File Download status.

Parameters
[in] | u8OtaUpdateStatusType | Possible values are listed in tenuOtaUpdateStatusType.
[in] | u8OtaUpdateStatus | Possible values are listed as enumerated by tenuOtaUpdateStatus.
Note
Executes other callbacks passed to the OTA module.
See also
tenuOtaUpdateStatusType tenuOtaUpdateStatus
void(* tpfFileGetCb)(uint8 u8Status, uint8 u8Handler, uint32 u32Size)

A callback to notify the application of the result of the download (success/fail), the generated handler ID and the size of the file which has just finished downloading (size expressed in bytes).

Parameters
[in] | u8Status | Status of the operation (see tenuOtaUpdateStatus).
[in] | u8Handler | Generated handler ID for the new file.
[in] | u32Size | Total size of the downloaded file (in bytes).
Warning
The file handler passed onto this callback will be the valid file handler generated by the WINC when the download finished successfully. This handler will be required for all operations on the file like read and erase.
void(* tpfFileReadCb)(uint8 u8Status, void *pBuff, uint32 u32Size)

A callback to handle a buffer of data after requesting a Host File read. The callback will provide the status of the read operation and if successful, a pointer to a valid placeholder containing the data read and the amount of data available. Such callback is required when using Host File read via the HIF.

Parameters
[in] | u8Status | Status of the operation (see tenuOtaUpdateStatus).
[in] | pBuff | Pointer to a placeholder where the data can be retrieved from.
[in] | u32Size | Amount of data available after reading (in bytes).
Warning
After the callback is executed, pBuff will be freed.
void(* tpfFileEraseCb)(uint8 u8Status)

A callback executed when the file erase has been completed.

Parameters
[in] u8Status Status of the operation (see tenuOtaUpdateStatus).
Generated on Tue Sep 27 2022 16:17:30 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 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_FORMAT_VER_0 (0)
#define | OTA_FORMAT_VER_1 (1)
#define | OTA_FORMAT_VER_2 (2)
#define | OTA_SHA256_DIGEST_SIZE (32)
#define | MAX_FILE_READ_STEP 128
#define | HFD_INVALID_HANDLER (0xff)

Detailed Description

Specifies the macros and defines used by the OTA APIs.

Macro Definition Documentation

#define OTA_STATUS_VALID (0x12526285)

Magic value updated in the Control structure in case of ROLLBACK image Valid

#define OTA_STATUS_INVALID (0x23987718)

Magic value updated in the Control structure in case of ROLLBACK image InValid

#define OTA_MAGIC_VALUE (0x1ABCDEF9)

Magic value set at the beginning of the OTA image header

#define OTA_FORMAT_VER_0 (0)

Control structure format version 0.
Format used until version 19.2.2.

#define OTA_FORMAT_VER_1 (1)

Control structure format version 1.
Starting from 19.3.0 CRC is used and sequence number is used.

#define OTA_FORMAT_VER_2 (2)

Control structure format version 2.
Starting from 19.6.1 a flexible flash map is used.

#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

#define MAX_FILE_READ_STEP 128

Max amount of bytes to read a file via HIF messages.

#define HFD_INVALID_HANDLER (0xff)

Defines an ID which symbolizes an invalid handler.

Generated on Tue Sep 27 2022 16:17:30 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Enumerations and Typedefs

Data Structures | Enumerations
Enumerations and Typedefs
OTA

Data Structures

struct | tstrOtaInitHdr
struct | tstrOtaControlSec
struct | tstrOtaUpdateStatusResp
struct | tstrOtaUpdateInfo
struct | tstrOtaHostFileGetStatusResp
struct | tstrOtaHostFileReadStatusResp
struct | tstrOtaHostFileEraseStatusResp
struct | tstrOtaStart

Enumerations

enum tenuOTASSLOption { WIFI_OTA_SSL_OPT_BYPASS_SERVER_AUTH = 0x1, WIFI_OTA_SSL_OPT_SNI_VALIDATION = 0x2, WIFI_OTA_SSL_OPT_SNI_SERVERNAME = 0x4 }
enum tenuOtaError {
OTA_SUCCESS = (0), OTA_ERR_WORKING_IMAGE_LOAD_FAIL = ((sint8) -1), OTA_ERR_INVALID_CONTROL_SEC = ((sint8) -2), M2M_ERR_OTA_SWITCH_FAIL = ((sint8) -3),
M2M_ERR_OTA_START_UPDATE_FAIL = ((sint8) -4), M2M_ERR_OTA_ROLLBACK_FAIL = ((sint8) -5), M2M_ERR_OTA_INVALID_FLASH_SIZE = ((sint8) -6), M2M_ERR_OTA_INVALID_ARG = ((sint8) -7),
M2M_ERR_OTA_INPROGRESS = ((sint8) -8)
}
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_FW_UPDATE,
M2M_OTA_REQ_SWITCH_FIRMWARE, M2M_OTA_REQ_ROLLBACK_FW, M2M_OTA_RESP_NOTIF_UPDATE_INFO, M2M_OTA_RESP_UPDATE_STATUS,
M2M_OTA_REQ_TEST, M2M_OTA_REQ_START_CRT_UPDATE, M2M_OTA_REQ_SWITCH_CRT_IMG, M2M_OTA_REQ_ROLLBACK_CRT,
M2M_OTA_REQ_ABORT, M2M_OTA_REQ_HOST_FILE_STATUS, M2M_OTA_RESP_HOST_FILE_STATUS, M2M_OTA_REQ_HOST_FILE_DOWNLOAD,
M2M_OTA_RESP_HOST_FILE_DOWNLOAD, M2M_OTA_REQ_HOST_FILE_READ, M2M_OTA_RESP_HOST_FILE_READ, M2M_OTA_REQ_HOST_FILE_ERASE,
M2M_OTA_RESP_HOST_FILE_ERASE, M2M_OTA_REQ_START_FW_UPDATE_V2, M2M_OTA_MAX_ALL
}
enum tenuOtaUpdateStatus {
OTA_STATUS_SUCCESS = 0, OTA_STATUS_FAIL = 1, OTA_STATUS_INVALID_ARG = 2, OTA_STATUS_INVALID_RB_IMAGE = 3,
OTA_STATUS_INVALID_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,
HFD_STATUS = 5
}

Detailed Description

Specifies the enums and Data Structures used by the OTA APIs.

Enumeration Type Documentation

enum tenuOTASSLOption

Enumeration for OTA SSL options The following SSL options can be set for OTA.

Enumerator
WIFI_OTA_SSL_OPT_BYPASS_SERVER_AUTH | Server authentication for OTA SSL connections. Values are of type int 1: Bypass server authentication.
WIFI_OTA_SSL_OPT_SNI_VALIDATION | Server Name Indication. The actual server name to send must be passed using option WIFI_OTA_SSL_OPT_SNI_SERVERNAME Values are of type int 0: Do not check the received servername against the server provided one 1: Check the received servername against the server provided one
WIFI_OTA_SSL_OPT_SNI_SERVERNAME | The server name string to send in the SNI extension. Value is a null terminated string up to 64 characters in length including the null terminator.
enum tenuOtaError

OTA Error codes.

Enumerator
OTA_SUCCESS

OTA Success status

OTA_ERR_WORKING_IMAGE_LOAD_FAIL

Failure to load the firmware image

OTA_ERR_INVALID_CONTROL_SEC

Control structure is corrupted

M2M_ERR_OTA_SWITCH_FAIL

Switching to the updated image failed as may be the image is invalid

M2M_ERR_OTA_START_UPDATE_FAIL

OTA update fail due to multiple reasons:

  • Connection failure
  • Image integrity fail
M2M_ERR_OTA_ROLLBACK_FAIL

Roll-back failed due to Roll-back image is not valid

M2M_ERR_OTA_INVALID_FLASH_SIZE

The OTA Support at least 4MB flash size, this error code will appear if the current flash is less than 4M

M2M_ERR_OTA_INVALID_ARG

Ota still in progress

M2M_ERR_OTA_INPROGRESS

Invalid argument in any OTA Function

enum tenuM2mOtaCmd

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

Enumerator
M2M_OTA_REQ_NOTIF_SET_URL |
M2M_OTA_REQ_NOTIF_CHECK_FOR_UPDATE |
M2M_OTA_REQ_NOTIF_SCHED |
M2M_OTA_REQ_START_FW_UPDATE | Request to start an OTA update.
M2M_OTA_REQ_SWITCH_FIRMWARE | Request to switch firmware.
M2M_OTA_REQ_ROLLBACK_FW | Request to perform an OTA rollback.
M2M_OTA_RESP_NOTIF_UPDATE_INFO |
M2M_OTA_RESP_UPDATE_STATUS | Response to indicate the OTA update status.
M2M_OTA_REQ_TEST |
M2M_OTA_REQ_START_CRT_UPDATE |
M2M_OTA_REQ_SWITCH_CRT_IMG |
M2M_OTA_REQ_ROLLBACK_CRT |
M2M_OTA_REQ_ABORT | Request to abort OTA.
M2M_OTA_REQ_HOST_FILE_STATUS |
M2M_OTA_RESP_HOST_FILE_STATUS |
M2M_OTA_REQ_HOST_FILE_DOWNLOAD |
M2M_OTA_RESP_HOST_FILE_DOWNLOAD |
M2M_OTA_REQ_HOST_FILE_READ |
M2M_OTA_RESP_HOST_FILE_READ |
M2M_OTA_REQ_HOST_FILE_ERASE |
M2M_OTA_RESP_HOST_FILE_ERASE |
M2M_OTA_REQ_START_FW_UPDATE_V2 |
M2M_OTA_MAX_ALL |
enum tenuOtaUpdateStatus

This struct contains the OTA return status.

Enumerator
OTA_STATUS_SUCCESS | OTA Success with no errors.
OTA_STATUS_FAIL | OTA generic fail.
OTA_STATUS_INVALID_ARG | Invalid or malformed download URL.
OTA_STATUS_INVALID_RB_IMAGE | Invalid rollback image.
OTA_STATUS_INVALID_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 Verification 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.
enum tenuOtaUpdateStatusType

This struct contains the OTA update status type.

Enumerator
DL_STATUS | Download WINC OTA file status
SW_STATUS | Switching to the upgrade firmware status
RB_STATUS | Roll-back status
AB_STATUS | Abort status
HFD_STATUS | Host File Download status
Generated on Tue Sep 27 2022 16:17:30 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrOtaInitHdr Struct Reference

Data Fields
tstrOtaInitHdr Struct Reference
OTA » Enumerations and Typedefs

Data Fields

uint32 u32OtaMagicValue
uint32 u32OtaPayloadSize

Detailed Description

This struct contains the OTA image header.

Field Documentation

uint32 u32OtaMagicValue

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

uint32 u32OtaPayloadSize

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

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrOtaControlSec Struct Reference

Data Fields
tstrOtaControlSec Struct Reference
OTA » Enumerations and Typedefs

Data Fields

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

Detailed Description

Control Section Structure. 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 are kept in this structure.

Field Documentation

uint32 u32OtaMagicValue

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

uint32 u32OtaFormatVersion

NA NA NA Flash version cs struct version 00 00 00 00 00 Control structure format version, the value will be incremented in case of structure changed or updated

uint32 u32OtaSequenceNumber

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

uint32 u32OtaLastCheckTime

Last time OTA check for update.

uint32 u32OtaCurrentworkingImagOffset

Current working offset in flash.

uint32 u32OtaCurrentworkingImagFirmwareVer

Current working image version ex 18.0.1.

uint32 u32OtaRollbackImageOffset

Roll-back image offset in flash

uint32 u32OtaRollbackImageValidStatus

Roll-back image valid status.

uint32 u32OtaRollbackImagFirmwareVer

Roll-back image version (ex 18.0.3).

uint32 u32OtaCortusAppWorkingOffset

Cortus app working offset in flash. Removed in v19.6.1.

uint32 u32OtaCortusAppWorkingValidSts

Working Cortus app valid status. Removed in v19.6.1.

uint32 u32OtaCortusAppWorkingVer

Working cortus app version (ex 18.0.3). Removed in v19.6.1.

uint32 u32OtaCortusAppRollbackOffset

Cortus app rollback offset in flash. Removed in v19.6.1.

uint32 u32OtaCortusAppRollbackValidSts

Roll-back cortus app valid status. Removed in v19.6.1.

uint32 u32OtaCortusAppRollbackVer

Roll-back cortus app version (ex 18.0.3). Removed in v19.6.1.

uint32 u32OtaControlSecCrc

CRC for the control structure to ensure validity.

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrOtaUpdateStatusResp Struct Reference

Data Fields
tstrOtaUpdateStatusResp Struct Reference
OTA » Enumerations and Typedefs

Data Fields

uint8 u8OtaUpdateStatusType
uint8 u8OtaUpdateStatus
uint8 _PAD16_ [2]

Detailed Description

This struct contains the OTA update status.

See also
tenuWPSTrigger

Field Documentation

uint8 u8OtaUpdateStatusType

Status type, see tenuOtaUpdateStatusType.

uint8 u8OtaUpdateStatus

The status of the update, see tenuOtaError.

uint8 _PAD16_[2]
Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrOtaUpdateInfo Struct Reference

Data Fields
tstrOtaUpdateInfo Struct Reference
OTA » Enumerations and Typedefs

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

uint32 u8NcfUpgradeVersion

NCF OTA Upgrade Version

uint32 u8NcfCurrentVersion

NCF OTA Current firmware version

uint32 u8NcdUpgradeVersion

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

uint8 u8NcdRequiredUpgrade

NCD Required upgrade to the above version

uint8 u8DownloadUrlOffset

Download URL offset in the received packet

uint8 u8DownloadUrlSize

Download URL size in the received packet

uint8 __PAD8__

Padding bytes for forcing 4-byte alignment

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrOtaHostFileGetStatusResp Struct Reference

Data Fields
tstrOtaHostFileGetStatusResp Struct Reference
OTA » Enumerations and Typedefs

Data Fields

uint32 u32OtaFileSize
uint8 u8OtaFileGetStatus
uint8 u8CFHandler
uint8 __PAD16__ [2]

Detailed Description

Host File OTA Information.

Field Documentation

uint32 u32OtaFileSize

Reports the size of the downloaded file. Valid if u8OtaFileGetStatus=OTA_STATUS_SUCCESS.

uint8 u8OtaFileGetStatus

The status of the File Get operation. See tenuOtaUpdateStatus.

uint8 u8CFHandler

The file handler stored in the WINC for a valid file. Valid if u8OtaFileGetStatus=OTA_STATUS_SUCCESS.

uint8 __PAD16__[2]

Padding byte for forcing 4-byte alignment

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrOtaHostFileReadStatusResp Struct Reference

Data Fields
tstrOtaHostFileReadStatusResp Struct Reference
OTA » Enumerations and Typedefs

Data Fields

uint16 u16FileBlockSz
uint8 u8OtaFileReadStatus
uint8 __PAD8__
uint8 pFileBuf [MAX_FILE_READ_STEP]

Detailed Description

Host File OTA Information.

Field Documentation

uint16 u16FileBlockSz

Reports the size of the block of data read via HIF. Valid if u8OtaFileReadStatus=OTA_STATUS_SUCCESS .

uint8 u8OtaFileReadStatus

The status of the File Read operation. See tenuOtaUpdateStatus.

uint8 __PAD8__

Padding byte for forcing 4-byte alignment

uint8 pFileBuf[MAX_FILE_READ_STEP]

Pointer to the temporary buffer containing the data just read. Max size is MAX_FILE_READ_STEP

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrOtaHostFileEraseStatusResp Struct Reference

Data Fields
tstrOtaHostFileEraseStatusResp Struct Reference
OTA » Enumerations and Typedefs

Data Fields

uint8 u8OtaFileEraseStatus
uint8 __PAD24__ [3]

Detailed Description

Host File OTA Information.

Field Documentation

uint8 u8OtaFileEraseStatus

The status of the File Erase operation. See tenuOtaUpdateStatus.

uint8 __PAD24__[3]

Padding byte for forcing 4-byte alignment

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrOtaStart Struct Reference

Data Fields
tstrOtaStart Struct Reference
OTA » Enumerations and Typedefs

Data Fields

uint32 u32TotalLen
char | acUrl [256]
char | acSNI [64]
uint8 u8SSLFlags
uint8 | __PAD24__ [3]

Field Documentation

uint32 u32TotalLen

Total length of the struct be sent over the HIF

char acUrl[256]

NULL terminated HTTP(S) URL from which to fetch the OTA file

char acSNI[64]

NULL terminated server name to send in the TLS SNI extension (can be empty)

uint8 u8SSLFlags

Flags to set SSL options

uint8 __PAD24__[3]

Padding byte for forcing 4-byte alignment

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Functions

Modules
Functions
OTA

Modules

Common
WINC
HFD

Detailed Description

Lists the full set of available APIs to manage OTA updates and Host File Downloads.

Generated on Tue Sep 27 2022 16:17:30 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Common

Functions
Common
OTA » Functions

Functions

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

Detailed Description

Function Documentation

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 MUST for all the 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.
sint8 m2m_ota_abort ( void )

Request the WINC to abort an OTA or Host File download in progress.
If no download is in progress, the API will respond with failure.

See also
m2m_ota_init m2m_ota_start_update
Returns
The function returns M2M_SUCCESS for a successful operation and a negative value otherwise.
Generated on Tue Sep 27 2022 16:17:30 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: WINC

Functions
WINC
OTA » Functions

Functions

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 (unsigned char *pcDownloadUrl)
NMI_API sint8 | m2m_ota_rollback (void)
NMI_API sint8 | m2m_ota_switch_firmware (void)
NMI_API sint8 | m2m_ota_set_ssl_option (tenuOTASSLOption enuOptionName, const void *pOptionValue, size_t OptionLen)
NMI_API sint8 | m2m_ota_get_ssl_option (tenuOTASSLOption enuOptionName, void *pOptionValue, size_t *pOptionLen)

Detailed Description

Function Documentation

sint8 m2m_ota_notif_set_url ( uint8 * u8Url )

Set the OTA notification server URL, the function needs 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 function needs to be called before any check for update.
Precondition
Prior calling of m2m_ota_init is required.
Warning
Notification Server is not supported in the current version (function is not implemented).
See also
m2m_ota_init
Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise.
sint8 m2m_ota_notif_check_for_update ( void )

Synchronous function to check for the OTA update using the Notification Server URL.
Function is not implemented (not supported at the current version).

Warning
Function is not implemented (not supported at the current version).
See also
m2m_ota_init m2m_ota_notif_set_url
Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise.
sint8 m2m_ota_notif_sched ( uint32 u32Period )

Schedule OTA notification Server check for update request after specific number of days.
Function is not implemented (not supported at the current version).

Parameters
[in] u32Period Period in days
Warning
Function is not implemented (not supported at the current version).
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.
sint8 m2m_ota_start_update ( unsigned char * pcDownloadUrl )

Request OTA start update using the download URL. The 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] pcDownloadUrl 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 any previous valid rollback image, irrespective of the result, but when the OTA succeeds, the current image will become the rollback image after m2m_ota_switch_firmware.
Precondition
m2m_ota_init is a prerequisite and must have been called before using m2m_ota_start_update
Switching to the newly downloaded image requires calling m2m_ota_switch_firmware API.
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
1 static void OtaUpdateCb(uint8 u8OtaUpdateStatusType, uint8 u8OtaUpdateStatus)
2 {
3 M2M_INFO("%d %d\n", u8OtaUpdateStatusType, u8OtaUpdateStatus);
4 switch(u8OtaUpdateStatusType)
5 {
6 case DL_STATUS:
7 if(u8OtaUpdateStatus == OTA_STATUS_SUCCESS)
8 {
9 M2M_INFO("OTA download succeeded\n");
10
11 // In this case the application MAY WANT TO update the host driver before calling
12 // @ref m2m_ota_switch_firmware(). Switching firmware image and resetting without
13 // updating host driver may lead to suboptimal functionality.
14
15 // Switch to the upgraded firmware
16 M2M_INFO("Now switching active partition...\n");
17 m2m_ota_switch_firmware();
18 }
19 break;
20 case SW_STATUS:
21 case RB_STATUS:
22 if(u8OtaUpdateStatus == OTA_STATUS_SUCCESS)
23 {
24 M2M_INFO("Switch/Rollback succeeded\n");
25
26 // Start the host SW upgrade if required, then system reset is required (Reinitialize the driver)
27
28 M2M_INFO("Now resetting the system...\n");
29 system_reset();
30 }
31 break;
32 }
33 }
34
35 static void wifi_event_cb(uint8 u8WiFiEvent, void *pvMsg)
36 {
37 // ...
38 case M2M_WIFI_REQ_DHCP_CONF:
39 {
40 // After successful connection, start the OTA upgrade
41 m2m_ota_start_update(OTA_URL);
42 }
43 break;
44 default:
45 break;
46 // ...
47 }
48
49 int main (void)
50 {
51 tstrWifiInitParam param;
52 sint8 s8Ret = M2M_SUCCESS;
53 bool rollback_required = FALSE;
54 tstr1xAuthCredentials gstrCred1x = AUTH_CREDENTIALS;
55
56 // System init, etc should be here...
57
58 m2m_memset((uint8*)&param, 0, sizeof(param));
59 param.pfAppWifiCb = wifi_event_cb;
60
61 // Initialize the WINC Driver
62 s8Ret = m2m_wifi_init(&param);
63 if(s8Ret == M2M_ERR_FW_VER_MISMATCH)
64 {
65 M2M_ERR("Firmware version mismatch\n");
66 }
67 if (M2M_SUCCESS != s8Ret)
68 {
69 M2M_ERR("Driver Init Failed <%d>\n",s8Ret);
70 while(1);
71 }
72 // Initialize the OTA module
73 m2m_ota_init(OtaUpdateCb,NULL);
74
75 // Connect to AP that provides connection to the OTA server
76 m2m_wifi_default_connect();
77
78 while(1)
79 {
80 // Handle the app state machine plus the WINC event handler
81 while(m2m_wifi_handle_events(NULL) != M2M_SUCCESS) {
82 }
83 }
84 }
sint8 m2m_ota_rollback ( void )

Request OTA Roll-back to the old (inactive) WINC image, the WINC firmware will check the validity of the inactive image and activate it if 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 requires 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.
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 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 requires 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.
sint8 m2m_ota_set_ssl_option | ( | tenuOTASSLOption | enuOptionName,
 |  | const void * | pOptionValue,
 |  | size_t | OptionLen
 | ) |  |

Set specific SSL options to be used when the WINC performs an OTA from an https server.

The following options can be set:
WIFI_OTA_SSL_OPT_BYPASS_SERVER_AUTH
WIFI_OTA_SSL_OPT_SNI_VALIDATION
WIFI_OTA_SSL_OPT_SNI_SERVERNAME
The setting applies to all subsequent OTA attempts via m2m_ota_start_update

Parameters
[in] | enuOptionName | The option to set.
[in] | pOptionValue | Pointer to a buffer containing the value to set. The buffer must be at least as long as OptionLen. If OptionLen is 0, then pOptionValue may be NULL.
[in] | OptionLen | The length of the option value being set (including the null terminator for strings).
Returns
The function returns M2M_SUCCESS if the parameters are valid and M2M_ERR_INVALID_ARG otherwise.
sint8 m2m_ota_get_ssl_option | ( | tenuOTASSLOption | enuOptionName,
 |  | void * | pOptionValue,
 |  | size_t * | pOptionLen
 | ) |  |

Get (read) SSL options relating to OTA.

The following options can be read:
WIFI_OTA_SSL_OPT_BYPASS_SERVER_AUTH
WIFI_OTA_SSL_OPT_SNI_VALIDATION
WIFI_OTA_SSL_OPT_SNI_SERVERNAME

Parameters
[in] | enuOptionName | The option to get.
[out] | pOptionValue | Pointer to a buffer to contain the value to get. The buffer must be at least as long as the value pointed to by pOptionLen.
[in,out] | pOptionLen | Pointer to a length. When calling the function, this length must be the length of the buffer available for reading the option value, and must be large enough to hold the returned option value otherwise an M2M_ERR_INVALID_ARG error will be returned. When the function returns, this length is the length of the data that has been populated by the function.
Returns
The function returns M2M_SUCCESS if the parameters are valid and M2M_ERR_INVALID_ARG otherwise.
Generated on Tue Sep 27 2022 16:17:30 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: HFD

Functions
HFD
OTA » Functions

Functions

NMI_API sint8 | m2m_ota_host_file_get (unsigned char *pcDownloadUrl, tpfFileGetCb pfHFDGetCb)
NMI_API sint8 | m2m_ota_host_file_read_hif (uint8 u8Handler, uint32 u32Offset, uint32 u32Size, tpfFileReadCb pfHFDReadCb)
NMI_API sint8 | m2m_ota_host_file_read_spi (uint8 u8Handler, uint8 *pu8Buff, uint32 u32Offset, uint32 u32Size)
NMI_API sint8 | m2m_ota_host_file_erase (uint8 u8Handler, tpfFileEraseCb pfHFDEraseCb)

Detailed Description

Function Documentation

sint8 m2m_ota_host_file_get | ( | unsigned char * | pcDownloadUrl,
 |  | tpfFileGetCb | pfHFDGetCb
 | ) |  |

Download a file from a remote location and store it in WINC's Flash.

Parameters
[in] | pcDownloadUrl | Url pointing to the remote file. HTTP/HTTPS only.
[in] | pfHFDGetCb | Pointer to a callback (see tpfFileGetCb) to be executed when the download finishes.
Returns
The function SHALL return M2M_SUCCESS for success and a negative value otherwise.
Precondition
Requires m2m_ota_init to be called before a download can start.
Warning
This functionality is only supported from WINC release 19.6.1 onwards. The maximum file size that can be stored in WINC1510 is 508KB, the WINC1500 variant is not supported for Host File Download.
Concurrent use of Host File Get and WINC OTA is not possible.
Providing a callback is mandatory.
See also
m2m_ota_init tpfFileGetCb
sint8 m2m_ota_host_file_read_hif | ( | uint8 | u8Handler,
 |  | uint32 | u32Offset,
 |  | uint32 | u32Size,
 |  | tpfFileReadCb | pfHFDReadCb
 | ) |  |

Read a certain amount of bytes from a file previously stored in WINC's Flash using HIF transfer.

Parameters
[in] | u8Handler | Handler of the file we are trying to read from. Must be valid.
[in] | u32Offset | Offset from start of the file to read from (in bytes).
[in] | u32Size | The amount of data to read (in bytes).
[in] | pfHFDReadCb | Callback (see tpfFileReadCb) to be executed when the read operation completes.
Returns
The function SHALL return M2M_SUCCESS for success and a negative value otherwise.
Precondition
Requires m2m_ota_init to be called before a read via HIF can be requested.
Warning
There is a limitation on how much data can be transferred at a time using HIF read, which is 128 bytes. The limitation described above can potentially reduce the speed of the read due to extra overhead, but using the HIF is non-blocking and therefore the Application can continue execution as normal, being interrupted only when data is available. Another advantage is that it does not require the WINC to be reset or put in download mode, as it is the case for reading the file via SPI (see m2m_ota_host_file_read_spi).
A valid file handler must be provided, this means that it needs to match the handler internally stored by the WINC and must not be HFD_INVALID_HANDLER
Providing a callback is mandatory.
Note
When calling this API while specifying a size > 128 bytes, the read will be limited to the first 128 bytes starting at the read offset. It it recommended that a read for sizes above 128 bytes is performed in multiple steps, using the callback to advance the offset and request another read of 128 bytes (or less) each time.
See also
m2m_ota_init m2m_ota_host_file_get tpfFileReadCb
sint8 m2m_ota_host_file_read_spi | ( | uint8 | u8Handler,
 |  | uint8 * | pu8Buff,
 |  | uint32 | u32Offset,
 |  | uint32 | u32Size
 | ) |  |

Read a certain amount of bytes from a file in WINC's Flash using SPI transfer.

Parameters
[in] | u8Handler | Handler of the file we are trying to read from. Must be valid.
[in] | pu8Buff | Pointer to a buffer to store the data being read. Must not be NULL.
[in] | u32Offset | Offset from start of the file to read from (in bytes).
[in] | u32Size | The amount of data to read (in Bytes).
Returns
The function SHALL return M2M_SUCCESS for success and a negative value otherwise.
Warning
Reading of a file via SPI can be much faster than by reading it via the HIF. However, the read will be blocking and it will require the WINC to be put into download mode prior to the read, the download mode means that the WINC will act as Flash device and not as a Wifi device. So, before using m2m_ota_host_file_read_spi, the Application should call m2m_wifi_download_mode before trying to read. After the read finishes, the WINC needs to be reset (see m2m_wifi_reinit).
A valid file handler must be provided, this means that it needs to match the handler internally stored by the WINC and must not be HFD_INVALID_HANDLER.
See also
m2m_ota_init m2m_ota_host_file_get

File Download SPI Read Example

The following is an example of how to perform a read file from the WINC via SPI.

1 typedef struct {
2 uint8 u8Handler;
3 uint32 u32Offset;
4 uint32 u32Size;
5 uint8 au8Buff[200];
6 }FileDescriptor;
7
8 tstrWifiInitParam gstrWifiParam;
9 static FileDescriptor gstrAppFile;
10
11 char *acURL = "http://www.microchip.com/_images/ics/medium-ATWINC1500-MODULE-28.png";
12
13 static void ReadFileSPI(void);
14 static void wifi_event_cb(uint8 u8WiFiEvent, void * pvMsg);
15 static void FileGetCallback(uint8 u8Status, uint8 u8Handler, uint32 u32Size);
16 static void OtaUpdateCb(uint8 u8OtaUpdateStatusType ,uint8 u8OtaUpdateStatus);
17
18 static void wifi_event_cb(uint8 u8WiFiEvent, void * pvMsg)
19 {
20 case M2M_WIFI_REQ_DHCP_CONF:
21 {
22 // After successfully connection, start the File Download
23 gstrAppFile.u32Offset = 0;
24 s8Ret = m2m_ota_host_file_get(acURL, FileGetCallback);
25 if(s8Ret != M2M_SUCCESS)
26 {
27 M2M_ERR("File Download Failed!\n");
28 }
29 }
30 break;
31 default:
32 break;
33 }
34
35 static void OtaUpdateCb(uint8 u8OtaUpdateStatusType ,uint8 u8OtaUpdateStatus)
36 {
37 M2M_INFO("%d %d\n",u8OtaUpdateStatusType,u8OtaUpdateStatus);
38
39 if(u8OtaUpdateStatus == OTA_STATUS_SUCCESS)
40 {
41 if(u8OtaUpdateStatusType == HFD_STATUS)
42 {
43 // Read the file and process it
44 ReadFileSPI();
45 }
46 }
47 }
48
49 static void FileGetCallback(uint8 u8Status, uint8 u8Handler, uint32 u32Size)
50 {
51 if(OTA_STATUS_SUCCESS == u8Status)
52 {
53 gstrAppFile.u8Handler = u8Handler;
54 gstrAppFile.u32Size = u32Size;
55 // File Get Successful
56 }
57 else
58 {
59 M2M_ERR("File Get Failed!\n");
60 // File Get Failed
61 }
62 }
63
64 static void ReadFileSPI(void)
65 {
66 sint8 s8Ret = M2M_ERR_FAIL;
67
68 if(WIFI_STATE_DEINIT != m2m_wifi_get_state())
69 m2m_wifi_deinit(NULL);
70
71 s8Ret = m2m_wifi_download_mode();
72 if(M2M_SUCCESS != s8Ret) goto EXIT;
73
74 // gstrAppFile.u32Offset can be changed to define a starting point for the read,
75 // in which case the size of the requested read should be adjusted to accommodate for this.
76 // This call assumes that m2m_ota_host_file_get was called earlier, in this example it is fine
77 // since ReadFileSPI is only called from the within OtaUpdateCb
78 // This example simply reads the first 200 bytes of the file.
79 uint32 u32AmountToRead = 200;
80 s8Ret = m2m_ota_host_file_read_spi(gstrAppFile.u8Handler, gstrAppFile.au8Buff, gstrAppFile.u32Offset, u32AmountToRead);
81
82 if(M2M_SUCCESS == s8Ret)
83 M2M_INFO("\nFile Read completed, Offset: %lu, Size of Read: %lu.\n", gstrAppFile.u32Offset, u32AmountToRead);
84
85 // *** Do something with the contents of gstrAppFile.au8Buff ***
86
87 s8Ret = m2m_wifi_reinit(&gstrWifiParam);
88 if(M2M_SUCCESS != s8Ret) goto EXIT;
89
90 // Initialize the OTA again and reconnect to the previously connected SSID
91 m2m_ota_init(OtaUpdateCb, NULL);
92 m2m_wifi_default_connect();
93
94 EXIT:
95 return;
96 }
97
98 void main(void)
99 {
100 nm_bsp_init();
101
102 m2m_memset((uint8*)&gstrWifiParam, 0, sizeof(gstrWifiParam));
103 gstrWifiParam.pfAppWifiCb = wifi_event_cb;
104
105 // Initialize the WINC Driver
106 sint8 s8Ret = m2m_wifi_init(&gstrWifiParam);
107 if (M2M_SUCCESS != s8Ret)
108 {
109 M2M_ERR("Driver Init Failed <%d>\n",s8Ret);
110 while(1);
111 }
112
113 // Initialize the OTA module
114 m2m_ota_init(OtaUpdateCb, NULL);
115
116 // *** Connect to a wifi network by calling m2m_wifi_connect() ***
117
118 while(1) m2m_wifi_handle_events(NULL);
119 }
sint8 m2m_ota_host_file_erase | ( | uint8 | u8Handler,
 |  | tpfFileEraseCb | pfHFDEraseCb
 | ) |  |

Erase any traces of file stored in WINC's Flash.

Parameters
[in] | u8Handler | Handler of the file we are trying to erase. Must be valid.
[in] | pfHFDEraseCb | Pointer to callback (see tpfFileEraseCb) to execute when the file erase is completed by the WINC.
Returns
The function SHALL return M2M_SUCCESS for success and a negative value otherwise.
Precondition
In order to execute the callback, m2m_ota_init must be called before requesting the erase.
Note
Providing a callback is optional. If the current handler is invalid at this point, it means one of the three:
  1. The file never existed;
  2. The file has already been already deleted;
  3. The request to get the file hasn't fully completed.
For 1. and 2. there is no need to signal the WINC to erase the file in Flash.
For 3. the Flash can't be erased while a file download is ongoing.
Warning
A valid file handler must be provided, this means that it needs to match the handler internally stored by the WINC and must not be HFD_INVALID_HANDLER
The handlers will be destroyed regardless of the call returning success or not.
See also
m2m_ota_init m2m_ota_host_file_get
Generated on Tue Sep 27 2022 16:17:30 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: SSL

Modules
SSL

Modules

Callbacks
Enumerations and Typedefs
Functions
TLS Defines

Detailed Description

Provides a description of the SSL Layer.

Generated on Tue Sep 27 2022 16:17:30 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Callbacks

Typedefs
Callbacks
SSL

Typedefs

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

Detailed Description

Provides detail on the available callbacks for the SSL Layer.

Typedef Documentation

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

A callback to get SSL notifications.

Parameters
[in] | u8MsgType | The type of the message received.
[in] | pvMsg | A structure to provide notification payload.
Generated on Tue Sep 27 2022 16:17:30 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Enumerations and Typedefs

Data Structures | Typedefs | Enumerations
Enumerations and Typedefs
SSL

Data Structures

struct | EcPoint
struct | EcDomainParam
struct | tstrEllipticCurve
struct | tstrEcdhReqInfo
struct | tstrEcdsaVerifyReqInfo
struct | tstrEcdsaSignReqInfo
struct | tstrEccReqInfo
struct | tstrTlsCrlEntry
struct | tstrTlsCrlInfo
struct | tstrTlsSrvSecFileEntry
struct | tstrTlsSrvSecHdr
struct | tstrTlsSrvChunkHdr
struct | tstrSslSetActiveCsList
struct | tstrECPoint
struct | tstrECDomainParam

Typedefs

typedef struct EcPoint | tstrECPoint
typedef struct EcDomainParam | tstrECDomainParam

Enumerations

enum tenuEcNamedCurve {
EC_SECP192R1 = 19, EC_SECP256R1 = 23, EC_SECP384R1 = 24, EC_SECP521R1 = 25,
EC_UNKNOWN = 255
}
enum tenuEccREQ {
ECC_REQ_NONE, ECC_REQ_CLIENT_ECDH, ECC_REQ_SERVER_ECDH, ECC_REQ_GEN_KEY,
ECC_REQ_SIGN_GEN, ECC_REQ_SIGN_VERIFY
}
enum tenuM2mSslCmd {
M2M_SSL_REQ_CERT_VERIF, M2M_SSL_REQ_ECC, M2M_SSL_RESP_ECC, M2M_SSL_IND_CRL,
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 tenuSslCertExpSettings { SSL_CERT_EXP_CHECK_DISABLE, SSL_CERT_EXP_CHECK_ENABLE, SSL_CERT_EXP_CHECK_EN_IF_SYS_TIME }
enum tenuTlsFlashStatus {
TLS_FLASH_OK, TLS_FLASH_OK_NO_CHANGE, TLS_FLASH_ERR_CORRUPT, TLS_FLASH_ERR_NO_CHANGE,
TLS_FLASH_ERR_UNKNOWN
}

Detailed Description

Specifies the enums and Data Structures used by the SSL APIs.

Typedef Documentation

typedef struct EcPoint tstrECPoint
typedef struct EcDomainParam tstrECDomainParam

Enumeration Type Documentation

enum tenuEcNamedCurve

EC Named Curves.

Defines a list of supported ECC named curves.

Enumerator
EC_SECP192R1 | It is defined by NIST as P192 and by the SEC Group as secp192r1.
EC_SECP256R1 | It is defined by NIST as P256 and by the SEC Group as secp256r1.
EC_SECP384R1 | It is defined by NIST as P384 and by the SEC Group as secp384r1.
EC_SECP521R1 | It is defined by NIST as P521 and by the SEC Group as secp521r1.
EC_UNKNOWN |
enum tenuEccREQ

ECC operations that may be requested by WINC.

These are passed in the u16REQ field of tstrEccReqInfo, which is used in both the request from the WINC and the response to the WINC.

Enumerator
ECC_REQ_NONE |
ECC_REQ_CLIENT_ECDH | Derive the shared secret from ECDHE key exchange as client.
ECC_REQ_SERVER_ECDH | Derive the shared secret from ECDHE key exchange as server.
ECC_REQ_GEN_KEY | Generate a key pair to be used in ECDHE key exchange as server.
ECC_REQ_SIGN_GEN | Generate the signature for a given curve and value. The value needs to be retrieved via m2m_ssl_retrieve_hash.
ECC_REQ_SIGN_VERIFY | Verify a list of signatures. Each set of value/signature/key/curve information needs to be retrieved via m2m_ssl_retrieve_next_for_verifying.
enum tenuM2mSslCmd
Enumerator
M2M_SSL_REQ_CERT_VERIF | For internal use only during RSA signature verification.
M2M_SSL_REQ_ECC | Request from WINC for an elliptic curve operation.
M2M_SSL_RESP_ECC | Response to WINC with the result of an elliptic curve operation.
M2M_SSL_IND_CRL | Indication to WINC of a custom-format certificate revocation list.
M2M_SSL_REQ_WRITE_OWN_CERTS | Request to WINC with local certificates to write into WINC flash.
M2M_SSL_REQ_SET_CS_LIST | Request to WINC to set the list of ciphersuites to be globally enabled.
M2M_SSL_RESP_SET_CS_LIST | Response from WINC with the list of ciphersuites that are globally enabled.
M2M_SSL_RESP_WRITE_OWN_CERTS | Response from WINC to indicate that local certificates have been written into WINC flash.
enum tenuSslCertExpSettings

SSL Certificate Expiry Validation Options.

Enumerator
SSL_CERT_EXP_CHECK_DISABLE | ALWAYS OFF. Ignore certificate expiration date validation. If a certificate is expired or there is no configured system time, the SSL connection SUCCEEDs.
SSL_CERT_EXP_CHECK_ENABLE | ALWAYS ON. Validate certificate expiration date. If a certificate is expired or there is no configured system time, the SSL connection FAILs.
SSL_CERT_EXP_CHECK_EN_IF_SYS_TIME | CONDITIONAL VALIDATION (Default setting at startup). Validate the certificate expiration date only if there is a configured system time. If there is no configured system time, the certificate expiration is bypassed and the SSL connection SUCCEEDs.
enum tenuTlsFlashStatus
Enumerator
TLS_FLASH_OK | Operation succeeded. Flash modified.
TLS_FLASH_OK_NO_CHANGE | Operation was unnecessary. Flash not modified.
TLS_FLASH_ERR_CORRUPT | Operation failed. Flash modified.
TLS_FLASH_ERR_NO_CHANGE | Operation failed. Flash not modified.
TLS_FLASH_ERR_UNKNOWN | Operation failed. Flash status unknown.
Generated on Tue Sep 27 2022 16:17:30 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: EcPoint Struct Reference

Data Fields
EcPoint Struct Reference
SSL » Enumerations and Typedefs

Data Fields

union {
uint8 XY [2 *ECC_POINT_MAX_SIZE]
struct {
uint8 X [ECC_POINT_MAX_SIZE]
uint8 Y [ECC_POINT_MAX_SIZE]
}
};
uint16 u16Size
uint16 u16PrivKeyID

Field Documentation

uint8 XY[2 *ECC_POINT_MAX_SIZE]

Concatenation of X and Y coordinates of the ec point.

uint8 X[ECC_POINT_MAX_SIZE]

The X-coordinate of the ec point.

uint8 Y[ECC_POINT_MAX_SIZE]

The Y-coordinate of the ec point.

union { ... }
uint16 u16Size

Point size in bytes (for each of the coordinates).

uint16 u16PrivKeyID

ID for the corresponding private key.

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: EcDomainParam Struct Reference

Data Fields
EcDomainParam Struct Reference
SSL » Enumerations and Typedefs

Data Fields

uint32 | p [ECC_POINT_MAX_SIZE_WORDS]
uint32 | a [ECC_POINT_MAX_SIZE_WORDS]
uint32 | b [ECC_POINT_MAX_SIZE_WORDS]
tstrECPoint G

Field Documentation

uint32 p[ECC_POINT_MAX_SIZE_WORDS]
uint32 a[ECC_POINT_MAX_SIZE_WORDS]
uint32 b[ECC_POINT_MAX_SIZE_WORDS]
tstrECPoint G
Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrEllipticCurve Struct Reference

Data Fields
tstrEllipticCurve Struct Reference
SSL » Enumerations and Typedefs

Data Fields

tenuEcNamedCurve enuType
tstrECDomainParam strParam

Detailed Description

Definition of an elliptic curve.

Field Documentation

tenuEcNamedCurve enuType
tstrECDomainParam strParam
Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrEcdhReqInfo Struct Reference

Data Fields
tstrEcdhReqInfo Struct Reference
SSL » Enumerations and Typedefs

Data Fields

tstrECPoint strPubKey
uint8 au8Key [ECC_POINT_MAX_SIZE]

Detailed Description

Information relating to operations of type ECC_REQ_CLIENT_ECDH, ECC_REQ_GEN_KEY and ECC_REQ_SERVER_ECDH.

Field Documentation

tstrECPoint strPubKey

Public key. Usage depends on type of operation.

uint8 au8Key[ECC_POINT_MAX_SIZE]

Pre master secret generated during operations of type ECC_REQ_CLIENT_ECDH and ECC_REQ_SERVER_ECDH.

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrEcdsaVerifyReqInfo Struct Reference

Data Fields
tstrEcdsaVerifyReqInfo Struct Reference
SSL » Enumerations and Typedefs

Data Fields

uint32 u32nSig

Detailed Description

Information relating to requests of type ECC_REQ_SIGN_VERIFY.

Field Documentation

uint32 u32nSig

Number of sets of value/signature/key/curve information for verifying. Each set needs to be retrieved via m2m_ssl_retrieve_next_for_verifying.

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrEcdsaSignReqInfo Struct Reference

Data Fields
tstrEcdsaSignReqInfo Struct Reference
SSL » Enumerations and Typedefs

Data Fields

uint16 u16CurveType
uint16 u16HashSz

Detailed Description

Information relating to requests of type ECC_REQ_SIGN_GEN.

Field Documentation

uint16 u16CurveType

The named curve to be used for signing, to be cast to type tenuEcNamedCurve.

uint16 u16HashSz

The size of the value to be signed. The value needs to be retrieved via m2m_ssl_retrieve_hash.

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrEccReqInfo Struct Reference

Data Fields
tstrEccReqInfo Struct Reference
SSL » Enumerations and Typedefs

Data Fields

uint16 u16REQ
uint16 u16Status
uint32 u32UserData
uint32 u32SeqNo
union {
tstrEcdhReqInfo strEcdhREQ
tstrEcdsaSignReqInfo strEcdsaSignREQ
tstrEcdsaVerifyReqInfo strEcdsaVerifyREQ
};

Detailed Description

Information relating to ECC operations.

This is used in both the request from the WINC and the response to the WINC.

Field Documentation

uint16 u16REQ

The requested ECC operation, to be cast to type tenuEccREQ.

uint16 u16Status

The status of the operation: zero for success; non-zero for failure. This field should be used in responses and ignored in requests.

uint32 u32UserData

This value is used internally. The value set in the response must match the value received in the request.

uint32 u32SeqNo

This value is used internally. The value set in the response must match the value received in the request.

tstrEcdhReqInfo strEcdhREQ

Information relating to an operation of type ECC_REQ_CLIENT_ECDH, ECC_REQ_GEN_KEY or ECC_REQ_SERVER_ECDH.

tstrEcdsaSignReqInfo strEcdsaSignREQ

Information relating to an operation of type ECC_REQ_SIGN_GEN. This field is used in requests and ignored in responses.

tstrEcdsaVerifyReqInfo strEcdsaVerifyREQ

Information relating to an operation of type ECC_REQ_SIGN_VERIFY. This field is used in requests and ignored in responses.

union { ... }
Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrTlsCrlEntry Struct Reference

Data Fields
tstrTlsCrlEntry Struct Reference
SSL » Enumerations and Typedefs

Data Fields

uint8 u8DataLen
uint8 au8Data [TLS_CRL_DATA_MAX_LEN]
uint8 __PAD24__ [3]

Detailed Description

Certificate data for inclusion in a revocation list (CRL)

Field Documentation

uint8 u8DataLen

Length of certificate data (maximum possible is TLS_CRL_DATA_MAX_LEN)

uint8 au8Data[TLS_CRL_DATA_MAX_LEN]

Certificate data

uint8 __PAD24__[3]

Padding bytes for forcing 4-byte alignment

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrTlsCrlInfo Struct Reference

Data Fields
tstrTlsCrlInfo Struct Reference
SSL » Enumerations and Typedefs

Data Fields

uint8 u8CrlType
uint8 u8Rsv1
uint8 u8Rsv2
uint8 u8Rsv3
tstrTlsCrlEntry astrTlsCrl [TLS_CRL_MAX_ENTRIES]

Detailed Description

Certificate revocation list details.

Field Documentation

uint8 u8CrlType

Type of certificate data contained in list

uint8 u8Rsv1

Reserved for future use

uint8 u8Rsv2

Reserved for future use

uint8 u8Rsv3

Reserved for future use

tstrTlsCrlEntry astrTlsCrl[TLS_CRL_MAX_ENTRIES]

List entries

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrTlsSrvSecFileEntry Struct Reference

Data Fields
tstrTlsSrvSecFileEntry Struct Reference
SSL » Enumerations and Typedefs

Data Fields

char acFileName [TLS_FILE_NAME_MAX]
uint32 u32FileSize
uint32 u32FileAddr

Detailed Description

This struct contains a TLS certificate.

Field Documentation

char acFileName[TLS_FILE_NAME_MAX]

Name of the certificate.

uint32 u32FileSize

Size of the certificate.

uint32 u32FileAddr

Error Code.

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrTlsSrvSecHdr Struct Reference

Data Fields
tstrTlsSrvSecHdr Struct Reference
SSL » Enumerations and Typedefs

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

uint8 au8SecStartPattern[TLS_SRV_SEC_START_PATTERN_LEN]

Start pattern.

uint32 u32nEntries

Number of certificates stored in the struct.

uint32 u32NextWriteAddr
tstrTlsSrvSecFileEntry astrEntries[TLS_SRV_SEC_MAX_FILES]

TLS Certificate headers.

uint32 u32CRC

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

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrTlsSrvChunkHdr Struct Reference

Data Fields
tstrTlsSrvChunkHdr Struct Reference
SSL » Enumerations and Typedefs

Data Fields

uint16 u16Sig
uint16 u16TotalSize32
uint16 u16Offset32
uint16 u16Size32

Field Documentation

uint16 u16Sig
uint16 u16TotalSize32
uint16 u16Offset32
uint16 u16Size32
Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrSslSetActiveCsList Struct Reference

Data Fields
tstrSslSetActiveCsList Struct Reference
SSL » Enumerations and Typedefs

Data Fields

uint32 u32CsBMP

Field Documentation

uint32 u32CsBMP
Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrECPoint Struct Reference

tstrECPoint Struct Reference
SSL » Enumerations and Typedefs

Detailed Description

Elliptic Curve point representation.

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrECDomainParam Struct Reference

tstrECDomainParam Struct Reference
SSL » Enumerations and Typedefs

Detailed Description

ECC Curve Domain Parameters.

The structure defines the ECC domain parameters for curves defined over prime finite fields.

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 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_next_for_verifying (tenuEcNamedCurve *penuCurve, uint8 *pu8Value, uint16 *pu16ValueSz, uint8 *pu8Sig, uint16 *pu16SigSz, tstrECPoint *pstrKey)
NMI_API sint8 | m2m_ssl_retrieve_cert (uint16 *pu16Curve, uint8 *pu8Value, uint8 *pu8Sig, tstrECPoint *pstrKey)
NMI_API sint8 | m2m_ssl_retrieve_hash (uint8 *pu8Value, uint16 u16ValueSz)
NMI_API void | m2m_ssl_stop_retrieving (void)
NMI_API void | m2m_ssl_stop_processing_certs (void)
NMI_API void | m2m_ssl_ecc_process_done (void)
NMI_API sint8 | m2m_ssl_set_active_ciphersuites (uint32 u32SslCsBMP)

Detailed Description

Provides detail on the available APIs for the SSL Layer.

Function Documentation

NMI_API sint8 m2m_ssl_init ( tpfAppSSLCb pfAppSSLCb )

Initializes the SSL layer.

Parameters
[in] pfAppSSLCb Application SSL callback function.
Returns
The function returns M2M_SUCCESS for success and a negative value otherwise.
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 returns M2M_SUCCESS for success and a negative value otherwise.
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 returns M2M_SUCCESS for success and a negative value otherwise.
NMI_API sint8 m2m_ssl_retrieve_next_for_verifying | ( | tenuEcNamedCurve * | penuCurve,
 |  | uint8 * | pu8Value,
 |  | uint16 * | pu16ValueSz,
 |  | uint8 * | pu8Sig,
 |  | uint16 * | pu16SigSz,
 |  | tstrECPoint * | pstrKey
 | ) |  |

Retrieve the next set of information from the WINC for ECDSA verification.

Parameters
[out] | penuCurve | The named curve.
[out] | pu8Value | Value retrieved for verification. This is the digest of the message, truncated/prepended to the appropriate size.
[in,out] | pu16ValueSz | in: Size of value buffer provided by caller. out: Size of value retrieved (provided for convenience; the value size is in fact determined by the curve).
[out] | pu8Sig | Signature retrieved for verification.
[in,out] | pu16SigSz | in: Size of signature buffer provided by caller. out: Size of signature retrieved (provided for convenience; the signature size is in fact determined by the curve).
[out] | pstrKey | Public key retrieved for verification.
Returns
The function returns M2M_SUCCESS for success and a negative value otherwise.
Precondition
This function should only be called after the application has been notified that verification information is ready via ECC_REQ_SIGN_VERIFY.
Warning
If this function returns M2M_ERR_FAIL, then any remaining verification info from the WINC is lost.
NMI_API sint8 m2m_ssl_retrieve_cert | ( | uint16 * | pu16Curve,
 |  | uint8 * | pu8Value,
 |  | uint8 * | pu8Sig,
 |  | tstrECPoint * | pstrKey
 | ) |  |

Retrieve the next set of information from the WINC for ECDSA verification.

Parameters
[out] | pu16Curve | The named curve, to be cast to type tenuEcNamedCurve.
[out] | pu8Value | Value retrieved for verification. This is the digest of the message, truncated/prepended to the appropriate size. The size of the value is equal to the field size of the curve, hence is determined by pu16Curve.
[out] | pu8Sig | Signature retrieved for verification. The size of the signature is equal to twice the field size of the curve, hence is determined by pu16Curve.
[out] | pstrKey | Public key retrieved for verification.
Returns
The function returns M2M_SUCCESS for success and a negative value otherwise.
Precondition
This function should only be called after the application has been notified that verification information is ready via ECC_REQ_SIGN_VERIFY.
Warning
If this function returns M2M_ERR_FAIL, then any remaining verification info from the WINC is lost.
This API has been deprecated and is kept for legacy purposes only. It is recommended that m2m_ssl_retrieve_next_for_verifying is used instead.
NMI_API sint8 m2m_ssl_retrieve_hash | ( | uint8 * | pu8Value,
 |  | uint16 | u16ValueSz
 | ) |  |

Retrieve the value from the WINC for ECDSA signing.

Parameters
[out] | pu8Value | Value retrieved for signing. This is the digest of the message, truncated/prepended to the appropriate size.
[in] | u16ValueSz | Size of value to be retrieved. (The application should obtain this information, along with the curve, from the associated ECC_REQ_SIGN_GEN notification.)
Returns
The function returns M2M_SUCCESS for success and a negative value otherwise.
Precondition
This function should only be called after the application has been notified that signing information is ready via ECC_REQ_SIGN_GEN.
Warning
If this function returns M2M_ERR_FAIL, then the value for signing is lost.
NMI_API void m2m_ssl_stop_retrieving ( void )

Allow SSL driver to tidy up when the application chooses not to retrieve all available information.

Warning
The application must call this function if it has been notified (via ECC_REQ_SIGN_GEN or ECC_REQ_SIGN_VERIFY) that information is available for retrieving from the WINC, but chooses not to retrieve it all. The application must not call this function if it has retrieved all the available information, or if a retrieve function returned M2M_ERR_FAIL indicating that any remaining information has been lost.
See also
m2m_ssl_retrieve_next_for_verifying
m2m_ssl_retrieve_cert
m2m_ssl_retrieve_hash
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 has been deprecated and is kept for legacy purposes only. It is recommended that m2m_ssl_stop_retrieving is used instead.
NMI_API void m2m_ssl_ecc_process_done ( void )

Allow SSL driver to tidy up after application has finished processing ECC message.

Warning
The application should call this function after receiving an SSL callback with message type M2M_SSL_REQ_ECC, after retrieving any related information, and before calling m2m_ssl_handshake_rsp.
NMI_API sint8 m2m_ssl_set_active_ciphersuites ( uint32 u32SslCsBMP )

Sets the active ciphersuites.

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. If u32SslCsBMP does not contain any ciphersuites supported by firmware, then the current active list will not change.
Returns
The function returns M2M_SUCCESS for success and a negative value otherwise.
Generated on Tue Sep 27 2022 16:17:30 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: TLS Defines

Modules | Macros
TLS Defines
SSL

Modules

TLS Socket Options
Legacy names for TLS Cipher Suite IDs
TLS Cipher Suite IDs

Macros

#define ALPN_LIST_MAX_APP_LENGTH 30

Detailed Description

Macro Definition Documentation

#define ALPN_LIST_MAX_APP_LENGTH 30

Maximum length of ALPN list that can be specified by the application. This length includes separators (spaces) and terminator (NUL).

Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: TLS Socket Options

Macros
TLS Socket Options
SSL » TLS Defines

Macros

#define | SO_SSL_BYPASS_X509_VERIF 0x01
#define | SO_SSL_SNI 0x02
#define | SO_SSL_ENABLE_SESSION_CACHING 0x03
#define | SO_SSL_ENABLE_SNI_VALIDATION 0x04
#define | SO_SSL_ALPN 0x05

Detailed Description

The following list of macros are used to define SSL Socket options.

See also
setsockopt

Macro Definition Documentation

#define SO_SSL_BYPASS_X509_VERIF 0x01

Allow an opened SSL socket to bypass the X509 certificate verification process. It is recommended NOT to use this socket option in production software applications. It is supported for debugging and testing purposes.
The option value should be casted to int type.
0: do not bypass the X509 certificate verification process (default, recommended).
1: bypass the X509 certificate verification process.
This option only takes effect if it is set after calling socket and before calling connect or secure.

#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. Its size must not exceed HOSTNAME_MAX_SIZE. If the SNI is not a null string, then TLS Client Hello messages will include the SNI extension.
This option only takes effect if it is set after calling socket and before calling connect or secure.

#define SO_SSL_ENABLE_SESSION_CACHING 0x03

This option 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 casted to int type.
0: disable TLS session caching (default).
1: enable TLS session caching.
Note that TLS session caching is always enabled in TLS Server Mode and this option is ignored.
This option only takes effect if it is set after calling socket and before calling connect or secure.

#define SO_SSL_ENABLE_SNI_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 casted to int type.
0: disable server certificate name validation (default).
1: enable server certificate name validation (recommended).
This option only takes effect if it is set after calling socket and before calling connect or secure.

#define SO_SSL_ALPN 0x05

Set the list to use for Application-Layer Protocol Negotiation for an SSL socket.
This option is intended for internal use and should not be used by the application. Applications should use the API set_alpn_list.

Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Legacy names for TLS Cipher Suite IDs

Macros
Legacy names for TLS Cipher Suite IDs
SSL » TLS Defines

Macros

#define | SSL_ENABLE_RSA_SHA_SUITES 0x01
#define | SSL_ENABLE_RSA_SHA256_SUITES 0x02
#define | SSL_ENABLE_DHE_SHA_SUITES 0x04
#define | SSL_ENABLE_DHE_SHA256_SUITES 0x08
#define | SSL_ENABLE_RSA_GCM_SUITES 0x10
#define | SSL_ENABLE_DHE_GCM_SUITES 0x20
#define | SSL_ENABLE_ALL_SUITES 0x0000003F

Detailed Description

The following list of macros MUST NOT be used. Instead use the new names under SSLCipherSuiteID

See also
m2m_ssl_set_active_ciphersuites

Macro Definition Documentation

#define SSL_ENABLE_RSA_SHA_SUITES 0x01

Enable RSA Hmac_SHA based Cipher suites. For example, TLS_RSA_WITH_AES_128_CBC_SHA

#define SSL_ENABLE_RSA_SHA256_SUITES 0x02

Enable RSA Hmac_SHA256 based Cipher suites. For example, TLS_RSA_WITH_AES_128_CBC_SHA256

#define SSL_ENABLE_DHE_SHA_SUITES 0x04

Enable DHE Hmac_SHA based Cipher suites. For example, TLS_DHE_RSA_WITH_AES_128_CBC_SHA

#define SSL_ENABLE_DHE_SHA256_SUITES 0x08

Enable DHE Hmac_SHA256 based Cipher suites. For example, TLS_DHE_RSA_WITH_AES_128_CBC_SHA256

#define SSL_ENABLE_RSA_GCM_SUITES 0x10

Enable RSA AEAD based Cipher suites. For example, TLS_RSA_WITH_AES_128_GCM_SHA256

#define SSL_ENABLE_DHE_GCM_SUITES 0x20

Enable DHE AEAD based Cipher suites. For example, TLS_DHE_RSA_WITH_AES_128_GCM_SHA256

#define SSL_ENABLE_ALL_SUITES 0x0000003F

Enable all possible supported cipher suites.

Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: TLS Cipher Suite IDs

Macros
TLS Cipher Suite IDs
SSL » TLS Defines

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_ECC_ALL_CIPHERS
#define | SSL_NON_ECC_CIPHERS_AES_128
#define | SSL_ECC_CIPHERS_AES_256
#define | SSL_NON_ECC_CIPHERS_AES_256
#define | SSL_CIPHER_ALL

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

#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
Value:
(\
SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 | \
SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 \
)

All ciphers that use ECC crypto only. This excludes ciphers that use RSA. They use ECDSA instead. These ciphers are turned off by default at startup. The application may enable them if it has an ECC math engine (like ATECC508).

#define SSL_ECC_ALL_CIPHERS
Value:
(\
SSL_CIPHER_ECDHE_RSA_WITH_AES_128_CBC_SHA | \
SSL_CIPHER_ECDHE_RSA_WITH_AES_128_CBC_SHA256 | \
SSL_CIPHER_ECDHE_RSA_WITH_AES_128_GCM_SHA256 | \
SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 | \
SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 \
)

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

#define SSL_NON_ECC_CIPHERS_AES_128
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 \
)

All supported AES-128 Ciphers (ECC ciphers are not counted). This is the default active group after startup.

#define SSL_ECC_CIPHERS_AES_256
Value:
(\
SSL_CIPHER_ECDHE_RSA_WITH_AES_256_CBC_SHA \
)

ECC AES-256 supported ciphers.

#define SSL_NON_ECC_CIPHERS_AES_256
Value:
(\
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 \
)

AES-256 Ciphers. This group is disabled by default at startup because the WINC HW Accelerator supports only AES-128. If the application needs to force AES-256 cipher support, it could enable them (or any of them) explicitly by calling m2m_ssl_set_active_ciphersuites.

#define SSL_CIPHER_ALL
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 | \
SSL_CIPHER_ECDHE_RSA_WITH_AES_128_CBC_SHA | \
SSL_CIPHER_ECDHE_RSA_WITH_AES_128_CBC_SHA256 | \
SSL_CIPHER_ECDHE_RSA_WITH_AES_128_GCM_SHA256 | \
SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 | \
SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 | \
SSL_CIPHER_ECDHE_RSA_WITH_AES_256_CBC_SHA \
)

Turn On All TLS Ciphers.

Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: WLAN

Modules
WLAN

Modules

Callbacks
Defines
Enumerations and Typedefs
Functions

Detailed Description

Generated on Tue Sep 27 2022 16:17:30 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Callbacks

Typedefs
Callbacks
WLAN

Typedefs

typedef void(* | tpfAppWifiCb) (uint8 u8MsgType, void *pvMsg)
typedef void(* | tpfAppEthCb) (uint8 u8MsgType, void *pvMsg, void *pvCtrlBuf)

Detailed Description

Provides detail on the available callbacks for the Wlan APIs.

Typedef Documentation

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

Wi-Fi's main callback function handler, for handling the M2M_WIFI events received on the Wi-Fi interface. Such notifications are received in response to Wi-Fi operations such as m2m_wifi_request_scan, m2m_wifi_connect_open, m2m_wifi_connect_wep, m2m_wifi_connect_psk, m2m_wifi_connect_1x_mschap2, m2m_wifi_connect_1x_tls.

Wi-Fi operations are implemented in an asynchronous mode, and all incoming information/status are to be handled through this callback function when the corresponding notification is received.

Applications are expected to assign this wi-fi callback function 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 (In case Ethernet/Bypass mode is defined)
  • M2M_WIFI_RESP_WIFI_RX_PACKET (In case monitoring mode is used)
[in] pvMsg A pointer to a buffer containing the notification parameters (if any). It should be cast to the correct data type corresponding to the notification type.
See also
tstrM2mWifiStateChanged tstrM2MWPSInfo tstrM2mScanDone tstrM2mWifiscanResult m2m_wifi_init
void(* tpfAppEthCb)(uint8 u8MsgType, void *pvMsg, void *pvCtrlBuf)

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

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). It should be cast to the correct data type corresponding to the notification type.

For example, it could be a pointer to the buffer holding the received frame in case of M2M_WIFI_RESP_ETHERNET_RX_PACKET event.

Parameters
[in] pvCtrlBuf A pointer to control buffer describing the accompanied message. To be cast to tstrM2mIpCtrlBuf in case of M2M_WIFI_RESP_ETHERNET_RX_PACKET event.
Warning
Make sure that the application defines ETH_MODE.
See also
m2m_wifi_init
Generated on Tue Sep 27 2022 16:17:30 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 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_MIN_PSK_LEN 9
#define | M2M_DEVICE_NAME_MAX 48
#define | M2M_NTP_MAX_SERVER_NAME_LENGTH 32
#define | M2M_LISTEN_INTERVAL 1
#define | MAX_HIDDEN_SITES 4
#define | M2M_CUST_IE_LEN_MAX 252
#define | M2M_CRED_STORE_FLAG 0x01
#define | M2M_CRED_ENCRYPT_FLAG 0x02
#define | M2M_CRED_IS_STORED_FLAG 0x10
#define | M2M_CRED_IS_ENCRYPTED_FLAG 0x20
#define | M2M_WIFI_CONN_BSSID_FLAG 0x01
#define | M2M_AUTH_1X_USER_LEN_MAX 100
#define | M2M_AUTH_1X_PASSWORD_LEN_MAX 256
#define | M2M_AUTH_1X_PRIVATEKEY_LEN_MAX 256
#define | M2M_AUTH_1X_CERT_LEN_MAX 1584
#define | M2M_802_1X_UNENCRYPTED_USERNAME_FLAG 0x80
#define | M2M_802_1X_PREPEND_DOMAIN_FLAG 0x40
#define | M2M_802_1X_MSCHAP2_FLAG 0x01
#define | M2M_802_1X_TLS_FLAG 0x02
#define | M2M_802_1X_TLS_CLIENT_CERTIFICATE 1
#define | PSK_CALC_LEN 40
#define | PWR_DEFAULT PWR_HIGH
#define | M2M_CONFIG_CMD_BASE 1
#define | M2M_STA_CMD_BASE 40
#define | M2M_AP_CMD_BASE 70
#define | M2M_SERVER_CMD_BASE 100
#define | M2M_GEN_CMD_BASE 105
#define | M2M_OTA_CMD_BASE 100
#define | M2M_CRYPTO_CMD_BASE 1
#define | M2M_MAX_GRP_NUM_REQ (127)
#define | WEP_40_KEY_SIZE ((uint8)5)
#define | WEP_104_KEY_SIZE ((uint8)13)
#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_SHA256_CONTEXT_BUFF_LEN (128)
#define | M2M_SCAN_DEFAULT_NUM_SLOTS (2)
#define | M2M_SCAN_DEFAULT_SLOT_TIME (30)
#define | M2M_SCAN_DEFAULT_PASSIVE_SLOT_TIME (300)
#define | M2M_SCAN_DEFAULT_NUM_PROBE (2)
#define | M2M_FASTCONNECT_DEFAULT_RSSI_THRESH (-45)
#define | TLS_FILE_NAME_MAX 48
#define | TLS_SRV_SEC_MAX_FILES 8
#define | TLS_SRV_SEC_START_PATTERN_LEN 8
#define | TLS_CRL_DATA_MAX_LEN 64
#define | TLS_CRL_MAX_ENTRIES 10
#define | TLS_CRL_TYPE_NONE 0
#define | TLS_CRL_TYPE_CERT_HASH 1
#define | TLS_CERTS_CHUNKED_SIG_VALUE 0x6ec8
#define | WLAN_11B_RATES_INITIALIZER
#define | WLAN_11G_RATES_INITIALIZER
#define | WLAN_11N_RATES_INITIALIZER
#define | WLAN_11BGN_RATES_ASC_INITIALIZER
#define | WLAN_11BG_RATES_ASC_INITIALIZER
#define | DEFAULT_CONF_AR_INITIALIZER { 5, 1, TX_RATE_AUTO, TX_RATE_AUTO, 10, 5, 3 }

Detailed Description

Specifies the macros and defines used by the Wlan APIs.

Macro Definition Documentation

#define M2M_BUFFER_MAX_SIZE (1600UL - 4)

Maximum size for the shared packet buffer.

#define M2M_MAC_ADDRES_LEN 6

The size of the 802 MAC address.

#define M2M_ETHERNET_HDR_OFFSET 34

The offset of the Ethernet header within the WLAN Tx Buffer.

#define M2M_ETHERNET_HDR_LEN 14

Length of the Ethernet header in bytes.

#define M2M_MAX_SSID_LEN 33

1 more than the max SSID length. This matches the size of SSID buffers (max SSID length + 1-byte length field).

#define M2M_MAX_PSK_LEN 65

1 more than the WPA PSK length (in ASCII format). This matches the size of the WPA PSK/Passphrase buffer (max ASCII contents + 1-byte length field). Alternatively it matches the WPA PSK length (in ASCII format) + 1 byte NULL termination.

#define M2M_MIN_PSK_LEN 9

1 more than the minimum WPA PSK Passphrase length. It matches the minimum WPA PSK Passphrase length + 1 byte NULL termination.

#define M2M_DEVICE_NAME_MAX 48

Maximum Size for the device name including the NULL termination.

#define M2M_NTP_MAX_SERVER_NAME_LENGTH 32

Maximum NTP server name length

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

#define MAX_HIDDEN_SITES 4

max number of hidden SSID supported by scan request

#define M2M_CUST_IE_LEN_MAX 252

The maximum size of IE (Information Element).

#define M2M_CRED_STORE_FLAG 0x01

Flag used in tstrM2mConnCredHdr to indicate that Wi-Fi connection credentials should be stored in WINC flash.

#define M2M_CRED_ENCRYPT_FLAG 0x02

Flag used in tstrM2mConnCredHdr to indicate that Wi-Fi connection credentials should be encrypted when stored in WINC flash.

#define M2M_CRED_IS_STORED_FLAG 0x10

Flag used in tstrM2mConnCredHdr to indicate that Wi-Fi connection credentials are stored in WINC flash. May only be set by WINC firmware.

#define M2M_CRED_IS_ENCRYPTED_FLAG 0x20

Flag used in tstrM2mConnCredHdr to indicate that Wi-Fi connection credentials are encrypted in WINC flash. May only be set by WINC firmware.

#define M2M_WIFI_CONN_BSSID_FLAG 0x01

Flag used in tstrM2mConnCredCmn to indicate that Wi-Fi connection must be restricted to an AP with a certain BSSID.

#define M2M_AUTH_1X_USER_LEN_MAX 100

The maximum length (in ASCII characters) of domain name + username (including '@' or '\') for authentication with Enterprise methods.

#define M2M_AUTH_1X_PASSWORD_LEN_MAX 256

The maximum length (in ASCII characters) of password for authentication with Enterprise MSCHAPv2 methods.

#define M2M_AUTH_1X_PRIVATEKEY_LEN_MAX 256

The maximum length (in bytes) of private key modulus for authentication with Enterprise TLS methods. Private key exponent must be the same length as modulus, pre-padded with 0s if necessary.

#define M2M_AUTH_1X_CERT_LEN_MAX 1584

The maximum length (in bytes) of certificate for authentication with Enterprise TLS methods.

#define M2M_802_1X_UNENCRYPTED_USERNAME_FLAG 0x80

Flag to indicate that the 802.1x user-name should be sent (unencrypted) in the initial EAP identity response. Intended for use with EAP-TLS only.

#define M2M_802_1X_PREPEND_DOMAIN_FLAG 0x40

Flag to indicate that the 802.1x domain name should be prepended to the user-name: "Domain\Username". If the flag is not set then domain name is appended to the user-name: "Username@Domain". (Note that the '@' or '\' must be included in the domain name.)

#define M2M_802_1X_MSCHAP2_FLAG 0x01

Flag to indicate 802.1x MsChapV2 credentials: domain/user-name/password.

#define M2M_802_1X_TLS_FLAG 0x02

Flag to indicate 802.1x TLS credentials: domain/user-name/private-key/certificate.

#define M2M_802_1X_TLS_CLIENT_CERTIFICATE 1

Info type used in tstrM2mWifiAuthInfoHdr to indicate Enterprise TLS client certificate.

#define PSK_CALC_LEN 40

PSK is 32 bytes generated either:

  • from 64 ASCII characters
  • by SHA1 operations on up to 63 ASCII characters 40 byte array is required during SHA1 operations, so we define PSK_CALC_LEN as 40.
#define PWR_DEFAULT PWR_HIGH
#define M2M_CONFIG_CMD_BASE 1

The base value of all the host configuration commands opcodes.

#define M2M_STA_CMD_BASE 40

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

#define M2M_AP_CMD_BASE 70

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

#define M2M_SERVER_CMD_BASE 100

The base value of all the power save mode host commands codes.

#define M2M_GEN_CMD_BASE 105

The base value of additional host wifi command opcodes. Usage restrictions (eg STA mode only) should always be made clear at the API layer in any case.

#define M2M_OTA_CMD_BASE 100

The base value of all the OTA mode host commands opcodes. The OTA Have special group so can extended from 1-M2M_MAX_GRP_NUM_REQ

#define M2M_CRYPTO_CMD_BASE 1

The base value of all the crypto mode host commands opcodes. The crypto Have special group so can extended from 1-M2M_MAX_GRP_NUM_REQ

#define M2M_MAX_GRP_NUM_REQ (127)

max number of request in one group equal to 127 as the last bit reserved for config or data pkt

#define WEP_40_KEY_SIZE ((uint8)5)

The size in bytes of a 40-bit wep key.

#define WEP_104_KEY_SIZE ((uint8)13)

The size in bytes of a 104-bit wep key.

#define WEP_40_KEY_STRING_SIZE ((uint8)10)

The string length of a 40-bit wep key.

#define WEP_104_KEY_STRING_SIZE ((uint8)26)

The string length of a 104-bit wep key.

#define WEP_KEY_MAX_INDEX ((uint8)4)

WEP key index is in the range 1 to 4 inclusive. (This is decremented to result in an index in the range 0 to 3 on air.)

#define M2M_SHA256_CONTEXT_BUFF_LEN (128)

sha256 context size

#define M2M_SCAN_DEFAULT_NUM_SLOTS (2)

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

#define M2M_SCAN_DEFAULT_SLOT_TIME (30)

The default duration in milliseconds of an active scan slot used by the WINC board.

#define M2M_SCAN_DEFAULT_PASSIVE_SLOT_TIME (300)

The passive scan slot default duration in ms.

#define M2M_SCAN_DEFAULT_NUM_PROBE (2)

The default number of probes per scan slot.

#define M2M_FASTCONNECT_DEFAULT_RSSI_THRESH (-45)

The default threshold RSSI for fast reconnection to an AP.

#define TLS_FILE_NAME_MAX 48

Maximum length for each TLS certificate file name including null terminator.

#define TLS_SRV_SEC_MAX_FILES 8

Maximum number of certificates allowed in TLS_SRV section.

#define TLS_SRV_SEC_START_PATTERN_LEN 8

Length of certificate struct start pattern.

#define TLS_CRL_DATA_MAX_LEN 64
#define TLS_CRL_MAX_ENTRIES 10
#define TLS_CRL_TYPE_NONE 0
#define TLS_CRL_TYPE_CERT_HASH 1
#define TLS_CERTS_CHUNKED_SIG_VALUE 0x6ec8
#define WLAN_11B_RATES_INITIALIZER
Value:
{ \
TX_RATE_1, TX_RATE_2, TX_RATE_5_5, \
TX_RATE_11 \
}
TX_RATE_2
Definition: m2m_types.h:2788
TX_RATE_5_5
Definition: m2m_types.h:2789
#define WLAN_11G_RATES_INITIALIZER
Value:
{ \
TX_RATE_6, TX_RATE_9, TX_RATE_12, \
TX_RATE_18, TX_RATE_24, TX_RATE_36, \
TX_RATE_48, TX_RATE_54 \
}
TX_RATE_12
Definition: m2m_types.h:2793
TX_RATE_9
Definition: m2m_types.h:2792
TX_RATE_54
Definition: m2m_types.h:2798
TX_RATE_36
Definition: m2m_types.h:2796
TX_RATE_24
Definition: m2m_types.h:2795
#define WLAN_11N_RATES_INITIALIZER
Value:
{ \
TX_RATE_MCS_0, TX_RATE_MCS_1, TX_RATE_MCS_2, \
TX_RATE_MCS_3, TX_RATE_MCS_4, TX_RATE_MCS_5, \
TX_RATE_MCS_6, TX_RATE_MCS_7 \
}
TX_RATE_MCS_2
Definition: m2m_types.h:2801
TX_RATE_MCS_7
Definition: m2m_types.h:2806
TX_RATE_MCS_4
Definition: m2m_types.h:2803
TX_RATE_MCS_1
Definition: m2m_types.h:2800
TX_RATE_MCS_5
Definition: m2m_types.h:2804
#define WLAN_11BGN_RATES_ASC_INITIALIZER
Value:
{ \
TX_RATE_1, TX_RATE_2, TX_RATE_5_5, \
TX_RATE_6, TX_RATE_MCS_0, TX_RATE_9, \
TX_RATE_11, TX_RATE_12, TX_RATE_MCS_1, \
TX_RATE_18, TX_RATE_MCS_2, TX_RATE_24, \
TX_RATE_MCS_3, TX_RATE_36, TX_RATE_MCS_4, \
TX_RATE_48, TX_RATE_MCS_5, TX_RATE_54, \
TX_RATE_MCS_6, TX_RATE_MCS_7, \
}
TX_RATE_12
Definition: m2m_types.h:2793
TX_RATE_9
Definition: m2m_types.h:2792
TX_RATE_2
Definition: m2m_types.h:2788
TX_RATE_MCS_2
Definition: m2m_types.h:2801
TX_RATE_MCS_7
Definition: m2m_types.h:2806
TX_RATE_MCS_4
Definition: m2m_types.h:2803
TX_RATE_54
Definition: m2m_types.h:2798
TX_RATE_36
Definition: m2m_types.h:2796
TX_RATE_5_5
Definition: m2m_types.h:2789
TX_RATE_MCS_0
Definition: m2m_types.h:2799
TX_RATE_MCS_1
Definition: m2m_types.h:2800
TX_RATE_24
Definition: m2m_types.h:2795
TX_RATE_MCS_5
Definition: m2m_types.h:2804
#define WLAN_11BG_RATES_ASC_INITIALIZER
Value:
{ \
TX_RATE_1, TX_RATE_2, TX_RATE_5_5, \
TX_RATE_6, TX_RATE_9, TX_RATE_11, \
TX_RATE_12, TX_RATE_18, TX_RATE_24, \
TX_RATE_36, TX_RATE_48, TX_RATE_54 \
}
TX_RATE_18
Definition: m2m_types.h:2794
TX_RATE_11
Definition: m2m_types.h:2790
TX_RATE_9
Definition: m2m_types.h:2792
TX_RATE_2
Definition: m2m_types.h:2788
TX_RATE_48
Definition: m2m_types.h:2797
TX_RATE_54
Definition: m2m_types.h:2798
TX_RATE_5_5
Definition: m2m_types.h:2789
TX_RATE_24
Definition: m2m_types.h:2795
#define DEFAULT_CONF_AR_INITIALIZER { 5, 1, TX_RATE_AUTO, TX_RATE_AUTO, 10, 5, 3 }
Generated on Tue Sep 27 2022 16:17:30 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Enumerations and Typedefs

Data Structures | Enumerations
Enumerations and Typedefs
WLAN

Data Structures

struct | tstrM2mPwrMode
struct | tstrM2mTxPwrLevel
struct | tstrM2mWiFiGainIdx
struct | tstrM2mEnableLogs
struct | tstrM2mBatteryVoltage
struct | tstrM2mWiFiRoaming
struct | tstrM2mWiFiXOSleepEnable
struct | tstrM2mWifiGainsParams
struct | tstrM2mConnCredHdr
struct | tstrM2mConnCredCmn
struct | tstrM2mWifiWep
struct | tstrM2mWifiPsk
struct | tstrM2mWifi1xHdr
struct | tstrM2mWifiAuthInfoHdr
struct | tstrM2mWifiConnHdr
struct | tstrM2mWifiApId
struct | tstrM2MGenericResp
struct | tstrM2MWPSConnect
struct | tstrM2MWPSInfo
struct | tstrM2MDefaultConnResp
struct | tstrM2MScanOption
struct | tstrM2MStopScanOption
struct | tstrM2MScanRegion
struct | tstrM2MScan
struct | tstrCyptoResp
struct | tstrM2mScanDone
struct | tstrM2mReqScanResult
struct | tstrM2mWifiscanResult
struct | tstrM2mWifiStateChanged
struct | tstrM2mPsType
struct | tstrM2mSlpReqTime
struct | tstrM2mLsnInt
struct | tstrM2MWifiMonitorModeCtrl
struct | tstrM2MWifiRxPacketInfo
struct | tstrM2MWifiTxPacketInfo
struct | tstrM2MAPConfig
struct | tstrM2MAPConfigExt
struct | tstrM2MAPModeConfig
struct | tstrM2mServerInit
struct | tstrM2mClientState
struct | tstrM2Mservercmd
struct | tstrM2mSetMacAddress
struct | tstrM2MDeviceNameConfig
struct | tstrM2MIPConfig
struct | tstrM2mIpRsvdPkt
struct | tstrM2MProvisionModeConfig
struct | tstrM2MProvisionInfo
struct | tstrM2MConnInfo
struct | tstrM2MSNTPConfig
struct | tstrSystemTime
struct | tstrM2MMulticastMac
struct | tstrPrng
struct | tstrConfAutoRate
struct | tstrEthInitParam
struct | tstrM2mIpCtrlBuf
struct | tstrWifiInitParam
struct | tstrNetworkId
struct | tstrM2mWifiWepParams
struct | tstr1xAuthCredentials
struct | tstrAuthPsk
struct | tstrAuthWep
struct | tstrAuth1xMschap2
struct | tstrAuth1xTls

Enumerations

enum tenuFlashLUTEntryID {
ENTRY_ID_FW = 0x0011, ENTRY_ID_PLLGAIN = 0x0021, ENTRY_ID_TLSROOT = 0x0031, ENTRY_ID_TLSCLIENT = 0x0032,
ENTRY_ID_TLSSERVER = 0x0033, ENTRY_ID_CONNPARAMS = 0x0034, ENTRY_ID_HTTPFILES = 0x0035, ENTRY_ID_TLSCOMMON = 0x0036,
ENTRY_ID_HOSTFILE = 0x0041
}
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 | 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 | 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 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_CRYPTO, M2M_REQ_GROUP_SIGMA,
M2M_REQ_GROUP_INTERNAL
}
enum | tenuM2mReqpkt { M2M_REQ_CONFIG_PKT, M2M_REQ_DATA_PKT = 0x80 }
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_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_GET_PRNG, M2M_WIFI_RESP_GET_PRNG,
M2M_WIFI_REQ_SCAN_SSID_LIST, M2M_WIFI_REQ_SET_GAINS, M2M_WIFI_REQ_PASSIVE_SCAN, M2M_WIFI_REQ_CONG_AUTO_RATE,
M2M_WIFI_REQ_CONFIG_SNTP, M2M_WIFI_REQ_SET_GAIN_TABLE_IDX, M2M_WIFI_REQRSP_DELETE_APID, 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_CONN,
M2M_WIFI_IND_CONN_PARAM, M2M_WIFI_REQ_DHCP_FAILURE, M2M_WIFI_MAX_STA_ALL
}
enum | tenuM2mApCmd { M2M_WIFI_REQ_ENABLE_AP = M2M_AP_CMD_BASE, M2M_WIFI_REQ_DISABLE_AP, M2M_WIFI_REQ_RESTART_AP, M2M_WIFI_MAX_AP_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 | tenuM2mGenCmd { M2M_WIFI_REQ_ROAMING = M2M_GEN_CMD_BASE, M2M_WIFI_REQ_XO_SLEEP_ENABLE, M2M_WIFI_REQ_SET_STOP_SCAN_OPTION, M2M_WIFI_MAX_GEN_ALL }
enum tenuM2mCryptoCmd {
M2M_CRYPTO_REQ_SHA256_INIT = M2M_CRYPTO_CMD_BASE, M2M_CRYPTO_RESP_SHA256_INIT, M2M_CRYPTO_REQ_SHA256_UPDATE, M2M_CRYPTO_RESP_SHA256_UPDATE,
M2M_CRYPTO_REQ_SHA256_FINISH, M2M_CRYPTO_RESP_SHA256_FINISH, M2M_CRYPTO_REQ_RSA_SIGN_GEN, M2M_CRYPTO_RESP_RSA_SIGN_GEN,
M2M_CRYPTO_REQ_RSA_SIGN_VERIFY, M2M_CRYPTO_RESP_RSA_SIGN_VERIFY, M2M_CRYPTO_MAX_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 | tenuM2mConnState { M2M_WIFI_DISCONNECTED = 0, M2M_WIFI_CONNECTED, M2M_WIFI_ROAMED, 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, M2M_WIFI_NUM_AUTH_TYPES
}
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_ATE_HIGH, M2M_WIFI_MODE_ATE_LOW, M2M_WIFI_MODE_ETHERNET,
M2M_WIFI_MODE_MAX
}
enum | tenuWPSTrigger { WPS_PIN_TRIGGER = 0, WPS_PBC_TRIGGER = 4 }
enum | tenuSNTPUseDHCP { SNTP_DISABLE_DHCP = 0, SNTP_ENABLE_DHCP = 1 }
enum tenuWlanTxRate {
TX_RATE_AUTO = 0xFF, TX_RATE_LOWEST = 0xFE, TX_RATE_1 = 0x00, TX_RATE_2 = 0x01,
TX_RATE_5_5 = 0x02, TX_RATE_11 = 0x03, TX_RATE_6 = 0x0B, TX_RATE_9 = 0x0F,
TX_RATE_12 = 0x0A, TX_RATE_18 = 0x0E, TX_RATE_24 = 0x09, TX_RATE_36 = 0x0D,
TX_RATE_48 = 0x08, TX_RATE_54 = 0x0C, TX_RATE_MCS_0 = 0x80, TX_RATE_MCS_1 = 0x81,
TX_RATE_MCS_2 = 0x82, TX_RATE_MCS_3 = 0x83, TX_RATE_MCS_4 = 0x84, TX_RATE_MCS_5 = 0x85,
TX_RATE_MCS_6 = 0x86, TX_RATE_MCS_7 = 0x87
}
enum | tenuWifiState { WIFI_STATE_DEINIT, WIFI_STATE_INIT, WIFI_STATE_START }
enum | tenuCredStoreOption { WIFI_CRED_DONTSAVE, WIFI_CRED_SAVE_UNENCRYPTED, WIFI_CRED_SAVE_ENCRYPTED }
enum | tenu1xOption { WIFI_1X_BYPASS_SERVER_AUTH, WIFI_1X_SESSION_CACHING, WIFI_1X_SPECIFIC_ROOTCERT, WIFI_1X_TIME_VERIF_MODE }

Detailed Description

Specifies the enums and Data Structures used by the Wlan APIs.

Enumeration Type Documentation

enum tenuFlashLUTEntryID
Enumerator
ENTRY_ID_FW
ENTRY_ID_PLLGAIN
ENTRY_ID_TLSROOT
ENTRY_ID_TLSCLIENT
ENTRY_ID_TLSSERVER
ENTRY_ID_CONNPARAMS
ENTRY_ID_HTTPFILES
ENTRY_ID_TLSCOMMON
ENTRY_ID_HOSTFILE
enum tenuM2mDefaultConnErrcode
Enumerator
M2M_DEFAULT_CONN_INPROGRESS | A failure that indicates that a default connection or forced connection is in progress
M2M_DEFAULT_CONN_FAIL | A failure response that indicates that the winc failed to connect to the cached network
M2M_DEFAULT_CONN_SCAN_MISMATCH | A failure response that indicates that no one of the cached networks was found in the scan results, as a result to the function call m2m_default_connect.
M2M_DEFAULT_CONN_EMPTY_LIST | A failure response that indicates an empty network list as a result to the function call m2m_default_connect.
enum tenuM2mConnChangedErrcode
Enumerator
M2M_ERR_SCAN_FAIL | Indicate that the WINC board has failed to perform the scan operation.
M2M_ERR_JOIN_FAIL | Indicate that the WINC board has failed to join the BSS .
M2M_ERR_AUTH_FAIL | Indicate that the WINC board has failed to authenticate with the AP.
M2M_ERR_ASSOC_FAIL | Indicate that the WINC board has failed to associate with the AP.
M2M_ERR_CONN_INPROGRESS | Indicate that the WINC board has another connection request in progress.
enum tenuM2mWepKeyIndex
Enumerator
M2M_WIFI_WEP_KEY_INDEX_1 |
M2M_WIFI_WEP_KEY_INDEX_2 |
M2M_WIFI_WEP_KEY_INDEX_3 |
M2M_WIFI_WEP_KEY_INDEX_4 | Index for WEP key Authentication
enum tenuM2mPwrMode
Enumerator
PWR_AUTO | FW will decide the best power mode to use internally.
PWR_LOW1 | Low power mode #1
PWR_LOW2 | Low power mode #2
PWR_HIGH | High power mode
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
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_CRYPTO
M2M_REQ_GROUP_SIGMA
M2M_REQ_GROUP_INTERNAL
enum tenuM2mReqpkt
Enumerator
M2M_REQ_CONFIG_PKT
M2M_REQ_DATA_PKT
enum tenuM2mConfigCmd

This enum contains 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_GET_CONN_INFO | Request connection information command.
M2M_WIFI_RESP_CONN_INFO | Connect with default AP response.
M2M_WIFI_REQ_SET_DEVICE_NAME | Set the WINC device name property.
M2M_WIFI_REQ_START_PROVISION_MODE | Start the provisioning mode for the M2M Device.
M2M_WIFI_RESP_PROVISION_INFO | Send the provisioning information to the host.
M2M_WIFI_REQ_STOP_PROVISION_MODE | Stop the current running provision mode.
M2M_WIFI_REQ_SET_SYS_TIME | Set time of day from host.
M2M_WIFI_REQ_ENABLE_SNTP_CLIENT | 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 | Disable the simple network time protocol for applications that do not need it.
M2M_WIFI_RESP_MEMORY_RECOVER | Reserved for debugging
M2M_WIFI_REQ_CUST_INFO_ELEMENT | Add Custom Element to Beacon Management Frame.
M2M_WIFI_REQ_SCAN | Request scan command.
M2M_WIFI_RESP_SCAN_DONE | Scan complete notification response.
M2M_WIFI_REQ_SCAN_RESULT | Request Scan results command.
M2M_WIFI_RESP_SCAN_RESULT | Request Scan results response.
M2M_WIFI_REQ_SET_SCAN_OPTION | Set Scan options "slot time, slot number .. etc" .
M2M_WIFI_REQ_SET_SCAN_REGION | Set scan region.
M2M_WIFI_REQ_SET_POWER_PROFILE | The API shall set power mode to one of 3 modes
M2M_WIFI_REQ_SET_TX_POWER | API to set TX power.
M2M_WIFI_REQ_SET_BATTERY_VOLTAGE | API to set Battery Voltage.
M2M_WIFI_REQ_SET_ENABLE_LOGS | API to set Battery Voltage.
M2M_WIFI_REQ_GET_SYS_TIME | REQ GET time of day from WINC.
M2M_WIFI_RESP_GET_SYS_TIME | RESP time of day from host.
M2M_WIFI_REQ_SEND_ETHERNET_PACKET | Send Ethernet packet in bypass mode.
M2M_WIFI_RESP_ETHERNET_RX_PACKET | Receive Ethernet packet in bypass mode.
M2M_WIFI_REQ_SET_MAC_MCAST | Set the WINC multicast filters.
M2M_WIFI_REQ_GET_PRNG | Request PRNG.
M2M_WIFI_RESP_GET_PRNG | Response for PRNG.
M2M_WIFI_REQ_SCAN_SSID_LIST | Request scan with list of hidden SSID plus the broadcast scan.
M2M_WIFI_REQ_SET_GAINS | Request to set the PPA gain
M2M_WIFI_REQ_PASSIVE_SCAN | Request a passive scan.
M2M_WIFI_REQ_CONG_AUTO_RATE | Configure auto TX rate selection algorithm.
M2M_WIFI_REQ_CONFIG_SNTP | Configure NTP servers.
M2M_WIFI_REQ_SET_GAIN_TABLE_IDX | API to set Gain table index.
M2M_WIFI_REQRSP_DELETE_APID | Request/response to delete AP security credentials from WINC flash.
M2M_WIFI_MAX_CONFIG_ALL |
enum tenuM2mStaCmd

This enum contains WINC commands while in Station mode.

Enumerator
M2M_WIFI_REQ_CONNECT | Connect with AP command. This command is deprecated in favor of M2M_WIFI_REQ_CONN.
M2M_WIFI_REQ_DEFAULT_CONNECT | Connect with default AP command.
M2M_WIFI_RESP_DEFAULT_CONNECT | Request connection information response.
M2M_WIFI_REQ_DISCONNECT | Request to disconnect from AP command.
M2M_WIFI_RESP_CON_STATE_CHANGED | Connection state changed response.
M2M_WIFI_REQ_SLEEP | Set PS mode command.
M2M_WIFI_REQ_WPS_SCAN | Request WPS scan command.
M2M_WIFI_REQ_WPS | Request WPS start command.
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 command.
M2M_WIFI_REQ_DHCP_CONF | Response indicating that IP address was obtained.
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 indicating a conflict in obtained IP address. The user should re attempt the DHCP request.
M2M_WIFI_REQ_ENABLE_MONITORING | Request to enable monitor mode command.
M2M_WIFI_REQ_DISABLE_MONITORING | Request to disable monitor mode command.
M2M_WIFI_RESP_WIFI_RX_PACKET | Indicate that a packet was received in monitor mode.
M2M_WIFI_REQ_SEND_WIFI_PACKET | Send packet in monitor mode.
M2M_WIFI_REQ_LSN_INT | Set WiFi listen interval.
M2M_WIFI_REQ_DOZE | Used to force the WINC to sleep in manual PS mode.
M2M_WIFI_REQ_CONN | New command to connect with AP. This replaces M2M_WIFI_REQ_CONNECT. (Firmware continues to handle M2M_WIFI_REQ_CONNECT for backwards compatibility purposes.)
M2M_WIFI_IND_CONN_PARAM | Provide extra information (such as Enterprise client certificate) required for connection.
M2M_WIFI_REQ_DHCP_FAILURE | Response indicating that IP address could not be obtained or renewed. If the IP could not be renewed then the previous IP will continue to be used.
M2M_WIFI_MAX_STA_ALL |
enum tenuM2mApCmd

This enum contains WINC commands while in AP mode.

Enumerator
M2M_WIFI_REQ_ENABLE_AP | Enable AP mode command.
M2M_WIFI_REQ_DISABLE_AP | Disable AP mode command.
M2M_WIFI_REQ_RESTART_AP |
M2M_WIFI_MAX_AP_ALL |
enum tenuM2mServerCmd

This enum contains WINC commands while in PS mode. These command are currently not supported.

Enumerator
M2M_WIFI_REQ_CLIENT_CTRL
M2M_WIFI_RESP_CLIENT_INFO
M2M_WIFI_REQ_SERVER_INIT
M2M_WIFI_MAX_SERVER_ALL
enum tenuM2mGenCmd

This enum contains additional WINC commands (overflow of previous enums).

Enumerator
M2M_WIFI_REQ_ROAMING | Request to enable/disable wifi roaming. (Processing matches tenuM2mConfigCmd.)
M2M_WIFI_REQ_XO_SLEEP_ENABLE | Request to enable/disable the crystal oscillator during deep sleep. (Processing matches tenuM2mConfigCmd.)
M2M_WIFI_REQ_SET_STOP_SCAN_OPTION | Set Scan option to stop on first result. (Processing matches tenuM2mConfigCmd.)
M2M_WIFI_MAX_GEN_ALL |
enum tenuM2mCryptoCmd
Enumerator
M2M_CRYPTO_REQ_SHA256_INIT
M2M_CRYPTO_RESP_SHA256_INIT
M2M_CRYPTO_REQ_SHA256_UPDATE
M2M_CRYPTO_RESP_SHA256_UPDATE
M2M_CRYPTO_REQ_SHA256_FINISH
M2M_CRYPTO_RESP_SHA256_FINISH
M2M_CRYPTO_REQ_RSA_SIGN_GEN
M2M_CRYPTO_RESP_RSA_SIGN_GEN
M2M_CRYPTO_REQ_RSA_SIGN_VERIFY
M2M_CRYPTO_RESP_RSA_SIGN_VERIFY
M2M_CRYPTO_MAX_ALL
enum tenuM2mIpCmd
Enumerator
M2M_IP_REQ_STATIC_IP_CONF
M2M_IP_REQ_ENABLE_DHCP
M2M_IP_REQ_DISABLE_DHCP
enum tenuM2mSigmaCmd
Enumerator
M2M_SIGMA_ENABLE
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 tenuM2mConnState

Wi-Fi Connection State.

Enumerator
M2M_WIFI_DISCONNECTED | Wi-Fi state is disconnected.
M2M_WIFI_CONNECTED | Wi-Fi state is connected.
M2M_WIFI_ROAMED | Wi-Fi state is roamed to new AP.
M2M_WIFI_UNDEF | Undefined Wi-Fi State.
enum tenuM2mSecType

Wi-Fi Supported Security types.

Wi-Fi Supported 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 | WEP is deprecated as of 19.7.5.
M2M_WIFI_SEC_802_1X | Wi-Fi network is secured with WPA/WPA2 Enterprise.IEEE802.1x.
M2M_WIFI_NUM_AUTH_TYPES | Upper limit for enum value.
enum tenuM2mSsidMode
Enumerator
SSID_MODE_VISIBLE | SSID is visible to others.
SSID_MODE_HIDDEN | SSID is hidden.
enum tenuM2mScanCh

Wi-Fi RF Channels.

See also
tstrM2MScan tstrM2MScanOption
Enumerator
M2M_WIFI_CH_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
enum tenuM2mScanRegion

Wi-Fi RF Channels.

Enumerator
REG_CH_1 |
REG_CH_2 |
REG_CH_3 |
REG_CH_4 |
REG_CH_5 |
REG_CH_6 |
REG_CH_7 |
REG_CH_8 |
REG_CH_9 |
REG_CH_10 |
REG_CH_11 |
REG_CH_12 |
REG_CH_13 |
REG_CH_14 |
REG_CH_ALL |
NORTH_AMERICA |
EUROPE | 11 channel
ASIA | 13 channel
enum tenuPowerSaveModes

Power Save Modes.

Enumerator
M2M_NO_PS | Power save is disabled.
M2M_PS_AUTOMATIC | Power save is done automatically by the WINC. This mode doesn't disable all of the WINC modules and use higher amount of power than the H_AUTOMATIC and the DEEP_AUTOMATIC modes..
M2M_PS_H_AUTOMATIC | Power save is done automatically by the WINC. Achieve higher power save than the AUTOMATIC mode by shutting down more parts of the WINC board.
M2M_PS_DEEP_AUTOMATIC | Power save is done automatically by the WINC. Achieve the highest possible power save.
M2M_PS_MANUAL | Power save is done manually by the user.
enum tenuM2mWifiMode

Wi-Fi Operation Mode.

Enumerator
M2M_WIFI_MODE_NORMAL | Normal Mode means to run customer firmware version.
M2M_WIFI_MODE_ATE_HIGH | Config Mode in HIGH POWER means to run production test firmware version which is known as ATE (Burst) firmware.
M2M_WIFI_MODE_ATE_LOW | Config Mode in LOW POWER means to run production test firmware version which is known as ATE (Burst) firmware.
M2M_WIFI_MODE_ETHERNET | ethernet Mode
M2M_WIFI_MODE_MAX |
enum tenuWPSTrigger

WPS Triggering Methods.

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

Use NTP server provided by the DHCP server.

Enumerator
SNTP_DISABLE_DHCP | Don't use the NTP server provided by the DHCP server when falling back.
SNTP_ENABLE_DHCP | Use the NTP server provided by the DHCP server when falling back.
enum tenuWlanTxRate

All possible supported 802.11 WLAN TX rates.

Enumerator
TX_RATE_AUTO | Automatic rate selection
TX_RATE_LOWEST | Force the lowest possible data rate for longest range.
TX_RATE_1 |
TX_RATE_2 |
TX_RATE_5_5 |
TX_RATE_11 |
TX_RATE_6 |
TX_RATE_9 |
TX_RATE_12 |
TX_RATE_18 |
TX_RATE_24 |
TX_RATE_36 |
TX_RATE_48 |
TX_RATE_54 |
TX_RATE_MCS_0 |
TX_RATE_MCS_1 |
TX_RATE_MCS_2 |
TX_RATE_MCS_3 |
TX_RATE_MCS_4 |
TX_RATE_MCS_5 |
TX_RATE_MCS_6 |
TX_RATE_MCS_7 |
enum tenuWifiState

Enumeration for Wi-Fi state The following is used to track the state of the wifi (not initialized, initialized or started)

Remarks
This is useful when putting the WINC in "download mode" to access the flash via SPI. By using m2m_wifi_get_state and checking against the desired state, it is possible to validate if the Application should proceed with the SPI Flash access or not.
Enumerator
WIFI_STATE_DEINIT | Wifi is not initialized
WIFI_STATE_INIT | Wifi has been initialized
WIFI_STATE_START | Wifi has started
enum tenuCredStoreOption
Enumerator
WIFI_CRED_DONTSAVE | Credentials will not be stored in WINC flash.
WIFI_CRED_SAVE_UNENCRYPTED | Credentials will be stored unencrypted in WINC flash.
WIFI_CRED_SAVE_ENCRYPTED | Credentials will be stored encrypted in WINC flash. The encryption is not secure; it is merely intended to prevent sensitive information being leaked by an opportunistic read of WINC flash contents. The encryption keys involve WINC efuse contents, so WINC efuses should not be written while this option is in use.
enum tenu1xOption
Remarks
Enumerator
WIFI_1X_BYPASS_SERVER_AUTH | Server authentication for 802.1x connections. Values are of type int. 0: Authenticate server; Default, Recommended. 1: Bypass server authentication.
WIFI_1X_SESSION_CACHING | TLS session caching on/off for 802.1x connections. Values are of type int. 0: Session caching off. 1: Session caching on; Default. Note that the WINC implementation of PEAPv0 does not support session caching; this setting is ignored for PEAPv0 methods.
WIFI_1X_SPECIFIC_ROOTCERT | SHA1 digest of subject name of the root certificate to be used during server authentication. Values are: 20-byte arrays: authentication is limited to this particular root certificate; Recommended 0-byte array: authentication can succeed with any certificate in the WINC root certificate store; Default.
WIFI_1X_TIME_VERIF_MODE | Mode for checking expiry of server certificate chain. Values are of type tenuSslCertExpSettings. Default is SSL_CERT_EXP_CHECK_EN_IF_SYS_TIME.
Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2mPwrMode Struct Reference

Data Fields
tstrM2mPwrMode Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint8 u8PwrMode
uint8 __PAD24__ [3]

Detailed Description

Power Mode.

Field Documentation

uint8 u8PwrMode

power Save Mode

uint8 __PAD24__[3]

Padding bytes for forcing 4-byte alignment

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2mTxPwrLevel Struct Reference

Data Fields
tstrM2mTxPwrLevel Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint8 u8TxPwrLevel
uint8 __PAD24__ [3]

Detailed Description

Tx power level.

Field Documentation

uint8 u8TxPwrLevel

Tx power level

uint8 __PAD24__[3]

Padding bytes for forcing 4-byte alignment

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2mWiFiGainIdx Struct Reference

Data Fields
tstrM2mWiFiGainIdx Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint8 u8GainTableIdx
uint8 __PAD24__ [3]

Detailed Description

Gain Table index selection corresponding to specific WiFi region.

Field Documentation

uint8 u8GainTableIdx

Gain table index

uint8 __PAD24__[3]

Padding bytes for forcing 4-byte alignment

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2mEnableLogs Struct Reference

Data Fields
tstrM2mEnableLogs Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint8 u8Enable
uint8 __PAD24__ [3]

Detailed Description

Enable Firmware logs.

Field Documentation

uint8 u8Enable

Enable/Disable firmware logs

uint8 __PAD24__[3]

Padding bytes for forcing 4-byte alignment

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2mBatteryVoltage Struct Reference

Data Fields
tstrM2mBatteryVoltage Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint16 u16BattVolt
uint8 __PAD16__ [2]

Detailed Description

Battery Voltage.

Field Documentation

uint16 u16BattVolt

Battery Voltage

uint8 __PAD16__[2]

Padding bytes for forcing 4-byte alignment

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2mWiFiRoaming Struct Reference

Data Fields
tstrM2mWiFiRoaming Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint8 u8EnableRoaming
uint8 u8EnableDhcp
uint8 __PAD16__ [2]

Detailed Description

Roaming related information .

Field Documentation

uint8 u8EnableRoaming

Enable/Disable Roaming

uint8 u8EnableDhcp

Enable/Disable DHCP client when u8EnableRoaming is true

uint8 __PAD16__[2]

Padding bytes for forcing 4-byte alignment

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2mWiFiXOSleepEnable Struct Reference

Data Fields
tstrM2mWiFiXOSleepEnable Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint8 u8EnableXODuringSleep
uint8 __PAD16__ [3]

Detailed Description

Choose to keep the XO on or off over deep sleep.

Field Documentation

uint8 u8EnableXODuringSleep

Enable/Disable XO during deep sleep

uint8 __PAD16__[3]

Padding bytes for forcing 4-byte alignment

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2mWifiGainsParams Struct Reference

Data Fields
tstrM2mWifiGainsParams Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint16 u8PPAGFor11B
uint16 u8PPAGFor11GN

Detailed Description

Gain Values.

Field Documentation

uint16 u8PPAGFor11B

PPA gain for 11B (as the RF document representation) PPA_AGC<0:2> Every bit have 3dB gain control each. for example: 1 ->3db 3 ->6db 7 ->9db

uint16 u8PPAGFor11GN

PPA gain for 11GN (as the RF document represented) PPA_AGC<0:2> Every bit have 3dB gain control each. for example: 1 ->3db 3 ->6db 7 ->9db

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2mConnCredHdr Struct Reference

Data Fields
tstrM2mConnCredHdr Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint16 u16CredSize
uint8 u8CredStoreFlags
uint8 u8Channel

Detailed Description

Wi-Fi Connect Credentials Header.

Field Documentation

uint16 u16CredSize

Total size of connect credentials, not including tstrM2mConnCredHdr: tstrM2mConnCredCmn Auth details (variable size)

uint8 u8CredStoreFlags

Credential storage options represented with flags: M2M_CRED_STORE_FLAG M2M_CRED_ENCRYPT_FLAG M2M_CRED_IS_STORED_FLAG M2M_CRED_IS_ENCRYPTED_FLAG

uint8 u8Channel

Wi-Fi channel(s) on which to attempt connection.

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2mConnCredCmn Struct Reference

Data Fields
tstrM2mConnCredCmn Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint8 u8SsidLen
uint8 | au8Ssid [M2M_MAX_SSID_LEN-1]
uint8 u8Options
uint8 au8Bssid [M2M_MAC_ADDRES_LEN]
uint8 u8AuthType
uint8 | au8Rsv [3]

Detailed Description

Wi-Fi Connect Credentials Common section.

Field Documentation

uint8 u8SsidLen

SSID length.

uint8 au8Ssid[M2M_MAX_SSID_LEN-1]

SSID.

uint8 u8Options

Common flags: M2M_WIFI_CONN_BSSID_FLAG

uint8 au8Bssid[M2M_MAC_ADDRES_LEN]

BSSID to restrict on, or all 0 if M2M_WIFI_CONN_BSSID_FLAG is not set in u8Options.

uint8 u8AuthType

Connection auth type. See tenuM2mSecType.

uint8 au8Rsv[3]

Reserved for future use. Set to 0.

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2mWifiWep Struct Reference

Data Fields
tstrM2mWifiWep Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint8 u8KeyIndex
uint8 u8KeyLen
uint8 au8WepKey [WEP_104_KEY_SIZE]
uint8 u8Rsv

Detailed Description

WEP security key header.

Field Documentation

uint8 u8KeyIndex

WEP Key Index.

uint8 u8KeyLen

WEP Key Size.

uint8 au8WepKey[WEP_104_KEY_SIZE]

WEP Key represented in bytes (padded with 0's if WEP-40).

uint8 u8Rsv

Reserved for future use. Set to 0.

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2mWifiPsk Struct Reference

Data Fields
tstrM2mWifiPsk Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint8 u8PassphraseLen
uint8 | au8Passphrase [M2M_MAX_PSK_LEN-1]
uint8 au8Psk [PSK_CALC_LEN]
uint8 u8PskCalculated
uint8 | au8Rsv [2]

Detailed Description

Passphrase and PSK for WPA(2) PSK.

Field Documentation

uint8 u8PassphraseLen

Length of passphrase (8 to 63) or 64 if au8Passphrase contains ASCII representation of PSK.

uint8 au8Passphrase[M2M_MAX_PSK_LEN-1]

Passphrase, or ASCII representation of PSK if u8PassphraseLen is 64.

uint8 au8Psk[PSK_CALC_LEN]

PSK calculated by firmware. Driver sets this to 0.

uint8 u8PskCalculated

Flag used by firmware to avoid unnecessary recalculation of PSK. Driver sets this to 0.

uint8 au8Rsv[2]

Reserved for future use. Set to 0.

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2mWifi1xHdr Struct Reference

Data Fields
tstrM2mWifi1xHdr Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint8 u8Flags
uint8 u8DomainLength
uint8 u8UserNameLength
uint8 u8HdrLength
uint16 u16PrivateKeyOffset
uint16 u16PrivateKeyLength
uint16 u16CertificateOffset
uint16 u16CertificateLength
uint8 au8TlsSpecificRootNameSha1 [20]
uint32 u32Rsv1
uint32 u32TlsHsFlags
uint32 u32Rsv2
uint8 au81xAuthDetails []

Detailed Description

Wi-Fi Authentication 802.1x header for parameters. The parameters (Domain, UserName, PrivateKey/Password) are appended to this structure.

Field Documentation

uint8 u8Flags

802.1x-specific flags: M2M_802_1X_MSCHAP2_FLAG M2M_802_1X_TLS_FLAG M2M_802_1X_UNENCRYPTED_USERNAME_FLAG M2M_802_1X_PREPEND_DOMAIN_FLAG

uint8 u8DomainLength

Length of Domain. (Offset of Domain, within au81xAuthDetails, understood to be 0.)

uint8 u8UserNameLength

Length of UserName. (Offset of UserName, within au81xAuthDetails, understood to be u8DomainLength.)

uint8 u8HdrLength

Length of header (offset of au81xAuthDetails within tstrM2mWifi1xHdr). Legacy implementations may have 0 here, in which case header is 12 bytes. The unusual placing of this field is in order to hit a zero in legacy implementations.

uint16 u16PrivateKeyOffset

Offset within au81xAuthDetails of PrivateKey/Password.

uint16 u16PrivateKeyLength

Length of PrivateKey/Password. In the case of PrivateKey, this is the length of the modulus.

uint16 u16CertificateOffset

Offset within au81xAuthDetails of Certificate.

uint16 u16CertificateLength

Length of Certificate.

uint8 au8TlsSpecificRootNameSha1[20]

SHA1 digest of subject name to identify specific root certificate for phase 1 server verification.

uint32 u32Rsv1

Reserved, set to 0.

uint32 u32TlsHsFlags

TLS handshake flags for phase 1.

uint32 u32Rsv2

Reserved, set to 0.

uint8 au81xAuthDetails[]

Placeholder for concatenation of Domain, UserName, PrivateKey/Password, Certificate. Certificate (for 1x Tls only) is sent over HIF separately from the other parameters.

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2mWifiAuthInfoHdr Struct Reference

Data Fields
tstrM2mWifiAuthInfoHdr Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint8 u8Type
uint8 au8Rsv [3]
uint16 u16InfoPos
uint16 u16InfoLen
uint8 au8Info []

Detailed Description

Generic Wi-Fi authentication information to be sent in a separate HIF message of type M2M_WIFI_IND_CONN_PARAM (preceding M2M_WIFI_REQ_CONN).

Field Documentation

uint8 u8Type

Type of info: M2M_802_1X_TLS_CLIENT_CERTIFICATE

uint8 au8Rsv[3]

Reserved for future use. Set to 0.

uint16 u16InfoPos

Information about positioning of the Info. The interpretation depends on u8Type.

uint16 u16InfoLen

Info length (not including this header).

uint8 au8Info[]

Placeholder for info.

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2mWifiConnHdr Struct Reference

Data Fields
tstrM2mWifiConnHdr Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

tstrM2mConnCredHdr strConnCredHdr
tstrM2mConnCredCmn strConnCredCmn

Detailed Description

Wi-Fi Connect Request (new format) for use with M2M_WIFI_REQ_CONN. This structure is sent across the HIF along with the relevant auth details. One of: tstrM2mWifiPsk tstrM2mWifiWep tstrM2mWifi1xHdr If further authentication details need to be sent (such as client certificate for 1x TLS), they are sent with header tstrM2mWifiAuthInfoHdr in a preceding HIF message of type M2M_WIFI_IND_CONN_PARAM.

Field Documentation

tstrM2mConnCredHdr strConnCredHdr

Credentials header.

tstrM2mConnCredCmn strConnCredCmn

Credentials common section, including auth type and SSID.

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2mWifiApId Struct Reference

Data Fields
tstrM2mWifiApId Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint8 au8SSID [M2M_MAX_SSID_LEN]
uint8 __PAD__ [3]

Detailed Description

Specify an access point (by SSID)

Field Documentation

uint8 au8SSID[M2M_MAX_SSID_LEN]

SSID of the desired AP, prefixed by length byte. First byte 0xFF used to mean all access points.

uint8 __PAD__[3]

Padding bytes for forcing 4-byte alignment

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2MGenericResp Struct Reference

Data Fields
tstrM2MGenericResp Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

sint8 s8ErrorCode
uint8 __PAD24__ [3]

Detailed Description

Generic success/error response.

Field Documentation

sint8 s8ErrorCode

Generic success/error code. Possible values are:

  • M2M_SUCCESS
  • M2M_ERR_FAIL
uint8 __PAD24__[3]
Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2MWPSConnect Struct Reference

Data Fields
tstrM2MWPSConnect Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

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

Detailed Description

WPS Configuration parameters.

See also
tenuWPSTrigger

Field Documentation

uint8 u8TriggerType

WPS triggering method (Push button or PIN)

char acPinNumber[8]

WPS PIN No (for PIN method)

uint8 __PAD24__[3]

Padding bytes for forcing 4-byte alignment

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2MWPSInfo Struct Reference

Data Fields
tstrM2MWPSInfo Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

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

Detailed Description

WPS Result.

This structure 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

uint8 u8AuthType

Network authentication type.

uint8 u8Ch

RF Channel for the AP.

uint8 au8SSID[M2M_MAX_SSID_LEN]

SSID obtained from WPS.

uint8 au8PSK[M2M_MAX_PSK_LEN]

PSK for the network obtained from WPS.

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2MDefaultConnResp Struct Reference

Data Fields
tstrM2MDefaultConnResp Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

sint8 s8ErrorCode
uint8 __PAD24__ [3]

Detailed Description

Response error of the m2m_default_connect.

See also
M2M_DEFAULT_CONN_SCAN_MISMATCH M2M_DEFAULT_CONN_EMPTY_LIST

Field Documentation

sint8 s8ErrorCode

Default connect error code. possible values are:

  • M2M_DEFAULT_CONN_EMPTY_LIST
  • M2M_DEFAULT_CONN_SCAN_MISMATCH
uint8 __PAD24__[3]
Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2MScanOption Struct Reference

Data Fields
tstrM2MScanOption Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint8 u8NumOfSlot
uint8 u8SlotTime
uint8 u8ProbesPerSlot
sint8 s8RssiThresh

Detailed Description

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

See also
tenuM2mScanCh tstrM2MScan

Field Documentation

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.

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.

uint8 u8ProbesPerSlot

Number of probe requests to be sent for each scan slot (when not specifying network to scan). Number of probe requests to be sent for each ssid to scan in each scan slot (when specifying network to scan). Refers to active scan only. Valid settings are in the range 0<Probes<=2. Default setting is M2M_SCAN_DEFAULT_NUM_PROBE.

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.

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2MStopScanOption Struct Reference

Data Fields
tstrM2MStopScanOption Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint8 u8StopOnFirstResult
uint8 au8Rsv [3]

Detailed Description

This struct holds additional configuration options for Wi-Fi scan.

These scan options should be set by the application prior to issuing the scan request, and once configured, WINC will keep the settings until the scan options are set again, via the same API, or until the device is either reset or power cycled.

Field Documentation

uint8 u8StopOnFirstResult

Stop scan as soon as an SSID is detected. 1 = Enabled, 0 = Disabled (default)

uint8 au8Rsv[3]

Reserved for future use. Set to 0.

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2MScanRegion Struct Reference

Data Fields
tstrM2MScanRegion Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint16 u16ScanRegion
uint8 __PAD16__ [2]

Detailed Description

Wi-Fi channel regulation region information.

See also
tenuM2mScanRegion

Field Documentation

uint16 u16ScanRegion
uint8 __PAD16__[2]

Padding bytes for forcing 4-byte alignment

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2MScan Struct Reference

Data Fields
tstrM2MScan Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint8 u8ChNum
uint8 __RSVD8__ [1]
uint16 u16PassiveScanTime

Detailed Description

Wi-Fi Scan Request.

See also
tenuM2mScanCh tstrM2MScanOption

Field Documentation

uint8 u8ChNum

The Wi-Fi RF Channel number

uint8 __RSVD8__[1]

Reserved for future use.

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.

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrCyptoResp Struct Reference

Data Fields
tstrCyptoResp Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

sint8 s8Resp
uint8 __PAD24__ [3]

Detailed Description

crypto response

Field Documentation

sint8 s8Resp
uint8 __PAD24__[3]
Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2mScanDone Struct Reference

Data Fields
tstrM2mScanDone Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint8 u8NumofCh
sint8 s8ScanState
uint8 __PAD16__ [2]

Detailed Description

Wi-Fi Scan Result.

Field Documentation

uint8 u8NumofCh

Number of found APs

sint8 s8ScanState

Scan status

uint8 __PAD16__[2]

Padding bytes for forcing 4-byte alignment

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2mReqScanResult Struct Reference

Data Fields
tstrM2mReqScanResult Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint8 u8Index
uint8 __PAD24__ [3]

Detailed Description

Scan Result Request.

The Wi-Fi Scan results list is stored in Firmware. The application can request a certain scan result by its index.

Field Documentation

uint8 u8Index

Index of the desired scan result

uint8 __PAD24__[3]

Padding bytes for forcing 4-byte alignment

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2mWifiscanResult Struct Reference

Data Fields
tstrM2mWifiscanResult Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

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

Detailed Description

Wi-Fi Scan Result.

Information corresponding to an AP in the Scan Result list identified by its order (index) in the list.

Field Documentation

uint8 u8index

AP index in the scan result list.

sint8 s8rssi

AP signal strength.

uint8 u8AuthType

AP authentication type.

uint8 u8ch

AP RF channel.

uint8 au8BSSID[6]

BSSID of the AP.

uint8 au8SSID[M2M_MAX_SSID_LEN]

AP ssid.

uint8 _PAD8_

Padding bytes for forcing 4-byte alignment

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2mWifiStateChanged Struct Reference

Data Fields
tstrM2mWifiStateChanged Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint8 u8CurrState
uint8 u8ErrCode
uint8 __PAD16__ [2]

Detailed Description

Wi-Fi Connection State.

See also
M2M_WIFI_DISCONNECTED, M2M_WIFI_CONNECTED, M2M_WIFI_REQ_CON_STATE_CHANGED,tenuM2mConnChangedErrcode

Field Documentation

uint8 u8CurrState

Current Wi-Fi connection state

uint8 u8ErrCode

Error type review tenuM2mConnChangedErrcode

uint8 __PAD16__[2]

Padding bytes for forcing 4-byte alignment

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2mPsType Struct Reference

Data Fields
tstrM2mPsType Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint8 u8PsType
uint8 u8BcastEn
uint8 __PAD16__ [2]

Detailed Description

Power Save Configuration.

See also
tenuPowerSaveModes

Field Documentation

uint8 u8PsType

Power save operating mode

uint8 u8BcastEn
uint8 __PAD16__[2]

Padding bytes for forcing 4-byte alignment

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2mSlpReqTime Struct Reference

Data Fields
tstrM2mSlpReqTime Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint32 u32SleepTime

Detailed Description

Manual power save request sleep time.

Field Documentation

uint32 u32SleepTime

< Sleep time in ms

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2mLsnInt Struct Reference

Data Fields
tstrM2mLsnInt Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint16 u16LsnInt
uint8 __PAD16__ [2]

Detailed Description

Listen interval.

It is the value of the Wi-Fi STA listen interval for power saving. It is given in units of Beacon period. Periodically after the listen interval fires, the WINC is wakeup and listen to the beacon and check for any buffered frames for it from the AP.

Field Documentation

uint16 u16LsnInt

Listen interval in Beacon period count.

uint8 __PAD16__[2]

Padding bytes for forcing 4-byte alignment

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2MWifiMonitorModeCtrl Struct Reference

Data Fields
tstrM2MWifiMonitorModeCtrl Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

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

Detailed Description

Wi-Fi Monitor Mode Filter.

This structure sets the filtering criteria for WLAN packets when monitoring mode is enable. The received packets matching the filtering parameters, are passed directly to the application.

Field Documentation

uint8 u8ChannelID
uint8 u8FrameType

It must use values from tenuWifiFrameType.

uint8 u8FrameSubtype

It must use values from tenuSubTypes.

uint8 au8SrcMacAddress[6]
uint8 au8DstMacAddress[6]
uint8 au8BSSID[6]
uint8 u8EnRecvHdr
uint8 __PAD16__[2]

Padding bytes for forcing 4-byte alignment

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2MWifiRxPacketInfo Struct Reference

Data Fields
tstrM2MWifiRxPacketInfo Struct Reference
WLAN » Enumerations and Typedefs

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

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

uint8 u8FrameType

It must use values from tenuWifiFrameType.

uint8 u8FrameSubtype

It must use values from tenuSubTypes.

uint8 u8ServiceClass

Service class from Wi-Fi header.

uint8 u8Priority

Priority from Wi-Fi header.

uint8 u8HeaderLength

Frame Header length.

uint8 u8CipherType

Encryption type for the rx packet.

uint8 au8SrcMacAddress[6]
uint8 au8DstMacAddress[6]
uint8 au8BSSID[6]
uint16 u16DataLength

Data payload length (Header excluded).

uint16 u16FrameLength

Total frame length (Header + Data).

uint32 u32DataRateKbps

Data Rate in Kbps.

sint8 s8RSSI

RSSI.

uint8 __PAD24__[3]

Padding bytes for forcing 4-byte alignment

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2MWifiTxPacketInfo Struct Reference

Data Fields
tstrM2MWifiTxPacketInfo Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint16 u16PacketSize
uint16 u16HeaderLength

Detailed Description

Wi-Fi TX Packet Info.

The M2M Application has the ability to compose a 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

uint16 u16PacketSize

Wlan frame length.

uint16 u16HeaderLength

Wlan frame header length.

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2MAPConfig Struct Reference

Data Fields
tstrM2MAPConfig Struct Reference
WLAN » Enumerations and Typedefs

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 au8Key [M2M_MAX_PSK_LEN]
uint8 | __PAD16__ [2]

Detailed Description

AP Configuration.

This structure holds the configuration parameters for the M2M AP mode. It should be set by the application when it requests to enable the M2M AP operation mode. This mode supports either open, WEP or WPA/WPA2 mixed mode security types.

Field Documentation

uint8 au8SSID[M2M_MAX_SSID_LEN]

< Configuration parameters for the WiFi AP.AP SSID

uint8 u8ListenChannel

Wi-Fi RF Channel which the AP will operate on

uint8 u8KeyIndx

Wep key Index

uint8 u8KeySz

Wep/WPA key Size

uint8 au8WepKey[WEP_104_KEY_STRING_SIZE+1]

Wep key

uint8 u8SecType

Security type: Open, WEP or WPA/WPA2 mixed mode

uint8 u8SsidHide

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

uint8 au8DHCPServerIP[4]

Ap IP server address

uint8 au8Key[M2M_MAX_PSK_LEN]

WPA key

uint8 __PAD16__[2]

Padding bytes for forcing alignment

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2MAPConfigExt Struct Reference

Data Fields
tstrM2MAPConfigExt Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint8 | au8DefRouterIP [4]
uint8 | au8DNSServerIP [4]
uint8 | au8SubnetMask [4]

Detailed Description

AP Configuration Extension.

This structure holds additional configuration parameters for the M2M AP mode. If modification of the extended parameters in AP mode is desired then tstrM2MAPModeConfig should be set by the application, which contains the main AP configuration structure as well as this extended parameters structure. When configuring provisioning mode then tstrM2MProvisionModeConfig should be used, which also contains the main AP configuration structure, this extended parameters structure and additional provisioning parameters.

Field Documentation

uint8 au8DefRouterIP[4]

Ap Default Router address

uint8 au8DNSServerIP[4]

Ap DNS server address

uint8 au8SubnetMask[4]

Network Subnet Mask

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2MAPModeConfig Struct Reference

Data Fields
tstrM2MAPModeConfig Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

tstrM2MAPConfig strApConfig
tstrM2MAPConfigExt strApConfigExt

Detailed Description

AP Configuration.

This structure holds the AP configuration parameters plus the extended AP configuration parameters for M2M AP mode. It should be set by the application when it requests to enable M2M AP operation mode. This mode supports either open, WEP or WPA/WPA2 mixed mode security types.

Field Documentation

tstrM2MAPConfig strApConfig

Configuration parameters for the WiFi AP.

tstrM2MAPConfigExt strApConfigExt

Additional configuration parameters for the WiFi AP.

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2mServerInit Struct Reference

Data Fields
tstrM2mServerInit Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint8 u8Channel
uint8 __PAD24__ [3]

Detailed Description

PS Server initialization.

Field Documentation

uint8 u8Channel

Server Listen channel

uint8 __PAD24__[3]

Padding bytes for forcing 4-byte alignment

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2mClientState Struct Reference

Data Fields
tstrM2mClientState Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint8 u8State
uint8 __PAD24__ [3]

Detailed Description

PS Client State.

Field Documentation

uint8 u8State

PS Client State

uint8 __PAD24__[3]

Padding bytes for forcing 4-byte alignment

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2Mservercmd Struct Reference

Data Fields
tstrM2Mservercmd Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint8 u8cmd
uint8 __PAD24__ [3]

Detailed Description

PS Server CMD.

Field Documentation

uint8 u8cmd

PS Server Cmd

uint8 __PAD24__[3]

Padding bytes for forcing 4-byte alignment

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2mSetMacAddress Struct Reference

Data Fields
tstrM2mSetMacAddress Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

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

Detailed Description

Sets the MAC address from application. The WINC load the mac address from the effuse by default to the WINC configuration memory, but that function is used to let the application overwrite the configuration memory with the mac address from the host.

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

Field Documentation

uint8 au8Mac[6]

MAC address array

uint8 __PAD16__[2]

Padding bytes for forcing 4-byte alignment

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2MDeviceNameConfig Struct Reference

Data Fields
tstrM2MDeviceNameConfig Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint8 au8DeviceName [M2M_DEVICE_NAME_MAX]

Detailed Description

Device name.

It is assigned by the application. It is used mainly for Wi-Fi Direct device discovery and WPS device information.

Field Documentation

uint8 au8DeviceName[M2M_DEVICE_NAME_MAX]

NULL terminated device name

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2MIPConfig Struct Reference

Data Fields
tstrM2MIPConfig Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint32 u32StaticIP
uint32 u32Gateway
uint32 u32DNS
uint32 u32AlternateDNS
uint32 u32SubnetMask
uint32 u32DhcpLeaseTime

Detailed Description

IP configuration (static/DHCP). The same structure is used for DCHP callback as well as 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

uint32 u32StaticIP

If DHCP callback, this is the IP address obtained from the DHCP. In static IP config, this is the assigned to the device from the application.

uint32 u32Gateway

IP of the default internet gateway.

uint32 u32DNS

IP for the DNS server.

uint32 u32AlternateDNS

IP for the secondary DNS server (if any). Must set to zero if not provided in static IP configuration from the application.

uint32 u32SubnetMask

Subnet mask for the local area network.

uint32 u32DhcpLeaseTime

DHCP Lease Time in sec. This field is is ignored in static IP configuration.

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2mIpRsvdPkt Struct Reference

Data Fields
tstrM2mIpRsvdPkt Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint16 u16PktSz
uint16 u16PktOffset

Detailed Description

Received Packet Size and Data Offset.

Field Documentation

uint16 u16PktSz
uint16 u16PktOffset
Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2MProvisionModeConfig Struct Reference

Data Fields
tstrM2MProvisionModeConfig Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

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

Detailed Description

M2M Provisioning Mode Configuration.

Field Documentation

tstrM2MAPConfig strApConfig

Configuration parameters for the WiFi AP.

char acHttpServerDomainName[64]

The device domain name for HTTP provisioning.

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.
tstrM2MAPConfigExt strApConfigExt

Additional configuration parameters for the WiFi AP.

uint8 __PAD24__[3]
Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2MProvisionInfo Struct Reference

Data Fields
tstrM2MProvisionInfo Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

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

Detailed Description

M2M Provisioning Information obtained from the HTTP Provisioning server.

Field Documentation

uint8 au8SSID[M2M_MAX_SSID_LEN]

Provisioned SSID.

uint8 au8Password[M2M_MAX_PSK_LEN]

Provisioned Password.

uint8 u8SecType

Wifi Security type.

uint8 u8Status

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

  • M2M_SUCCESS : Provision successful.
  • M2M_FAIL : Provision Failed.
Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2MConnInfo Struct Reference

Data Fields
tstrM2MConnInfo Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

char | acSSID [M2M_MAX_SSID_LEN]
uint8 u8SecType
uint8 | au8IPAddr [4]
uint8 | au8MACAddress [6]
sint8 s8RSSI
uint8 u8CurrChannel
uint8 | __PAD16__ [2]

Detailed Description

M2M Provisioning Information obtained from the HTTP Provisioning server.

Field Documentation

char acSSID[M2M_MAX_SSID_LEN]

AP connection SSID name

uint8 u8SecType

Security type

uint8 au8IPAddr[4]

Connection IP address

uint8 au8MACAddress[6]

MAC address of the peer Wi-Fi station

sint8 s8RSSI

Connection RSSI signal

uint8 u8CurrChannel

Wi-Fi RF channel number 1,2,... 14.

uint8 __PAD16__[2]

Padding bytes for forcing 4-byte alignment

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2MSNTPConfig Struct Reference

Data Fields
tstrM2MSNTPConfig Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

char | acNTPServer [M2M_NTP_MAX_SERVER_NAME_LENGTH+1]
tenuSNTPUseDHCP enuUseDHCP
uint8 | __PAD8__ [tstrM2MSNTPConfig_PAD]

Detailed Description

SNTP Client Configuration.

Configuration structure for the SNTP client.

Field Documentation

char acNTPServer[M2M_NTP_MAX_SERVER_NAME_LENGTH+1]

< Configuration parameters for the NTP Client.Custom NTP server name.

tenuSNTPUseDHCP enuUseDHCP

Use NTP server provided by the DHCP server when falling back

uint8 __PAD8__[tstrM2MSNTPConfig_PAD]

Padding bytes for forcing 4-byte alignment

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrSystemTime Struct Reference

Data Fields
tstrSystemTime Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint16 u16Year
uint8 u8Month
uint8 u8Day
uint8 u8Hour
uint8 u8Minute
uint8 u8Second
uint8 __PAD8__

Detailed Description

Used for time storage.

Field Documentation

uint16 u16Year
uint8 u8Month
uint8 u8Day
uint8 u8Hour
uint8 u8Minute
uint8 u8Second
uint8 __PAD8__
Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2MMulticastMac Struct Reference

Data Fields
tstrM2MMulticastMac Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint8 au8macaddress [M2M_MAC_ADDRES_LEN]
uint8 u8AddRemove
uint8 __PAD8__

Detailed Description

M2M add/remove multi-cast mac address.

Field Documentation

uint8 au8macaddress[M2M_MAC_ADDRES_LEN]

Mac address needed to be added or removed from filter.

uint8 u8AddRemove

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

uint8 __PAD8__

Padding bytes for forcing 4-byte alignment

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrPrng Struct Reference

Data Fields
tstrPrng Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint8 * pu8RngBuff
uint16 u16PrngSize
uint8 __PAD16__ [2]

Detailed Description

M2M Request PRNG.

Field Documentation

uint8* pu8RngBuff

< return buffer address PRNG size requested

uint16 u16PrngSize

PRNG pads

uint8 __PAD16__[2]
Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrConfAutoRate Struct Reference

Data Fields
tstrConfAutoRate Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint16 u16ArMaxRecoveryFailThreshold
uint16 u16ArMinRecoveryFailThreshold
tenuWlanTxRate enuWlanTxRate
tenuWlanTxRate enuArInitialRateSel
uint8 u8ArEnoughTxThreshold
uint8 u8ArSuccessTXThreshold
uint8 u8ArFailTxThreshold
uint8 __PAD24__ [3]

Detailed Description

Auto TX rate selection parameters passed to m2m_wifi_conf_auto_rate.

Field Documentation

uint16 u16ArMaxRecoveryFailThreshold

To stabilize the TX rate and avoid oscillation, the algorithm will not attempt to push the rate up again after a failed attempt to push the rate up. An attempt to push the rate up is considered failed if the next rate suffers from very high retransmission. In this case, WINC will not attempt again until a duration of time is elapsed to keep the TX rate stable. The min duration is (u16ArMinRecoveryFailThreshold) seconds and doubles on every failed attempt. The doubling continues until the duration is (u16ArMaxRecoveryFailThreshold) max.

Increasing u16ArMaxRecoveryFailThreshold will cause the TX rate to be stable over a long period of time with fewer attempts to increase the data rate. However, increasing it to a very large value will deter the algorithm from attempting to increase the rate if, for instance, the wireless conditions before were better.

Default is 5 seconds.

uint16 u16ArMinRecoveryFailThreshold

To stabilize the TX rate and avoid oscillation, the algorithm will not attempt to push the rate up again after a failed attempt to push the rate up. An attempt to push the rate up is considered failed if the next rate suffers from very high retransmission. In this case, WINC will not attempt again until a duration of time is elapsed to keep the TX rate stable. The min duration is (u16ArMinRecoveryFailThreshold) seconds and doubles on every failed attempt. The doubling continues until the duration is (u16ArMaxRecoveryFailThreshold) max.

Default is 1 second.

tenuWlanTxRate enuWlanTxRate

The TX data rate selected as enumerated in tenuWlanTxRate Default is TX_RATE_AUTO.

WINC shall override the rate provided through this API if it not supported by the peer WLAN device (STA/AP). For instance, if the TX_RATE_MCS_0 is requested while the connection is to a BG only AP, WINC shall elect the nearest BG data rate to the requested rate. In this example, it will be TX_RATE_9.

tenuWlanTxRate enuArInitialRateSel

Configures the initial WLAN TX rate used right after association. This is the starting point for auto rate algorithm. The algorithm tunes the rate up or down based on the wireless medium condition if enuWlanTxRate is set to TX_RATE_AUTO. If enuWlanTxRate is set to any value other than TX_RATE_AUTO, then u8ArInitialRateSel is ignored. Default is TX_RATE_AUTO.

By default WINC selects the best initial rate based on the receive signal level from the WLAN peer. For applications that favor range right after association, TX_RATE_LOWEST can bs used.

uint8 u8ArEnoughTxThreshold

Configures the minimum number of transmitted packets per second for auto rate selection algorithm to start to make rate up or down decisions. Default is 10.

uint8 u8ArSuccessTXThreshold

Configures the threshold for rate up. Rate goes up if number of WLAN TX retries is less than (1/u8ArSuccessTXThreshold) of the number of packet transmitted within one second. This can be tuned to speed up or slow down the rate at which the algorithm moves the WLAN TX rate up. Default value is 5.

uint8 u8ArFailTxThreshold

Configures the threshold for rate down. Rate goes down if number of WLAN TX retries is greater than (1/u8ArFailTxThreshold) of the number of packet transmitted within one second. This can be tuned to speed up or slow down the rate at which the algorithm moves the WLAN TX rate down. Default value is 3.

uint8 __PAD24__[3]

Pad bytes for forcing 4-byte alignment

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrEthInitParam Struct Reference

Data Fields
tstrEthInitParam Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

tpfAppWifiCb pfAppWifiCb
tpfAppEthCb pfAppEthCb
uint8 * au8ethRcvBuf
uint16 u16ethRcvBufSize
uint8 u8EthernetEnable
uint8 __PAD8__

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
Warning
Make sure that application defines ETH_MODE before using tstrEthInitParam.

Field Documentation

tpfAppWifiCb pfAppWifiCb

Callback for wifi notifications.

tpfAppEthCb pfAppEthCb

Callback for Ethernet interface.

uint8* au8ethRcvBuf

Pointer to Receive Buffer of Ethernet Packet

uint16 u16ethRcvBufSize

Size of Receive Buffer for Ethernet Packet

uint8 u8EthernetEnable

Enable Ethernet mode flag

uint8 __PAD8__

Padding

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2mIpCtrlBuf Struct Reference

Data Fields
tstrM2mIpCtrlBuf Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint16 u16DataSize
uint16 u16RemainingDataSize

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
tpfAppWifiCb tpfAppEthCb tstrEthInitParam
Warning
Make sure that ETHERNET/bypass mode is defined before using tstrM2mIpCtrlBuf

Field Documentation

uint16 u16DataSize

Size of the received data in bytes.

uint16 u16RemainingDataSize

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

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrWifiInitParam Struct Reference

Data Fields
tstrWifiInitParam Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

tpfAppWifiCb pfAppWifiCb
tpfAppMonCb pfAppMonCb
tstrEthInitParam strEthInitParam

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.

See also
tpfAppEthCb tpfAppMonCb tstrEthInitParam

Field Documentation

tpfAppWifiCb pfAppWifiCb

Callback for Wi-Fi notifications.

tpfAppMonCb pfAppMonCb

Callback for monitoring interface.

tstrEthInitParam strEthInitParam

Structure to hold Ethernet interface parameters.

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrNetworkId Struct Reference

Data Fields
tstrNetworkId Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint8 * pu8Bssid
uint8 * pu8Ssid
uint8 u8SsidLen
tenuM2mScanCh enuChannel

Field Documentation

uint8* pu8Bssid

Pointer to BSSID (6 bytes). Optional (may be NULL). If present, this restricts the connection attempt to APs that have a matching BSSID.

uint8* pu8Ssid

Pointer to SSID. Required.

uint8 u8SsidLen

Length of SSID in bytes. Permitted values are between 0 and 32.

tenuM2mScanCh enuChannel

Wi-Fi channel to connect on. If an appropriate AP cannot be found on this channel then connection fails. M2M_WIFI_CH_ALL may be used to allow scanning of all channels.

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrM2mWifiWepParams Struct Reference

Data Fields
tstrM2mWifiWepParams Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

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

Field Documentation

uint8 u8KeyIndx
uint8 u8KeySz
uint8 au8WepKey[WEP_104_KEY_STRING_SIZE+1]
uint8 __PAD24__[3]
Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstr1xAuthCredentials Struct Reference

Data Fields
tstr1xAuthCredentials Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint8 | au8UserName [21]
uint8 | au8Passwd [41]

Field Documentation

uint8 au8UserName[21]
uint8 au8Passwd[41]
Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrAuthPsk Struct Reference

Data Fields
tstrAuthPsk Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint8 * pu8Psk
uint8 * pu8Passphrase
uint8 u8PassphraseLen

Field Documentation

uint8* pu8Psk

Pointer to PSK, represented as an ASCII string (64 characters, representing 32 bytes). Must be NULL if Passphrase is provided instead.

uint8* pu8Passphrase

Pointer to Passphrase (Printable ASCII). Must be NULL if PSK is provided instead.

uint8 u8PassphraseLen

Length of Passphrase. Permitted values are between 8 and 63. This field is ignored if pu8Passphrase == NULL.

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrAuthWep Struct Reference

Data Fields
tstrAuthWep Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint8 * pu8WepKey
uint8 u8KeySz
uint8 u8KeyIndx

Field Documentation

uint8* pu8WepKey

Pointer to WEP Key, represented as an ASCII string. (10 or 26 characters, representing 5 or 13 bytes.)

uint8 u8KeySz

Size of WEP Key string. Permitted values are WEP_40_KEY_STRING_SIZE or WEP_104_KEY_STRING_SIZE.

uint8 u8KeyIndx

WEP Key Index in the range 1 to 4.

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrAuth1xMschap2 Struct Reference

Data Fields
tstrAuth1xMschap2 Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint8 * pu8Domain
uint8 * pu8UserName
uint8 * pu8Password
uint16 u16DomainLen
uint16 u16UserNameLen
uint16 u16PasswordLen
bool | bUnencryptedUserName
bool | bPrependDomain

Field Documentation

uint8* pu8Domain

Pointer to Domain of authentication server (printable ASCII), including '@' or '\' separator character as appropriate. Use NULL if there is no domain information. The Domain will be either prepended or appended to the UserName, depending on the setting of field bPrependDomain.
Example 1: if [Domain]is "@my_domain" and bPrependDomain is false, then the EAP identity response is "[UserName]@my_domain".
Example 2: if [Domain]is "my_domain\" and bPrependDomain is true, then the EAP identity response is "my_domain\[UserName]".

uint8* pu8UserName

Pointer to UserName (ASCII). This will be sent (encrypted) in the tunneled EAP identity response (if applicable) and used during MSCHAPv2 authentication. If bUnencryptedUserName is true then it will also be sent (unencrypted) in the initial EAP identity response.

uint8* pu8Password

Pointer to MSCHAPv2 Password (ASCII). This will be used during MSCHAPv2 authentication.

uint16 u16DomainLen

Length of Domain (in ASCII characters), including '@' or '\' separator character as appropriate. Permitted values are such that u16DomainLen + u16UserNameLen is between 0 and M2M_AUTH_1X_USER_LEN_MAX.

uint16 u16UserNameLen

Length of UserName (in ASCII characters). Permitted values are such that u16DomainLen + u16UserNameLen is between 0 and M2M_AUTH_1X_USER_LEN_MAX.

uint16 u16PasswordLen

Length of Password (in ASCII characters). Permitted values are between 0 and M2M_AUTH_1X_PASSWORD_LEN_MAX.

bool bUnencryptedUserName

Determines whether UserName or "anonymous" is sent (unencrypted) in the initial EAP identity response. Domain is sent in both cases.
true: UserName is sent in the initial EAP identity response (not recommended). false: "anonymous" is sent in the initial EAP identity response. This setting is recommended for tunneled methods. MSCHAPv2 is always a tunneled method.

bool bPrependDomain

Determines whether Domain is prepended or appended to UserName in EAP identity responses. true: Domain is prepended to UserName - [Domain][UserName]. false: Domain is appended to UserName - [UserName][Domain].

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrAuth1xTls Struct Reference

Data Fields
tstrAuth1xTls Struct Reference
WLAN » Enumerations and Typedefs

Data Fields

uint8 * pu8Domain
uint8 * pu8UserName
uint8 * pu8PrivateKey_Mod
uint8 * pu8PrivateKey_Exp
uint8 * pu8Certificate
uint16 u16DomainLen
uint16 u16UserNameLen
uint16 u16PrivateKeyLen
uint16 u16CertificateLen
bool | bUnencryptedUserName
bool | bPrependDomain

Field Documentation

uint8* pu8Domain

Pointer to Domain of authentication server (printable ASCII), including '@' or '\' separator character as appropriate. Use NULL if there is no domain information. The Domain will be either prepended or appended to the UserName, depending on the setting of field bPrependDomain.
Example 1: if [Domain]is "@my_domain" and bPrependDomain is false, then the EAP identity response is "[UserName]@my_domain".
Example 2: if [Domain]is "my_domain\" and bPrependDomain is true, then the EAP identity response is "my_domain\[UserName]".

uint8* pu8UserName

Pointer to UserName (ASCII). This will be sent (encrypted) in the tunneled EAP identity response. If bUnencryptedUserName is true then it will also be sent (unencrypted) in the initial EAP identity response.

uint8* pu8PrivateKey_Mod

Pointer to PrivateKey modulus (raw data). This will be used during TLS client authentication.

uint8* pu8PrivateKey_Exp

Pointer to PrivateKey exponent (raw data). This will be used during TLS client authentication.

uint8* pu8Certificate

Pointer to TLS client certificate corresponding to PrivateKey. This will be used during TLS client authentication.

uint16 u16DomainLen

Length of Domain (in ASCII characters), including '@' or '\' separator character as appropriate. Permitted values are such that u16DomainLen + u16UserNameLen is between 0 and M2M_AUTH_1X_USER_LEN_MAX.

uint16 u16UserNameLen

Length of UserName (in ASCII characters). Permitted values are such that u16DomainLen + u16UserNameLen is between 0 and M2M_AUTH_1X_USER_LEN_MAX.

uint16 u16PrivateKeyLen

Length of PrivateKey_Mod (in bytes). Permitted values are between 0 and M2M_AUTH_1X_PRIVATEKEY_LEN_MAX, typically 128 or 256. PrivateKey_Exp must be the same length as modulus, pre-padded with 0s if necessary.

uint16 u16CertificateLen

Length of Certificate (in bytes). Permitted values are between 0 and M2M_AUTH_1X_CERT_LEN_MAX.

bool bUnencryptedUserName

Determines whether UserName or "anonymous" is sent (unencrypted) in the initial EAP identity response. Domain is sent in both cases.
true: UserName is sent in the initial EAP identity response (required for EAP-TLS). false: "anonymous" is sent in the initial EAP identity response. This setting is recommended for tunneled methods such as EAP-PEAP/TLS.

bool bPrependDomain

Determines whether Domain is prepended or appended to UserName in EAP identity responses. true: Domain is prepended to UserName - [Domain][UserName]. false: Domain is appended to UserName - [UserName][Domain].

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Functions

Modules
Functions
WLAN

Modules

Initialization
Wlan Events
Connection
Scanning
Hot-Spot (Access-Point)
Bypass Mode
Roaming
Power Save
Configuration
System Time
Provisioning
Crypto

Detailed Description

Here are listed all the functions that implement the Wlan APIs.

Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Initialization

Functions
Initialization
WLAN » Functions

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)
NMI_API sint8 | m2m_wifi_init_hold (void)
NMI_API sint8 | m2m_wifi_init_start (tstrWifiInitParam *pWifiInitParam)
NMI_API sint8 | m2m_wifi_reinit (tstrWifiInitParam *pWifiInitParam)
NMI_API sint8 | m2m_wifi_reinit_hold (void)
NMI_API sint8 | m2m_wifi_reinit_start (tstrWifiInitParam *pWifiInitParam)
NMI_API uint8 | m2m_wifi_get_state (void)

Detailed Description

Here are listed all the functions that implement the Wlan Initialization APIs.

Function Documentation

NMI_API void m2m_wifi_download_mode ( void )

Prepares the WINC board before downloading any data (Firmware, Certificates, etc).

This function should be called before attempting to download any data to the WINC board. Performs the appropriate WINC driver initialization, this includes bus initialization, interrupt enabling and it halts the chip to allow for the firmware downloads. Firmware can be downloaded through a number of interfaces, UART, I2C and SPI.

Precondition
Prior to call m2m_wifi_download_mode, the Application should ensure that the wifi is not initialized. This can be done by calling m2m_wifi_get_state and in case the wifi state differs from WIFI_STATE_DEINIT, a m2m_wifi_deinit needs to be issued.
Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise.
NMI_API sint8 m2m_wifi_init ( tstrWifiInitParam * pWifiInitParam )

Synchronous API to initialize the WINC driver.

This function initializes the WINC driver by registering the callback function for the M2M_WIFI layer (also the callback 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.

The possible Wi-Fi events that are expected to be received through the callback function (provided by the application) to the M2M_WIFI layer are listed below:

  • 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 a structure of type tstrWifiInitParam which contains pointers to the application WIFI layer callback function, monitoring mode callback and tstrEthInitParam structure (which contains initialization settings for bypass mode).
Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise.
Precondition
Prior to this function call, The application should initialize the BSP using nm_bsp_init. Also, application users must provide a call back function responsible for receiving all the wi-fi events that are received on the M2M_WIFI layer.
Warning
Failure to successfully complete indicates that the driver could not be initialized and a fatal error will prevent the application from proceeding, proper error handling should be implemented by the application.
See also
m2m_wifi_deinit m2m_wifi_init_hold m2m_wifi_init_start tstrWifiInitParam tenuM2mStaCmd tenuM2mStaCmd
NMI_API sint8 m2m_wifi_deinit ( void * arg )

De-initialize the WINC driver and host interface.

Synchronous de-initialization function for the WINC driver. De-initializes the host interface and frees any resources used by the M2M_WIFI layer. This function must be called in the application closing phase to ensure that all resources have been correctly released. No arguments are expected to be passed in.

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.
Note
This function must be called at the de-initialization stage of the application. Generally this function should be the last function before switching off the chip and it should be followed only by nm_bsp_deinit function call. Every function call of m2m_wifi_init should be matched with a call to m2m_wifi_deinit.
See also
nm_bsp_deinit m2m_wifi_init m2m_wifi_init_hold m2m_wifi_download_mode
NMI_API 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
NMI_API sint8 m2m_wifi_init_start ( tstrWifiInitParam * pWifiInitParam )

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

Parameters
[in] pWifiInitParam This is a pointer to a variable of type tstrWifiInitParam which contains pointers to the application WIFI layer callback function (see tpfAppWifiCb), monitoring mode callback (see tpfAppEthCb) and tstrEthInitParam structure (which contains initialization settings for bypass mode).
See also
m2m_wifi_init tstrWifiInitParam
NMI_API sint8 m2m_wifi_reinit ( tstrWifiInitParam * pWifiInitParam )

De-initialize and then initialize wifi. Resets the WINC.

Parameters
[in] pWifiInitParam This is a pointer to a variable of type tstrWifiInitParam which contains pointers to the application WIFI layer callback function (see tpfAppWifiCb), monitoring mode callback (see tpfAppEthCb) and tstrEthInitParam structure (which contains initialization settings for bypass mode).
Note
m2m_wifi_reinit wraps a call to m2m_wifi_deinit and to m2m_wifi_init.
See also
m2m_wifi_deinit m2m_wifi_init tstrWifiInitParam
NMI_API sint8 m2m_wifi_reinit_hold ( void )

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

Note
m2m_wifi_reinit_hold wraps a call to m2m_wifi_deinit and to m2m_wifi_init_hold.
See also
m2m_wifi_deinit m2m_wifi_reinit m2m_wifi_init_hold
NMI_API sint8 m2m_wifi_reinit_start ( tstrWifiInitParam * pWifiInitParam )

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

Parameters
[in] pWifiInitParam This is a pointer to the tstrWifiInitParam structure which contains pointers to the application WIFI layer callback function (see tpfAppWifiCb), monitoring mode callback (see tpfAppEthCb) and tstrEthInitParam structure (which contains initialization settings for bypass mode).
See also
m2m_wifi_reinit m2m_wifi_init_start tstrWifiInitParam
NMI_API uint8 m2m_wifi_get_state ( void )

Get the wifi state.

Returns
The function returns the current wifi state (see tenuWifiState for the possible states).
Note
Check the WINC state. See tenuWifiState for possible states.
WIFI_STATE_INIT state represents WINC initialized but not started, this is a suitable state for safe flash access.
See also
m2m_wifi_init m2m_wifi_download_mode
Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Wlan Events

Functions
Wlan Events
WLAN » Functions

Functions

NMI_API void | m2m_wifi_yield (void)
NMI_API sint8 | m2m_wifi_handle_events (void *arg)

Detailed Description

Here are listed all the functions that implement the Wlan Events APIs.

Function Documentation

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.

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

Handle the various events received from the WINC board. Whenever an event happens in the WINC board (e.g. Connection, Disconnection, DHCP, etc), the WINC will interrupt the host to let it know that a new event has occurred. The host driver will attempt to handle these events whenever the application decides to do so by calling the m2m_wifi_handle_events function. It is mandatory to call this function periodically and independently of any other condition. It is ideal to include this function in the main and the most frequent loop of the host application.

Precondition
Prior to receiving events, 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.
Returns
The function returns M2M_SUCCESS for successful interrupt handling and a negative value otherwise.
Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Connection

Functions
Connection
WLAN » Functions

Functions

sint8 | m2m_wifi_delete_sc (char *pcSsid, uint8 u8SsidLen)
NMI_API sint8 | m2m_wifi_default_connect (void)
sint8 | m2m_wifi_connect_open (tenuCredStoreOption enuCredStoreOption, tstrNetworkId *pstrNetworkId)
sint8 | m2m_wifi_connect_wep (tenuCredStoreOption enuCredStoreOption, tstrNetworkId *pstrNetworkId, tstrAuthWep *pstrAuthWep)
sint8 | m2m_wifi_connect_psk (tenuCredStoreOption enuCredStoreOption, tstrNetworkId *pstrNetworkId, tstrAuthPsk *pstrAuthPsk)
sint8 | m2m_wifi_1x_set_option (tenu1xOption enuOptionName, const void *pOptionValue, size_t OptionLen)
sint8 | m2m_wifi_1x_get_option (tenu1xOption enuOptionName, void *pOptionValue, size_t *pOptionLen)
sint8 | m2m_wifi_connect_1x_mschap2 (tenuCredStoreOption enuCredStoreOption, tstrNetworkId *pstrNetworkId, tstrAuth1xMschap2 *pstrAuth1xMschap2)
sint8 | m2m_wifi_connect_1x_tls (tenuCredStoreOption enuCredStoreOption, tstrNetworkId *pstrNetworkId, tstrAuth1xTls *pstrAuth1xTls)
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 u8NoSaveCred)
NMI_API sint8 | m2m_wifi_disconnect (void)
NMI_API sint8 | m2m_wifi_get_connection_info (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_req_curr_rssi (void)

Detailed Description

Here are listed all the functions that implement the Wifi Connection APIs.

Function Documentation

sint8 m2m_wifi_delete_sc | ( | char * | pcSsid,
 |  | uint8 | u8SsidLen
 | ) |  |

Asynchronous API that deletes connection credentials (PSK, WEP key, 802.1X password) from WINC flash. Either deletes all credentials, or for a specific SSID.

Causes WINC to delete connection credentials. If the parameter is NULL, then WINC will delete all credentials from flash. Otherwise WINC will only delete credentials for matching SSID. Callback will report the status of the operation (success or not).

Parameters
[in] | pcSsid | SSID to match on when deleting credentials. SSID must not contain '\0'. NULL is a valid argument here, in which case all credentials are deleted.
[in] | u8SsidLen | Length of SSID provided in pcSsid. Must be less than M2M_MAX_SSID_LEN. This parameter is ignored if pcSsid is NULL.
Precondition
Prior to deleting credentials, the WINC driver should have been successfully initialized by calling the m2m_wifi_init function.
Warning
The option to delete for a specific SSID is currently not supported; all credentials are deleted regardless of the input parameters.
Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC and a negative value otherwise.
NMI_API sint8 m2m_wifi_default_connect ( void )

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

Asynchronous Wi-Fi connection function. An application calling this function will cause the firmware to correspondingly connect to the last successfully connected AP from the cached connections.
A failure to connect will result in a response of M2M_WIFI_RESP_DEFAULT_CONNECT indicating the connection error as defined in the structure tstrM2MDefaultConnResp.

Possible errors are: The connection list is empty M2M_DEFAULT_CONN_EMPTY_LIST or a mismatch for the saved AP name M2M_DEFAULT_CONN_SCAN_MISMATCH.

Precondition
Prior to connecting, the WINC driver should have been successfully initialized by calling the m2m_wifi_init function.
Warning
This function must be 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
Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC and a negative value otherwise.
sint8 m2m_wifi_connect_open | ( | tenuCredStoreOption | enuCredStoreOption,
 |  | tstrNetworkId * | pstrNetworkId
 | ) |  |

Asynchronous API to connect to an access point using open authentication.

Asynchronous Wi-Fi connection function. An application calling this function will cause the firmware to attempt to connect to an access point matching the details in pstrNetworkId, with open authentication. On successful connection, the connection details may be saved in WINC's flash, according to the option selected in enuCredStoreOption. Once connection has been attempted (whether successful or otherwise), a response event M2M_WIFI_RESP_CON_STATE_CHANGED will be sent to the callback function tpfAppWifiCb provided during initialization m2m_wifi_init.

Possible results indicated by the response event are:

  • M2M_WIFI_DISCONNECTED if the connection attempt failed.
  • M2M_WIFI_CONNECTED if the connection attempt succeeded.
Precondition
Prior to attempting connection, the WINC driver must have been initialized by calling the m2m_wifi_init function.
Warning
This function is handled in station mode only.
Parameters
[in] | enuCredStoreOption | Option to specify whether connection details (i.e. the contents of pstrNetworkId) are stored in WINC's flash and, if so, whether they are encrypted before storing.
[in] | pstrNetworkId | Structure specifying SSID/BSSID and Wi-Fi channel.
Returns
The function returns M2M_SUCCESS if the connect request has been successfully passed to the firmware and a negative value otherwise.
sint8 m2m_wifi_connect_wep | ( | tenuCredStoreOption | enuCredStoreOption,
 |  | tstrNetworkId * | pstrNetworkId,
 |  | tstrAuthWep * | pstrAuthWep
 | ) |  |

Asynchronous API to connect to an access point using WEP authentication.

Asynchronous Wi-Fi connection function. An application calling this function will cause the firmware to attempt to connect to an access point matching the details in pstrNetworkId, with the WEP key provided in pstrAuthWep. On successful connection, the connection details may be saved in WINC's flash, according to the option selected in enuCredStoreOption. Once connection has been attempted (whether successful or otherwise), a response event M2M_WIFI_RESP_CON_STATE_CHANGED will be sent to the callback function tpfAppWifiCb provided during initialization m2m_wifi_init.

Possible results indicated by the response event are:

  • M2M_WIFI_DISCONNECTED if the connection attempt failed.
  • M2M_WIFI_CONNECTED if the connection attempt succeeded.
Precondition
Prior to attempting connection, the WINC driver must have been initialized by calling the m2m_wifi_init function.
Warning
This function is handled in station mode only.
Parameters
[in] | enuCredStoreOption | Option to specify whether connection details (i.e. the contents of pstrNetworkId and pstrAuthWep) are stored in WINC's flash and, if so, whether they are encrypted before storing.
[in] | pstrNetworkId | Structure specifying SSID/BSSID and Wi-Fi channel.
[in] | pstrAuthWep | Structure specifying the WEP key.
Returns
The function returns M2M_SUCCESS if the connect request has been successfully passed to the firmware and a negative value otherwise.
sint8 m2m_wifi_connect_psk | ( | tenuCredStoreOption | enuCredStoreOption,
 |  | tstrNetworkId * | pstrNetworkId,
 |  | tstrAuthPsk * | pstrAuthPsk
 | ) |  |

Asynchronous API to connect to an access point using WPA(2) PSK authentication.

Asynchronous Wi-Fi connection function. An application calling this function will cause the firmware to attempt to connect to an access point matching the details in pstrNetworkId, with the PSK passphrase provided in pstrAuthPsk. On successful connection, the connection details may be saved in WINC's flash, according to the option selected in enuCredStoreOption. Once connection has been attempted (whether successful or otherwise), a response event M2M_WIFI_RESP_CON_STATE_CHANGED will be sent to the callback function tpfAppWifiCb provided during initialization m2m_wifi_init.

Possible results indicated by the response event are:

  • M2M_WIFI_DISCONNECTED if the connection attempt failed.
  • M2M_WIFI_CONNECTED if the connection attempt succeeded.
Precondition
Prior to attempting connection, the WINC driver must have been initialized by calling the m2m_wifi_init function.
Warning
This function is handled in station mode only.
Parameters
[in] | enuCredStoreOption | Option to specify whether connection details (i.e. the contents of pstrNetworkId and pstrAuthPsk) are stored in WINC's flash and, if so, whether they are encrypted before storing.
[in] | pstrNetworkId | Structure specifying SSID/BSSID and Wi-Fi channel.
[in] | pstrAuthPsk | Structure specifying the Passphrase/PSK.
Returns
The function returns M2M_SUCCESS if the connect request has been successfully passed to the firmware and a negative value otherwise.
sint8 m2m_wifi_1x_set_option | ( | tenu1xOption | enuOptionName,
 |  | const void * | pOptionValue,
 |  | size_t | OptionLen
 | ) |  |

API to set (write) options relating to Wi-Fi connection using WPA(2) Enterprise authentication.

The following options can be set:
WIFI_1X_BYPASS_SERVER_AUTH
WIFI_1X_SESSION_CACHING
WIFI_1X_SPECIFIC_ROOTCERT
WIFI_1X_TIME_VERIF_MODE
The setting applies to all subsequent connection attempts via m2m_wifi_connect_1x_mschap2 or m2m_wifi_connect_1x_tls
Connection attempts via m2m_wifi_default_connect use the settings which were in place at the time of the original connection.

Parameters
[in] | enuOptionName | The option to set.
[in] | pOptionValue | Pointer to a buffer containing the value to set. The buffer must be at least as long as OptionLen. If OptionLen is 0, then pOptionValue may be NULL.
[in] | OptionLen | The length of the option value being set.
Returns
The function returns M2M_SUCCESS if the parameters are valid and M2M_ERR_INVALID_ARG otherwise.
sint8 m2m_wifi_1x_get_option | ( | tenu1xOption | enuOptionName,
 |  | void * | pOptionValue,
 |  | size_t * | pOptionLen
 | ) |  |

API to get (read) options relating to Wi-Fi connection using WPA(2) Enterprise authentication.

The following options can be read:
WIFI_1X_BYPASS_SERVER_AUTH
WIFI_1X_SESSION_CACHING
WIFI_1X_SPECIFIC_ROOTCERT
WIFI_1X_TIME_VERIF_MODE

Parameters
[in] | enuOptionName | The option to get.
[out] | pOptionValue | Pointer to a buffer to contain the value to get. The buffer must be at least as long as the value pointed to by pOptionLen.
[in,out] | pOptionLen | Pointer to a length. When calling the function, this length must be the length of the buffer available for reading the option value. When the function returns, this length is the length of the data that has been populated by the function.
Returns
The function returns M2M_SUCCESS if the parameters are valid and M2M_ERR_INVALID_ARG otherwise.
sint8 m2m_wifi_connect_1x_mschap2 | ( | tenuCredStoreOption | enuCredStoreOption,
 |  | tstrNetworkId * | pstrNetworkId,
 |  | tstrAuth1xMschap2 * | pstrAuth1xMschap2
 | ) |  |

Asynchronous API to connect to an access point using WPA(2) Enterprise authentication with MS-CHAP-V2 credentials.

Asynchronous Wi-Fi connection function. An application calling this function will cause the firmware to attempt to connect to an access point matching the details in pstrNetworkId, with the Enterprise MS-CHAP-V2 credentials provided in pstrAuth1xMschap2. On successful connection, the connection details may be saved in WINC's flash, according to the option selected in enuCredStoreOption. Once connection has been attempted (whether successful or otherwise), a response event M2M_WIFI_RESP_CON_STATE_CHANGED will be sent to the callback function tpfAppWifiCb provided during initialization m2m_wifi_init.

Possible results indicated by the response event are:

  • M2M_WIFI_DISCONNECTED if the connection attempt failed.
  • M2M_WIFI_CONNECTED if the connection attempt succeeded.
Precondition
Prior to attempting connection, the WINC driver must have been initialized by calling the m2m_wifi_init function.
Warning
This function is handled in station mode only.
Parameters
[in] | enuCredStoreOption | Option to specify whether connection details (i.e. the contents of pstrNetworkId and pstrAuth1xMschap2) are stored in WINC's flash and, if so, whether they are encrypted before storing.
[in] | pstrNetworkId | Structure specifying SSID/BSSID and Wi-Fi channel.
[in] | pstrAuth1xMschap2 | Structure specifying the MS-CHAP-V2 credentials.
Returns
The function returns M2M_SUCCESS if the connect request has been successfully passed to the firmware and a negative value otherwise.
sint8 m2m_wifi_connect_1x_tls | ( | tenuCredStoreOption | enuCredStoreOption,
 |  | tstrNetworkId * | pstrNetworkId,
 |  | tstrAuth1xTls * | pstrAuth1xTls
 | ) |  |

Asynchronous API to connect to an access point using WPA(2) Enterprise authentication with MS-CHAP-V2 credentials.

Asynchronous Wi-Fi connection function. An application calling this function will cause the firmware to attempt to connect to an access point matching the details in pstrNetworkId, with the Enterprise TLS credentials provided in pstrAuth1xTls. On successful connection, the connection details may be saved in WINC's flash, according to the option selected in enuCredStoreOption. Once connection has been attempted (whether successful or otherwise), a response event M2M_WIFI_RESP_CON_STATE_CHANGED will be sent to the callback function tpfAppWifiCb provided during initialization m2m_wifi_init.

Possible results indicated by the response event are:

  • M2M_WIFI_DISCONNECTED if the connection attempt failed.
  • M2M_WIFI_CONNECTED if the connection attempt succeeded.
Precondition
Prior to attempting connection, the WINC driver must have been initialized by calling the m2m_wifi_init function.
Warning
This function is handled in station mode only.
Parameters
[in] | enuCredStoreOption | Option to specify whether connection details (i.e. the contents of pstrNetworkId and pstrAuth1xTls) are stored in WINC's flash and, if so, whether they are encrypted before storing.
[in] | pstrNetworkId | Structure specifying SSID/BSSID and Wi-Fi channel.
[in] | pstrAuth1xTls | Structure specifying the EAP-TLS credentials.
Returns
The function returns M2M_SUCCESS if the connect request has been successfully passed to the firmware and a negative value otherwise.
NMI_API sint8 m2m_wifi_connect | ( | char * | pcSsid,
 |  | uint8 | u8SsidLen,
 |  | uint8 | u8SecType,
 |  | void * | pvAuthInfo,
 |  | uint16 | u16Ch
 | ) |  |

DEPRECATED in v19.6.1 - Kept only for legacy purposes.
Legacy asynchronous API to request connection to a specified access point.

Prior to a successful connection, the application must define the SSID of the AP, the security type, the authentication information parameters and the channel number to which the connection will be established.

The connection status is known when a response of M2M_WIFI_RESP_CON_STATE_CHANGED is received based on the states defined in tenuM2mConnState, successful connection is defined by M2M_WIFI_CONNECTED

The only difference between this function and m2m_wifi_default_connect, is the set of connection parameters. Connection using this function is expected to be made to a specific AP and to a specified channel.

Parameters
[in] | pcSsid | A buffer holding the SSID corresponding to the requested AP. SSID must not contain '\0'.
[in] | u8SsidLen | Length of the given SSID (not including the NULL termination). A length 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. Its 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. Specifying 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, since this 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.

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.
Warning
If there is a '\0' character within the first u8SsidLen characters, then this function will assume that the input u8SsidLen was incorrect, set length to strlen(pcSsid) and continue.
This function has been deprecated since v19.6.1 and will no longer be supported afterwards. The following should be used instead: m2m_wifi_connect_open m2m_wifi_connect_wep m2m_wifi_connect_psk m2m_wifi_connect_1x_mschap2 m2m_wifi_connect_1x_tls

Additionally:

  • 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.
See also
tstr1xAuthCredentials tstrM2mWifiWepParams
NMI_API sint8 m2m_wifi_connect_sc | ( | char * | pcSsid,
 |  | uint8 | u8SsidLen,
 |  | uint8 | u8SecType,
 |  | void * | pvAuthInfo,
 |  | uint16 | u16Ch,
 |  | uint8 | u8NoSaveCred
 | ) |  |

DEPRECATED in v19.6.1 - Kept only for legacy purposes.
Legacy asynchronous API to request connection to a specific AP with the option to save credentials in Flash.

Prior to a successful connection, the application developers must know the SSID of the AP, the security type, the authentication information parameters and the channel number to which the connection will be established.

The connection status is known when a response of M2M_WIFI_RESP_CON_STATE_CHANGED is received based on the states defined in tenuM2mConnState, successful connection is defined by M2M_WIFI_CONNECTED The only difference between this function and m2m_wifi_connect, is the option to save the access point info (SSID, password...etc) or not. Connection using this function is expected to be made to a specific AP and to a specified channel.

Parameters
[in] | pcSsid | A buffer holding the SSID corresponding to the requested AP. SSID must not contain '\0'.
[in] | u8SsidLen | Length of the given SSID (not including the NULL termination). A length 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 see tenuM2mSecType. 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. Its 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. 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] u8NoSaveCred Option to store the access 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.
Warning
If there is a '\0' character within the first u8SsidLen characters, then this function will assume that the input u8SsidLen was incorrect, set length to strlen(pcSsid) and continue.
This function has been deprecated since v19.6.1 and will no longer be supported afterwards. The following should be used instead: m2m_wifi_connect_open m2m_wifi_connect_wep m2m_wifi_connect_psk m2m_wifi_connect_1x_mschap2 m2m_wifi_connect_1x_tls

Additionally:

  • 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.
See also
tenuM2mSecType tstr1xAuthCredentials tstrM2mWifiWepParams
Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC and a negative value otherwise.
NMI_API sint8 m2m_wifi_disconnect ( void )

Synchronous API to request disconnection from a network.

Request a Wi-Fi disconnect from the currently connected AP. After the disconnect is complete the driver should receive a response of M2M_WIFI_RESP_CON_STATE_CHANGED based on the states defined in tenuM2mConnState, successful disconnection is defined by M2M_WIFI_DISCONNECTED .

Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC and a negative value otherwise.
Precondition
Disconnection request 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_open m2m_wifi_connect_wep m2m_wifi_connect_psk m2m_wifi_connect_1x_mschap2 m2m_wifi_connect_1x_tls m2m_wifi_default_connect
sint8 m2m_wifi_get_connection_info ( void )

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

Asynchronous connection status retrieval function, retrieves the status information of the currently connected AP. The result is passed to the Wi-Fi notification callback through the event M2M_WIFI_RESP_CONN_INFO. Connection information is retrieved from the structure tstrM2MConnInfo.

Connection Information retrieved:

  • Connection Security
  • Connection RSSI
  • Remote MAC address
  • Remote IP address

In case the WINC is operating in station mode, the SSID of the AP is also retrieved.

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 the WINC is operating in AP mode, the SSID field will be returned as a NULL string.
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_RESP_CONN_INFO, tstrM2MConnInfo

Example

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

1 #include "m2m_wifi.h"
2 #include "m2m_types.h"
3
4 void wifi_event_cb(uint8 u8WiFiEvent, void * pvMsg)
5 {
6 switch(u8WiFiEvent)
7 {
8 case M2M_WIFI_RESP_CONN_INFO:
9 {
10 tstrM2MConnInfo *pstrConnInfo = (tstrM2MConnInfo*)pvMsg;
11
12 printf("CONNECTED AP INFO\n");
13 printf("SSID : %s\n",pstrConnInfo->acSSID);
14 printf("SEC TYPE : %d\n",pstrConnInfo->u8SecType);
15 printf("Signal Strength : %d\n", pstrConnInfo->s8RSSI);
16 printf("Local IP Address : %d.%d.%d.%d\n",
17 pstrConnInfo->au8IPAddr[0] , pstrConnInfo->au8IPAddr[1], pstrConnInfo->au8IPAddr[2], pstrConnInfo->au8IPAddr[3]);
18 }
19 break;
20
21 case M2M_WIFI_REQ_DHCP_CONF:
22 {
23 // Get the current AP information.
24 m2m_wifi_get_connection_info();
25 }
26 break;
27 default:
28 break;
29 }
30 }
31
32 int main()
33 {
34 tstrWifiInitParam param;
35
36 param.pfAppWifiCb = wifi_event_cb;
37 if(!m2m_wifi_init(&param))
38 {
39 // connect to the default AP
40 m2m_wifi_default_connect();
41
42 while(1)
43 {
44 m2m_wifi_handle_events(NULL);
45 }
46 }
47 }
NMI_API sint8 m2m_wifi_set_static_ip ( tstrM2MIPConfig * pstrStaticIPConf )

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

Assign a static IP address to the WINC board. This function assigns a static IP address in case the AP doesn't have a DHCP server or in case the application wants to assign a predefined known IP address. The user must keep in mind that assigning a static IP address might result in an IP address conflict. In case of an IP address conflict observed by the WINC board the user will get a response of M2M_WIFI_RESP_IP_CONFLICT in the wifi callback. The application is then responsible to either solve the conflict or assign another IP address.

Precondition
The application must disable auto DHCP using m2m_wifi_enable_dhcp before assigning a static IP address.
Warning
Normally this function should not be used. DHCP configuration is requested automatically after successful Wi-Fi connection is established.
Parameters
[in] pstrStaticIPConf Pointer to a structure holding the static IP configuration (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.
See also
tstrM2MIPConfig
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.

Warning
This function has been deprecated. DHCP is used automatically when the WINC IC connects.
Returns
This function always returns M2M_SUCCESS.
NMI_API sint8 m2m_wifi_request_dhcp_server ( uint8 * addr )

Dhcp requested by the firmware automatically in STA/AP mode).

Warning
This function is legacy and exists only for compatibility with older applications. DHCP server is started automatically when enabling the AP mode.
Returns
This function always returns M2M_SUCCESS.
NMI_API sint8 m2m_wifi_enable_dhcp ( uint8 u8DhcpEn )

Enable/Disable the DHCP client after connection.

Synchronous Wi-Fi DHCP enable function. This function will Enable/Disable the DHCP protocol.

Parameters
[in] u8DhcpEn The state of the DHCP client feature after successful association with an access point:
  • 1: Enables DHCP client after connection.
  • 0: Disables DHCP client after connection.
Returns
The function SHALL return M2M_SUCCESS for successful operation and a negative value otherwise.
Warning
DHCP client is enabled by default. This Function should be called before using m2m_wifi_set_static_ip
See also
m2m_wifi_set_static_ip
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.

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

Example

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

1 #include "m2m_wifi.h"
2 #include "m2m_types.h"
3
4 void wifi_event_cb(uint8 u8WiFiEvent, void * pvMsg)
5 {
6 static uint8 u8ScanResultIdx = 0;
7
8 switch(u8WiFiEvent)
9 {
10 case M2M_WIFI_RESP_CURRENT_RSSI:
11 {
12 sint8 *rssi = (sint8*)pvMsg;
13 M2M_INFO("ch rssi %d\n",*rssi);
14 }
15 break;
16 default:
17 break;
18 }
19 }
20
21 int main()
22 {
23 tstrWifiInitParam param;
24
25 param.pfAppWifiCb = wifi_event_cb;
26 if(!m2m_wifi_init(&param))
27 {
28 // Scan all channels
29 m2m_wifi_req_curr_rssi();
30
31 while(1)
32 {
33 m2m_wifi_handle_events(NULL);
34 }
35 }
36 }
Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Scanning

Functions
Scanning
WLAN » Functions

Functions

NMI_API sint8 | m2m_wifi_set_scan_options (tstrM2MScanOption *ptstrM2MScanOption)
NMI_API sint8 | m2m_wifi_set_stop_scan_on_first (uint8 u8StopScanOption)
NMI_API sint8 | m2m_wifi_set_scan_region (uint16 ScanRegion)
NMI_API sint8 | m2m_wifi_request_scan (uint8 ch)
NMI_API sint8 | m2m_wifi_request_scan_passive (uint8 ch, uint16 scan_time)
NMI_API sint8 | m2m_wifi_request_scan_ssid_list (uint8 ch, uint8 *u8Ssidlist)
NMI_API uint8 | m2m_wifi_get_num_ap_found (void)
NMI_API sint8 | m2m_wifi_req_scan_result (uint8 index)

Detailed Description

Here are listed all the functions that implement the Wifi Scanning APIs.

Function Documentation

sint8 m2m_wifi_set_scan_options ( tstrM2MScanOption * ptstrM2MScanOption )

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

This function sets the configuration parameters for the scan operation.

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
sint8 m2m_wifi_set_stop_scan_on_first ( uint8 u8StopScanOption )

Synchronous API for enabling/disabling the stop scan on first result of the WINC IC's network scanning functions.

Allows for enabling/disabling of stop scan on first result. When enabled, the WINC will stop the scan as soon as it detects a network and return the results to the host. Setting is persistent and will need to be explicitly reverted back by the application if it no longer wishes for it to be enabled.

Parameters
[in] u8StopScanOption; Setting for enabling or disabling Stopping Scan on first result. 1 = Enabled, 0 = Disabled (Default)
Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC and a negative value otherwise.
See also
tenuM2mScanCh tstrM2MScanOption tstrM2MStopScanOption m2m_wifi_request_scan m2m_wifi_set_scan_options
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.

For 2.4GHz, supported in the current release, the requested scan region can't exceed the maximum number of channels (14).

Parameters
[in] ScanRegion ASIA NORTH_AMERICA
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
NMI_API sint8 m2m_wifi_request_scan ( uint8 ch )

Asynchronous API to request the WINC IC to 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.
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.
Warning
This API is valid only for STA mode, it may be called regardless of connection state (connected or disconnected states).
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.

1 #include "m2m_wifi.h"
2 #include "m2m_types.h"
3
4 void wifi_event_cb(uint8 u8WiFiEvent, void * pvMsg)
5 {
6 static uint8 u8ScanResultIdx = 0;
7
8 switch(u8WiFiEvent)
9 {
10 case M2M_WIFI_RESP_SCAN_DONE:
11 {
12 tstrM2mScanDone *pstrInfo = (tstrM2mScanDone*)pvMsg;
13
14 printf("Num of AP found %d\n",pstrInfo->u8NumofCh);
15 if(pstrInfo->s8ScanState == M2M_SUCCESS)
16 {
17 u8ScanResultIdx = 0;
18 if(pstrInfo->u8NumofCh >= 1)
19 {
20 m2m_wifi_req_scan_result(u8ScanResultIdx);
21 u8ScanResultIdx ++;
22 }
23 else
24 {
25 printf("No AP Found Rescan\n");
26 m2m_wifi_request_scan(M2M_WIFI_CH_ALL);
27 }
28 }
29 else
30 {
31 printf("(ERR) Scan fail with error <%d>\n",pstrInfo->s8ScanState);
32 }
33 }
34 break;
35
36 case M2M_WIFI_RESP_SCAN_RESULT:
37 {
38 tstrM2mWifiscanResult *pstrScanResult = (tstrM2mWifiscanResult*)pvMsg;
39 uint8 u8NumFoundAPs = m2m_wifi_get_num_ap_found();
40
41 printf(">>%02d RI %d SEC %s CH %02d BSSID %02X:%02X:%02X:%02X:%02X:%02X SSID %s\n",
42 pstrScanResult->u8index,pstrScanResult->s8rssi,
43 pstrScanResult->u8AuthType,
44 pstrScanResult->u8ch,
45 pstrScanResult->au8BSSID[0], pstrScanResult->au8BSSID[1], pstrScanResult->au8BSSID[2],
46 pstrScanResult->au8BSSID[3], pstrScanResult->au8BSSID[4], pstrScanResult->au8BSSID[5],
47 pstrScanResult->au8SSID);
48
49 if(u8ScanResultIdx < u8NumFoundAPs)
50 {
51 // Read the next scan result
52 m2m_wifi_req_scan_result(index);
53 u8ScanResultIdx ++;
54 }
55 }
56 break;
57 default:
58 break;
59 }
60 }
61
62 int main()
63 {
64 tstrWifiInitParam param;
65
66 param.pfAppWifiCb = wifi_event_cb;
67 if(!m2m_wifi_init(&param))
68 {
69 // Scan all channels
70 m2m_wifi_request_scan(M2M_WIFI_CH_ALL);
71
72 while(1)
73 {
74 m2m_wifi_handle_events(NULL);
75 }
76 }
77 }
NMI_API sint8 m2m_wifi_request_scan_passive | ( | uint8 | ch,
 |  | uint16 | scan_time
 | ) |  |

Similar to m2m_wifi_request_scan but performs passive scanning instead of active scanning.

Parameters
[in] | ch | RF Channel ID for SCAN operation. It should be set according to tenuM2mScanCh. With a value of M2M_WIFI_CH_ALL, means to scan all channels.
[in] | scan_time | The time in ms that passive scan is listening for beacons on each channel per one slot, enter 0 for default setting.
Warning
This function is not allowed in AP mode. 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_RESP_SCAN_DONE M2M_WIFI_RESP_SCAN_RESULT tpfAppWifiCb tstrM2mWifiscanResult tenuM2mScanCh m2m_wifi_init m2m_wifi_request_scan m2m_wifi_handle_events m2m_wifi_req_scan_result
Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise.
NMI_API sint8 m2m_wifi_request_scan_ssid_list | ( | uint8 | ch,
 |  | uint8 * | u8SsidList
 | ) |  |

Asynchronous wi-fi scan request on the given channel and the hidden scan list.

The scan status is delivered in the wi-fi event callback and then the application is to read the scan results sequentially. The number of APs found (N) is returned in event M2M_WIFI_RESP_SCAN_DONE with the number of found APs. The application could read the list of APs by calling the function m2m_wifi_req_scan_result N times.

Parameters
[in] | ch | RF Channel ID for SCAN operation. It should be set according to tenuM2mScanCh. With a value of M2M_WIFI_CH_ALL, means to scan all channels.
[in] | u8SsidList | u8SsidList is a buffer containing a list of hidden SSIDs to include during the scan. The first byte in the buffer, u8SsidList[0], is the number of SSIDs encoded in the string. The number of hidden SSIDs cannot exceed MAX_HIDDEN_SITES. All SSIDs are concatenated in the following bytes and each SSID is prefixed with a one-byte header containing its length. The total number of bytes in u8SsidList buffer, including length byte, cannot exceed 133 bytes (MAX_HIDDEN_SITES SSIDs x 32 bytes each, which is max SSID length). For instance, encoding the two hidden SSIDs "DEMO_AP" and "TEST" results in the following buffer content:
1 uint8 u8SsidList[14];
2 u8SsidList[0] = 2; // Number of SSIDs is 2
3 u8SsidList[1] = 7; // Length of the string "DEMO_AP" without NULL termination
4 memcpy(&u8SsidList[2], "DEMO_AP", 7); // Bytes index 2-9 containing the string DEMO_AP
5 u8SsidList[9] = 4; // Length of the string "TEST" without NULL termination
6 memcpy(&u8SsidList[10], "TEST", 4); // Bytes index 10-13 containing the string TEST
Note
It works with STA/AP mode (connected or disconnected).
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_RESP_SCAN_DONE M2M_WIFI_RESP_SCAN_RESULT tpfAppWifiCb 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.

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.

1 #include "m2m_wifi.h"
2 #include "m2m_types.h"
3
4 static void request_scan_hidden_demo_ap(void);
5
6 void wifi_event_cb(uint8 u8WiFiEvent, void * pvMsg)
7 {
8 static uint8 u8ScanResultIdx = 0;
9
10 switch(u8WiFiEvent)
11 {
12 case M2M_WIFI_RESP_SCAN_DONE:
13 {
14 tstrM2mScanDone *pstrInfo = (tstrM2mScanDone*)pvMsg;
15
16 printf("Num of AP found %d\n",pstrInfo->u8NumofCh);
17 if(pstrInfo->s8ScanState == M2M_SUCCESS)
18 {
19 u8ScanResultIdx = 0;
20 if(pstrInfo->u8NumofCh >= 1)
21 {
22 m2m_wifi_req_scan_result(u8ScanResultIdx);
23 u8ScanResultIdx ++;
24 }
25 else
26 {
27 printf("No AP Found Rescan\n");
28 request_scan_hidden_demo_ap();
29 }
30 }
31 else
32 {
33 printf("(ERR) Scan fail with error <%d>\n",pstrInfo->s8ScanState);
34 }
35 }
36 break;
37 case M2M_WIFI_RESP_SCAN_RESULT:
38 {
39 tstrM2mWifiscanResult *pstrScanResult =(tstrM2mWifiscanResult*)pvMsg;
40 uint8 u8NumFoundAPs = m2m_wifi_get_num_ap_found();
41
42 printf(">>%02d RI %d SEC %s CH %02d BSSID %02X:%02X:%02X:%02X:%02X:%02X SSID %s\n",
43 pstrScanResult->u8index,pstrScanResult->s8rssi,
44 pstrScanResult->u8AuthType,
45 pstrScanResult->u8ch,
46 pstrScanResult->au8BSSID[0], pstrScanResult->au8BSSID[1], pstrScanResult->au8BSSID[2],
47 pstrScanResult->au8BSSID[3], pstrScanResult->au8BSSID[4], pstrScanResult->au8BSSID[5],
48 pstrScanResult->au8SSID);
49
50 if(u8ScanResultIdx < u8NumFoundAPs)
51 {
52 // Read the next scan result
53 m2m_wifi_req_scan_result(index);
54 u8ScanResultIdx ++;
55 }
56 }
57 break;
58 default:
59 break;
60 }
61 }
62
63 static void request_scan_hidden_demo_ap(void)
64 {
65 uint8 list[9];
66 char ssid[] = "DEMO_AP";
67 uint8 len = (uint8)(sizeof(ssid)-1);
68
69 list[0] = 1;
70 list[1] = len;
71 memcpy(&list[2], ssid, len); // copy 7 bytes
72 // Scan all channels
73 m2m_wifi_request_scan_ssid_list(M2M_WIFI_CH_ALL, list);
74 }
75
76
77 int main()
78 {
79 tstrWifiInitParam param;
80
81 param.pfAppWifiCb = wifi_event_cb;
82 if(!m2m_wifi_init(&param))
83 {
84 request_scan_hidden_demo_ap();
85 while(1)
86 {
87 m2m_wifi_handle_events(NULL);
88 }
89 }
90 }
NMI_API uint8 m2m_wifi_get_num_ap_found ( void )

Synchronous function to retrieve the number of AP's found during the last scan operation.

The function reads the number of APs from global variable which was updated in the Wi-Fi callback function through the M2M_WIFI_RESP_SCAN_DONE event. Function used only in STA mode only.

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.
  • 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_RESP_SCAN_DONE must be handled in the callback to receive the requested scan information.
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 will result in undefined/outdated numbers.
Returns
Returns the number of AP's found in the last Scan Request.

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.

1 #include "m2m_wifi.h"
2 #include "m2m_types.h"
3
4 void wifi_event_cb(uint8 u8WiFiEvent, void * pvMsg)
5 {
6 static uint8 u8ScanResultIdx = 0;
7
8 switch(u8WiFiEvent)
9 {
10 case M2M_WIFI_RESP_SCAN_DONE:
11 {
12 tstrM2mScanDone *pstrInfo = (tstrM2mScanDone*)pvMsg;
13
14 printf("Num of AP found %d\n",pstrInfo->u8NumofCh);
15 if(pstrInfo->s8ScanState == M2M_SUCCESS)
16 {
17 u8ScanResultIdx = 0;
18 if(pstrInfo->u8NumofCh >= 1)
19 {
20 m2m_wifi_req_scan_result(u8ScanResultIdx);
21 u8ScanResultIdx ++;
22 }
23 else
24 {
25 printf("No AP Found Rescan\n");
26 m2m_wifi_request_scan(M2M_WIFI_CH_ALL);
27 }
28 }
29 else
30 {
31 printf("(ERR) Scan fail with error <%d>\n",pstrInfo->s8ScanState);
32 }
33 }
34 break;
35
36 case M2M_WIFI_RESP_SCAN_RESULT:
37 {
38 tstrM2mWifiscanResult *pstrScanResult =(tstrM2mWifiscanResult*)pvMsg;
39 uint8 u8NumFoundAPs = m2m_wifi_get_num_ap_found();
40
41 printf(">>%02d RI %d SEC %s CH %02d BSSID %02X:%02X:%02X:%02X:%02X:%02X SSID %s\n",
42 pstrScanResult->u8index,pstrScanResult->s8rssi,
43 pstrScanResult->u8AuthType,
44 pstrScanResult->u8ch,
45 pstrScanResult->au8BSSID[0], pstrScanResult->au8BSSID[1], pstrScanResult->au8BSSID[2],
46 pstrScanResult->au8BSSID[3], pstrScanResult->au8BSSID[4], pstrScanResult->au8BSSID[5],
47 pstrScanResult->au8SSID);
48
49 if(u8ScanResultIdx < u8NumFoundAPs)
50 {
51 // Read the next scan result
52 m2m_wifi_req_scan_result(index);
53 u8ScanResultIdx ++;
54 }
55 }
56 break;
57 default:
58 break;
59 }
60 }
61
62 int main()
63 {
64 tstrWifiInitParam param;
65
66 param.pfAppWifiCb = wifi_event_cb;
67 if(!m2m_wifi_init(&param))
68 {
69 // Scan all channels
70 m2m_wifi_request_scan(M2M_WIFI_CH_ALL);
71
72 while(1)
73 {
74 m2m_wifi_handle_events(NULL);
75 }
76 }
77 }
NMI_API sint8 m2m_wifi_req_scan_result ( uint8 index )

Synchronous call to read the AP information from the SCAN Result list.

Synchronous call to read the AP information from the SCAN Result list with the given index. This function is expected to be called when the response events M2M_WIFI_RESP_SCAN_RESULT or M2M_WIFI_RESP_SCAN_DONE are received in the wi-fi callback function. The response information received can be obtained through the casting to the tstrM2mWifiscanResult structure.

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 needs to be called first, then m2m_wifi_get_num_ap_found to get the number of AP's found.
  • 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 function.
  • The event M2M_WIFI_RESP_SCAN_RESULT must be handled in the callback to receive the requested scan information.
Warning
  • Function used in STA mode only. the scan results are updated only if the scan request is called.
  • Calling this function only without a scan request will lead to firmware errors.
  • Application code should refrain from introducing a large delay between the scan request and the scan result request, to prevent errors occurring.

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.

1 #include "m2m_wifi.h"
2 #include "m2m_types.h"
3
4 void wifi_event_cb(uint8 u8WiFiEvent, void * pvMsg)
5 {
6 static uint8 u8ScanResultIdx = 0;
7
8 switch(u8WiFiEvent)
9 {
10 case M2M_WIFI_RESP_SCAN_DONE:
11 {
12 tstrM2mScanDone *pstrInfo = (tstrM2mScanDone*)pvMsg;
13
14 printf("Num of AP found %d\n",pstrInfo->u8NumofCh);
15 if(pstrInfo->s8ScanState == M2M_SUCCESS)
16 {
17 u8ScanResultIdx = 0;
18 if(pstrInfo->u8NumofCh >= 1)
19 {
20 m2m_wifi_req_scan_result(u8ScanResultIdx);
21 u8ScanResultIdx ++;
22 }
23 else
24 {
25 printf("No AP Found Rescan\n");
26 m2m_wifi_request_scan(M2M_WIFI_CH_ALL);
27 }
28 }
29 else
30 {
31 printf("(ERR) Scan fail with error <%d>\n",pstrInfo->s8ScanState);
32 }
33 }
34 break;
35
36 case M2M_WIFI_RESP_SCAN_RESULT:
37 {
38 tstrM2mWifiscanResult *pstrScanResult =(tstrM2mWifiscanResult*)pvMsg;
39 uint8 u8NumFoundAPs = m2m_wifi_get_num_ap_found();
40
41 printf(">>%02d RI %d SEC %s CH %02d BSSID %02X:%02X:%02X:%02X:%02X:%02X SSID %s\n",
42 pstrScanResult->u8index,pstrScanResult->s8rssi,
43 pstrScanResult->u8AuthType,
44 pstrScanResult->u8ch,
45 pstrScanResult->au8BSSID[0], pstrScanResult->au8BSSID[1], pstrScanResult->au8BSSID[2],
46 pstrScanResult->au8BSSID[3], pstrScanResult->au8BSSID[4], pstrScanResult->au8BSSID[5],
47 pstrScanResult->au8SSID);
48
49 if(u8ScanResultIdx < u8NumFoundAPs)
50 {
51 // Read the next scan result
52 m2m_wifi_req_scan_result(index);
53 u8ScanResultIdx ++;
54 }
55 }
56 break;
57 default:
58 break;
59 }
60 }
61
62 int main()
63 {
64 tstrWifiInitParam param;
65
66 param.pfAppWifiCb = wifi_event_cb;
67 if(!m2m_wifi_init(&param))
68 {
69 // Scan all channels
70 m2m_wifi_request_scan(M2M_WIFI_CH_ALL);
71
72 while(1)
73 {
74 m2m_wifi_handle_events(NULL);
75 }
76 }
77 }
Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Hot-Spot (Access-Point)

Functions
Hot-Spot (Access-Point)
WLAN » Functions

Functions

NMI_API sint8 | m2m_wifi_enable_ap (CONST tstrM2MAPConfig *pstrM2MAPConfig)
NMI_API sint8 | m2m_wifi_enable_ap_ext (CONST tstrM2MAPModeConfig *pstrM2MAPModeConfig)
NMI_API sint8 | m2m_wifi_disable_ap (void)

Detailed Description

Here are listed all the functions that implement the Wifi Hot-Spot (Access-Point) APIs.

Function Documentation

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 following limitations:

  • Only 1 station may be associated at any given 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.
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.
Warning
This function is not allowed in STA mode.
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.

1 #include "m2m_wifi.h"
2 #include "m2m_types.h"
3
4 void wifi_event_cb(uint8 u8WiFiEvent, void * pvMsg)
5 {
6 switch(u8WiFiEvent)
7 {
8 case M2M_WIFI_REQ_DHCP_CONF:
9 {
10 uint8 *pu8IPAddress = (uint8*)pvMsg;
11
12 printf("Associated STA has IP Address \"%u.%u.%u.%u\"\n",pu8IPAddress[0],pu8IPAddress[1],pu8IPAddress[2],pu8IPAddress[3]);
13 }
14 break;
15
16 default:
17 break;
18 }
19 }
20
21 int main()
22 {
23 tstrWifiInitParam param;
24
25 param.pfAppWifiCb = wifi_event_cb;
26 if(!m2m_wifi_init(&param))
27 {
28 tstrM2MAPConfig apConfig;
29
30 strcpy(apConfig.au8SSID, "WINC_SSID");
31 apConfig.u8ListenChannel = 1;
32 apConfig.u8SecType = M2M_WIFI_SEC_OPEN;
33 apConfig.u8SsidHide = 0;
34
35 // IP Address
36 apConfig.au8DHCPServerIP[0] = 192;
37 apConfig.au8DHCPServerIP[1] = 168;
38 apConfig.au8DHCPServerIP[2] = 1;
39 apConfig.au8DHCPServerIP[3] = 1;
40
41 // Trigger AP
42 m2m_wifi_enable_ap(&apConfig);
43
44 while(1)
45 {
46 m2m_wifi_handle_events(NULL);
47 }
48 }
49 }
NMI_API sint8 m2m_wifi_enable_ap_ext ( CONST tstrM2MAPModeConfig * pstrM2MAPModeConfig )

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

The WINC IC supports the ability to operate as an access point with the following limitations:

  • Only 1 station may be associated at any given time.
  • Open system and WEP are the only security suites supported.
Parameters
[in] pstrM2MAPModeConfig 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.
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.
Warning
This function is not allowed in STA mode.
See also
tpfAppWifiCb tenuM2mSecType m2m_wifi_init M2M_WIFI_REQ_DHCP_CONF tstrM2mWifiStateChanged tstrM2MAPModeConfig tstrM2MAPConfigExt

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.

1 #include "m2m_wifi.h"
2 #include "m2m_types.h"
3
4 void wifi_event_cb(uint8 u8WiFiEvent, void * pvMsg)
5 {
6 switch(u8WiFiEvent)
7 {
8 case M2M_WIFI_REQ_DHCP_CONF:
9 {
10 uint8 *pu8IPAddress = (uint8*)pvMsg;
11
12 printf("Associated STA has IP Address \"%u.%u.%u.%u\"\n",pu8IPAddress[0],pu8IPAddress[1],pu8IPAddress[2],pu8IPAddress[3]);
13 }
14 break;
15
16 default:
17 break;
18 }
19 }
20
21 int main()
22 {
23 tstrWifiInitParam param;
24
25 param.pfAppWifiCb = wifi_event_cb;
26 if(!m2m_wifi_init(&param))
27 {
28 tstrM2MAPModeConfig apModeConfig;
29
30 strcpy(apConfig.strApConfig.au8SSID, "WINC_SSID");
31 apModeConfig.strApConfig.u8ListenChannel = 1;
32 apModeConfig.strApConfig.u8SecType = M2M_WIFI_SEC_OPEN;
33 apModeConfig.strApConfig.u8SsidHide = 0;
34
35 // IP Address
36 apModeConfig.strApConfig.au8DHCPServerIP[0] = 192;
37 apModeConfig.strApConfig.au8DHCPServerIP[1] = 168;
38 apModeConfig.strApConfig.au8DHCPServerIP[2] = 1;
39 apModeConfig.strApConfig.au8DHCPServerIP[3] = 1;
40
41 // Default router IP
42 m2m_memcpy(apModeConfig.strApConfigExt.au8DefRouterIP, apModeConfig.strApConfig.au8DHCPServerIP, 4);
43
44 // DNS Server IP
45 m2m_memcpy(apModeConfig.strApConfigExt.au8DNSServerIP, apModeConfig.strApConfig.au8DHCPServerIP, 4);
46
47 // Subnet mask
48 apModeConfig.strApConfigExt.au8SubnetMask[0] = 255;
49 apModeConfig.strApConfigExt.au8SubnetMask[1] = 255;
50 apModeConfig.strApConfigExt.au8SubnetMask[2] = 255;
51 apModeConfig.strApConfigExt.au8SubnetMask[3] = 0;
52
53 // Trigger AP
54 m2m_wifi_enable_ap_ext(&apModeConfig);
55
56 while(1)
57 {
58 m2m_wifi_handle_events(NULL);
59 }
60 }
61 }
NMI_API sint8 m2m_wifi_disable_ap ( void )

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

Must be called only when the AP is enabled through the m2m_wifi_enable_ap function. Otherwise the call to this function will not be useful.

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
Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Bypass Mode

Functions
Bypass Mode
WLAN » Functions

Functions

NMI_API sint8 | m2m_wifi_send_ethernet_pkt (uint8 *pu8Packet, uint16 u16PacketSize)
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

Here are listed all the functions that implement the Bypass Mode APIs.

Function Documentation

NMI_API sint8 m2m_wifi_send_ethernet_pkt | ( | uint8 * | pu8Packet,
 |  | uint16 | u16PacketSize
 | ) |  |

Synchronous function to transmit an Ethernet packet.

Transmit a packet directly in ETHERNET/bypass mode where the TCP/IP stack is disabled and the implementation of this packet is left to the application developer. The Ethernet packet composition is left to the application developer.

Note
Packets are the user's responsibility.
Warning
This function available in ETHERNET/Bypass mode ONLY. Make sure that application defines ETH_MODE.
Parameters
[in] | pu8Packet | Pointer to a buffer holding the whole Ethernet frame.
[in] | u16PacketSize | The size of the whole packet in bytes.
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_mac_mcast m2m_wifi_set_receive_buffer
NMI_API sint8 m2m_wifi_enable_mac_mcast | ( | uint8 * | pu8MulticastMacAddress,
 |  | uint8 | u8AddRemove
 | ) |  |

Synchronous function for filtering received MAC addresses.

Synchronous function for filtering received MAC addresses from certain MAC address groups. This function allows the addition/removal of certain MAC addresses, used in the multicast filter.

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
Note
Maximum number of MAC addresses that could be added is 8.
Warning
This function is available in ETHERNET/bypass mode ONLY. Make sure that the application defines ETH_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_set_receive_buffer m2m_wifi_send_ethernet_pkt
NMI_API sint8 m2m_wifi_set_receive_buffer | ( | void * | pvBuffer,
 |  | uint16 | u16BufferLen
 | ) |  |

Synchronous function for setting or modifying the receiver buffer's length.

Synchronous function for setting or modifying the receiver buffer's length. In the ETHERNET/bypass mode the application should define a callback of type tpfAppEthCb, through which the application handles the received ethernet frames. It is through this callback function that the user can dynamically modify the length of the currently used receiver buffer.

Parameters
[in] | pvBuffer | Pointer to Buffer to receive data. 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
Warning
This function is available in the Ethernet/bypass mode ONLY. Make sure that the application defines ETH_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_mac_mcast m2m_wifi_send_ethernet_pkt
Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Roaming

Functions
Roaming
WLAN » Functions

Functions

sint8 | m2m_wifi_enable_roaming (uint8 bEnableDhcp)
sint8 | m2m_wifi_disable_roaming (void)

Detailed Description

Here are listed all the functions that implement the Wifi Roaming APIs.

Function Documentation

sint8 m2m_wifi_enable_roaming ( uint8 bEnableDhcp )

Enable WiFi STA roaming.

m2m_wifi_enable_roaming enables the firmware to trigger the roaming algorithm/steps on link loss with the current AP. If roaming is successful, the M2M_WIFI_RESP_CON_STATE_CHANGED message with state as M2M_WIFI_ROAMED is sent to host. Additionally a M2M_WIFI_REQ_DHCP_CONF message with new DHCP lease details is sent to host (only if bEnableDhcp=1). If roaming is unsuccessful, M2M_WIFI_RESP_CON_STATE_CHANGED message with state as M2M_WIFI_DISCONNECTED is sent to host.

Parameters
[in] bEnableDhcp 0 : Disables DHCP client execution after roaming to new AP 1 : Enables DHCP client execution after roaming to new AP
Precondition
Must be called after the initialization. The roaming algorithm/procedure is internal to the firmware.
Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise.
See also
m2m_wifi_init
sint8 m2m_wifi_disable_roaming ( void )

Disable WiFi STA roaming.

Precondition
Must be called after the initialization.
Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise.
See also
m2m_wifi_init
Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Power Save

Functions
Power Save
WLAN » Functions

Functions

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_lsn_int (tstrM2mLsnInt *pstrM2mLsnInt)
sint8 | m2m_wifi_set_power_profile (uint8 u8PwrMode)
sint8 | m2m_wifi_enable_XO_during_sleep (uint8 bXOSleepEnable)

Detailed Description

Here are listed all the functions that implement the Power-Save APIs.

Function Documentation

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

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

This is one of the two synchronous power-save setting functions that allow the host MCU application to tweak the system power consumption. Such tweaking can be done through one of two ways:

  • 1) Changing the power save mode, to one of the allowed power save modes (see tenuPowerSaveModes). This is done by setting the first parameter.
  • 2) Configuring DTIM monitoring: Configuring beacon monitoring parameters by enabling or disabling the reception of broadcast/multicast data. This is done by setting the second parameter.
Parameters
[in] | PsTyp | Desired power saving mode. Supported types are enumerated in tenuPowerSaveModes.
[in] | BcastEn | Broadcast reception enable flag. If it is 1, the WINC will be awake for each DTIM beacon in order to check for and receive broadcast traffic. If it is 0, the WINC will ignore broadcast traffic. Through this flag the WINC will not wakeup at the DTIM beacon, but instead it will wakeup only based on the configured Listen Interval.
Warning
The function called once after initialization.
Returns
The function returns M2M_SUCCESS for successful operation and a negative value otherwise.
See also
tenuPowerSaveModes m2m_wifi_get_sleep_mode m2m_wifi_set_lsn_int
NMI_API sint8 m2m_wifi_request_sleep ( uint32 u32SlpReqTime )

API to place the WINC IC into sleep mode for a specified period of time.

Synchronous power-save sleep request function, which requests the WINC device to sleep in the currently configured power save mode, as set using m2m_wifi_set_sleep_mode, for a specific time as defined by the passed in parameter. This function should be used in the M2M_PS_MANUAL power save mode only. A wake up request is automatically performed by the WINC device when any host driver API function, e.g. Wi-Fi or socket operation is called.

Parameters
[in] u32SlpReqTime Request sleep time in ms.
The best recommended sleep duration is left to be determined by the application. Taking into account that if the application sends notifications very rarely, sleeping for a long time can be a power-efficient decision. In contrast, applications that are sensitive for long periods of absence can experience performance degradation in the connection if long sleeping times are used.
Returns
The function returns M2M_SUCCESS for successful operation and a negative value otherwise.
Warning
The function should be called in M2M_PS_MANUAL power save mode only. As enumerated in tenuPowerSaveModes. It's also important to note that during the sleeping time while in the M2M_PS_MANUAL mode, AP beacon monitoring is bypassed and the wifi-connection may drop if the sleep period is elongated.
See also
tenuPowerSaveModes m2m_wifi_set_sleep_mode
NMI_API uint8 m2m_wifi_get_sleep_mode ( void )

Synchronous power save mode retrieval function.

Returns
The current operating power saving mode based on the enumerated sleep modes tenuPowerSaveModes.
See also
tenuPowerSaveModes m2m_wifi_set_sleep_mode
NMI_API sint8 m2m_wifi_set_lsn_int ( tstrM2mLsnInt * pstrM2mLsnInt )

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

This is one of the two synchronous power-save setting functions that allow the host MCU application to tweak the system power consumption. Such tweaking can be done by modifying the Wi-Fi listen interval. The listen interval is how many beacon periods the station can sleep before it wakes up to receive data buffered in the AP. It is represented in units of AP beacon periods(100ms).

Warning
The function should be called once after initialization.
Parameters
[in] pstrM2mLsnInt Structure holding the listen interval configuration.
Precondition
The function m2m_wifi_set_sleep_mode shall be called first, to set the power saving mode required.
Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC and a negative value otherwise.
See also
tstrM2mLsnInt m2m_wifi_set_sleep_mode
NMI_API sint8 m2m_wifi_set_power_profile ( uint8 u8PwrMode )

Change the power profile mode.

Parameters
[in] u8PwrMode Change the WINC power profile to different mode based on the enumeration tenuM2mPwrMode.
Warning
May only be called after initialization, before any connection request, and may not be used to change the power mode thereafter.
Returns
The function SHALL return M2M_SUCCESS for success and a negative value otherwise.
See also
tenuM2mPwrMode m2m_wifi_init
sint8 m2m_wifi_enable_XO_during_sleep ( uint8 bXOSleepEnable )

Specifies whether the crystal oscillator is left on or off during deep sleep (defaults to off).

m2m_wifi_enable_XO_during_sleep controls the state of the crystal oscillator during deep sleep.

Parameters
[in] bXOSleepEnable 0 : The XO will be switched off during deep sleep 1 : The XO will be kept on during deep sleep
Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise.
Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Configuration

Functions
Configuration
WLAN » Functions

Functions

NMI_API sint8 | m2m_wifi_set_mac_address (uint8 au8MacAddress[6])
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_device_name (uint8 *pu8DeviceName, uint8 u8DeviceNameLength)
NMI_API sint8 | m2m_wifi_set_cust_InfoElement (uint8 *pau8M2mCustInfoElement)
sint8 | m2m_wifi_set_tx_power (uint8 u8TxPwrLevel)
sint8 | m2m_wifi_set_gain_table_idx (uint8 u8GainTableIdx)
sint8 | m2m_wifi_set_gains (tstrM2mWifiGainsParams *pstrM2mGain)
NMI_API sint8 | m2m_wifi_conf_auto_rate (tstrConfAutoRate *pstrConfAutoRate)

Detailed Description

Here are listed all the functions that implement the Wlan Configuration APIs.

Function Documentation

NMI_API sint8 m2m_wifi_set_mac_address ( uint8 au8MacAddress[6] )

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

This function override the already assigned MAC address of the WINC board with a user provided one. This is for experimental use only and should never be used in the production SW.

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.
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 is returned via RAM pointed to by the input arguments.

Request the MAC address stored on the One Time Programmable(OTP) memory of the device. The function is blocking until the response is received.

Precondition
Prior call to m2m_wifi_init is required before any WIFI/socket function.
Parameters
[out] | pu8MacAddr | Output MAC address buffer 6 bytes in size. Valid only if *pu8Valid=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
NMI_API sint8 m2m_wifi_get_mac_address ( uint8 * pu8MacAddr )

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

Function to retrieve the current MAC address. The function is blocking until the response is received.

Precondition
Prior call to m2m_wifi_init is required before any WIFI/socket function.
Parameters
[out] pu8MacAddr Pointer to a buffer in memory containing a 6-byte MAC address (provided function returns M2M_SUCCESS).
Returns
The function returns M2M_SUCCESS for successful operation and a negative value otherwise.
See also
m2m_wifi_get_otp_mac_address
NMI_API sint8 m2m_wifi_set_device_name | ( | uint8 * | pu8DeviceName,
 |  | uint8 | u8DeviceNameLength
 | ) |  |

Asynchronous API to set the "Device Name" of the WINC IC.

Sets the WINC device name. The name string is used as a device name in DHCP hostname (option 12). If a device is not set through this function a default name is assigned. The default name is WINC-XX-YY, where XX and YY are the last 2 octets of the OTP MAC address. If OTP (eFuse) is programmed, then the default name is WINC-00-00.

Warning
The function called once after initialization.
Used for DHCP client hostname option (12).
Device name shall contain only characters allowed in valid internet host name as defined in RFC 952 and 1123.
Parameters
[in] | pu8DeviceName | Buffer holding the device name. Device name is a null terminated C string.
[in] | u8DeviceNameLength | Length of the device name. Should not exceed the maximum device name's length M2M_DEVICE_NAME_MAX (including null character).
Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC and a negative value otherwise.
NMI_API sint8 m2m_wifi_set_cust_InfoElement ( uint8 * pau8M2mCustInfoElement )

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

Synchronous function to Add/Remove user-defined Information Element to the WIFIBeacon and Probe Response frames while chip mode is Access Point Mode.
According to the information element layout shown bellow, if it is required to set new data for the information elements, pass in the buffer with the information according to the sizes and ordering defined bellow. However, if it's required to delete these IEs, fill the buffer with zeros.

Parameters
[in] pau8M2mCustInfoElement Pointer to Buffer containing the IE to be sent. It is the application developer's responsibility to ensure on the correctness of the information element's ordering passed in.
Warning
Size of All elements combined must not exceed 255 byte. Used in Access Point Mode.
Note
IEs Format will be follow the following layout:
    --------------- ---------- ---------- ------------------- -------- -------- ----------- -----------------------
    | 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.
See also
m2m_wifi_enable_sntp

Example

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

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

Set the TX power tenuM2mTxPwrLevel.

Parameters
[in] u8TxPwrLevel Change the TX power based on the enumeration tenuM2mTxPwrLevel.
Precondition
Must be called after the initialization and before any connection request and can't be changed in runtime.
Returns
The function SHALL return M2M_SUCCESS for success and a negative value otherwise.
See also
tenuM2mTxPwrLevel m2m_wifi_init
NMI_API sint8 m2m_wifi_set_gain_table_idx ( uint8 u8GainTableIdx )

Set the Gain table index corresponding to specific WiFi region.

Parameters
[in] u8GainTableIdx Change the gain table index based on the WiFi region it is suppose to be used.
Precondition
Must be called after the initialization and before any connection request. The corresponding gain tables must be present in the flash.
Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise.
See also
m2m_wifi_init
sint8 m2m_wifi_set_gains ( tstrM2mWifiGainsParams * pstrM2mGain )

Set the chip PPA gain for 11b/11gn.

Parameters
[in] pstrM2mGain tstrM2mWifiGainsParams contain gain parameters as implemented in rf document.
Precondition
Must be called after initialization through the following function m2m_wifi_init.
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_init
NMI_API sint8 m2m_wifi_conf_auto_rate ( tstrConfAutoRate * pstrConfAutoRate )

Configures WLAN automatic TX rate adaptation algorithm.

Allow the host MCU app to configure auto TX rate selection algorithm. The application can use this API to tweak the algorithm performance. Moreover, it allows the application to force a specific WLAN PHY rate for transmitted data packets to favor range vs. throughput needs.

Parameters
[in] pstrConfAutoRate The Auto rate configuration parameters as listed in tstrConfAutoRate.
Warning
The application will be responsible for keeping track of what values are set and, if required, going back to default values. Changes will become permanent until the chip is power-cycled.
Returns
The function SHALL return M2M_SUCCESS for success and a negative value otherwise.
See also
tstrConfAutoRate
Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: System Time

Functions
System Time
WLAN » Functions

Functions

NMI_API sint8 | m2m_wifi_configure_sntp (uint8 *pu8NTPServerName, uint8 u8NTPServerNameLength, tenuSNTPUseDHCP useDHCP)
NMI_API sint8 | m2m_wifi_enable_sntp (uint8 bEnable)
NMI_API sint8 | m2m_wifi_set_system_time (uint32 u32UTCSeconds)
NMI_API sint8 | m2m_wifi_get_system_time (void)

Detailed Description

Here are listed all the functions that implement the System Time APIs.

Function Documentation

NMI_API sint8 m2m_wifi_configure_sntp | ( | uint8 * | pu8NTPServerName,
 |  | uint8 | u8NTPServerNameLength,
 |  | tenuSNTPUseDHCP | useDHCP
 | ) |  |

Configures what NTP server the SNTP client should use.

Configures what NTP server the SNTP client should use. Only 1 server name can be provided, if the configured server name begins with an asterisk then it will be treated as a server pool. The SNTP client can also use the NTP server provided by the DHCP server through option 42. By default the NTP server provided by DHCP will be tried first, then the built-in default NTP server (time.nist.gov) will be used.

Parameters
[in] | pu8NTPServerName | Buffer holding the NTP server name. If the first character is an asterisk (*) then it will be treated as a server pool, where the asterisk will be replaced with an incrementing value from 0 to 3 each time a server fails (example: *.pool.ntp.org).
[in] | u8NTPServerNameLength | Length of the NTP server name. Should not exceed the maximum NTP server name length of M2M_NTP_MAX_SERVER_NAME_LENGTH.
[in] | useDHCP | Explicity tell the WINC if it should use the NTP server provided by the DHCP server or not.
Warning
SNTP should be configured before the connection takes place. If SNTP is configured after the device connects to a network, the new configuration can take a minimum of 24h to be applied. However, it can take even longer since it is triggered by DHCP renewal. Currently there is also a known issue in which if the WINC obtains the NTP server from DHCP and then connects to a different network, it will still use the NTP from the previous network. Configuring a server name will overwrite the built-in default server until next reboot.
Returns
The function returns M2M_SUCCESS for success and a negative value otherwise.
NMI_API sint8 m2m_wifi_enable_sntp ( uint8 bEnable )

Synchronous function to enable/disable the native Simple Network Time Protocol(SNTP) client in the WINC15x0 firmware.

The SNTP is enabled by default at start-up.The SNTP client at firmware is used to synchronize the system clock to the UTC time from the well known time servers (e.g. "time-c.nist.gov"). The SNTP client uses a default update cycle of 1 day.

The UTC is important for checking the expiration date of X509 certificates used while establishing TLS (Transport Layer Security) connections.

It is highly recommended to use it if there is no other means to get the UTC time. If there is a RTC on the host MCU, the SNTP could be disabled and the host should set the system time to the firmware using the m2m_wifi_set_system_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_system_time
NMI_API sint8 m2m_wifi_set_system_time ( uint32 u32UTCSeconds )

Function for setting the system time within the WINC IC.

Synchronous function for setting the system time in time/date format (uint32). The tstrSystemTime structure can be used as a reference to the time values that should be set and pass its value as uint32.

Parameters
[in] u32UTCSeconds Seconds elapsed since January 1, 1900 (NTP Timestamp).
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_system_time.
NMI_API sint8 m2m_wifi_get_system_time ( void )

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

Asynchronous function used to retrieve the system time through the use of the response M2M_WIFI_RESP_GET_SYS_TIME. Response time retrieved is parsed into the members defined in the structure tstrSystemTime.

Note
Get the system time from the SNTP client using the API m2m_wifi_get_system_time.
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
Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Provisioning

Functions
Provisioning
WLAN » Functions

Functions

NMI_API sint8 | m2m_wifi_start_provision_mode (tstrM2MAPConfig *pstrAPConfig, char *pcHttpServerDomainName, uint8 bEnableHttpRedirect)
NMI_API sint8 | m2m_wifi_start_provision_mode_ext (tstrM2MAPModeConfig *pstrAPModeConfig, char *pcHttpServerDomainName, uint8 bEnableHttpRedirect)
NMI_API sint8 | m2m_wifi_stop_provision_mode (void)

Detailed Description

Here are listed all the functions that implement the Wifi Provisioning APIs.

Function Documentation

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

Asynchronous API for control of Wi-Fi provisioning functionality.

Asynchronous Wi-Fi provisioning function, which starts the WINC HTTP PROVISIONING mode. The function triggers the WINC to activate the Wi-Fi AP (HOTSPOT) mode with the passed configuration parameters and then starts the HTTP Provision WEB Server.

Provisioning status is returned in an event M2M_WIFI_RESP_PROVISION_INFO.

Parameters
[in] pstrAPConfig AP configuration parameters as defined in tstrM2MAPConfig configuration structure. If a NULL value is passed in, the call 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. The domain name can have one of the following 3 forms:
  • 1. "wincprov.com"
  • 2. "http://wincprov.com"
  • 3. "https://wincprov.com"

Forms 1 and 2 are equivalent, they will both start a plain http server, while form 3 will start a secure HTTP provisioning Session (HTTP over SSL connection).

Parameters
[in] bEnableHttpRedirect A flag to enable/disable the HTTP redirect feature. If Secure provisioning is enabled (i.e. the server domain name uses "https" prefix) this flag is ignored (no meaning for redirect in HTTPS). Possible values are:
  • ZERO value, which means 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 value, means 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.
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
DO NOT use ".local" in the pcHttpServerDomainName.
Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC and a negative value otherwise.
See also
tpfAppWifiCb m2m_wifi_init M2M_WIFI_RESP_PROVISION_INFO m2m_wifi_stop_provision_mode tstrM2MAPConfig

Example

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

1 #include "m2m_wifi.h"
2 #include "m2m_types.h"
3
4 void wifi_event_cb(uint8 u8WiFiEvent, void * pvMsg)
5 {
6 switch(u8WiFiEvent)
7 {
8 case M2M_WIFI_RESP_PROVISION_INFO:
9 {
10 tstrM2MProvisionInfo *pstrProvInfo = (tstrM2MProvisionInfo*)pvMsg;
11 if(pstrProvInfo->u8Status == M2M_SUCCESS)
12 {
13 tstrNetworkId strNetworkId = {NULL, pstrProvInfo->au8SSID, (uint8)strlen((char*)(pstrProvInfo->au8SSID)), M2M_WIFI_CH_ALL};
14 tstrAuthPsk strAuthPsk = {NULL, pstrProvInfo->au8Password, (uint8)strlen((char*)(pstrProvInfo->au8Password))};
15 m2m_wifi_connect_psk(WIFI_CRED_SAVE_ENCRYPTED, &strNetworkId, &strAuthPsk);
16
17 printf("PROV SSID : %s\n",pstrProvInfo->au8SSID);
18 printf("PROV PSK : %s\n",pstrProvInfo->au8Password);
19 }
20 else
21 {
22 printf("(ERR) Provisioning Failed\n");
23 }
24 }
25 break;
26
27 default:
28 break;
29 }
30 }
31
32 int main()
33 {
34 tstrWifiInitParam param;
35
36 param.pfAppWifiCb = wifi_event_cb;
37 if(!m2m_wifi_init(&param))
38 {
39 tstrM2MAPConfig apConfig;
40 uint8 bEnableRedirect = 1;
41
42 strcpy(apConfig.au8SSID, "WINC_SSID");
43 apConfig.u8ListenChannel = 1;
44 apConfig.u8SecType = M2M_WIFI_SEC_OPEN;
45 apConfig.u8SsidHide = 0;
46
47 // IP Address
48 apConfig.au8DHCPServerIP[0] = 192;
49 apConfig.au8DHCPServerIP[1] = 168;
50 apConfig.au8DHCPServerIP[2] = 1;
51 apConfig.au8DHCPServerIP[3] = 1;
52
53 m2m_wifi_start_provision_mode(&apConfig, "atmelwincconf.com", bEnableRedirect);
54
55 while(1)
56 {
57 m2m_wifi_handle_events(NULL);
58 }
59 }
60 }
NMI_API sint8 m2m_wifi_start_provision_mode_ext | ( | tstrM2MAPModeConfig * | pstrAPModeConfig,
 |  | char * | pcHttpServerDomainName,
 |  | uint8 | bEnableHttpRedirect
 | ) |  |

Asynchronous API for control of Wi-Fi provisioning functionality with extended options.

Asynchronous Wi-Fi provisioning function, which starts the WINC HTTP PROVISIONING mode. The function triggers the WINC to activate the Wi-Fi AP (HOTSPOT) mode with the passed configuration parameters and then starts the HTTP Provision WEB Server.

Provisioning status is returned in an event M2M_WIFI_RESP_PROVISION_INFO.

Parameters
[in] pstrAPModeConfig AP configuration parameters as defined in tstrM2MAPModeConfig 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. The domain name can have one of the following 3 forms:
  • 1. "wincprov.com"
  • 2. "http://wincprov.com"
  • 3. "https://wincprov.com"

The forms 1 and 2 are equivalent, they both will start a plain http server, while form 3 will start a secure HTTP provisioning Session (HTTP over SSL connection).

Parameters
[in] bEnableHttpRedirect A flag to enable/disable the HTTP redirect feature. If Secure provisioning is enabled (i.e. the server domain name uses "https" prefix) this flag is ignored (no meaning for redirect in HTTPS). Possible values are:
  • ZERO value, which means 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 value, means 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.
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
DO Not use ".local" in the pcHttpServerDomainName.
See also
tpfAppWifiCb m2m_wifi_init M2M_WIFI_RESP_PROVISION_INFO m2m_wifi_stop_provision_mode tstrM2MAPModeConfig
Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC and a negative value otherwise.

Example

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

1 #include "m2m_wifi.h"
2 #include "m2m_types.h"
3
4 void wifi_event_cb(uint8 u8WiFiEvent, void * pvMsg)
5 {
6 switch(u8WiFiEvent)
7 {
8 case M2M_WIFI_RESP_PROVISION_INFO:
9 {
10 tstrM2MProvisionInfo *pstrProvInfo = (tstrM2MProvisionInfo*)pvMsg;
11 if(pstrProvInfo->u8Status == M2M_SUCCESS)
12 {
13 tstrNetworkId strNetworkId = {NULL, pstrProvInfo->au8SSID, (uint8)strlen((char*)(pstrProvInfo->au8SSID)), M2M_WIFI_CH_ALL};
14 tstrAuthPsk strAuthPsk = {NULL, pstrProvInfo->au8Password, (uint8)strlen((char*)(pstrProvInfo->au8Password))};
15 m2m_wifi_connect_psk(WIFI_CRED_SAVE_ENCRYPTED, &strNetworkId, &strAuthPsk);
16
17 printf("PROV SSID : %s\n",pstrProvInfo->au8SSID);
18 printf("PROV PSK : %s\n",pstrProvInfo->au8Password);
19 }
20 else
21 {
22 printf("(ERR) Provisioning Failed\n");
23 }
24 }
25 break;
26
27 default:
28 break;
29 }
30 }
31
32 int main()
33 {
34 tstrWifiInitParam param;
35
36 param.pfAppWifiCb = wifi_event_cb;
37 if(!m2m_wifi_init(&param))
38 {
39 tstrM2MAPModeConfig apModeConfig;
40 uint8 bEnableRedirect = 1;
41
42 strcpy(apModeConfig.strApConfig.au8SSID, "WINC_SSID");
43 apModeConfig.strApConfig.u8ListenChannel = 1;
44 apModeConfig.strApConfig.u8SecType = M2M_WIFI_SEC_OPEN;
45 apModeConfig.strApConfig.u8SsidHide = 0;
46
47 // IP Address
48 apModeConfig.strApConfig.au8DHCPServerIP[0] = 192;
49 apModeConfig.strApConfig.au8DHCPServerIP[1] = 168;
50 apModeConfig.strApConfig.au8DHCPServerIP[2] = 1;
51 apModeConfig.strApConfig.au8DHCPServerIP[3] = 1;
52
53 // Default router IP
54 m2m_memcpy(apModeConfig.strApConfigExt.au8DefRouterIP, apModeConfig.strApConfig.au8DHCPServerIP, 4);
55
56 // DNS Server IP
57 m2m_memcpy(apModeConfig.strApConfigExt.au8DNSServerIP, apModeConfig.strApConfig.au8DHCPServerIP, 4);
58
59 // Subnet mask
60 apModeConfig.strApConfigExt.au8SubnetMask[0] = 255;
61 apModeConfig.strApConfigExt.au8SubnetMask[1] = 255;
62 apModeConfig.strApConfigExt.au8SubnetMask[2] = 255;
63 apModeConfig.strApConfigExt.au8SubnetMask[3] = 0;
64
65 m2m_wifi_start_provision_mode_ext(&apModeConfig, "atmelwincconf.com", bEnableRedirect);
66
67 while(1)
68 {
69 m2m_wifi_handle_events(NULL);
70 }
71 }
72 }
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.

Precondition
An active provisioning session must be active before it is terminated through this function.
Returns
The function returns M2M_SUCCESS for success and a negative value otherwise.
See also
m2m_wifi_start_provision_mode
Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Crypto

Functions
Crypto
WLAN » Functions

Functions

sint8 m2m_wifi_prng_get_random_bytes (uint8 *pu8PrngBuff, uint16 u16PrngSize)

Detailed Description

Here are listed all the functions that implement the Wifi Crypto APIs.

Function Documentation

sint8 m2m_wifi_prng_get_random_bytes | ( | uint8 * | pu8PrngBuff,
 |  | uint16 | u16PrngSize
 | ) |  |

Asynchronous function for retrieving from the firmware a pseudo-random set of bytes.

Asynchronous function for retrieving from the firmware a pseudo-random set of bytes as specified in the size passed in as a parameter. The registered wifi-cb function retrieves the random bytes through the response M2M_WIFI_RESP_GET_PRNG

Parameters
[in] | pu8PrngBuff | Pointer to a buffer to receive data.
[in] | u16PrngSize | Requested size in bytes. Maximum 1580.
Warning
Size greater than the maximum specified (1580) causes a negative error M2M_ERR_FAIL.
Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise.
Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Version

Modules
Version

Modules

Defines
Functions

Detailed Description

Describes the APIs for reading the version information of the WINC firmware.

Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Defines

Macros
Defines
Version

Macros

#define | M2M_MAJOR_SHIFT (8)
#define | M2M_MINOR_SHIFT (4)
#define | M2M_PATCH_SHIFT (0)
#define | M2M_DRV_VERSION_SHIFT (16)
#define | M2M_FW_VERSION_SHIFT (0)
#define | M2M_GET_MAJOR(ver_info_hword) ((uint8)((ver_info_hword) >> M2M_MAJOR_SHIFT) & 0xff)
#define | M2M_GET_MINOR(ver_info_hword) ((uint8)((ver_info_hword) >> M2M_MINOR_SHIFT) & 0x0f)
#define | M2M_GET_PATCH(ver_info_hword) ((uint8)((ver_info_hword) >> M2M_PATCH_SHIFT) & 0x0f)
#define | M2M_GET_FW_VER(ver_info_word) ((uint16) ((ver_info_word) >> M2M_FW_VERSION_SHIFT))
#define | M2M_GET_DRV_VER(ver_info_word) ((uint16) ((ver_info_word) >> M2M_DRV_VERSION_SHIFT))
#define | M2M_GET_DRV_MAJOR(ver_info_word) M2M_GET_MAJOR(M2M_GET_DRV_VER(ver_info_word))
#define | M2M_GET_DRV_MINOR(ver_info_word) M2M_GET_MINOR(M2M_GET_DRV_VER(ver_info_word))
#define | M2M_GET_DRV_PATCH(ver_info_word) M2M_GET_PATCH(M2M_GET_DRV_VER(ver_info_word))
#define | M2M_GET_FW_MAJOR(ver_info_word) M2M_GET_MAJOR(M2M_GET_FW_VER(ver_info_word))
#define | M2M_GET_FW_MINOR(ver_info_word) M2M_GET_MINOR(M2M_GET_FW_VER(ver_info_word))
#define | M2M_GET_FW_PATCH(ver_info_word) M2M_GET_PATCH(M2M_GET_FW_VER(ver_info_word))
#define | M2M_MAKE_VERSION(major, minor, patch)
#define | M2M_MAKE_VERSION_INFO(fw_major, fw_minor, fw_patch, drv_major, drv_minor, drv_patch)
#define | REL_19_7_7_VER M2M_MAKE_VERSION_INFO(19,7,7,19,3,0)
#define | REL_19_7_6_VER M2M_MAKE_VERSION_INFO(19,7,6,19,3,0)
#define | REL_19_7_5_VER M2M_MAKE_VERSION_INFO(19,7,5,19,3,0)
#define | REL_19_7_0_VER M2M_MAKE_VERSION_INFO(19,7,0,19,3,0)
#define | REL_19_6_4_VER M2M_MAKE_VERSION_INFO(19,6,4,19,3,0)
#define | REL_19_6_0_VER M2M_MAKE_VERSION_INFO(19,6,0,19,3,0)
#define | REL_19_5_3_VER M2M_MAKE_VERSION_INFO(19,5,3,19,3,0)
#define | REL_19_5_2_VER M2M_MAKE_VERSION_INFO(19,5,2,19,3,0)
#define | REL_19_5_1_VER M2M_MAKE_VERSION_INFO(19,5,1,19,3,0)
#define | REL_19_5_0_VER M2M_MAKE_VERSION_INFO(19,5,0,19,3,0)
#define | REL_19_4_6_VER M2M_MAKE_VERSION_INFO(19,4,6,19,3,0)
#define | REL_19_4_5_VER M2M_MAKE_VERSION_INFO(19,4,5,19,3,0)
#define | REL_19_4_4_VER M2M_MAKE_VERSION_INFO(19,4,4,19,3,0)
#define | REL_19_4_3_VER M2M_MAKE_VERSION_INFO(19,4,3,19,3,0)
#define | REL_19_4_2_VER M2M_MAKE_VERSION_INFO(19,4,2,19,3,0)
#define | REL_19_4_1_VER M2M_MAKE_VERSION_INFO(19,4,1,19,3,0)
#define | REL_19_4_0_VER M2M_MAKE_VERSION_INFO(19,4,0,19,3,0)
#define | REL_19_3_1_VER M2M_MAKE_VERSION_INFO(19,3,1,19,3,0)
#define | REL_19_3_0_VER M2M_MAKE_VERSION_INFO(19,3,0,19,3,0)
#define | REL_19_2_2_VER M2M_MAKE_VERSION_INFO(19,2,2,19,2,0)
#define | REL_19_2_1_VER M2M_MAKE_VERSION_INFO(19,2,1,19,2,0)
#define | REL_19_2_0_VER M2M_MAKE_VERSION_INFO(19,2,0,19,2,0)
#define | REL_19_1_0_VER M2M_MAKE_VERSION_INFO(19,1,0,18,2,0)
#define | REL_19_0_0_VER M2M_MAKE_VERSION_INFO(19,0,0,18,1,1)
#define | M2M_RELEASE_VERSION_MAJOR_NO (19)
#define | M2M_RELEASE_VERSION_MINOR_NO (7)
#define | M2M_RELEASE_VERSION_PATCH_NO (7)
#define | M2M_RELEASE_VERSION_SVN_VERSION (SVN_REVISION)
#define | M2M_MIN_REQ_DRV_VERSION_MAJOR_NO (19)
#define | M2M_MIN_REQ_DRV_VERSION_MINOR_NO (3)
#define | M2M_MIN_REQ_DRV_VERSION_PATCH_NO (0)
#define | M2M_MIN_REQ_DRV_SVN_VERSION (0)

Detailed Description

Specifies the macros and defines used by the version APIs.

Macro Definition Documentation

#define M2M_MAJOR_SHIFT (8)
#define M2M_MINOR_SHIFT (4)
#define M2M_PATCH_SHIFT (0)
#define M2M_DRV_VERSION_SHIFT (16)
#define M2M_FW_VERSION_SHIFT (0)
#define M2M_GET_MAJOR ( ver_info_hword ) ((uint8)((ver_info_hword) >> M2M_MAJOR_SHIFT) & 0xff)
#define M2M_GET_MINOR ( ver_info_hword ) ((uint8)((ver_info_hword) >> M2M_MINOR_SHIFT) & 0x0f)
#define M2M_GET_PATCH ( ver_info_hword ) ((uint8)((ver_info_hword) >> M2M_PATCH_SHIFT) & 0x0f)
#define M2M_GET_FW_VER ( ver_info_word ) ((uint16) ((ver_info_word) >> M2M_FW_VERSION_SHIFT))
#define M2M_GET_DRV_VER ( ver_info_word ) ((uint16) ((ver_info_word) >> M2M_DRV_VERSION_SHIFT))
#define M2M_GET_DRV_MAJOR ( ver_info_word ) M2M_GET_MAJOR(M2M_GET_DRV_VER(ver_info_word))
#define M2M_GET_DRV_MINOR ( ver_info_word ) M2M_GET_MINOR(M2M_GET_DRV_VER(ver_info_word))
#define M2M_GET_DRV_PATCH ( ver_info_word ) M2M_GET_PATCH(M2M_GET_DRV_VER(ver_info_word))
#define M2M_GET_FW_MAJOR ( ver_info_word ) M2M_GET_MAJOR(M2M_GET_FW_VER(ver_info_word))
#define M2M_GET_FW_MINOR ( ver_info_word ) M2M_GET_MINOR(M2M_GET_FW_VER(ver_info_word))
#define M2M_GET_FW_PATCH ( ver_info_word ) M2M_GET_PATCH(M2M_GET_FW_VER(ver_info_word))
#define M2M_MAKE_VERSION | ( | major,
 |  | minor,
 |  | patch
 | ) |
Value:
( \
((uint16)((major) & 0xff) << M2M_MAJOR_SHIFT) | \
((uint16)((minor) & 0x0f) << M2M_MINOR_SHIFT) | \
((uint16)((patch) & 0x0f) << M2M_PATCH_SHIFT))
M2M_PATCH_SHIFT
#define M2M_PATCH_SHIFT
Definition: m2m_types.h:70
M2M_MINOR_SHIFT
#define M2M_MINOR_SHIFT
Definition: m2m_types.h:69
M2M_MAJOR_SHIFT
#define M2M_MAJOR_SHIFT
Definition: m2m_types.h:68
uint16
unsigned short uint16
Range of values between 0 to 65535.
Definition: nm_bsp.h:107
#define M2M_MAKE_VERSION_INFO | ( | fw_major,
 |  | fw_minor,
 |  | fw_patch,
 |  | drv_major,
 |  | drv_minor,
 |  | drv_patch
 | ) |
Value:
( \
( ((uint32)M2M_MAKE_VERSION((fw_major), (fw_minor), (fw_patch))) << M2M_FW_VERSION_SHIFT) | \
( ((uint32)M2M_MAKE_VERSION((drv_major), (drv_minor), (drv_patch))) << M2M_DRV_VERSION_SHIFT))
M2M_DRV_VERSION_SHIFT
#define M2M_DRV_VERSION_SHIFT
Definition: m2m_types.h:72
M2M_MAKE_VERSION
#define M2M_MAKE_VERSION(major, minor, patch)
Definition: m2m_types.h:90
M2M_FW_VERSION_SHIFT
#define M2M_FW_VERSION_SHIFT
Definition: m2m_types.h:73
uint32
unsigned long uint32
Range of values between 0 to 4294967295.
Definition: nm_bsp.h:114
#define REL_19_7_7_VER M2M_MAKE_VERSION_INFO(19,7,7,19,3,0)
#define REL_19_7_6_VER M2M_MAKE_VERSION_INFO(19,7,6,19,3,0)
#define REL_19_7_5_VER M2M_MAKE_VERSION_INFO(19,7,5,19,3,0)
#define REL_19_7_0_VER M2M_MAKE_VERSION_INFO(19,7,0,19,3,0)
#define REL_19_6_4_VER M2M_MAKE_VERSION_INFO(19,6,4,19,3,0)
#define REL_19_6_0_VER M2M_MAKE_VERSION_INFO(19,6,0,19,3,0)
#define REL_19_5_3_VER M2M_MAKE_VERSION_INFO(19,5,3,19,3,0)
#define REL_19_5_2_VER M2M_MAKE_VERSION_INFO(19,5,2,19,3,0)
#define REL_19_5_1_VER M2M_MAKE_VERSION_INFO(19,5,1,19,3,0)
#define REL_19_5_0_VER M2M_MAKE_VERSION_INFO(19,5,0,19,3,0)
#define REL_19_4_6_VER M2M_MAKE_VERSION_INFO(19,4,6,19,3,0)
#define REL_19_4_5_VER M2M_MAKE_VERSION_INFO(19,4,5,19,3,0)
#define REL_19_4_4_VER M2M_MAKE_VERSION_INFO(19,4,4,19,3,0)
#define REL_19_4_3_VER M2M_MAKE_VERSION_INFO(19,4,3,19,3,0)
#define REL_19_4_2_VER M2M_MAKE_VERSION_INFO(19,4,2,19,3,0)
#define REL_19_4_1_VER M2M_MAKE_VERSION_INFO(19,4,1,19,3,0)
#define REL_19_4_0_VER M2M_MAKE_VERSION_INFO(19,4,0,19,3,0)
#define REL_19_3_1_VER M2M_MAKE_VERSION_INFO(19,3,1,19,3,0)
#define REL_19_3_0_VER M2M_MAKE_VERSION_INFO(19,3,0,19,3,0)
#define REL_19_2_2_VER M2M_MAKE_VERSION_INFO(19,2,2,19,2,0)
#define REL_19_2_1_VER M2M_MAKE_VERSION_INFO(19,2,1,19,2,0)
#define REL_19_2_0_VER M2M_MAKE_VERSION_INFO(19,2,0,19,2,0)
#define REL_19_1_0_VER M2M_MAKE_VERSION_INFO(19,1,0,18,2,0)
#define REL_19_0_0_VER M2M_MAKE_VERSION_INFO(19,0,0,18,1,1)
#define M2M_RELEASE_VERSION_MAJOR_NO (19)

Firmware Major release version number.

#define M2M_RELEASE_VERSION_MINOR_NO (7)

Firmware Minor release version number.

#define M2M_RELEASE_VERSION_PATCH_NO (7)

Firmware patch release version number.

#define M2M_RELEASE_VERSION_SVN_VERSION (SVN_REVISION)

Firmware SVN release version number.

#define M2M_MIN_REQ_DRV_VERSION_MAJOR_NO (19)

Driver Major release version number.

#define M2M_MIN_REQ_DRV_VERSION_MINOR_NO (3)

Driver Minor release version number.

#define M2M_MIN_REQ_DRV_VERSION_PATCH_NO (0)

Driver patch release version number.

#define M2M_MIN_REQ_DRV_SVN_VERSION (0)

Driver svn version.

Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Functions

Functions
Functions
Version

Functions

NMI_API sint8 | m2m_ota_get_firmware_version (tstrM2mRev *pstrRev)
NMI_API sint8 | m2m_wifi_get_firmware_version (tstrM2mRev *pstrRev)

Detailed Description

Lists the APIs for reading the version information of the WINC firmware.

Function Documentation

sint8 m2m_ota_get_firmware_version ( tstrM2mRev * pstrRev )

Get the OTA Firmware version.

Get OTA Firmware version info from the inactive partition, as defined in the structure tstrM2mRev.

Parameters
[out] pstrRev Pointer to the structure tstrM2mRev that contains the firmware version parameters.
Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise.
NMI_API m2m_wifi_get_firmware_version ( tstrM2mRev * pstrRev )

Get Firmware version info.

Get the Firmware version info from the active partition, as defined in the structure tstrM2mRev.

Parameters
[out] pstrRev Pointer to the structure tstrM2mRev that contains the firmware version parameters.
Precondition
Must be called after initialization through the following function m2m_wifi_init.
See also
m2m_wifi_init
Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise.
Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: BSP

Modules
BSP

Modules

Data Types
Defines
Functions

Detailed Description

Description of the BSP (Board Support Package) module.

Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Data Types

Typedefs
Data Types
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

void(* tpfNmBspIsr)(void)

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

Returns
None
unsigned char uint8

Range of values between 0 to 255.

unsigned short uint16

Range of values between 0 to 65535.

unsigned long uint32

Range of values between 0 to 4294967295.

signed char sint8

Range of values between -128 to 127.

signed short sint16

Range of values between -32768 to 32767.

signed long sint32

Range of values between -2147483648 to 2147483647.

Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 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

#define NMI_API

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

#define CONST const

Used for code portability.

#define NULL ((void*)0)

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

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

Computes the minimum value between x and y.

#define NM_BSP_B_L_32 ( x ) (x)

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

#define NM_BSP_B_L_16 ( x ) (x)

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

Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Functions

Modules
Functions
BSP

Modules

nm_bsp_init
nm_bsp_deinit
nm_bsp_reset
nm_bsp_sleep
nm_bsp_register_isr
nm_bsp_interrupt_ctrl

Detailed Description

Lists the available BSP (Board Support Package) APIs.

Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: nm_bsp_init

Functions
nm_bsp_init
BSP » Functions

Functions

sint8 nm_bsp_init (void)

Detailed Description

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

Function Documentation

sint8 nm_bsp_init ( void )

This function is used to initialize the Board Support Package (BSP) in order to prepare the WINC before any WINC API calls.

The nm_bsp_init function is the first function that should be called at the beginning of every application to initialize the BSP and the WINC board. Otherwise, the rest of the BSP function calls will return with failure. This function should also be called after the WINC has been switched off with a successful call to nm_bsp_deinit in order to reinitialize the BSP before the Application can use any of the WINC APIs again. After the function initializes the WINC, a hard reset must be applied to start the WINC board by calling nm_bsp_reset.

Note
Implementation of this function is host dependent.
Warning
Omitting this function will lead to unavailability of host-chip communication.
See also
nm_bsp_deinit, nm_bsp_reset
Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise.
Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: nm_bsp_deinit

Functions
nm_bsp_deinit
BSP » Functions

Functions

sint8 nm_bsp_deinit (void)

Detailed Description

De-initialization of the BSP (Board Support Package).
This function should be called only after a successful call to nm_bsp_init.

Function Documentation

sint8 nm_bsp_deinit ( void )

This function is used to de-initialize the BSP and turn off the WINC board.

The nm_bsp_deinit is the last function that should be called after the application has finished and before the WINC is switched off. A call to this function will turn off the WINC board by setting CHIP_EN and RESET_N signals low. Every function call of nm_bsp_init should be matched with a call to nm_bsp_deinit. Failure to do so may result in the WINC consuming higher power than expected, since it won't be properly de-initialized.

Precondition
The BSP should be initialized through nm_bsp_init first.
Note
Implementation of this function is host dependent.
Warning
Omitting this function 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.
Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: nm_bsp_reset

Functions
nm_bsp_reset
BSP » Functions

Functions

void nm_bsp_reset (void)

Detailed Description

Resets the WINC SoC by setting CHIP_EN and RESET_N signals low, then after an appropriate delay, this function will put CHIP_EN high then RESET_N high, for more details on the timing between signals please check the WINC data-sheet.

Function Documentation

void nm_bsp_reset ( void )

Performs a hardware reset to the WINC board.

The nm_bsp_reset is used to perform a hard reset on the WINC board by setting CHIP_EN and RESET_N signals low, then after an appropriate delay this function puts CHIP_EN high then RESET_N high, for more details on the timing between signals please check the WINC data-sheet. After a successful call, the WINC board firmware will kick off to load and start the WINC firmware. This function should be called to reset the WINC firmware after the BSP is initialized and before the start of any communication with WINC board. Calling this function at any other time will result in losing the state and connections saved in the WINC board and starting again from the initial state. The host driver will need to be de-initialized before calling nm_bsp_reset and initialized again, which can be achieved by use of m2m_wifi_init and m2m_wifi_deinit.

Precondition
Initialize the BSP first by calling nm_bsp_init.
Note
Implementation of this function is host dependent and called by HIF layer.
Warning
Calling this function will drop any connection and lose the internal state saved on the WINC firmware.
See also
nm_bsp_init, m2m_wifi_init, m2m_wifi_deinit
Returns
None
Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: nm_bsp_sleep

Functions
nm_bsp_sleep
BSP » Functions

Functions

void nm_bsp_sleep (uint32 u32TimeMsec)

Detailed Description

Sleep in units of milliseconds.
This function used by the HIF Layer on several different scenarios.

Function Documentation

void nm_bsp_sleep ( uint32 u32TimeMsec )

Used to put the host to sleep for the specified duration (in milliseconds). Forcing the host to sleep for extended period may lead to host not being able to respond to WINC board events. It is important to be considerate while choosing the sleep period.

Parameters
[in] u32TimeMsec Time unit in milliseconds.
Precondition
Initialize nm_bsp_init first.
Note
Implementation of this function is host dependent.
Warning
Maximum value must nor exceed 4294967295 milliseconds which is equal to 4294967.295 seconds.
See also
nm_bsp_init
Returns
None
Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: nm_bsp_register_isr

Functions
nm_bsp_register_isr
BSP » Functions

Functions

void nm_bsp_register_isr (tpfNmBspIsr pfIsr)

Detailed Description

Register ISR (Interrupt Service Routine) in the initialization of the HIF (Host Interface) Layer. When the interrupt is triggered, the BSP layer should call the pfisr function from the interrupt handler.

Function Documentation

void nm_bsp_register_isr ( tpfNmBspIsr pfIsr )

Register the host interface interrupt service routine.

The WINC board uses the SPI interface to communicate with the host. This function registers the SPI interrupt to notify the host whenever there is an outstanding message from the WINC board. This function should be called during the initialization of the host interface. It is an internal driver function and shouldn't be called by the Application.

Parameters
[in] pfIsr Pointer to ISR handler in the HIF layer.
Note
Implementation of this function is host dependent and called by HIF layer.
Warning
Make sure that ISR for IRQ pin for WINC is disabled by default in your implementation.
See also
tpfNmBspIsr
Returns
None
Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: nm_bsp_interrupt_ctrl

Functions
nm_bsp_interrupt_ctrl
BSP » Functions

Functions

void nm_bsp_interrupt_ctrl (uint8 u8Enable)

Detailed Description

Synchronous enable/disable of WINC to host interrupts.

Function Documentation

void nm_bsp_interrupt_ctrl ( uint8 u8Enable )

Enable/Disable interrupts from the WINC.

This function can be used to enable/disable the WINC to host interrupts, depending on how the driver is implemented. It is an internal driver function and shouldn't be called by the application.

Parameters
[in] u8Enable
  • '0' disable interrupts.
  • '1' enable interrupts.
Precondition
The interrupt must be registered using nm_bsp_register_isr first.
Note
Implementation of this function is host dependent and called by HIF layer.
See also
tpfNmBspIsr, nm_bsp_register_isr
Returns
None
Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Common

Modules
Common

Modules

Defines
Functions

Detailed Description

Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 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 | M2M_ERR_INVALID ((sint8)-16)
#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_FIRMWARE_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

#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 M2M_ERR_INVALID ((sint8)-16)
#define I2C_ERR_LARGE_ADDRESS 0xE1UL

The address exceeds the max addressing mode in I2C flash.

#define I2C_ERR_TX_ABRT 0xE2UL

NO ACK from slave.

#define I2C_ERR_OVER_SIZE 0xE3UL
#define ERR_PREFIX_NMIS 0xE4UL

Wrong first four bytes in flash NMIS.

#define ERR_FIRMWARE_EXCEED_SIZE 0xE5UL

Total size of firmware exceeds the max size 256k.

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

Maximum of two values

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

Choose one of three values

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

Align to next multiple of 4

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

Most significant byte of 32bit word (LE)

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

Second most significant byte of 32bit word (LE)

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

Third most significant byte of 32bit word (LE)

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

Least significant byte of 32bit word (LE)

Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 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)
sint8 | hexstr_2_bytes (uint8 *pu8Out, uint8 *pu8In, uint8 u8SizeOut)

Variables

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

Detailed Description

Function Documentation

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
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
uint16 m2m_strlen ( uint8 * pcStr )

Returns the length of a null terminated string buffer.

Parameters
[in] pcStr Null terminated string buffer.
Returns
Length of the string in the specified string buffer.
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.
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.
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.
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.
sint8 hexstr_2_bytes | ( | uint8 * | pu8Out,
 |  | uint8 * | pu8In,
 |  | uint8 | u8SizeOut
 | ) |  |

Converts a string of hex characters to bytes.

Parameters
[out] | pu8Out | Output buffer (eg {0x11, 0x12, 0x13,...})
[in] | pu8In | Input buffer (eg {0x31, 0x31, 0x31, 0x32, 0x31, 0x33, ...})
[in] | u8SizeOut | Length of output buffer (should be half of the length of the input buffer).
Returns
M2M_SUCCESS if successful, M2M_ERR_INVALID_ARG otherwise (eg unrecognised hexchar in input).

Variable Documentation

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

Chooses which function to use in order to output debug.

Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Socket

Modules
Socket

Modules

Defines
Error Codes
DataTypes
Callbacks
Functions
Byte Order

Detailed Description

BSD compatible socket interface between the host layer and the network protocol stacks in the firmware. These functions are used by the host application to send or receive packets and to do other socket operations.

Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Defines

Modules
Defines
Socket

Modules

TCP/IP Defines

Detailed Description

Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: TCP/IP Defines

Macros
TCP/IP Defines
Socket » Defines

Macros

#define | HOSTNAME_MAX_SIZE 64
#define | SOCKET_BUFFER_MAX_LENGTH 1400
#define | AF_INET 2
#define | SOCK_STREAM 1
#define | SOCK_DGRAM 2
#define | SOCKET_FLAGS_SSL 0x01
#define | SOCKET_CONFIG_SSL_OFF 0
#define | SOCKET_CONFIG_SSL_ON 1
#define | SOCKET_CONFIG_SSL_DELAY 2
#define | TCP_SOCK_MAX (7)
#define | UDP_SOCK_MAX 4
#define | MAX_SOCKET (TCP_SOCK_MAX + UDP_SOCK_MAX)
#define | SOL_SOCKET 1
#define | SOL_SSL_SOCKET 2
#define | SO_SET_UDP_SEND_CALLBACK 0x00
#define | IP_ADD_MEMBERSHIP 0x01
#define | IP_DROP_MEMBERSHIP 0x02
#define | SO_TCP_KEEPALIVE 0x04
#define | SO_TCP_KEEPIDLE 0x05
#define | SO_TCP_KEEPINTVL 0x06
#define | SO_TCP_KEEPCNT 0x07

Detailed Description

The following list of macros are used to define constants used throughout the socket layer.

Macro Definition Documentation

#define HOSTNAME_MAX_SIZE 64

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

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

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

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

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

#define SOCKET_FLAGS_SSL 0x01

This flag may be set in the u8Config parameter of socket, to create a TLS socket.
Note that the number of TLS sockets is limited to 4.
This flag is kept for legacy purposes. It is recommended that applications use SOCKET_CONFIG_SSL_ON instead.

#define SOCKET_CONFIG_SSL_OFF 0

This value may be passed in the u8Config parameter of socket, to create a socket not capable of TLS.

#define SOCKET_CONFIG_SSL_ON 1

This value may be passed in the u8Config parameter of socket, to create a TLS socket.
Note that the number of TLS sockets is limited to 4.

#define SOCKET_CONFIG_SSL_DELAY 2

This value may be passed in the u8Config parameter of socket, to create a TCP socket which has the potential to upgrade to a TLS socket later (by calling secure).
Note that the total number of TLS sockets and potential TLS sockets is limited to 4.

#define TCP_SOCK_MAX (7)

Maximum number of simultaneous TCP sockets.

#define UDP_SOCK_MAX 4

Maximum number of simultaneous UDP sockets.

#define MAX_SOCKET (TCP_SOCK_MAX + UDP_SOCK_MAX)

Maximum number of simultaneous sockets.

#define SOL_SOCKET 1

Socket option. Used with the setsockopt function

#define SOL_SSL_SOCKET 2

SSL Socket option level. Used with the setsockopt function

#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.
The option value should be cast to int type.
0: disable UDP send callbacks.
1: enable UDP send callbacks.
Default setting is enable.

Warning
connect and bind cause this setting to be lost, so the application should only set this option after calling connect or bind.
#define IP_ADD_MEMBERSHIP 0x01

Set Socket Option Add Membership command value (to join a multicast group). Used with the setsockopt function.

#define IP_DROP_MEMBERSHIP 0x02

Set Socket Option Drop Membership command value (to leave a multicast group). Used with the setsockopt function.

#define SO_TCP_KEEPALIVE 0x04

Socket option to enable or disable TCP keep-alive.
Used with the setsockopt function.
The option value should be cast to int type.
0: disable TCP keep-alive.
1: enable TCP keep-alive.
Default setting is disable.

Warning
connect and bind cause this setting to be lost, so the application should only set this option after calling connect or bind.
#define SO_TCP_KEEPIDLE 0x05

Socket option to set the time period after which the socket will trigger keep-alive transmissions.
Used with the setsockopt function.
The option value should be cast to int type.
Option value is the time period in units of 500ms. Maximum 2^32 - 1. Default setting is 120 (60 seconds).

Warning
connect and bind cause this setting to be lost, so the application should only set this option after calling connect or bind.
#define SO_TCP_KEEPINTVL 0x06

Socket option to set the time period between keep-alive retransmissions.
Used with the setsockopt function.
The option value should be cast to int type.
Option value is the time period in units of 500ms. Maximum 255. Default setting is 1 (0.5 seconds).

Warning
connect and bind cause this setting to be lost, so the application should only set this option after calling connect or bind.
#define SO_TCP_KEEPCNT 0x07

Socket option to set the number of keep-alive retransmissions to be carried out before declaring that the remote end is not available.
Used with the setsockopt function.
The option value should be cast to int type.
Maximum 255. Default setting is 20.

Warning
connect and bind cause this setting to be lost, so the application should only set this option after calling connect or bind.
Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 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

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

#define SOCK_ERR_INVALID_ADDRESS -1

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

#define SOCK_ERR_ADDR_ALREADY_IN_USE -2

Socket operation cannot bind on the given address. With socket operations, only one IP address per socket 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. States that bind operation failed.

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

#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

#define SOCK_ERR_INVALID_ARG -6

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

#define SOCK_ERR_MAX_LISTEN_SOCK -7

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

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

#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. It is generated as an error to the sendto function when the address required to send the data to is not known.

#define SOCK_ERR_CONN_ABORTED -12

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

#define SOCK_ERR_TIMEOUT -13

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

#define SOCK_ERR_BUFFER_FULL -14

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

Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: DataTypes

Modules | Data Structures | Typedefs | Enumerations
DataTypes
Socket

Modules

Asynchronous Events

Data Structures

struct | in_addr
struct | sockaddr
struct | sockaddr_in
struct | tstrSockErr

Typedefs

typedef sint8 SOCKET

Enumerations

enum tenuSockErrSource { SOCKET_ERR_UNKNOWN = 0, SOCKET_ERR_TLS_REMOTE, SOCKET_ERR_TLS_LOCAL }

Detailed Description

Specific Enumeration-typedefs used for socket operations

Typedef Documentation

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.

Enumeration Type Documentation

enum tenuSockErrSource

Source of socket error (local, remote or unknown).

See also
tstrSockErr
Enumerator
SOCKET_ERR_UNKNOWN | No detail available (also used when there is no error).
SOCKET_ERR_TLS_REMOTE | TLS Error Alert received from peer.
SOCKET_ERR_TLS_LOCAL | TLS Error Alert generated locally.
Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Asynchronous Events

Data Structures | Enumerations
Asynchronous Events
Socket » DataTypes

Data Structures

struct | tstrSocketBindMsg
struct | tstrSocketListenMsg
struct | tstrSocketAcceptMsg
struct | tstrSocketConnectMsg
struct | tstrSocketRecvMsg

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, SOCKET_MSG_SECURE
}

Detailed Description

Specific Enumeration used for asynchronous operations

Enumeration Type Documentation

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.
SOCKET_MSG_SECURE | Existing socket made secure event.
Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrSocketBindMsg Struct Reference

Data Fields
tstrSocketBindMsg Struct Reference
Socket » DataTypes » Asynchronous Events

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

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 Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrSocketListenMsg Struct Reference

Data Fields
tstrSocketListenMsg Struct Reference
Socket » DataTypes » Asynchronous Events

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

sint8 status

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

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrSocketAcceptMsg Struct Reference

Data Fields
tstrSocketAcceptMsg Struct Reference
Socket » DataTypes » Asynchronous Events

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

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.

struct sockaddr_in strAddr

Socket address structure for the remote peer.

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrSocketConnectMsg Struct Reference

Data Fields
tstrSocketConnectMsg Struct Reference
Socket » DataTypes » Asynchronous Events

Data Fields

SOCKET sock
sint8 s8Error

Detailed Description

Socket connect status.

Socket connect information is returned through this structure in response to an asynchronous call to the connect socket function or the secure socket function. This structure and the event SOCKET_MSG_CONNECT or SOCKET_MSG_SECURE 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

SOCKET sock

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

sint8 s8Error

Connect error code:

  • ZERO for a successful connect or successful secure.
  • Otherwise a negative error code corresponding to the type of error.
Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrSocketRecvMsg Struct Reference

Data Fields
tstrSocketRecvMsg Struct Reference
Socket » DataTypes » Asynchronous Events

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, is passed-in parameters to the callback function.

Remarks
After receiving this structure, the application should issue a new call to recv or recvfrom in order to receive subsequent data.
In the case of SOCKET_MSG_RECVFROM (UDP), any further data in the same datagram is dropped, then subsequent datagrams are buffered on the WINC until the application provides a buffer via a new call to recvfrom
In the case of SOCKET_MSG_RECV (TCP), all subsequent data is buffered on the WINC until the application provides a buffer via a new call to recv
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

uint8* pu8Buffer

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

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.

uint16 u16RemainingSize

This field is used internally by the driver. In normal operation, this field will be 0 when the application receives this structure.

struct sockaddr_in strRemoteAddr

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

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: in_addr Struct Reference

Data Fields
in_addr Struct Reference
Socket » DataTypes

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

uint32 s_addr

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

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: sockaddr Struct Reference

Data Fields
sockaddr Struct Reference
Socket » DataTypes

Data Fields

uint16 sa_family
uint8 sa_data [14]

Detailed Description

Generic socket address structure.

See also
sockaddr_in

Field Documentation

uint16 sa_family

Socket address family.

uint8 sa_data[14]

Maximum size of all the different socket address structures.

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: sockaddr_in Struct Reference

Data Fields
sockaddr_in Struct Reference
Socket » DataTypes

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

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.

uint16 sin_port

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

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.

uint8 sin_zero[8]

Padding to make structure the same size as sockaddr.

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: tstrSockErr Struct Reference

Data Fields
tstrSockErr Struct Reference
Socket » DataTypes

Data Fields

tenuSockErrSource enuErrSource
uint8 u8ErrCode

Detailed Description

Detail about socket failures. Used with get_error_detail.

Field Documentation

tenuSockErrSource enuErrSource

Source of socket error (local, remote or unknown).

uint8 u8ErrCode

TLS Alert code as defined in https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-6.

Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Callbacks

Typedefs
Callbacks
Socket

Typedefs

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)

Detailed Description

Typedef Documentation

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
  • SOCKET_MSG_SECURE
[in] pvMsg Pointer to message structure. Existing types are:
  • tstrSocketBindMsg
  • tstrSocketListenMsg
  • tstrSocketAcceptMsg
  • tstrSocketConnectMsg
  • tstrSocketRecvMsg
See also
tenuSocketCallbackMsgType tstrSocketRecvMsg tstrSocketConnectMsg tstrSocketAcceptMsg tstrSocketListenMsg tstrSocketBindMsg
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

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
Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Functions

Modules
Functions
Socket

Modules

socketInit
socketDeInit
socketState
registerSocketCallback
socket
bind
listen
accept
connect
secure
recv
recvfrom
send
sendto
close
nmi_inet_addr
gethostbyname
sslEnableCertExpirationCheck
setsockopt
getsockopt
m2m_ping_req

Detailed Description

Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: socketInit

Functions
socketInit
Socket » Functions

Functions

NMI_API void socketInit (void)

Detailed Description

The function performs the necessary initializations 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 resetting 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.

Function Documentation

NMI_API void socketInit ( void )
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 in the maximum number of sockets MAX_SOCKET based on the systems capability.

Example

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

1 tstrWifiInitParam param;
2 tstrNetworkId strNetworkId;
3 tstrAuthPsk strAuthPsk;
4 int8_t ret;
5 char topic[strlen(MAIN_CHAT_TOPIC) + MAIN_CHAT_USER_NAME_SIZE + 1];
6
7 //Initialize the board.
8 system_init();
9
10 //Initialize the UART console.
11 configure_console();
12
13 // Initialize the BSP.
14 nm_bsp_init();
15
16 ----------
17
18 // Initialize socket interface.
19 socketInit();
20 registerSocketCallback(socket_event_handler, socket_resolve_handler);
21
22 // Connect to router.
23 strNetworkId.pu8Bssid = NULL;
24 strNetworkId.pu8Ssid = MAIN_WLAN_SSID;
25 strNetworkId.u8SsidLen = sizeof(MAIN_WLAN_SSID);
26 strNetworkId.u8Channel = M2M_WIFI_CH_ALL;
27
28 strAuthPsk.pu8Psk = NULL;
29 strAuthPsk.pu8Passphrase = MAIN_WLAN_PSK;
30 strAuthPsk.u8PassphraseLen = (uint8)strlen((char*)MAIN_WLAN_PSK);
31
32 m2m_wifi_connect_psk(WIFI_CRED_SAVE_ENCRYPTED, &strNetworkId, &strAuthPsk);
Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: socketDeInit

Functions
socketDeInit
Socket » Functions

Functions

NMI_API void socketDeinit (void)

Detailed Description

Function Documentation

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.

Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: socketState

Functions
socketState
Socket » Functions

Functions

NMI_API uint8 IsSocketReady (void)

Detailed Description

Function Documentation

uint8 IsSocketReady ( void )
See also
socketInit socketDeinit
Returns
If the socket has been initialized and is ready. Should return 1 after socketInit and 0 after socketDeinit
Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: registerSocketCallback

Functions
registerSocketCallback
Socket » Functions

Functions

NMI_API void registerSocketCallback (tpfAppSocketCb socket_cb, tpfAppResolveCb resolve_cb)

Detailed Description

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.

Function Documentation

NMI_API void registerSocketCallback | ( | tpfAppSocketCb | socket_cb,
 |  | tpfAppResolveCb | resolve_cb
 | ) |  |
Parameters
[in] | socket_cb | tpfAppSocketCb 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 | tpfAppResolveCb Assignment of callback function to the global callback tpfAppResolveCb gpfAppResolveCb. Used for DNS resolving. 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 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.

1 tstrWifiInitParam param;
2 tstrNetworkId strNetworkId;
3 tstrAuthPsk strAuthPsk;
4 int8_t ret;
5 struct sockaddr_in addr;
6
7 // Initialize the board
8 system_init();
9
10 //Initialize the UART console.
11 configure_console();
12
13 // Initialize the BSP.
14 nm_bsp_init();
15
16 // Initialize socket address structure.
17 addr.sin_family = AF_INET;
18 addr.sin_port = _htons(MAIN_WIFI_M2M_SERVER_PORT);
19 addr.sin_addr.s_addr = _htonl(MAIN_WIFI_M2M_SERVER_IP);
20
21 // Initialize Wi-Fi parameters structure.
22 memset((uint8_t *)&param, 0, sizeof(tstrWifiInitParam));
23
24 // Initialize Wi-Fi driver with data and status callbacks.
25 param.pfAppWifiCb = wifi_cb;
26 ret = m2m_wifi_init(&param);
27 if (M2M_SUCCESS != ret) {
28 printf("main: m2m_wifi_init call error!(%d)\r\n", ret);
29 while (1) {
30 }
31 }
32
33 // Initialize socket module
34 socketInit();
35 registerSocketCallback(socket_cb, NULL);
36
37 // Connect to router.
38 strNetworkId.pu8Bssid = NULL;
39 strNetworkId.pu8Ssid = MAIN_WLAN_SSID;
40 strNetworkId.u8SsidLen = sizeof(MAIN_WLAN_SSID);
41 strNetworkId.u8Channel = M2M_WIFI_CH_ALL;
42
43 strAuthPsk.pu8Psk = NULL;
44 strAuthPsk.pu8Passphrase = MAIN_WLAN_PSK;
45 strAuthPsk.u8PassphraseLen = (uint8)strlen((char*)MAIN_WLAN_PSK);
46
47 m2m_wifi_connect_psk(WIFI_CRED_SAVE_ENCRYPTED, &strNetworkId, &strAuthPsk);
Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: socket

Functions
socket
Socket » Functions

Functions

NMI_API SOCKET socket (uint16 u16Domain, uint8 u8Type, uint8 u8Config)

Detailed Description

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.

Function Documentation

NMI_API SOCKET socket | ( | uint16 | u16Domain,
 |  | uint8 | u8Type,
 |  | uint8 | u8Config
 | ) |  |
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] u8Config Used to specify the socket configuration. The following configuration values are defined:
  • SOCKET_CONFIG_SSL_OFF : The socket is not secured by TLS.
  • SOCKET_CONFIG_SSL_ON : The socket is secured by TLS. This value has no effect if u8Type is SOCK_DGRAM
  • SOCKET_CONFIG_SSL_DELAY : The socket is not secured by TLS, but may be secured later, by calling secure. This value has no effect if u8Type is SOCK_DGRAM
    All other configuration values are reserved and should not be used.
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 secure 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 a priori to any other related socket functions "e.g. send, recv, close ..etc"

Allocation 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

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

TCP example

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

SSL example

1 static SOCKET ssl_socket = -1;
2
3 ssl_socket = socket(AF_INET, SOCK_STREAM, SOCK_FLAGS_SSL));
Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: bind

Functions
bind
Socket » Functions

Functions

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

Detailed Description

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.

Function Documentation

NMI_API sint8 bind | ( | SOCKET | sock,
 |  | struct sockaddr * | pstrAddr,
 |  | uint8 | u8AddrLen
 | ) |  |
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.
[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.

1 struct sockaddr_in addr;
2 SOCKET udpServerSocket =-1;
3 int ret = -1;
4
5 if(udpServerSocket == -1)
6 {
7 udpServerSocket = socket(AF_INET, SOCK_DGRAM, 0);
8 if(udpServerSocket >= 0)
9 {
10 addr.sin_family = AF_INET;
11 addr.sin_port = _htons(1234);
12 addr.sin_addr.s_addr = 0;
13 ret = bind(udpServerSocket,(struct sockaddr*)&addr,sizeof(addr));
14
15 if(ret != 0)
16 {
17 printf("Bind Failed. Error code = %d\n",ret);
18 close(udpServerSocket);
19 }
20 }
21 else
22 {
23 printf("UDP Server Socket Creation Failed\n");
24 return;
25 }
26 }
Generated on Tue Sep 27 2022 16:17:31 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: listen

Functions
listen
Socket » Functions

Functions

NMI_API sint8 listen (SOCKET sock, uint8 backlog)

Detailed Description

After successful socket binding to an IP address and port on the system, start listening on a passive socket 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 receive notification of socket connection termination.

Function Documentation

NMI_API sint8 listen | ( | SOCKET | sock,
 |  | uint8 | backlog
 | ) |  |
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 passing invalid arguments 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.

1 static void TCP_Socketcallback(SOCKET sock, uint8 u8Msg, void * pvMsg)
2 {
3 int ret =-1;
4
5 switch(u8Msg)
6 {
7 case SOCKET_MSG_BIND:
8 {
9 tstrSocketBindMsg *pstrBind = (tstrSocketBindMsg*)pvMsg;
10 if(pstrBind != NULL)
11 {
12 if(pstrBind->status == 0)
13 {
14 ret = listen(sock, 0);
15
16 if(ret <0)
17 printf("Listen failure! Error = %d\n",ret);
18 }
19 else
20 {
21 M2M_ERR("bind Failure!\n");
22 close(sock);
23 }
24 }
25 }
26 break;
27
28 case SOCKET_MSG_LISTEN:
29 {
30
31 tstrSocketListenMsg *pstrListen = (tstrSocketListenMsg*)pvMsg;
32 if(pstrListen != NULL)
33 {
34 if(pstrListen->status == 0)
35 {
36 ret = accept(sock,NULL,0);
37 }
38 else
39 {
40 M2M_ERR("listen Failure!\n");
41 close(sock);
42 }
43 }
44 }
45 break;
46
47 case SOCKET_MSG_ACCEPT:
48 {
49 tstrSocketAcceptMsg *pstrAccept = (tstrSocketAcceptMsg*)pvMsg;
50
51 if(pstrAccept->sock >= 0)
52 {
53 TcpNotificationSocket = pstrAccept->sock;
54 recv(pstrAccept->sock,gau8RxBuffer,sizeof(gau8RxBuffer),TEST_RECV_TIMEOUT);
55 }
56 else
57 {
58 M2M_ERR("accept failure\n");
59 }
60 }
61 break;
62
63 default:
64 break;
65 }
66 }
Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: accept

Functions
accept
Socket » Functions

Functions

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

Detailed Description

The function has no current implementation. An empty declaration is used to prevent errors when legacy application code is used. For recent application use, the accept function can be safer as it has no effect and could be safely removed from any application using it.

Function Documentation

NMI_API sint8 accept | ( | SOCKET | sock,
 |  | struct sockaddr * | addr,
 |  | uint8 * | addrlen
 | ) |  |
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.
Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: connect

Functions
connect
Socket » Functions

Functions

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

Detailed Description

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 to receive any packets transmitted by the remote server, unless the application is interrupted by a notification of socket connection termination.

Function Documentation

NMI_API sint8 connect | ( | SOCKET | sock,
 |  | struct sockaddr * | pstrAddr,
 |  | uint8 | u8AddrLen
 | ) |  |
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.
[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

1 struct sockaddr_in Serv_Addr;
2 SOCKET TcpClientSocket =-1;
3 int ret = -1
4
5 TcpClientSocket = socket(AF_INET,SOCK_STREAM,0);
6 Serv_Addr.sin_family = AF_INET;
7 Serv_Addr.sin_port = _htons(1234);
8 Serv_Addr.sin_addr.s_addr = inet_addr(SERVER);
9 printf("Connected to server via socket %u\n",TcpClientSocket);
10
11 do
12 {
13 ret = connect(TcpClientSocket,(sockaddr_in*)&Serv_Addr,sizeof(Serv_Addr));
14 if(ret != 0)
15 {
16 printf("Connection Error\n");
17 }
18 else
19 {
20 printf("Connection successful.\n");
21 break;
22 }
23 }while(1)

Socket Callback

1 if(u8Msg == SOCKET_MSG_CONNECT)
2 {
3 tstrSocketConnectMsg *pstrConnect = (tstrSocketConnectMsg*)pvMsg;
4 if(pstrConnect->s8Error == 0)
5 {
6 uint8 acBuffer[GROWL_MSG_SIZE];
7 uint16 u16MsgSize;
8
9 printf("Connect success!\n");
10
11 u16MsgSize = FormatMsg(u8ClientID, acBuffer);
12 send(sock, acBuffer, u16MsgSize, 0);
13 recv(pstrNotification->Socket, (void*)au8Msg,GROWL_DESCRIPTION_MAX_LENGTH, GROWL_RX_TIMEOUT);
14 u8Retry = GROWL_CONNECT_RETRY;
15 }
16 else
17 {
18 M2M_DBG("Connection Failed, Error: %d\n",pstrConnect->s8Error");
19 close(pstrNotification->Socket);
20 }
21 }
Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: secure

Functions
secure
Socket » Functions

Functions

sint8 secure (SOCKET sock)

Detailed Description

Converts an (insecure) TCP connection with a remote server into a secure TLS-over-TCP connection. It may be called after both of the following:

  • a TCP socket has been created by the socket function, with u8Config parameter set to SOCKET_CONFIG_SSL_DELAY
  • a successful connection has been made on the socket via the connect function. This is an asynchronous API; the application socket callback function is notified of the result of the attempt to make the connection secure through the event SOCKET_MSG_SECURE, along with a structure tstrSocketConnectMsg. If the attempt to make the connection secure fails, the application should call close()

Function Documentation

sint8 secure ( SOCKET sock )
Parameters
[in] sock Socket ID, corresponding to a connected TCP socket.
Precondition
socket and connect must be called to connect a TCP socket before passing the socket ID to this function. Value SOCKET_CONFIG_SSL_DELAY must have been set in the u8Config parameter that was passed to socket.
See also
socket connect
Returns
The function returns SOCK_ERR_NO_ERROR for successful operations and a negative error value otherwise. The possible error values are:
  • SOCK_ERR_INVALID_ARG Indicating passing invalid arguments such as negative socket ID.
  • SOCK_ERR_INVALID Indicating failure to process the request.
Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: recv

Functions
recv
Socket » Functions

Functions

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

Detailed Description

An asynchronous 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. The application code is expected to close the socket through the call to the close function upon the appearance of the above mentioned errors.

Function Documentation

NMI_API sint16 recv | ( | SOCKET | sock,
 |  | void * | pvRecvBuf,
 |  | uint16 | u16BufLen,
 |  | uint32 | u32Timeoutmsec
 | ) |  |
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 Receive buffer.
  • SOCK_ERR_BUFFER_FULL Indicate socket receive 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.

1 switch(u8Msg)
2 {
3
4 case SOCKET_MSG_ACCEPT:
5 {
6 tstrSocketAcceptMsg *pstrAccept = (tstrSocketAcceptMsg*)pvMsg;
7
8 if(pstrAccept->sock >= 0)
9 {
10 recv(pstrAccept->sock,gau8RxBuffer,sizeof(gau8RxBuffer),TEST_RECV_TIMEOUT);
11 }
12 else
13 {
14 M2M_ERR("accept\n");
15 }
16 }
17 break;
18
19
20 case SOCKET_MSG_RECV:
21 {
22 tstrSocketRecvMsg *pstrRx = (tstrSocketRecvMsg*)pvMsg;
23
24 if(pstrRx->s16BufferSize > 0)
25 {
26 recv(sock,gau8RxBuffer,sizeof(gau8RxBuffer),TEST_RECV_TIMEOUT);
27 }
28 else
29 {
30 printf("Socket recv Error: %d\n",pstrRx->s16BufferSize);
31 close(sock);
32 }
33 }
34 break;
35
36 default:
37 break;
38 }
39 }
Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: recvfrom

Functions
recvfrom
Socket » Functions

Functions

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

Detailed Description

Receives data from a UDP Socket.

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)

Function Documentation

NMI_API sint16 recvfrom | ( | SOCKET | sock,
 |  | void * | pvRecvBuf,
 |  | uint16 | u16BufLen,
 |  | uint32 | u32TimeoutSeconds
 | ) |  |
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 UDP socket before passing the socket ID to the recvfrom 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.

1 switch(u8Msg)
2 {
3 case SOCKET_MSG_BIND:
4 {
5 tstrSocketBindMsg *pstrBind = (tstrSocketBindMsg*)pvMsg;
6
7 if(pstrBind != NULL)
8 {
9 if(pstrBind->status == 0)
10 {
11 recvfrom(sock, gau8SocketTestBuffer, TEST_BUFFER_SIZE, 0);
12 }
13 else
14 {
15 M2M_ERR("bind\n");
16 }
17 }
18 }
19 break;
20
21 case SOCKET_MSG_RECVFROM:
22 {
23 tstrSocketRecvMsg *pstrRx = (tstrSocketRecvMsg*)pvMsg;
24
25 if(pstrRx->s16BufferSize > 0)
26 {
27 //get the remote host address and port number
28 uint16 u16port = pstrRx->strRemoteAddr.sin_port;
29 uint32 strRemoteHostAddr = pstrRx->strRemoteAddr.sin_addr.s_addr;
30
31 printf("Received frame with size = %d.\tHost address=%x, Port number = %d\n\n",pstrRx->s16BufferSize,strRemoteHostAddr, u16port);
32
33 ret = recvfrom(sock,gau8SocketTestBuffer,sizeof(gau8SocketTestBuffer),TEST_RECV_TIMEOUT);
34 }
35 else
36 {
37 printf("Socket recv Error: %d\n",pstrRx->s16BufferSize);
38 ret = close(sock);
39 }
40 }
41 break;
42
43 default:
44 break;
45 }
46 }
Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: send

Functions
send
Socket » Functions

Functions

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

Detailed Description

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.

Function Documentation

NMI_API sint16 send | ( | SOCKET | sock,
 |  | void * | pvSendBuffer,
 |  | uint16 | u16SendLength,
 |  | uint16 | u16Flags
 | ) |  |
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 a priori the consecutive calls to the send function, to ensure that the destination address is saved in the firmware.
Warning
u16SendLength must not exceed SOCKET_BUFFER_MAX_LENGTH
Use a valid socket identifier through the a prior 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.
See also
socketInit recv sendto socket connect accept sendto
Returns
The function shall return SOCK_ERR_NO_ERROR for successful operation and a negative value (indicating the error) otherwise.
Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: sendto

Functions
sendto
Socket » Functions

Functions

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

Detailed Description

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 handler. The application code is expected to receive data from a successful bounded 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.

Function Documentation

NMI_API sint16 sendto | ( | SOCKET | sock,
 |  | void * | pvSendBuffer,
 |  | uint16 | u16SendLength,
 |  | uint16 | flags,
 |  | struct sockaddr * | pstrDestAddr,
 |  | uint8 | u8AddrLen
 | ) |  |
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.
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.
See also
socketInit recvfrom sendto socket connect accept send
Returns
The function returns SOCK_ERR_NO_ERROR for successful operation and a negative value (indicating the error) otherwise.
Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: close

Functions
close
Socket » Functions

Functions

NMI_API sint8 close (SOCKET sock)

Detailed Description

Synchronous close function, releases all the socket assigned resources.

Function Documentation

NMI_API sint8 close ( SOCKET sock )
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.
Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: nmi_inet_addr

Functions
nmi_inet_addr
Socket » Functions

Functions

NMI_API uint32 nmi_inet_addr (char *pcIpAddr)

Detailed Description

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 host name, 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).

Function Documentation

NMI_API uint32 nmi_inet_addr ( char * pcIpAddr )
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).
Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: gethostbyname

Functions
gethostbyname
Socket » Functions

Functions

NMI_API sint8 gethostbyname (uint8 *pcHostName)

Detailed Description

Asynchronous DNS resolving function. This function use DNS to resolve a domain name into 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()

Function Documentation

NMI_API sint8 gethostbyname ( uint8 * pcHostName )
Parameters
[in] pcHostName NULL terminated string containing the domain name for the remote host. Its size must not exceed HOSTNAME_MAX_SIZE.
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
See also
registerSocketCallback
Returns
  • SOCK_ERR_NO_ERROR
  • SOCK_ERR_INVALID_ARG
Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: sslEnableCertExpirationCheck

Functions
sslEnableCertExpirationCheck
Socket » Functions

Functions

NMI_API sint8 sslEnableCertExpirationCheck (tenuSslCertExpSettings enuValidationSetting)

Detailed Description

Configure the behavior of the SSL Library for Certificate Expiry Validation.

Function Documentation

NMI_API sint8 sslEnableCertExpirationCheck ( tenuSslCertExpSettings enuValidationSetting )
Parameters
[in] enuValidationSetting See tenuSslCertExpSettings for details.
See also
tenuSslCertExpSettings
Returns
  • SOCK_ERR_NO_ERROR for successful operation and negative error code otherwise.
Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: setsockopt

Functions
setsockopt
Socket » Functions

Functions

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

Detailed Description

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 socket specified by the socket argument.

Function Documentation

NMI_API sint8 setsockopt | ( | SOCKET | socket,
 |  | uint8 | u8Level,
 |  | uint8 | option_name,
 |  | const void * | option_value,
 |  | uint16 | u16OptionLen
 | ) |  |
Parameters
[in] | socket | Socket handler.
[in] u8Level Protocol level.
Supported protocol levels are SOL_SOCKET and SOL_SSL_SOCKET.
[in] option_name Option to be set.
For protocol level SOL_SOCKET, the supported option names are:
SO_SET_UDP_SEND_CALLBACK
SO_TCP_KEEPALIVE
SO_TCP_KEEPIDLE
SO_TCP_KEEPINTVL
SO_TCP_KEEPCNT
For protocol level SOL_SSL_SOCKET, the supported option names are:
SO_SSL_BYPASS_X509_VERIF
SO_SSL_SNI
SO_SSL_ENABLE_SESSION_CACHING
SO_SSL_ENABLE_SNI_VALIDATION
SO_SSL_ALPN
[in] | option_value | Pointer to user provided value.
[in] | u16OptionLen | Length of the option value in bytes. Refer to each option documentation for the required length.
Returns
The function shall return SOCK_ERR_NO_ERROR for successful operation and a negative value (indicating the error) otherwise.
Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: getsockopt

Functions
getsockopt
Socket » Functions

Functions

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

Detailed Description

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

Function Documentation

sint8 getsockopt | ( | SOCKET | sock,
 |  | uint8 | u8Level,
 |  | uint8 | u8OptName,
 |  | const void * | pvOptValue,
 |  | uint8 * | pu8OptLen
 | ) |  |
Parameters
[in] | sock | Socket Identifier.
[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.
Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: m2m_ping_req

Functions
m2m_ping_req
Socket » Functions

Functions

NMI_API sint8 | m2m_ping_req (uint32 u32DstIP, uint8 u8TTL, tpfPingCb fpPingCb)
sint8 | set_alpn_list (SOCKET sock, const char *pcProtocolList)
sint8 | get_alpn_index (SOCKET sock)
sint8 | get_error_detail (SOCKET sock, tstrSockErr *pstrErr)

Detailed Description

The function sends ping request to the given IP Address.

Function Documentation

NMI_API sint8 m2m_ping_req | ( | uint32 | u32DstIP,
 |  | uint8 | u8TTL,
 |  | tpfPingCb | fpPingCb
 | ) |  |
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 representative.
[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.
Warning
This API should only be used to request one ping at a time; calling this API invalidates callbacks for previous ping requests.
See also
nmi_inet_addr
Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise.
sint8 set_alpn_list | ( | SOCKET | sock,
 |  | const char * | pcProtocolList
 | ) |  |

This function sets the protocol list used for application-layer protocol negotiation (ALPN). If used, it must be called after creating a SSL socket (using socket) and before connecting/binding (using connect or bind) or securing (using secure).

Parameters
[in] sock Socket ID obtained by a call to socket. This is the SSL socket to which the ALPN list applies.
[in] pcProtocolList Pointer to the list of protocols available in the application.
The entries in the list must:
  • be separated with ' ' (space).
  • not contain ' ' (space) or '\0' (NUL).
  • be non-zero length.
The list itself must:
  • be terminated with '\0' (NUL).
  • be no longer than ALPN_LIST_MAX_APP_LENGTH, including separators (spaces) and terminator (NUL).
  • contain at least one entry.
Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise.

Example

The example demonstrates an application using set_alpn_list and get_alpn_index to negotiate secure HTTP/2 (with fallback option of HTTP/1.1).

Main Function

1 SOCKET TcpClientSocket = socket(AF_INET, SOCK_STREAM, SOCKET_CONFIG_SSL_ON);
2 if (TcpClientSocket >= 0)
3 {
4 struct sockaddr_in Serv_Addr = {
5 .sin_family = AF_INET,
6 .sin_port = _htons(1234),
7 .sin_addr.s_addr = inet_addr(SERVER)
8 };
9 set_alpn_list(TcpClientSocket, "h2 http/1.1");
10 connect(TcpClientSocket, &Serv_Addr, sizeof(Serv_Addr));
11 }

Socket Callback

1 if(u8Msg == SOCKET_MSG_CONNECT)
2 {
3 tstrSocketConnectMsg *pstrConnect = (tstrSocketConnectMsg*)pvMsg;
4 if(pstrConnect->s8Error == 0)
5 {
6 uint8 alpn_index = get_alpn_index(pstrConnect->sock);
7 switch (alpn_index)
8 {
9 case 1:
10 printf("Negotiated HTTP/2\n");
11 break;
12 case 2:
13 printf("Negotiated HTTP/1.1\n");
14 break;
15 case 0:
16 printf("Protocol negotiation did not occur\n");
17 break;
18 }
19 }
20 }
sint8 get_alpn_index ( SOCKET sock )

This function gets the index of the protocol negotiated via ALPN. It should be called when a SSL socket connection succeeds, in order to determine which application-layer protocol must be used.

Parameters
[in] sock Socket ID obtained by a call to socket. This is the SSL socket to which the ALPN applies.
Returns
The function returns:
  • >0: 1-based index of negotiated protocol with respect to the list previously provided to set_alpn_list
  • 0: No negotiation occurred (eg TLS peer did not support ALPN).
  • <0: Invalid parameters (socket is not in use, or not an SSL socket).
See also
Example
sint8 get_error_detail | ( | SOCKET | sock,
 |  | tstrSockErr * | pstrErr
 | ) |  |

This function gets detail about a socket failure. The application can call this when notified of a socket failure via SOCKET_MSG_CONNECT or SOCKET_MSG_RECV. If used, it must be called before close.

Parameters
[in] | sock | Socket ID obtained by a call to socket.
[out] | pstrErr | Pointer to structure to be populated with the details of the socket failure.
Returns
The function returns SOCK_ERR_NO_ERROR if the request is successful. In this case pstrErr has been populated. The function returns a negative value if the request is not successful. In this case pstrErr has not been populated.
Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 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

#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 the host representation to the Network byte order representation.

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

Convert a 2-byte integer (short) from the host representation to the Network byte order representation.

#define _ntohl _htonl

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

#define _ntohs _htons

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

Generated on Tue Sep 27 2022 16:17:32 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Data Structures

Data Structures
Here are the data structures with brief descriptions:
C EcDomainParam |
C EcPoint |
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 |
C tstrAuth1xMschap2 |
C tstrAuth1xTls |
C tstrAuthPsk |
C tstrAuthWep |
C tstrConfAutoRate | Auto TX rate selection parameters passed to m2m_wifi_conf_auto_rate
C tstrCyptoResp | Crypto response
C tstrEccReqInfo | Information relating to ECC operations
C tstrEcdhReqInfo | Information relating to operations of type ECC_REQ_CLIENT_ECDH, ECC_REQ_GEN_KEY and ECC_REQ_SERVER_ECDH
C tstrECDomainParam | ECC Curve Domain Parameters
C tstrEcdsaSignReqInfo | Information relating to requests of type ECC_REQ_SIGN_GEN
C tstrEcdsaVerifyReqInfo | Information relating to requests of type ECC_REQ_SIGN_VERIFY
C tstrECPoint | Elliptic Curve point representation
C tstrEllipticCurve | Definition of an elliptic curve
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 tstrM2MAPConfig | AP Configuration
C tstrM2MAPConfigExt | AP Configuration Extension
C tstrM2MAPModeConfig | AP Configuration
C tstrM2mBatteryVoltage | Battery Voltage
C tstrM2mClientState | PS Client State
C tstrM2mConnCredCmn | Wi-Fi Connect Credentials Common section
C tstrM2mConnCredHdr | Wi-Fi Connect Credentials Header
C tstrM2MConnInfo | M2M Provisioning Information obtained from the HTTP Provisioning server
C tstrM2MDefaultConnResp | Response error of the m2m_default_connect
C tstrM2MDeviceNameConfig | Device name
C tstrM2mEnableLogs | Enable Firmware logs
C tstrM2MGenericResp | Generic success/error response
C tstrM2MIPConfig | IP configuration (static/DHCP). The same structure is used for DCHP callback as well as 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 | Received Packet Size and Data Offset
C tstrM2mLsnInt | Listen interval
C tstrM2MMulticastMac | M2M add/remove multi-cast mac address
C tstrM2MProvisionInfo | M2M Provisioning Information obtained from the HTTP Provisioning server
C tstrM2MProvisionModeConfig | M2M Provisioning Mode Configuration
C tstrM2mPsType | Power Save Configuration
C tstrM2mPwrMode | Power Mode
C tstrM2mReqScanResult | Scan Result Request
C tstrM2MScan | Wi-Fi Scan Request
C tstrM2mScanDone | Wi-Fi Scan Result
C tstrM2MScanOption | This struct contains the configuration options for Wi-Fi scan
C tstrM2MScanRegion | Wi-Fi channel regulation region information
C tstrM2Mservercmd | PS Server CMD
C tstrM2mServerInit | PS Server initialization
C tstrM2mSetMacAddress | Sets the MAC address from application. The WINC load the mac address from the effuse by default to the WINC configuration memory, but that function is used to let the application overwrite the configuration memory with the mac address from the host
C tstrM2mSlpReqTime | Manual power save request sleep time
C tstrM2MSNTPConfig | SNTP Client Configuration
C tstrM2MStopScanOption | This struct holds additional configuration options for Wi-Fi scan
C tstrM2mTxPwrLevel | Tx power level
C tstrM2mWifi1xHdr | Wi-Fi Authentication 802.1x header for parameters. The parameters (Domain, UserName, PrivateKey/Password) are appended to this structure
C tstrM2mWifiApId | Specify an access point (by SSID)
C tstrM2mWifiAuthInfoHdr | Generic Wi-Fi authentication information to be sent in a separate HIF message of type M2M_WIFI_IND_CONN_PARAM (preceding M2M_WIFI_REQ_CONN)
C tstrM2mWifiConnHdr | Wi-Fi Connect Request (new format) for use with M2M_WIFI_REQ_CONN. This structure is sent across the HIF along with the relevant auth details. One of: tstrM2mWifiPsk tstrM2mWifiWep tstrM2mWifi1xHdr If further authentication details need to be sent (such as client certificate for 1x TLS), they are sent with header tstrM2mWifiAuthInfoHdr in a preceding HIF message of type M2M_WIFI_IND_CONN_PARAM
C tstrM2mWiFiGainIdx | Gain Table index selection corresponding to specific WiFi region
C tstrM2mWifiGainsParams | Gain Values
C tstrM2MWifiMonitorModeCtrl | Wi-Fi Monitor Mode Filter
C tstrM2mWifiPsk | Passphrase and PSK for WPA(2) PSK
C tstrM2mWiFiRoaming | Roaming related information
C tstrM2MWifiRxPacketInfo | Wi-Fi RX Frame Header
C tstrM2mWifiscanResult | Wi-Fi Scan Result
C tstrM2mWifiStateChanged | Wi-Fi Connection State
C tstrM2MWifiTxPacketInfo | Wi-Fi TX Packet Info
C tstrM2mWifiWep | WEP security key header
C tstrM2mWifiWepParams |
C tstrM2mWiFiXOSleepEnable | Choose to keep the XO on or off over deep sleep
C tstrM2MWPSConnect | WPS Configuration parameters
C tstrM2MWPSInfo | WPS Result
C tstrNetworkId |
C tstrOtaControlSec | Control Section Structure. 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 are kept in this structure
C tstrOtaHostFileEraseStatusResp | Host File OTA Information
C tstrOtaHostFileGetStatusResp | Host File OTA Information
C tstrOtaHostFileReadStatusResp | Host File OTA Information
C tstrOtaInitHdr | This struct contains the OTA image header
C tstrOtaStart |
C tstrOtaUpdateInfo | This struct contains the OTA update information
C tstrOtaUpdateStatusResp | This struct contains the OTA update status
C tstrPrng | M2M Request PRNG
C tstrSockErr | Detail about socket failures. Used with get_error_detail
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 | Used for time storage
C tstrTlsCrlEntry | Certificate data for inclusion in a revocation list (CRL)
C tstrTlsCrlInfo | Certificate revocation list details
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
Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 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__ : tstrM2MAPConfig , tstrM2mBatteryVoltage , tstrM2MConnInfo , tstrM2mLsnInt , tstrM2mPsType , tstrM2mScanDone , tstrM2MScanRegion , tstrM2mSetMacAddress , tstrM2MWifiMonitorModeCtrl , tstrM2mWiFiRoaming , tstrM2mWifiStateChanged , tstrM2mWiFiXOSleepEnable , tstrOtaHostFileGetStatusResp , tstrPrng
  • __PAD24__ : tstrConfAutoRate , tstrCyptoResp , tstrM2mClientState , tstrM2MDefaultConnResp , tstrM2mEnableLogs , tstrM2MGenericResp , tstrM2MProvisionModeConfig , tstrM2mPwrMode , tstrM2mReqScanResult , tstrM2Mservercmd , tstrM2mServerInit , tstrM2mTxPwrLevel , tstrM2mWiFiGainIdx , tstrM2MWifiRxPacketInfo , tstrM2mWifiWepParams , tstrM2MWPSConnect , tstrOtaHostFileEraseStatusResp , tstrOtaStart , tstrTlsCrlEntry
  • __PAD8__ : tstrEthInitParam , tstrM2MMulticastMac , tstrM2MSNTPConfig , tstrOtaHostFileReadStatusResp , tstrOtaUpdateInfo , tstrSystemTime
  • __PAD__ : tstrM2mWifiApId
  • __RSVD8__ : tstrM2MScan
  • _PAD16_ : tstrOtaUpdateStatusResp
  • _PAD8_ : tstrM2mWifiscanResult
Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 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 -

  • a : EcDomainParam
  • acFileName : tstrTlsSrvSecFileEntry
  • acHttpServerDomainName : tstrM2MProvisionModeConfig
  • acNTPServer : tstrM2MSNTPConfig
  • acPinNumber : tstrM2MWPSConnect
  • acSNI : tstrOtaStart
  • acSSID : tstrM2MConnInfo
  • acUrl : tstrOtaStart
  • astrEntries : tstrTlsSrvSecHdr
  • astrTlsCrl : tstrTlsCrlInfo
  • au81xAuthDetails : tstrM2mWifi1xHdr
  • au8Bssid : tstrM2mConnCredCmn
  • au8BSSID : tstrM2MWifiMonitorModeCtrl , tstrM2MWifiRxPacketInfo , tstrM2mWifiscanResult
  • au8Data : tstrTlsCrlEntry
  • au8DefRouterIP : tstrM2MAPConfigExt
  • au8DeviceName : tstrM2MDeviceNameConfig
  • au8DHCPServerIP : tstrM2MAPConfig
  • au8DNSServerIP : tstrM2MAPConfigExt
  • au8DstMacAddress : tstrM2MWifiMonitorModeCtrl , tstrM2MWifiRxPacketInfo
  • au8ethRcvBuf : tstrEthInitParam
  • au8Info : tstrM2mWifiAuthInfoHdr
  • au8IPAddr : tstrM2MConnInfo
  • au8Key : tstrEcdhReqInfo , tstrM2MAPConfig
  • au8Mac : tstrM2mSetMacAddress
  • au8MACAddress : tstrM2MConnInfo
  • au8macaddress : tstrM2MMulticastMac
  • au8Passphrase : tstrM2mWifiPsk
  • au8Passwd : tstr1xAuthCredentials
  • au8Password : tstrM2MProvisionInfo
  • au8Psk : tstrM2mWifiPsk
  • au8PSK : tstrM2MWPSInfo
  • au8Rsv : tstrM2mConnCredCmn , tstrM2MStopScanOption , tstrM2mWifiAuthInfoHdr , tstrM2mWifiPsk
  • au8SecStartPattern : tstrTlsSrvSecHdr
  • au8SrcMacAddress : tstrM2MWifiMonitorModeCtrl , tstrM2MWifiRxPacketInfo
  • au8SSID : tstrM2MAPConfig
  • au8Ssid : tstrM2mConnCredCmn
  • au8SSID : tstrM2MProvisionInfo , tstrM2mWifiApId , tstrM2mWifiscanResult , tstrM2MWPSInfo
  • au8SubnetMask : tstrM2MAPConfigExt
  • au8TlsSpecificRootNameSha1 : tstrM2mWifi1xHdr
  • au8UserName : tstr1xAuthCredentials
  • au8WepKey : tstrM2MAPConfig , tstrM2mWifiWep , tstrM2mWifiWepParams
Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Data Fields

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

- b -

  • b : EcDomainParam
  • bPrependDomain : tstrAuth1xMschap2 , tstrAuth1xTls
  • bUnencryptedUserName : tstrAuth1xMschap2 , tstrAuth1xTls
Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 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 -

  • enuArInitialRateSel : tstrConfAutoRate
  • enuChannel : tstrNetworkId
  • enuErrSource : tstrSockErr
  • enuType : tstrEllipticCurve
  • enuUseDHCP : tstrM2MSNTPConfig
  • enuWlanTxRate : tstrConfAutoRate
Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 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 -

  • G : EcDomainParam
Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 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 -

  • p : EcDomainParam
  • pfAppEthCb : tstrEthInitParam
  • pfAppMonCb : tstrWifiInitParam
  • pfAppWifiCb : tstrEthInitParam , tstrWifiInitParam
  • pFileBuf : tstrOtaHostFileReadStatusResp
  • pu8Bssid : tstrNetworkId
  • pu8Buffer : tstrSocketRecvMsg
  • pu8Certificate : tstrAuth1xTls
  • pu8Domain : tstrAuth1xMschap2 , tstrAuth1xTls
  • pu8Passphrase : tstrAuthPsk
  • pu8Password : tstrAuth1xMschap2
  • pu8PrivateKey_Exp : tstrAuth1xTls
  • pu8PrivateKey_Mod : tstrAuth1xTls
  • pu8Psk : tstrAuthPsk
  • pu8RngBuff : tstrPrng
  • pu8Ssid : tstrNetworkId
  • pu8UserName : tstrAuth1xMschap2 , tstrAuth1xTls
  • pu8WepKey : tstrAuthWep
Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 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 , tstrM2MGenericResp
  • s8Resp : tstrCyptoResp
  • 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 : tstrM2MAPModeConfig , tstrM2MProvisionModeConfig
  • strApConfigExt : tstrM2MAPModeConfig , tstrM2MProvisionModeConfig
  • strConnCredCmn : tstrM2mWifiConnHdr
  • strConnCredHdr : tstrM2mWifiConnHdr
  • strEcdhREQ : tstrEccReqInfo
  • strEcdsaSignREQ : tstrEccReqInfo
  • strEcdsaVerifyREQ : tstrEccReqInfo
  • strEthInitParam : tstrWifiInitParam
  • strParam : tstrEllipticCurve
  • strPubKey : tstrEcdhReqInfo
  • strRemoteAddr : tstrSocketRecvMsg
Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 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 -

  • u16ArMaxRecoveryFailThreshold : tstrConfAutoRate
  • u16ArMinRecoveryFailThreshold : tstrConfAutoRate
  • u16BattVolt : tstrM2mBatteryVoltage
  • u16CertificateLen : tstrAuth1xTls
  • u16CertificateLength : tstrM2mWifi1xHdr
  • u16CertificateOffset : tstrM2mWifi1xHdr
  • u16CredSize : tstrM2mConnCredHdr
  • u16CurveType : tstrEcdsaSignReqInfo
  • u16DataLength : tstrM2MWifiRxPacketInfo
  • u16DataSize : tstrM2mIpCtrlBuf
  • u16DomainLen : tstrAuth1xMschap2 , tstrAuth1xTls
  • u16ethRcvBufSize : tstrEthInitParam
  • u16FileBlockSz : tstrOtaHostFileReadStatusResp
  • u16FrameLength : tstrM2MWifiRxPacketInfo
  • u16HashSz : tstrEcdsaSignReqInfo
  • u16HeaderLength : tstrM2MWifiTxPacketInfo
  • u16InfoLen : tstrM2mWifiAuthInfoHdr
  • u16InfoPos : tstrM2mWifiAuthInfoHdr
  • u16LsnInt : tstrM2mLsnInt
  • u16Offset32 : tstrTlsSrvChunkHdr
  • u16PacketSize : tstrM2MWifiTxPacketInfo
  • u16PassiveScanTime : tstrM2MScan
  • u16PasswordLen : tstrAuth1xMschap2
  • u16PktOffset : tstrM2mIpRsvdPkt
  • u16PktSz : tstrM2mIpRsvdPkt
  • u16PrivateKeyLen : tstrAuth1xTls
  • u16PrivateKeyLength : tstrM2mWifi1xHdr
  • u16PrivateKeyOffset : tstrM2mWifi1xHdr
  • u16PrivKeyID : EcPoint
  • u16PrngSize : tstrPrng
  • u16RemainingDataSize : tstrM2mIpCtrlBuf
  • u16RemainingSize : tstrSocketRecvMsg
  • u16REQ : tstrEccReqInfo
  • u16ScanRegion : tstrM2MScanRegion
  • u16Sig : tstrTlsSrvChunkHdr
  • u16Size : EcPoint
  • u16Size32 : tstrTlsSrvChunkHdr
  • u16Status : tstrEccReqInfo
  • u16TotalSize32 : tstrTlsSrvChunkHdr
  • u16UserNameLen : tstrAuth1xMschap2 , tstrAuth1xTls
  • u16Year : tstrSystemTime
  • u32AlternateDNS : tstrM2MIPConfig
  • u32CRC : tstrTlsSrvSecHdr
  • u32CsBMP : tstrSslSetActiveCsList
  • u32DataRateKbps : tstrM2MWifiRxPacketInfo
  • u32DhcpLeaseTime : tstrM2MIPConfig
  • u32DNS : tstrM2MIPConfig
  • u32FileAddr : tstrTlsSrvSecFileEntry
  • u32FileSize : tstrTlsSrvSecFileEntry
  • u32Gateway : tstrM2MIPConfig
  • u32nEntries : tstrTlsSrvSecHdr
  • u32NextWriteAddr : tstrTlsSrvSecHdr
  • u32nSig : tstrEcdsaVerifyReqInfo
  • u32OtaControlSecCrc : tstrOtaControlSec
  • u32OtaCortusAppRollbackOffset : tstrOtaControlSec
  • u32OtaCortusAppRollbackValidSts : tstrOtaControlSec
  • u32OtaCortusAppRollbackVer : tstrOtaControlSec
  • u32OtaCortusAppWorkingOffset : tstrOtaControlSec
  • u32OtaCortusAppWorkingValidSts : tstrOtaControlSec
  • u32OtaCortusAppWorkingVer : tstrOtaControlSec
  • u32OtaCurrentworkingImagFirmwareVer : tstrOtaControlSec
  • u32OtaCurrentworkingImagOffset : tstrOtaControlSec
  • u32OtaFileSize : tstrOtaHostFileGetStatusResp
  • u32OtaFormatVersion : tstrOtaControlSec
  • u32OtaLastCheckTime : tstrOtaControlSec
  • u32OtaMagicValue : tstrOtaControlSec , tstrOtaInitHdr
  • u32OtaPayloadSize : tstrOtaInitHdr
  • u32OtaRollbackImageOffset : tstrOtaControlSec
  • u32OtaRollbackImageValidStatus : tstrOtaControlSec
  • u32OtaRollbackImagFirmwareVer : tstrOtaControlSec
  • u32OtaSequenceNumber : tstrOtaControlSec
  • u32Rsv1 : tstrM2mWifi1xHdr
  • u32Rsv2 : tstrM2mWifi1xHdr
  • u32SeqNo : tstrEccReqInfo
  • u32SleepTime : tstrM2mSlpReqTime
  • u32StaticIP : tstrM2MIPConfig
  • u32SubnetMask : tstrM2MIPConfig
  • u32TlsHsFlags : tstrM2mWifi1xHdr
  • u32TotalLen : tstrOtaStart
  • u32UserData : tstrEccReqInfo
  • u8AddRemove : tstrM2MMulticastMac
  • u8ArEnoughTxThreshold : tstrConfAutoRate
  • u8ArFailTxThreshold : tstrConfAutoRate
  • u8ArSuccessTXThreshold : tstrConfAutoRate
  • u8AuthType : tstrM2mConnCredCmn , tstrM2mWifiscanResult , tstrM2MWPSInfo
  • u8BcastEn : tstrM2mPsType
  • u8CFHandler : tstrOtaHostFileGetStatusResp
  • u8ch : tstrM2mWifiscanResult
  • u8Ch : tstrM2MWPSInfo
  • u8Channel : tstrM2mConnCredHdr , tstrM2mServerInit
  • u8ChannelID : tstrM2MWifiMonitorModeCtrl
  • u8ChNum : tstrM2MScan
  • u8CipherType : tstrM2MWifiRxPacketInfo
  • u8cmd : tstrM2Mservercmd
  • u8CredStoreFlags : tstrM2mConnCredHdr
  • u8CrlType : tstrTlsCrlInfo
  • u8CurrChannel : tstrM2MConnInfo
  • u8CurrState : tstrM2mWifiStateChanged
  • u8DataLen : tstrTlsCrlEntry
  • u8Day : tstrSystemTime
  • u8DomainLength : tstrM2mWifi1xHdr
  • u8DownloadUrlOffset : tstrOtaUpdateInfo
  • u8DownloadUrlSize : tstrOtaUpdateInfo
  • u8Enable : tstrM2mEnableLogs
  • u8EnableDhcp : tstrM2mWiFiRoaming
  • u8EnableRedirect : tstrM2MProvisionModeConfig
  • u8EnableRoaming : tstrM2mWiFiRoaming
  • u8EnableXODuringSleep : tstrM2mWiFiXOSleepEnable
  • u8EnRecvHdr : tstrM2MWifiMonitorModeCtrl
  • u8ErrCode : tstrM2mWifiStateChanged , tstrSockErr
  • u8EthernetEnable : tstrEthInitParam
  • u8Flags : tstrM2mWifi1xHdr
  • u8FrameSubtype : tstrM2MWifiMonitorModeCtrl , tstrM2MWifiRxPacketInfo
  • u8FrameType : tstrM2MWifiMonitorModeCtrl , tstrM2MWifiRxPacketInfo
  • u8GainTableIdx : tstrM2mWiFiGainIdx
  • u8HdrLength : tstrM2mWifi1xHdr
  • u8HeaderLength : tstrM2MWifiRxPacketInfo
  • u8Hour : tstrSystemTime
  • u8Index : tstrM2mReqScanResult
  • u8index : tstrM2mWifiscanResult
  • u8KeyIndex : tstrM2mWifiWep
  • u8KeyIndx : tstrAuthWep , tstrM2MAPConfig , tstrM2mWifiWepParams
  • u8KeyLen : tstrM2mWifiWep
  • u8KeySz : tstrAuthWep , tstrM2MAPConfig , tstrM2mWifiWepParams
  • u8ListenChannel : tstrM2MAPConfig
  • u8Minute : tstrSystemTime
  • u8Month : tstrSystemTime
  • u8NcdRequiredUpgrade : tstrOtaUpdateInfo
  • u8NcdUpgradeVersion : tstrOtaUpdateInfo
  • u8NcfCurrentVersion : tstrOtaUpdateInfo
  • u8NcfUpgradeVersion : tstrOtaUpdateInfo
  • u8NumofCh : tstrM2mScanDone
  • u8NumOfSlot : tstrM2MScanOption
  • u8Options : tstrM2mConnCredCmn
  • u8OtaFileEraseStatus : tstrOtaHostFileEraseStatusResp
  • u8OtaFileGetStatus : tstrOtaHostFileGetStatusResp
  • u8OtaFileReadStatus : tstrOtaHostFileReadStatusResp
  • u8OtaUpdateStatus : tstrOtaUpdateStatusResp
  • u8OtaUpdateStatusType : tstrOtaUpdateStatusResp
  • u8PassphraseLen : tstrAuthPsk , tstrM2mWifiPsk
  • u8PPAGFor11B : tstrM2mWifiGainsParams
  • u8PPAGFor11GN : tstrM2mWifiGainsParams
  • u8Priority : tstrM2MWifiRxPacketInfo
  • u8ProbesPerSlot : tstrM2MScanOption
  • u8PskCalculated : tstrM2mWifiPsk
  • u8PsType : tstrM2mPsType
  • u8PwrMode : tstrM2mPwrMode
  • u8Rsv : tstrM2mWifiWep
  • u8Rsv1 : tstrTlsCrlInfo
  • u8Rsv2 : tstrTlsCrlInfo
  • u8Rsv3 : tstrTlsCrlInfo
  • u8Second : tstrSystemTime
  • u8SecType : tstrM2MAPConfig , tstrM2MConnInfo , tstrM2MProvisionInfo
  • u8ServiceClass : tstrM2MWifiRxPacketInfo
  • u8SlotTime : tstrM2MScanOption
  • u8SsidHide : tstrM2MAPConfig
  • u8SsidLen : tstrM2mConnCredCmn , tstrNetworkId
  • u8SSLFlags : tstrOtaStart
  • u8State : tstrM2mClientState
  • u8Status : tstrM2MProvisionInfo
  • u8StopOnFirstResult : tstrM2MStopScanOption
  • u8TriggerType : tstrM2MWPSConnect
  • u8TxPwrLevel : tstrM2mTxPwrLevel
  • u8Type : tstrM2mWifiAuthInfoHdr
  • u8UserNameLength : tstrM2mWifi1xHdr
Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Data Fields

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

- x -

  • X : EcPoint
  • XY : EcPoint
Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Data Fields

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

- y -

  • Y : EcPoint
Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Data Fields - Variables

- _ -

  • __PAD16__ : tstrM2MAPConfig , tstrM2mBatteryVoltage , tstrM2MConnInfo , tstrM2mLsnInt , tstrM2mPsType , tstrM2mScanDone , tstrM2MScanRegion , tstrM2mSetMacAddress , tstrM2MWifiMonitorModeCtrl , tstrM2mWiFiRoaming , tstrM2mWifiStateChanged , tstrM2mWiFiXOSleepEnable , tstrOtaHostFileGetStatusResp , tstrPrng
  • __PAD24__ : tstrConfAutoRate , tstrCyptoResp , tstrM2mClientState , tstrM2MDefaultConnResp , tstrM2mEnableLogs , tstrM2MGenericResp , tstrM2MProvisionModeConfig , tstrM2mPwrMode , tstrM2mReqScanResult , tstrM2Mservercmd , tstrM2mServerInit , tstrM2mTxPwrLevel , tstrM2mWiFiGainIdx , tstrM2MWifiRxPacketInfo , tstrM2mWifiWepParams , tstrM2MWPSConnect , tstrOtaHostFileEraseStatusResp , tstrOtaStart , tstrTlsCrlEntry
  • __PAD8__ : tstrEthInitParam , tstrM2MMulticastMac , tstrM2MSNTPConfig , tstrOtaHostFileReadStatusResp , tstrOtaUpdateInfo , tstrSystemTime
  • __PAD__ : tstrM2mWifiApId
  • __RSVD8__ : tstrM2MScan
  • _PAD16_ : tstrOtaUpdateStatusResp
  • _PAD8_ : tstrM2mWifiscanResult
Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Data Fields - Variables

- a -

  • a : EcDomainParam
  • acFileName : tstrTlsSrvSecFileEntry
  • acHttpServerDomainName : tstrM2MProvisionModeConfig
  • acNTPServer : tstrM2MSNTPConfig
  • acPinNumber : tstrM2MWPSConnect
  • acSNI : tstrOtaStart
  • acSSID : tstrM2MConnInfo
  • acUrl : tstrOtaStart
  • astrEntries : tstrTlsSrvSecHdr
  • astrTlsCrl : tstrTlsCrlInfo
  • au81xAuthDetails : tstrM2mWifi1xHdr
  • au8Bssid : tstrM2mConnCredCmn
  • au8BSSID : tstrM2MWifiMonitorModeCtrl , tstrM2MWifiRxPacketInfo , tstrM2mWifiscanResult
  • au8Data : tstrTlsCrlEntry
  • au8DefRouterIP : tstrM2MAPConfigExt
  • au8DeviceName : tstrM2MDeviceNameConfig
  • au8DHCPServerIP : tstrM2MAPConfig
  • au8DNSServerIP : tstrM2MAPConfigExt
  • au8DstMacAddress : tstrM2MWifiMonitorModeCtrl , tstrM2MWifiRxPacketInfo
  • au8ethRcvBuf : tstrEthInitParam
  • au8Info : tstrM2mWifiAuthInfoHdr
  • au8IPAddr : tstrM2MConnInfo
  • au8Key : tstrEcdhReqInfo , tstrM2MAPConfig
  • au8Mac : tstrM2mSetMacAddress
  • au8MACAddress : tstrM2MConnInfo
  • au8macaddress : tstrM2MMulticastMac
  • au8Passphrase : tstrM2mWifiPsk
  • au8Passwd : tstr1xAuthCredentials
  • au8Password : tstrM2MProvisionInfo
  • au8Psk : tstrM2mWifiPsk
  • au8PSK : tstrM2MWPSInfo
  • au8Rsv : tstrM2mConnCredCmn , tstrM2MStopScanOption , tstrM2mWifiAuthInfoHdr , tstrM2mWifiPsk
  • au8SecStartPattern : tstrTlsSrvSecHdr
  • au8SrcMacAddress : tstrM2MWifiMonitorModeCtrl , tstrM2MWifiRxPacketInfo
  • au8SSID : tstrM2MAPConfig
  • au8Ssid : tstrM2mConnCredCmn
  • au8SSID : tstrM2MProvisionInfo , tstrM2mWifiApId , tstrM2mWifiscanResult , tstrM2MWPSInfo
  • au8SubnetMask : tstrM2MAPConfigExt
  • au8TlsSpecificRootNameSha1 : tstrM2mWifi1xHdr
  • au8UserName : tstr1xAuthCredentials
  • au8WepKey : tstrM2MAPConfig , tstrM2mWifiWep , tstrM2mWifiWepParams
Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Data Fields - Variables

- b -

  • b : EcDomainParam
  • bPrependDomain : tstrAuth1xMschap2 , tstrAuth1xTls
  • bUnencryptedUserName : tstrAuth1xMschap2 , tstrAuth1xTls
Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Data Fields - Variables

- e -

  • enuArInitialRateSel : tstrConfAutoRate
  • enuChannel : tstrNetworkId
  • enuErrSource : tstrSockErr
  • enuType : tstrEllipticCurve
  • enuUseDHCP : tstrM2MSNTPConfig
  • enuWlanTxRate : tstrConfAutoRate
Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Data Fields - Variables

- g -

  • G : EcDomainParam
Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Data Fields - Variables

- p -

  • p : EcDomainParam
  • pfAppEthCb : tstrEthInitParam
  • pfAppMonCb : tstrWifiInitParam
  • pfAppWifiCb : tstrEthInitParam , tstrWifiInitParam
  • pFileBuf : tstrOtaHostFileReadStatusResp
  • pu8Bssid : tstrNetworkId
  • pu8Buffer : tstrSocketRecvMsg
  • pu8Certificate : tstrAuth1xTls
  • pu8Domain : tstrAuth1xMschap2 , tstrAuth1xTls
  • pu8Passphrase : tstrAuthPsk
  • pu8Password : tstrAuth1xMschap2
  • pu8PrivateKey_Exp : tstrAuth1xTls
  • pu8PrivateKey_Mod : tstrAuth1xTls
  • pu8Psk : tstrAuthPsk
  • pu8RngBuff : tstrPrng
  • pu8Ssid : tstrNetworkId
  • pu8UserName : tstrAuth1xMschap2 , tstrAuth1xTls
  • pu8WepKey : tstrAuthWep
Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Data Fields - Variables

- s -

  • s16BufferSize : tstrSocketRecvMsg
  • s8Error : tstrSocketConnectMsg
  • s8ErrorCode : tstrM2MDefaultConnResp , tstrM2MGenericResp
  • s8Resp : tstrCyptoResp
  • 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 : tstrM2MAPModeConfig , tstrM2MProvisionModeConfig
  • strApConfigExt : tstrM2MAPModeConfig , tstrM2MProvisionModeConfig
  • strConnCredCmn : tstrM2mWifiConnHdr
  • strConnCredHdr : tstrM2mWifiConnHdr
  • strEcdhREQ : tstrEccReqInfo
  • strEcdsaSignREQ : tstrEccReqInfo
  • strEcdsaVerifyREQ : tstrEccReqInfo
  • strEthInitParam : tstrWifiInitParam
  • strParam : tstrEllipticCurve
  • strPubKey : tstrEcdhReqInfo
  • strRemoteAddr : tstrSocketRecvMsg
Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Data Fields - Variables

- u -

  • u16ArMaxRecoveryFailThreshold : tstrConfAutoRate
  • u16ArMinRecoveryFailThreshold : tstrConfAutoRate
  • u16BattVolt : tstrM2mBatteryVoltage
  • u16CertificateLen : tstrAuth1xTls
  • u16CertificateLength : tstrM2mWifi1xHdr
  • u16CertificateOffset : tstrM2mWifi1xHdr
  • u16CredSize : tstrM2mConnCredHdr
  • u16CurveType : tstrEcdsaSignReqInfo
  • u16DataLength : tstrM2MWifiRxPacketInfo
  • u16DataSize : tstrM2mIpCtrlBuf
  • u16DomainLen : tstrAuth1xMschap2 , tstrAuth1xTls
  • u16ethRcvBufSize : tstrEthInitParam
  • u16FileBlockSz : tstrOtaHostFileReadStatusResp
  • u16FrameLength : tstrM2MWifiRxPacketInfo
  • u16HashSz : tstrEcdsaSignReqInfo
  • u16HeaderLength : tstrM2MWifiTxPacketInfo
  • u16InfoLen : tstrM2mWifiAuthInfoHdr
  • u16InfoPos : tstrM2mWifiAuthInfoHdr
  • u16LsnInt : tstrM2mLsnInt
  • u16Offset32 : tstrTlsSrvChunkHdr
  • u16PacketSize : tstrM2MWifiTxPacketInfo
  • u16PassiveScanTime : tstrM2MScan
  • u16PasswordLen : tstrAuth1xMschap2
  • u16PktOffset : tstrM2mIpRsvdPkt
  • u16PktSz : tstrM2mIpRsvdPkt
  • u16PrivateKeyLen : tstrAuth1xTls
  • u16PrivateKeyLength : tstrM2mWifi1xHdr
  • u16PrivateKeyOffset : tstrM2mWifi1xHdr
  • u16PrivKeyID : EcPoint
  • u16PrngSize : tstrPrng
  • u16RemainingDataSize : tstrM2mIpCtrlBuf
  • u16RemainingSize : tstrSocketRecvMsg
  • u16REQ : tstrEccReqInfo
  • u16ScanRegion : tstrM2MScanRegion
  • u16Sig : tstrTlsSrvChunkHdr
  • u16Size : EcPoint
  • u16Size32 : tstrTlsSrvChunkHdr
  • u16Status : tstrEccReqInfo
  • u16TotalSize32 : tstrTlsSrvChunkHdr
  • u16UserNameLen : tstrAuth1xMschap2 , tstrAuth1xTls
  • u16Year : tstrSystemTime
  • u32AlternateDNS : tstrM2MIPConfig
  • u32CRC : tstrTlsSrvSecHdr
  • u32CsBMP : tstrSslSetActiveCsList
  • u32DataRateKbps : tstrM2MWifiRxPacketInfo
  • u32DhcpLeaseTime : tstrM2MIPConfig
  • u32DNS : tstrM2MIPConfig
  • u32FileAddr : tstrTlsSrvSecFileEntry
  • u32FileSize : tstrTlsSrvSecFileEntry
  • u32Gateway : tstrM2MIPConfig
  • u32nEntries : tstrTlsSrvSecHdr
  • u32NextWriteAddr : tstrTlsSrvSecHdr
  • u32nSig : tstrEcdsaVerifyReqInfo
  • u32OtaControlSecCrc : tstrOtaControlSec
  • u32OtaCortusAppRollbackOffset : tstrOtaControlSec
  • u32OtaCortusAppRollbackValidSts : tstrOtaControlSec
  • u32OtaCortusAppRollbackVer : tstrOtaControlSec
  • u32OtaCortusAppWorkingOffset : tstrOtaControlSec
  • u32OtaCortusAppWorkingValidSts : tstrOtaControlSec
  • u32OtaCortusAppWorkingVer : tstrOtaControlSec
  • u32OtaCurrentworkingImagFirmwareVer : tstrOtaControlSec
  • u32OtaCurrentworkingImagOffset : tstrOtaControlSec
  • u32OtaFileSize : tstrOtaHostFileGetStatusResp
  • u32OtaFormatVersion : tstrOtaControlSec
  • u32OtaLastCheckTime : tstrOtaControlSec
  • u32OtaMagicValue : tstrOtaControlSec , tstrOtaInitHdr
  • u32OtaPayloadSize : tstrOtaInitHdr
  • u32OtaRollbackImageOffset : tstrOtaControlSec
  • u32OtaRollbackImageValidStatus : tstrOtaControlSec
  • u32OtaRollbackImagFirmwareVer : tstrOtaControlSec
  • u32OtaSequenceNumber : tstrOtaControlSec
  • u32Rsv1 : tstrM2mWifi1xHdr
  • u32Rsv2 : tstrM2mWifi1xHdr
  • u32SeqNo : tstrEccReqInfo
  • u32SleepTime : tstrM2mSlpReqTime
  • u32StaticIP : tstrM2MIPConfig
  • u32SubnetMask : tstrM2MIPConfig
  • u32TlsHsFlags : tstrM2mWifi1xHdr
  • u32TotalLen : tstrOtaStart
  • u32UserData : tstrEccReqInfo
  • u8AddRemove : tstrM2MMulticastMac
  • u8ArEnoughTxThreshold : tstrConfAutoRate
  • u8ArFailTxThreshold : tstrConfAutoRate
  • u8ArSuccessTXThreshold : tstrConfAutoRate
  • u8AuthType : tstrM2mConnCredCmn , tstrM2mWifiscanResult , tstrM2MWPSInfo
  • u8BcastEn : tstrM2mPsType
  • u8CFHandler : tstrOtaHostFileGetStatusResp
  • u8ch : tstrM2mWifiscanResult
  • u8Ch : tstrM2MWPSInfo
  • u8Channel : tstrM2mConnCredHdr , tstrM2mServerInit
  • u8ChannelID : tstrM2MWifiMonitorModeCtrl
  • u8ChNum : tstrM2MScan
  • u8CipherType : tstrM2MWifiRxPacketInfo
  • u8cmd : tstrM2Mservercmd
  • u8CredStoreFlags : tstrM2mConnCredHdr
  • u8CrlType : tstrTlsCrlInfo
  • u8CurrChannel : tstrM2MConnInfo
  • u8CurrState : tstrM2mWifiStateChanged
  • u8DataLen : tstrTlsCrlEntry
  • u8Day : tstrSystemTime
  • u8DomainLength : tstrM2mWifi1xHdr
  • u8DownloadUrlOffset : tstrOtaUpdateInfo
  • u8DownloadUrlSize : tstrOtaUpdateInfo
  • u8Enable : tstrM2mEnableLogs
  • u8EnableDhcp : tstrM2mWiFiRoaming
  • u8EnableRedirect : tstrM2MProvisionModeConfig
  • u8EnableRoaming : tstrM2mWiFiRoaming
  • u8EnableXODuringSleep : tstrM2mWiFiXOSleepEnable
  • u8EnRecvHdr : tstrM2MWifiMonitorModeCtrl
  • u8ErrCode : tstrM2mWifiStateChanged , tstrSockErr
  • u8EthernetEnable : tstrEthInitParam
  • u8Flags : tstrM2mWifi1xHdr
  • u8FrameSubtype : tstrM2MWifiMonitorModeCtrl , tstrM2MWifiRxPacketInfo
  • u8FrameType : tstrM2MWifiMonitorModeCtrl , tstrM2MWifiRxPacketInfo
  • u8GainTableIdx : tstrM2mWiFiGainIdx
  • u8HdrLength : tstrM2mWifi1xHdr
  • u8HeaderLength : tstrM2MWifiRxPacketInfo
  • u8Hour : tstrSystemTime
  • u8Index : tstrM2mReqScanResult
  • u8index : tstrM2mWifiscanResult
  • u8KeyIndex : tstrM2mWifiWep
  • u8KeyIndx : tstrAuthWep , tstrM2MAPConfig , tstrM2mWifiWepParams
  • u8KeyLen : tstrM2mWifiWep
  • u8KeySz : tstrAuthWep , tstrM2MAPConfig , tstrM2mWifiWepParams
  • u8ListenChannel : tstrM2MAPConfig
  • u8Minute : tstrSystemTime
  • u8Month : tstrSystemTime
  • u8NcdRequiredUpgrade : tstrOtaUpdateInfo
  • u8NcdUpgradeVersion : tstrOtaUpdateInfo
  • u8NcfCurrentVersion : tstrOtaUpdateInfo
  • u8NcfUpgradeVersion : tstrOtaUpdateInfo
  • u8NumofCh : tstrM2mScanDone
  • u8NumOfSlot : tstrM2MScanOption
  • u8Options : tstrM2mConnCredCmn
  • u8OtaFileEraseStatus : tstrOtaHostFileEraseStatusResp
  • u8OtaFileGetStatus : tstrOtaHostFileGetStatusResp
  • u8OtaFileReadStatus : tstrOtaHostFileReadStatusResp
  • u8OtaUpdateStatus : tstrOtaUpdateStatusResp
  • u8OtaUpdateStatusType : tstrOtaUpdateStatusResp
  • u8PassphraseLen : tstrAuthPsk , tstrM2mWifiPsk
  • u8PPAGFor11B : tstrM2mWifiGainsParams
  • u8PPAGFor11GN : tstrM2mWifiGainsParams
  • u8Priority : tstrM2MWifiRxPacketInfo
  • u8ProbesPerSlot : tstrM2MScanOption
  • u8PskCalculated : tstrM2mWifiPsk
  • u8PsType : tstrM2mPsType
  • u8PwrMode : tstrM2mPwrMode
  • u8Rsv : tstrM2mWifiWep
  • u8Rsv1 : tstrTlsCrlInfo
  • u8Rsv2 : tstrTlsCrlInfo
  • u8Rsv3 : tstrTlsCrlInfo
  • u8Second : tstrSystemTime
  • u8SecType : tstrM2MAPConfig , tstrM2MConnInfo , tstrM2MProvisionInfo
  • u8ServiceClass : tstrM2MWifiRxPacketInfo
  • u8SlotTime : tstrM2MScanOption
  • u8SsidHide : tstrM2MAPConfig
  • u8SsidLen : tstrM2mConnCredCmn , tstrNetworkId
  • u8SSLFlags : tstrOtaStart
  • u8State : tstrM2mClientState
  • u8Status : tstrM2MProvisionInfo
  • u8StopOnFirstResult : tstrM2MStopScanOption
  • u8TriggerType : tstrM2MWPSConnect
  • u8TxPwrLevel : tstrM2mTxPwrLevel
  • u8Type : tstrM2mWifiAuthInfoHdr
  • u8UserNameLength : tstrM2mWifi1xHdr
Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Data Fields - Variables

- x -

  • X : EcPoint
  • XY : EcPoint
Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Data Fields - Variables

- y -

  • Y : EcPoint
Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Data Structure Index

Data Structure Index
E | I | S | T
E
tstrEcdhReqInfo tstrM2mIpRsvdPkt tstrM2mWifiAuthInfoHdr tstrOtaInitHdr
tstrECDomainParam tstrM2mLsnInt tstrM2mWifiConnHdr tstrOtaStart
EcDomainParam tstrEcdsaSignReqInfo tstrM2MMulticastMac tstrM2mWiFiGainIdx tstrOtaUpdateInfo
EcPoint tstrEcdsaVerifyReqInfo tstrM2MProvisionInfo tstrM2mWifiGainsParams tstrOtaUpdateStatusResp
i
tstrECPoint tstrM2MProvisionModeConfig tstrM2MWifiMonitorModeCtrl tstrPrng
tstrEllipticCurve tstrM2mPsType tstrM2mWifiPsk tstrSockErr
in_addr tstrEthInitParam tstrM2mPwrMode tstrM2mWiFiRoaming tstrSocketAcceptMsg
s
tstrM2MAPConfig tstrM2mReqScanResult tstrM2MWifiRxPacketInfo tstrSocketBindMsg
tstrM2MAPConfigExt tstrM2MScan tstrM2mWifiscanResult tstrSocketConnectMsg
sockaddr tstrM2MAPModeConfig tstrM2mScanDone tstrM2mWifiStateChanged tstrSocketListenMsg
sockaddr_in tstrM2mBatteryVoltage tstrM2MScanOption tstrM2MWifiTxPacketInfo tstrSocketRecvMsg
t
tstrM2mClientState tstrM2MScanRegion tstrM2mWifiWep tstrSslSetActiveCsList
tstrM2mConnCredCmn tstrM2Mservercmd tstrM2mWifiWepParams tstrSystemTime
tstr1xAuthCredentials tstrM2mConnCredHdr tstrM2mServerInit tstrM2mWiFiXOSleepEnable tstrTlsCrlEntry
tstrAuth1xMschap2 tstrM2MConnInfo tstrM2mSetMacAddress tstrM2MWPSConnect tstrTlsCrlInfo
tstrAuth1xTls tstrM2MDefaultConnResp tstrM2mSlpReqTime tstrM2MWPSInfo tstrTlsSrvChunkHdr
tstrAuthPsk tstrM2MDeviceNameConfig tstrM2MSNTPConfig tstrNetworkId tstrTlsSrvSecFileEntry
tstrAuthWep tstrM2mEnableLogs tstrM2MStopScanOption tstrOtaControlSec tstrTlsSrvSecHdr
tstrConfAutoRate tstrM2MGenericResp tstrM2mTxPwrLevel tstrOtaHostFileEraseStatusResp tstrWifiInitParam
tstrCyptoResp tstrM2MIPConfig tstrM2mWifi1xHdr tstrOtaHostFileGetStatusResp
tstrEccReqInfo tstrM2mIpCtrlBuf tstrM2mWifiApId tstrOtaHostFileReadStatusResp
E | I | S | T
Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: ecc_types.h Source File

ecc_types.h
1
11 #ifndef __ECC_TYPES_H__
12 #define __ECC_TYPES_H__
13
14 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
15 INCLUDES
16 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
17
18 #ifndef _FIRMWARE_
19 #include "driver/include/m2m_types.h"
20 #else
21 #include "m2m_types.h"
22 #endif
23
24 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
25 MACROS
26 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
27
28
29
30 #define ECC_LARGEST_CURVE_SIZE (32)
31
37 #define ECC_POINT_MAX_SIZE ECC_LARGEST_CURVE_SIZE
38
43 #define ECC_POINT_MAX_SIZE_WORDS (ECC_POINT_MAX_SIZE / 4)
44
49 #define ECC_NUM_SUPP_CURVES ((sizeof(gastrECCSuppList)) / (sizeof(tstrEllipticCurve)))
50
54 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
55 DATA TYPES
56 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
57
69 typedef enum{
70 EC_SECP192R1 = 19,
74 EC_SECP256R1 = 23,
78 EC_SECP384R1 = 24,
82 EC_SECP521R1 = 25,
86 EC_UNKNOWN = 255
87 }tenuEcNamedCurve;
88
89
96 typedef struct EcPoint{
97 union {
98 uint8 XY[2*ECC_POINT_MAX_SIZE];
102 struct {
103 uint8 X[ECC_POINT_MAX_SIZE];
107 uint8 Y[ECC_POINT_MAX_SIZE];
111 };
112 };
113 uint16 u16Size;
117 uint16 u16PrivKeyID;
121 }tstrECPoint;
122
123
132 typedef struct EcDomainParam{
133 uint32 p[ECC_POINT_MAX_SIZE_WORDS];
134 uint32 a[ECC_POINT_MAX_SIZE_WORDS];
135 uint32 b[ECC_POINT_MAX_SIZE_WORDS];
136 tstrECPoint G;
137 }tstrECDomainParam;
138
139
147 typedef struct{
148 tenuEcNamedCurve enuType;
149 tstrECDomainParam strParam;
150 }tstrEllipticCurve;
151
161 typedef enum{
162 ECC_REQ_NONE,
164 ECC_REQ_CLIENT_ECDH,
168 ECC_REQ_SERVER_ECDH,
172 ECC_REQ_GEN_KEY,
176 ECC_REQ_SIGN_GEN,
181 ECC_REQ_SIGN_VERIFY
186 }tenuEccREQ;
187
195 typedef struct{
196 tstrECPoint strPubKey;
200 uint8 au8Key[ECC_POINT_MAX_SIZE];
205 }tstrEcdhReqInfo;
206
213 typedef struct{
214 uint32 u32nSig;
219 }tstrEcdsaVerifyReqInfo;
220
227 typedef struct{
228 uint16 u16CurveType;
232 uint16 u16HashSz;
237 }tstrEcdsaSignReqInfo;
238
247 typedef struct{
248 uint16 u16REQ;
252 uint16 u16Status;
257 uint32 u32UserData;
262 uint32 u32SeqNo;
267 union{
268 tstrEcdhReqInfo strEcdhREQ;
273 tstrEcdsaSignReqInfo strEcdsaSignREQ;
278 tstrEcdsaVerifyReqInfo strEcdsaVerifyREQ;
283 };
284 }tstrEccReqInfo; //SSLEnums
286
287 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
288 GLOBALS
289 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
290
291
292 static tstrEllipticCurve gastrECCSuppList[] = {
293 {
294 .enuType = EC_SECP256R1,
295 .strParam = {
296 .p = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0xFFFFFFFF},
297 .a = {0xFFFFFFFC, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0xFFFFFFFF},
298 .b = {0x27D2604B, 0x3BCE3C3E, 0xCC53B0F6, 0x651D06B0, 0x769886BC, 0xB3EBBD55, 0xAA3A93E7, 0x5AC635D8},
299 .G = {
300 {
301 .X = {
302 0x6B, 0x17, 0xD1, 0xF2, 0xE1, 0x2C, 0x42, 0x47, 0xF8, 0xBC, 0xE6, 0xE5, 0x63, 0xA4, 0x40, 0xF2,
303 0x77, 0x03, 0x7D, 0x81, 0x2D, 0xEB, 0x33, 0xA0, 0xF4, 0xA1, 0x39, 0x45, 0xD8, 0x98, 0xC2, 0x96
304 },
305 .Y = {
306 0x4F, 0xE3, 0x42, 0xE2, 0xFE, 0x1A, 0x7F, 0x9B, 0x8E, 0xE7, 0xEB, 0x4A, 0x7C, 0x0F, 0x9E, 0x16,
307 0x2B, 0xCE, 0x33, 0x57, 0x6B, 0x31, 0x5E, 0xCE, 0xCB, 0xB6, 0x40, 0x68, 0x37, 0xBF, 0x51, 0xF5
308 },
309 },
310 .u16Size = 32
311 }
312 }
313 }
314 };
321 #endif /* __ECC_TYPES_H__ */
ECC_REQ_CLIENT_ECDH
Definition: ecc_types.h:164
EcPoint::X
uint8 X[ECC_POINT_MAX_SIZE]
Definition: ecc_types.h:103
tstrEcdsaVerifyReqInfo
Information relating to requests of type ECC_REQ_SIGN_VERIFY.
Definition: ecc_types.h:213
tstrEccReqInfo::u16REQ
uint16 u16REQ
Definition: ecc_types.h:248
ECC_REQ_SIGN_GEN
Definition: ecc_types.h:176
EC_SECP384R1
Definition: ecc_types.h:78
EC_SECP256R1
Definition: ecc_types.h:74
EcPoint::u16Size
uint16 u16Size
Definition: ecc_types.h:113
tstrEccReqInfo::u32UserData
uint32 u32UserData
Definition: ecc_types.h:257
tstrEccReqInfo::u16Status
uint16 u16Status
Definition: ecc_types.h:252
tstrEcdsaSignReqInfo
Information relating to requests of type ECC_REQ_SIGN_GEN.
Definition: ecc_types.h:227
ECC_REQ_SIGN_VERIFY
Definition: ecc_types.h:181
EcDomainParam::a
uint32 a[ECC_POINT_MAX_SIZE_WORDS]
Definition: ecc_types.h:134
tstrECPoint
struct EcPoint tstrECPoint
ECC_REQ_NONE
Definition: ecc_types.h:162
EcPoint::u16PrivKeyID
uint16 u16PrivKeyID
Definition: ecc_types.h:117
tstrEccReqInfo::u32SeqNo
uint32 u32SeqNo
Definition: ecc_types.h:262
EcDomainParam::b
uint32 b[ECC_POINT_MAX_SIZE_WORDS]
Definition: ecc_types.h:135
tstrEcdhReqInfo::strPubKey
tstrECPoint strPubKey
Definition: ecc_types.h:196
EC_SECP192R1
Definition: ecc_types.h:70
EcPoint
Definition: ecc_types.h:96
tstrECDomainParam
ECC Curve Domain Parameters.
tstrEcdsaSignReqInfo::u16CurveType
uint16 u16CurveType
Definition: ecc_types.h:228
tstrEcdsaSignReqInfo::u16HashSz
uint16 u16HashSz
Definition: ecc_types.h:232
tstrECPoint
Elliptic Curve point representation.
tstrEllipticCurve::enuType
tenuEcNamedCurve enuType
Definition: ecc_types.h:148
tstrEccReqInfo::strEcdsaSignREQ
tstrEcdsaSignReqInfo strEcdsaSignREQ
Definition: ecc_types.h:273
EcDomainParam::G
tstrECPoint G
Definition: ecc_types.h:136
uint32
unsigned long uint32
Range of values between 0 to 4294967295.
Definition: nm_bsp.h:114
tenuEccREQ
tenuEccREQ
ECC operations that may be requested by WINC.
Definition: ecc_types.h:161
tenuEcNamedCurve
tenuEcNamedCurve
EC Named Curves.
Definition: ecc_types.h:69
tstrEccReqInfo::strEcdhREQ
tstrEcdhReqInfo strEcdhREQ
Definition: ecc_types.h:268
EcPoint::XY
uint8 XY[2 *ECC_POINT_MAX_SIZE]
Definition: ecc_types.h:98
tstrEcdsaVerifyReqInfo::u32nSig
uint32 u32nSig
Definition: ecc_types.h:214
tstrEllipticCurve::strParam
tstrECDomainParam strParam
Definition: ecc_types.h:149
tstrEllipticCurve
Definition of an elliptic curve.
Definition: ecc_types.h:147
ECC_REQ_SERVER_ECDH
Definition: ecc_types.h:168
tstrEccReqInfo
Information relating to ECC operations.
Definition: ecc_types.h:247
tstrECDomainParam
struct EcDomainParam tstrECDomainParam
EcPoint::Y
uint8 Y[ECC_POINT_MAX_SIZE]
Definition: ecc_types.h:107
tstrEccReqInfo::strEcdsaVerifyREQ
tstrEcdsaVerifyReqInfo strEcdsaVerifyREQ
Definition: ecc_types.h:278
ECC_REQ_GEN_KEY
Definition: ecc_types.h:172
EC_SECP521R1
Definition: ecc_types.h:82
uint8
unsigned char uint8
Range of values between 0 to 255.
Definition: nm_bsp.h:100
tstrEcdhReqInfo
Information relating to operations of type ECC_REQ_CLIENT_ECDH, ECC_REQ_GEN_KEY and ECC_REQ_SERVER_EC...
Definition: ecc_types.h:195
EC_UNKNOWN
Definition: ecc_types.h:86
uint16
unsigned short uint16
Range of values between 0 to 65535.
Definition: nm_bsp.h:107
EcDomainParam::p
uint32 p[ECC_POINT_MAX_SIZE_WORDS]
Definition: ecc_types.h:133
EcDomainParam
Definition: ecc_types.h:132
Generated on Tue Sep 27 2022 16:17:30 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: m2m_ota.h Source File

m2m_ota.h
1
77 #ifndef __M2M_OTA_H__
78 #define __M2M_OTA_H__
79
80 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
81 INCLUDES
82 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
83
84 #include "common/include/nm_common.h"
85 #include "driver/include/m2m_types.h"
86 #include "driver/source/nmdrv.h"
87
98 typedef enum {
99 WIFI_OTA_SSL_OPT_BYPASS_SERVER_AUTH = 0x1,
103 WIFI_OTA_SSL_OPT_SNI_VALIDATION = 0x2,
109 WIFI_OTA_SSL_OPT_SNI_SERVERNAME = 0x4,
113 } tenuOTASSLOption; //OTATYPEDEF
115
116 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
117 MACROS
118 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
119
138 typedef void (*tpfOtaNotifCb)(tstrOtaUpdateInfo *pstrOtaUpdateInfo);
139
161 typedef void (*tpfOtaUpdateCb)(uint8 u8OtaUpdateStatusType, uint8 u8OtaUpdateStatus);
162
185 typedef void (*tpfFileGetCb)(uint8 u8Status, uint8 u8Handler, uint32 u32Size);
186
208 typedef void (*tpfFileReadCb)(uint8 u8Status, void *pBuff, uint32 u32Size);
209
219 typedef void (*tpfFileEraseCb)(uint8 u8Status); //OTACALLBACKS
221
222 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
223 FUNCTION PROTOTYPES
224 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
225
226 #ifdef __cplusplus
227 extern "C" {
228 #endif
229
249 NMI_API sint8 m2m_ota_init(tpfOtaUpdateCb pfOtaUpdateCb, tpfOtaNotifCb pfOtaNotifCb);
250
275 NMI_API sint8 m2m_ota_notif_set_url(uint8 *u8Url);
276
296 NMI_API sint8 m2m_ota_notif_check_for_update(void);
297
321 NMI_API sint8 m2m_ota_notif_sched(uint32 u32Period);
322
453 NMI_API sint8 m2m_ota_start_update(unsigned char *pcDownloadUrl);
454
479 NMI_API sint8 m2m_ota_rollback(void);
480
497 NMI_API sint8 m2m_ota_abort(void);
498
524 NMI_API sint8 m2m_ota_switch_firmware(void);
525
557 NMI_API sint8 m2m_ota_host_file_get(unsigned char *pcDownloadUrl, tpfFileGetCb pfHFDGetCb);
558
605 NMI_API sint8 m2m_ota_host_file_read_hif(uint8 u8Handler, uint32 u32Offset, uint32 u32Size, tpfFileReadCb pfHFDReadCb);
606
767 NMI_API sint8 m2m_ota_host_file_read_spi(uint8 u8Handler, uint8 *pu8Buff, uint32 u32Offset, uint32 u32Size);
768
808 NMI_API sint8 m2m_ota_host_file_erase(uint8 u8Handler, tpfFileEraseCb pfHFDEraseCb);
809
810 #if 0
811 NMI_API sint8 m2m_ota_test(void);
812 #endif
813
823 NMI_API sint8 m2m_ota_get_firmware_version(tstrM2mRev *pstrRev);
824
855 NMI_API sint8 m2m_ota_set_ssl_option(tenuOTASSLOption enuOptionName, const void *pOptionValue, size_t OptionLen);
856
857
888 NMI_API sint8 m2m_ota_get_ssl_option(tenuOTASSLOption enuOptionName, void *pOptionValue, size_t *pOptionLen);
889
890 #ifdef __cplusplus
891 }
892 #endif
893 #endif /* __M2M_OTA_H__ */
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 i...
m2m_ota_start_update
NMI_API sint8 m2m_ota_start_update(unsigned char *pcDownloadUrl)
Request OTA start update using the download URL. The OTA module will download the OTA image...
tpfFileReadCb
void(* tpfFileReadCb)(uint8 u8Status, void *pBuff, uint32 u32Size)
A callback to handle a buffer of data after requesting a Host File read. The callback will provide th...
Definition: m2m_ota.h:208
tpfOtaUpdateCb
void(* tpfOtaUpdateCb)(uint8 u8OtaUpdateStatusType, uint8 u8OtaUpdateStatus)
A callback to get OTA status update, the callback provides the status type and its status...
Definition: m2m_ota.h:161
tpfFileGetCb
void(* tpfFileGetCb)(uint8 u8Status, uint8 u8Handler, uint32 u32Size)
A callback to notify the application of the result of the download (success/fail), the generated handler ID and the size of the file which has just finished downloading (size expressed in bytes).
Definition: m2m_ota.h:185
tpfOtaNotifCb
void(* tpfOtaNotifCb)(tstrOtaUpdateInfo *pstrOtaUpdateInfo)
A callback to get notification about a potential OTA update.
Definition: m2m_ota.h:138
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. Function is not implemented (not supported at the current version).
WIFI_OTA_SSL_OPT_SNI_SERVERNAME
Definition: m2m_ota.h:109
m2m_ota_host_file_read_spi
NMI_API sint8 m2m_ota_host_file_read_spi(uint8 u8Handler, uint8 *pu8Buff, uint32 u32Offset, uint32 u32Size)
Read a certain amount of bytes from a file in WINC's Flash using SPI transfer.
tstrOtaUpdateInfo
This struct contains the OTA update information.
Definition: m2m_types.h:3307
m2m_ota_abort
NMI_API sint8 m2m_ota_abort(void)
Request the WINC to abort an OTA or Host File download in progress. If no download is in progress...
m2m_ota_host_file_erase
NMI_API sint8 m2m_ota_host_file_erase(uint8 u8Handler, tpfFileEraseCb pfHFDEraseCb)
Erase any traces of file stored in WINC's Flash.
m2m_ota_get_firmware_version
NMI_API sint8 m2m_ota_get_firmware_version(tstrM2mRev *pstrRev)
Get the OTA Firmware version.
m2m_ota_get_ssl_option
NMI_API sint8 m2m_ota_get_ssl_option(tenuOTASSLOption enuOptionName, void *pOptionValue, size_t *pOptionLen)
Get (read) SSL options relating to OTA.
uint32
unsigned long uint32
Range of values between 0 to 4294967295.
Definition: nm_bsp.h:114
m2m_ota_host_file_read_hif
NMI_API sint8 m2m_ota_host_file_read_hif(uint8 u8Handler, uint32 u32Offset, uint32 u32Size, tpfFileReadCb pfHFDReadCb)
Read a certain amount of bytes from a file previously stored in WINC's Flash using HIF transfer...
m2m_ota_host_file_get
NMI_API sint8 m2m_ota_host_file_get(unsigned char *pcDownloadUrl, tpfFileGetCb pfHFDGetCb)
Download a file from a remote location and store it in WINC's Flash.
NMI_API
#define NMI_API
Definition: nm_bsp.h:60
WIFI_OTA_SSL_OPT_SNI_VALIDATION
Definition: m2m_ota.h:103
m2m_ota_set_ssl_option
NMI_API sint8 m2m_ota_set_ssl_option(tenuOTASSLOption enuOptionName, const void *pOptionValue, size_t OptionLen)
Set specific SSL options to be used when the WINC performs an OTA from an https server.
sint8
signed char sint8
Range of values between -128 to 127.
Definition: nm_bsp.h:121
m2m_ota_rollback
NMI_API sint8 m2m_ota_rollback(void)
Request OTA Roll-back to the old (inactive) WINC image, the WINC firmware will check the validity of ...
tenuOTASSLOption
tenuOTASSLOption
Enumeration for OTA SSL options The following SSL options can be set for OTA.
Definition: m2m_ota.h:98
m2m_ota_notif_set_url
NMI_API sint8 m2m_ota_notif_set_url(uint8 *u8Url)
Set the OTA notification server URL, the function needs to be called before any check for update...
WIFI_OTA_SSL_OPT_BYPASS_SERVER_AUTH
Definition: m2m_ota.h:99
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 MUST for all the OTA API's.
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...
uint8
unsigned char uint8
Range of values between 0 to 255.
Definition: nm_bsp.h:100
tpfFileEraseCb
void(* tpfFileEraseCb)(uint8 u8Status)
A callback executed when the file erase has been completed.
Definition: m2m_ota.h:219
Generated on Tue Sep 27 2022 16:17:30 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: m2m_ssl.h Source File

m2m_ssl.h
1
60 #ifndef __M2M_SSL_H__
61 #define __M2M_SSL_H__
62
63 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
64 INCLUDES
65 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
66
67 #include "common/include/nm_common.h"
68 #include "driver/include/m2m_types.h"
69 #include "driver/source/nmdrv.h"
70 #include "ecc_types.h"
71 #include "socket/include/socket.h"
72
82 typedef void (*tpfAppSSLCb)(uint8 u8MsgType, void *pvMsg);
83
84 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
85 FUNCTION PROTOTYPES
86 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
87
96 NMI_API sint8 m2m_ssl_init(tpfAppSSLCb pfAppSSLCb);
97
110 NMI_API sint8 m2m_ssl_handshake_rsp(tstrEccReqInfo *strECCResp, uint8 *pu8RspDataBuff, uint16 u16RspDataSz);
111
122 NMI_API sint8 m2m_ssl_send_certs_to_winc(uint8 *pu8Buffer, uint32 u32BufferSz);
123
150 NMI_API sint8 m2m_ssl_retrieve_next_for_verifying(tenuEcNamedCurve *penuCurve, uint8 *pu8Value, uint16 *pu16ValueSz, uint8 *pu8Sig, uint16 *pu16SigSz, tstrECPoint *pstrKey);
151
177 NMI_API sint8 m2m_ssl_retrieve_cert(uint16 *pu16Curve, uint8 *pu8Value, uint8 *pu8Sig, tstrECPoint *pstrKey);
178
195 NMI_API sint8 m2m_ssl_retrieve_hash(uint8 *pu8Value, uint16 u16ValueSz);
196
214 NMI_API void m2m_ssl_stop_retrieving(void);
215
224 NMI_API void m2m_ssl_stop_processing_certs(void);
225
235 NMI_API void m2m_ssl_ecc_process_done(void);
236
253 NMI_API sint8 m2m_ssl_set_active_ciphersuites(uint32 u32SslCsBMP);
254
255 #endif /* __M2M_SSL_H__ */
m2m_ssl_stop_retrieving
NMI_API void m2m_ssl_stop_retrieving(void)
Allow SSL driver to tidy up when the application chooses not to retrieve all available information...
m2m_ssl_retrieve_hash
NMI_API sint8 m2m_ssl_retrieve_hash(uint8 *pu8Value, uint16 u16ValueSz)
Retrieve the value from the WINC for ECDSA signing.
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
NMI_API sint8 m2m_ssl_set_active_ciphersuites(uint32 u32SslCsBMP)
Sets the active ciphersuites.
tstrECPoint
Elliptic Curve point representation.
uint32
unsigned long uint32
Range of values between 0 to 4294967295.
Definition: nm_bsp.h:114
tpfAppSSLCb
void(* tpfAppSSLCb)(uint8 u8MsgType, void *pvMsg)
A callback to get SSL notifications.
Definition: m2m_ssl.h:82
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)
Initializes the SSL layer.
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.
tenuEcNamedCurve
tenuEcNamedCurve
EC Named Curves.
Definition: ecc_types.h:69
NMI_API
#define NMI_API
Definition: nm_bsp.h:60
sint8
signed char sint8
Range of values between -128 to 127.
Definition: nm_bsp.h:121
tstrEccReqInfo
Information relating to ECC operations.
Definition: ecc_types.h:247
m2m_ssl_retrieve_cert
NMI_API sint8 m2m_ssl_retrieve_cert(uint16 *pu16Curve, uint8 *pu8Value, uint8 *pu8Sig, tstrECPoint *pstrKey)
Retrieve the next set of information from the WINC for ECDSA verification.
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:100
uint16
unsigned short uint16
Range of values between 0 to 65535.
Definition: nm_bsp.h:107
m2m_ssl_retrieve_next_for_verifying
NMI_API sint8 m2m_ssl_retrieve_next_for_verifying(tenuEcNamedCurve *penuCurve, uint8 *pu8Value, uint16 *pu16ValueSz, uint8 *pu8Sig, uint16 *pu16SigSz, tstrECPoint *pstrKey)
Retrieve the next set of information from the WINC for ECDSA verification.
Generated on Tue Sep 27 2022 16:17:30 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 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 #include "m2m_svnrev.h"
50
51 #ifndef _BOOT_
52 #ifndef _FIRMWARE_
53 #include "common/include/nm_common.h"
54 #else
55 #include "m2m_common.h"
56 #endif
57 #endif
58
59 #ifndef _lint
60 #endif
61
62 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
63 MACROS
64 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
68 #define M2M_MAJOR_SHIFT (8)
69 #define M2M_MINOR_SHIFT (4)
70 #define M2M_PATCH_SHIFT (0)
71
72 #define M2M_DRV_VERSION_SHIFT (16)
73 #define M2M_FW_VERSION_SHIFT (0)
74
75 #define M2M_GET_MAJOR(ver_info_hword) ((uint8)((ver_info_hword) >> M2M_MAJOR_SHIFT) & 0xff)
76 #define M2M_GET_MINOR(ver_info_hword) ((uint8)((ver_info_hword) >> M2M_MINOR_SHIFT) & 0x0f)
77 #define M2M_GET_PATCH(ver_info_hword) ((uint8)((ver_info_hword) >> M2M_PATCH_SHIFT) & 0x0f)
78
79 #define M2M_GET_FW_VER(ver_info_word) ((uint16) ((ver_info_word) >> M2M_FW_VERSION_SHIFT))
80 #define M2M_GET_DRV_VER(ver_info_word) ((uint16) ((ver_info_word) >> M2M_DRV_VERSION_SHIFT))
81
82 #define M2M_GET_DRV_MAJOR(ver_info_word) M2M_GET_MAJOR(M2M_GET_DRV_VER(ver_info_word))
83 #define M2M_GET_DRV_MINOR(ver_info_word) M2M_GET_MINOR(M2M_GET_DRV_VER(ver_info_word))
84 #define M2M_GET_DRV_PATCH(ver_info_word) M2M_GET_PATCH(M2M_GET_DRV_VER(ver_info_word))
85
86 #define M2M_GET_FW_MAJOR(ver_info_word) M2M_GET_MAJOR(M2M_GET_FW_VER(ver_info_word))
87 #define M2M_GET_FW_MINOR(ver_info_word) M2M_GET_MINOR(M2M_GET_FW_VER(ver_info_word))
88 #define M2M_GET_FW_PATCH(ver_info_word) M2M_GET_PATCH(M2M_GET_FW_VER(ver_info_word))
89
90 #define M2M_MAKE_VERSION(major, minor, patch) ( \
91 ((uint16)((major) & 0xff) << M2M_MAJOR_SHIFT) | \
92 ((uint16)((minor) & 0x0f) << M2M_MINOR_SHIFT) | \
93 ((uint16)((patch) & 0x0f) << M2M_PATCH_SHIFT))
94
95 #define M2M_MAKE_VERSION_INFO(fw_major, fw_minor, fw_patch, drv_major, drv_minor, drv_patch) \
96 ( \
97 ( ((uint32)M2M_MAKE_VERSION((fw_major), (fw_minor), (fw_patch))) << M2M_FW_VERSION_SHIFT) | \
98 ( ((uint32)M2M_MAKE_VERSION((drv_major), (drv_minor), (drv_patch))) << M2M_DRV_VERSION_SHIFT))
99
100 #define REL_19_7_7_VER M2M_MAKE_VERSION_INFO(19,7,7,19,3,0)
101 #define REL_19_7_6_VER M2M_MAKE_VERSION_INFO(19,7,6,19,3,0)
102 #define REL_19_7_5_VER M2M_MAKE_VERSION_INFO(19,7,5,19,3,0)
103 #define REL_19_7_0_VER M2M_MAKE_VERSION_INFO(19,7,0,19,3,0)
104 #define REL_19_6_4_VER M2M_MAKE_VERSION_INFO(19,6,4,19,3,0)
105 #define REL_19_6_0_VER M2M_MAKE_VERSION_INFO(19,6,0,19,3,0)
106 #define REL_19_5_3_VER M2M_MAKE_VERSION_INFO(19,5,3,19,3,0)
107 #define REL_19_5_2_VER M2M_MAKE_VERSION_INFO(19,5,2,19,3,0)
108 #define REL_19_5_1_VER M2M_MAKE_VERSION_INFO(19,5,1,19,3,0)
109 #define REL_19_5_0_VER M2M_MAKE_VERSION_INFO(19,5,0,19,3,0)
110 #define REL_19_4_6_VER M2M_MAKE_VERSION_INFO(19,4,6,19,3,0)
111 #define REL_19_4_5_VER M2M_MAKE_VERSION_INFO(19,4,5,19,3,0)
112 #define REL_19_4_4_VER M2M_MAKE_VERSION_INFO(19,4,4,19,3,0)
113 #define REL_19_4_3_VER M2M_MAKE_VERSION_INFO(19,4,3,19,3,0)
114 #define REL_19_4_2_VER M2M_MAKE_VERSION_INFO(19,4,2,19,3,0)
115 #define REL_19_4_1_VER M2M_MAKE_VERSION_INFO(19,4,1,19,3,0)
116 #define REL_19_4_0_VER M2M_MAKE_VERSION_INFO(19,4,0,19,3,0)
117 #define REL_19_3_1_VER M2M_MAKE_VERSION_INFO(19,3,1,19,3,0)
118 #define REL_19_3_0_VER M2M_MAKE_VERSION_INFO(19,3,0,19,3,0)
119 #define REL_19_2_2_VER M2M_MAKE_VERSION_INFO(19,2,2,19,2,0)
120 #define REL_19_2_1_VER M2M_MAKE_VERSION_INFO(19,2,1,19,2,0)
121 #define REL_19_2_0_VER M2M_MAKE_VERSION_INFO(19,2,0,19,2,0)
122 #define REL_19_1_0_VER M2M_MAKE_VERSION_INFO(19,1,0,18,2,0)
123 #define REL_19_0_0_VER M2M_MAKE_VERSION_INFO(19,0,0,18,1,1)
124
125 /*======*======*======*======*
126 FIRMWARE VERSION NO INFO
127 *======*======*======*======*/
128
129 #define M2M_RELEASE_VERSION_MAJOR_NO (19)
130
134 #ifndef BLDTESTVERSION1
135 // the real version number must appear first as the release script greps it out to create folder.
136 #define M2M_RELEASE_VERSION_MINOR_NO (7)
137 #else
138 #define M2M_RELEASE_VERSION_MINOR_NO (8)
139 #endif
140
143 #define M2M_RELEASE_VERSION_PATCH_NO (7)
144
147 #define M2M_RELEASE_VERSION_SVN_VERSION (SVN_REVISION)
148
151 /*======*======*======*======*
152 SUPPORTED DRIVER VERSION NO INFO
153 *======*======*======*======*/
154
155 #define M2M_MIN_REQ_DRV_VERSION_MAJOR_NO (19)
156
160 #define M2M_MIN_REQ_DRV_VERSION_MINOR_NO (3)
161
164 #define M2M_MIN_REQ_DRV_VERSION_PATCH_NO (0)
165
168 #define M2M_MIN_REQ_DRV_SVN_VERSION (0)
169
172 #if !defined(M2M_RELEASE_VERSION_MAJOR_NO) || !defined(M2M_RELEASE_VERSION_MINOR_NO)
173 #error Undefined version number
174 #endif
175 //VERSIONDEF
177
182 #define M2M_BUFFER_MAX_SIZE (1600UL - 4)
183
186 #define M2M_MAC_ADDRES_LEN 6
187
190 #define M2M_ETHERNET_HDR_OFFSET 34
191
195 #define M2M_ETHERNET_HDR_LEN 14
196
200 #define M2M_MAX_SSID_LEN 33
201
206 #define M2M_MAX_PSK_LEN 65
207
212 #define M2M_MIN_PSK_LEN 9
213
217 #define M2M_DEVICE_NAME_MAX 48
218
221 #define M2M_NTP_MAX_SERVER_NAME_LENGTH 32
222
225 #define M2M_LISTEN_INTERVAL 1
226
231 #define MAX_HIDDEN_SITES 4
232
236 #define M2M_CUST_IE_LEN_MAX 252
237
240 #define M2M_CRED_STORE_FLAG 0x01
241
244 #define M2M_CRED_ENCRYPT_FLAG 0x02
245
248 #define M2M_CRED_IS_STORED_FLAG 0x10
249
252 #define M2M_CRED_IS_ENCRYPTED_FLAG 0x20
253
257 #define M2M_WIFI_CONN_BSSID_FLAG 0x01
258
262 #define M2M_AUTH_1X_USER_LEN_MAX 100
263
266 #define M2M_AUTH_1X_PASSWORD_LEN_MAX 256
267
269 #define M2M_AUTH_1X_PRIVATEKEY_LEN_MAX 256
270
273 #define M2M_AUTH_1X_CERT_LEN_MAX 1584
274
276 #define M2M_802_1X_UNENCRYPTED_USERNAME_FLAG 0x80
277
280 #define M2M_802_1X_PREPEND_DOMAIN_FLAG 0x40
281
285 #define M2M_802_1X_MSCHAP2_FLAG 0x01
286
288 #define M2M_802_1X_TLS_FLAG 0x02
289
291 #define M2M_802_1X_TLS_CLIENT_CERTIFICATE 1
292
295 #define PSK_CALC_LEN 40
296
302 #define PWR_DEFAULT PWR_HIGH
303 /*********************
304 *
305 * WIFI GROUP requests
306 */
307
308 #define M2M_CONFIG_CMD_BASE 1
309
311 #define M2M_STA_CMD_BASE 40
312
314 #define M2M_AP_CMD_BASE 70
315
320 #define M2M_P2P_CMD_BASE 90
321 //P2P_DOC
324
325 #define M2M_SERVER_CMD_BASE 100
326
328 #define M2M_GEN_CMD_BASE 105
329
332 /**********************
333 * OTA GROUP requests
334 */
335 #define M2M_OTA_CMD_BASE 100
336
339 /***********************
340 *
341 * CRYPTO group requests
342 */
343 #define M2M_CRYPTO_CMD_BASE 1
344
348 #define M2M_MAX_GRP_NUM_REQ (127)
349
352 #define WEP_40_KEY_SIZE ((uint8)5)
353
355 #define WEP_104_KEY_SIZE ((uint8)13)
356
359 #define WEP_40_KEY_STRING_SIZE ((uint8)10)
360
362 #define WEP_104_KEY_STRING_SIZE ((uint8)26)
363
366 #define WEP_KEY_MAX_INDEX ((uint8)4)
367
370 #define M2M_SHA256_CONTEXT_BUFF_LEN (128)
371
373 #define M2M_SCAN_DEFAULT_NUM_SLOTS (2)
374
376 #define M2M_SCAN_DEFAULT_SLOT_TIME (30)
377
379 #define M2M_SCAN_DEFAULT_PASSIVE_SLOT_TIME (300)
380
382 #define M2M_SCAN_DEFAULT_NUM_PROBE (2)
383
385 #define M2M_FASTCONNECT_DEFAULT_RSSI_THRESH (-45)
386
389 /*======*======*======*======*
390 TLS DEFINITIONS
391 *======*======*======*======*/
392 #define TLS_FILE_NAME_MAX 48
393
395 #define TLS_SRV_SEC_MAX_FILES 8
396
398 #define TLS_SRV_SEC_START_PATTERN_LEN 8
399
402 /*======*======*======*======*
403 SSL DEFINITIONS
404 *======*======*======*======*/
405
406 #define TLS_CRL_DATA_MAX_LEN 64
407 /*<!
408 Maximum data length in a CRL entry (= Hash length for SHA512)
409 */
410 #define TLS_CRL_MAX_ENTRIES 10
411 /*<!
412 Maximum number of entries in a CRL
413 */
414
415 #define TLS_CRL_TYPE_NONE 0
416 /*<!
417 No CRL check
418 */
419 #define TLS_CRL_TYPE_CERT_HASH 1
420 /*<!
421 CRL contains certificate hashes
422 */
423
424 #define TLS_CERTS_CHUNKED_SIG_VALUE 0x6ec8
425
426 /* Commonly used initializers for rate lists for B, G, N or mixed modes for iteration on rates. */
427 #define WLAN_11B_RATES_INITIALIZER { \
428 TX_RATE_1, TX_RATE_2, TX_RATE_5_5, \
429 TX_RATE_11 \
430 }
431
432 #define WLAN_11G_RATES_INITIALIZER { \
433 TX_RATE_6, TX_RATE_9, TX_RATE_12, \
434 TX_RATE_18, TX_RATE_24, TX_RATE_36, \
435 TX_RATE_48, TX_RATE_54 \
436 }
437
438 #define WLAN_11N_RATES_INITIALIZER { \
439 TX_RATE_MCS_0, TX_RATE_MCS_1, TX_RATE_MCS_2, \
440 TX_RATE_MCS_3, TX_RATE_MCS_4, TX_RATE_MCS_5, \
441 TX_RATE_MCS_6, TX_RATE_MCS_7 \
442 }
443
444 #define WLAN_11BGN_RATES_ASC_INITIALIZER { \
445 TX_RATE_1, TX_RATE_2, TX_RATE_5_5, \
446 TX_RATE_6, TX_RATE_MCS_0, TX_RATE_9, \
447 TX_RATE_11, TX_RATE_12, TX_RATE_MCS_1, \
448 TX_RATE_18, TX_RATE_MCS_2, TX_RATE_24, \
449 TX_RATE_MCS_3, TX_RATE_36, TX_RATE_MCS_4, \
450 TX_RATE_48, TX_RATE_MCS_5, TX_RATE_54, \
451 TX_RATE_MCS_6, TX_RATE_MCS_7, \
452 }
453
454 #define WLAN_11BG_RATES_ASC_INITIALIZER { \
455 TX_RATE_1, TX_RATE_2, TX_RATE_5_5, \
456 TX_RATE_6, TX_RATE_9, TX_RATE_11, \
457 TX_RATE_12, TX_RATE_18, TX_RATE_24, \
458 TX_RATE_36, TX_RATE_48, TX_RATE_54 \
459 }
460
461 #define DEFAULT_CONF_AR_INITIALIZER { 5, 1, TX_RATE_AUTO, TX_RATE_AUTO, 10, 5, 3 }
462 //WlanDefines
464
468 /*======*======*======*======*
469 OTA DEFINITIONS
470 *======*======*======*======*/
471
472 #define OTA_STATUS_VALID (0x12526285)
473
476 #define OTA_STATUS_INVALID (0x23987718)
477
480 #define OTA_MAGIC_VALUE (0x1ABCDEF9)
481
484 #ifdef CORTUS_APP
485 #define M2M_MAGIC_APP (0xef522f61UL)
486
489 #endif
490
491 #define OTA_FORMAT_VER_0 (0)
492
496 #define OTA_FORMAT_VER_1 (1)
497
501 #define OTA_FORMAT_VER_2 (2)
502
506 #define OTA_SHA256_DIGEST_SIZE (32)
507
512 #define MAX_FILE_READ_STEP 128
513
517 #define HFD_INVALID_HANDLER (0xff)
518 //OTADEFINE
522
523 #define tstrM2MSNTPConfig_PAD (4 - ((M2M_NTP_MAX_SERVER_NAME_LENGTH + 1 + 1) % 4))
524
528 /*======*======*======*======*
529 * FLASH ID DEFINITIONS *
530 *======*======*======*======*/
531 typedef enum {
532 ENTRY_ID_FW = 0x0011,
533 ENTRY_ID_PLLGAIN = 0x0021,
534 ENTRY_ID_TLSROOT = 0x0031,
535 ENTRY_ID_TLSCLIENT = 0x0032,
536 ENTRY_ID_TLSSERVER = 0x0033,
537 ENTRY_ID_CONNPARAMS = 0x0034,
538 ENTRY_ID_HTTPFILES = 0x0035,
539 ENTRY_ID_TLSCOMMON = 0x0036,
540 ENTRY_ID_HOSTFILE = 0x0041
541 } tenuFlashLUTEntryID;
542
543 /*======*======*======*======*
544 CONNECTION ERROR DEFINITIONS
545 *======*======*======*======*/
546 typedef enum {
547 M2M_DEFAULT_CONN_INPROGRESS = ((sint8)-23),
551 M2M_DEFAULT_CONN_FAIL,
555 M2M_DEFAULT_CONN_SCAN_MISMATCH,
560 M2M_DEFAULT_CONN_EMPTY_LIST
566 } tenuM2mDefaultConnErrcode;
567
575 typedef enum {
576 M2M_ERR_SCAN_FAIL = ((uint8)1),
579 M2M_ERR_JOIN_FAIL,
582 M2M_ERR_AUTH_FAIL,
585 M2M_ERR_ASSOC_FAIL,
588 M2M_ERR_CONN_INPROGRESS
591 } tenuM2mConnChangedErrcode;
599 typedef enum {
600 M2M_WIFI_WEP_KEY_INDEX_1 = ((uint8) 1),
601 M2M_WIFI_WEP_KEY_INDEX_2,
602 M2M_WIFI_WEP_KEY_INDEX_3,
603 M2M_WIFI_WEP_KEY_INDEX_4
606 } tenuM2mWepKeyIndex;
607
615 typedef enum {
616 PWR_AUTO = ((uint8) 1),
618 PWR_LOW1,
620 PWR_LOW2,
622 PWR_HIGH
624 } tenuM2mPwrMode;
625
633 typedef struct {
634 uint8 u8PwrMode;
637 uint8 __PAD24__[3];
640 } tstrM2mPwrMode;
641 #ifndef _lint
642 #ifdef __GNUC__
643 _Static_assert((sizeof(tstrM2mPwrMode)%4)==0, "Structure alignment error");
644 #else
645 static_assert((sizeof(tstrM2mPwrMode)%4)==0, "Structure alignment error");
646 #endif
647 #endif
648
656 typedef enum {
657 TX_PWR_HIGH = ((uint8) 1),
659 TX_PWR_MED,
661 TX_PWR_LOW
663 } tenuM2mTxPwrLevel;
664
672 typedef struct {
673 uint8 u8TxPwrLevel;
676 uint8 __PAD24__[3];
679 } tstrM2mTxPwrLevel;
680 #ifndef _lint
681 #ifdef __GNUC__
682 _Static_assert((sizeof(tstrM2mTxPwrLevel)%4)==0, "Structure alignment error");
683 #else
684 static_assert((sizeof(tstrM2mTxPwrLevel)%4)==0, "Structure alignment error");
685 #endif
686 #endif
687
695 typedef struct {
696 uint8 u8GainTableIdx;
699 uint8 __PAD24__[3];
702 } tstrM2mWiFiGainIdx;
703 #ifndef _lint
704 #ifdef __GNUC__
705 _Static_assert((sizeof(tstrM2mWiFiGainIdx)%4)==0, "Structure alignment error");
706 #else
707 static_assert((sizeof(tstrM2mWiFiGainIdx)%4)==0, "Structure alignment error");
708 #endif
709 #endif
710
718 typedef struct {
719 uint8 u8Enable;
722 uint8 __PAD24__[3];
725 } tstrM2mEnableLogs;
726 #ifndef _lint
727 #ifdef __GNUC__
728 _Static_assert((sizeof(tstrM2mEnableLogs)%4)==0, "Structure alignment error");
729 #else
730 static_assert((sizeof(tstrM2mEnableLogs)%4)==0, "Structure alignment error");
731 #endif
732 #endif
733
741 typedef struct {
742 //Note: on SAMD D21 the size of double is 8 Bytes
743 uint16 u16BattVolt;
746 uint8 __PAD16__[2];
749 } tstrM2mBatteryVoltage;
750 #ifndef _lint
751 #ifdef __GNUC__
752 _Static_assert((sizeof(tstrM2mBatteryVoltage)%4)==0, "Structure alignment error");
753 #else
754 static_assert((sizeof(tstrM2mBatteryVoltage)%4)==0, "Structure alignment error");
755 #endif
756 #endif
757
765 typedef struct {
766 uint8 u8EnableRoaming;
769 uint8 u8EnableDhcp;
772 uint8 __PAD16__[2];
775 } tstrM2mWiFiRoaming;
776
777 #ifndef _lint
778 #ifdef __GNUC__
779 _Static_assert((sizeof(tstrM2mWiFiRoaming)%4)==0, "Structure alignment error");
780 #else
781 static_assert((sizeof(tstrM2mWiFiRoaming)%4)==0, "Structure alignment error");
782 #endif
783 #endif
784
792 typedef struct {
793 uint8 u8EnableXODuringSleep;
796 uint8 __PAD16__[3];
799 } tstrM2mWiFiXOSleepEnable;
800
801 #ifndef _lint
802 #ifdef __GNUC__
803 _Static_assert((sizeof(tstrM2mWiFiXOSleepEnable)%4)==0, "Structure alignment error");
804 #else
805 static_assert((sizeof(tstrM2mWiFiXOSleepEnable)%4)==0, "Structure alignment error");
806 #endif
807 #endif
808
809
816 typedef enum {
817 M2M_REQ_GROUP_MAIN = 0,
818 M2M_REQ_GROUP_WIFI,
819 M2M_REQ_GROUP_IP,
820 M2M_REQ_GROUP_HIF,
821 M2M_REQ_GROUP_OTA,
822 M2M_REQ_GROUP_SSL,
823 M2M_REQ_GROUP_CRYPTO,
824 M2M_REQ_GROUP_SIGMA,
825 M2M_REQ_GROUP_INTERNAL
826 } tenuM2mReqGroup;
827
834 typedef enum {
835 M2M_REQ_CONFIG_PKT,
836 M2M_REQ_DATA_PKT = 0x80 /*BIT7*/
837 } tenuM2mReqpkt;
846 typedef enum {
847 M2M_WIFI_REQ_RESTART = M2M_CONFIG_CMD_BASE,
851 M2M_WIFI_REQ_SET_MAC_ADDRESS,
855 M2M_WIFI_REQ_CURRENT_RSSI,
859 M2M_WIFI_RESP_CURRENT_RSSI,
863 M2M_WIFI_REQ_GET_CONN_INFO,
866 M2M_WIFI_RESP_CONN_INFO,
867
870 M2M_WIFI_REQ_SET_DEVICE_NAME,
874 M2M_WIFI_REQ_START_PROVISION_MODE,
878 M2M_WIFI_RESP_PROVISION_INFO,
882 M2M_WIFI_REQ_STOP_PROVISION_MODE,
886 M2M_WIFI_REQ_SET_SYS_TIME,
890 M2M_WIFI_REQ_ENABLE_SNTP_CLIENT,
895 M2M_WIFI_REQ_DISABLE_SNTP_CLIENT,
900 M2M_WIFI_RESP_MEMORY_RECOVER,
904 M2M_WIFI_REQ_CUST_INFO_ELEMENT,
907 M2M_WIFI_REQ_SCAN,
910 M2M_WIFI_RESP_SCAN_DONE,
913 M2M_WIFI_REQ_SCAN_RESULT,
916 M2M_WIFI_RESP_SCAN_RESULT,
919 M2M_WIFI_REQ_SET_SCAN_OPTION,
922 M2M_WIFI_REQ_SET_SCAN_REGION,
925 M2M_WIFI_REQ_SET_POWER_PROFILE,
928 M2M_WIFI_REQ_SET_TX_POWER,
931 M2M_WIFI_REQ_SET_BATTERY_VOLTAGE,
934 M2M_WIFI_REQ_SET_ENABLE_LOGS,
937 M2M_WIFI_REQ_GET_SYS_TIME,
941 M2M_WIFI_RESP_GET_SYS_TIME,
945 M2M_WIFI_REQ_SEND_ETHERNET_PACKET,
948 M2M_WIFI_RESP_ETHERNET_RX_PACKET,
951 M2M_WIFI_REQ_SET_MAC_MCAST,
954 M2M_WIFI_REQ_GET_PRNG,
957 M2M_WIFI_RESP_GET_PRNG,
960 M2M_WIFI_REQ_SCAN_SSID_LIST,
963 M2M_WIFI_REQ_SET_GAINS,
966 M2M_WIFI_REQ_PASSIVE_SCAN,
969 M2M_WIFI_REQ_CONG_AUTO_RATE,
972 M2M_WIFI_REQ_CONFIG_SNTP,
975 M2M_WIFI_REQ_SET_GAIN_TABLE_IDX,
978 M2M_WIFI_REQRSP_DELETE_APID,
981 /* This enum is now 'full' in the sense that (M2M_WIFI_REQRSP_DELETE_APID+1) == M2M_STA_CMD_BASE.
982 * Any new config values should be placed in tenuM2mGenCmd. */
983 M2M_WIFI_MAX_CONFIG_ALL
984 } tenuM2mConfigCmd;
985
993 typedef enum {
994 M2M_WIFI_REQ_CONNECT = M2M_STA_CMD_BASE,
997 M2M_WIFI_REQ_DEFAULT_CONNECT,
1000 M2M_WIFI_RESP_DEFAULT_CONNECT,
1003 M2M_WIFI_REQ_DISCONNECT,
1006 M2M_WIFI_RESP_CON_STATE_CHANGED,
1009 M2M_WIFI_REQ_SLEEP,
1012 M2M_WIFI_REQ_WPS_SCAN,
1015 M2M_WIFI_REQ_WPS,
1018 M2M_WIFI_REQ_START_WPS,
1022 M2M_WIFI_REQ_DISABLE_WPS,
1025 M2M_WIFI_REQ_DHCP_CONF,
1028 M2M_WIFI_RESP_IP_CONFIGURED,
1032 M2M_WIFI_RESP_IP_CONFLICT,
1036 M2M_WIFI_REQ_ENABLE_MONITORING,
1039 M2M_WIFI_REQ_DISABLE_MONITORING,
1042 M2M_WIFI_RESP_WIFI_RX_PACKET,
1045 M2M_WIFI_REQ_SEND_WIFI_PACKET,
1048 M2M_WIFI_REQ_LSN_INT,
1051 M2M_WIFI_REQ_DOZE,
1054 M2M_WIFI_REQ_CONN,
1059 M2M_WIFI_IND_CONN_PARAM,
1062 M2M_WIFI_REQ_DHCP_FAILURE,
1065 M2M_WIFI_MAX_STA_ALL
1066 } tenuM2mStaCmd;
1067
1075 typedef enum {
1076 M2M_WIFI_REQ_ENABLE_AP = M2M_AP_CMD_BASE,
1079 M2M_WIFI_REQ_DISABLE_AP,
1082 M2M_WIFI_REQ_RESTART_AP,
1085 M2M_WIFI_MAX_AP_ALL
1086 } tenuM2mApCmd;
1087
1096 typedef enum {
1097 M2M_WIFI_REQ_CLIENT_CTRL = M2M_SERVER_CMD_BASE,
1098 M2M_WIFI_RESP_CLIENT_INFO,
1099 M2M_WIFI_REQ_SERVER_INIT,
1100 M2M_WIFI_MAX_SERVER_ALL
1101 } tenuM2mServerCmd;
1102
1110 typedef enum {
1111 M2M_WIFI_REQ_ROAMING = M2M_GEN_CMD_BASE,
1115 M2M_WIFI_REQ_XO_SLEEP_ENABLE,
1119 M2M_WIFI_REQ_SET_STOP_SCAN_OPTION,
1123 M2M_WIFI_MAX_GEN_ALL
1124 } tenuM2mGenCmd;
1125
1133 typedef enum {
1134 M2M_CRYPTO_REQ_SHA256_INIT = M2M_CRYPTO_CMD_BASE,
1135 M2M_CRYPTO_RESP_SHA256_INIT,
1136 M2M_CRYPTO_REQ_SHA256_UPDATE,
1137 M2M_CRYPTO_RESP_SHA256_UPDATE,
1138 M2M_CRYPTO_REQ_SHA256_FINISH,
1139 M2M_CRYPTO_RESP_SHA256_FINISH,
1140 M2M_CRYPTO_REQ_RSA_SIGN_GEN,
1141 M2M_CRYPTO_RESP_RSA_SIGN_GEN,
1142 M2M_CRYPTO_REQ_RSA_SIGN_VERIFY,
1143 M2M_CRYPTO_RESP_RSA_SIGN_VERIFY,
1144 M2M_CRYPTO_MAX_ALL
1145 } tenuM2mCryptoCmd;
1146
1154 typedef enum {
1155 /* Request IDs corresponding to the IP GROUP. */
1156 M2M_IP_REQ_STATIC_IP_CONF = ((uint8) 10),
1157 M2M_IP_REQ_ENABLE_DHCP,
1158 M2M_IP_REQ_DISABLE_DHCP
1159 } tenuM2mIpCmd;
1160
1168 typedef enum {
1169 /* Request IDs corresponding to the IP GROUP. */
1170 M2M_SIGMA_ENABLE = ((uint8) 3),
1171 M2M_SIGMA_TA_START,
1172 M2M_SIGMA_TA_STATS,
1173 M2M_SIGMA_TA_RECEIVE_STOP,
1174 M2M_SIGMA_ICMP_ARP,
1175 M2M_SIGMA_ICMP_RX,
1176 M2M_SIGMA_ICMP_TX,
1177 M2M_SIGMA_UDP_TX,
1178 M2M_SIGMA_UDP_TX_DEFER,
1179 M2M_SIGMA_SECURITY_POLICY,
1180 M2M_SIGMA_SET_SYSTIME
1181 } tenuM2mSigmaCmd;
1182
1190 typedef enum {
1191 M2M_WIFI_DISCONNECTED = 0,
1194 M2M_WIFI_CONNECTED,
1197 M2M_WIFI_ROAMED,
1200 M2M_WIFI_UNDEF = 0xff
1203 } tenuM2mConnState;
1204
1212 typedef enum {
1213 M2M_WIFI_SEC_INVALID = 0,
1216 M2M_WIFI_SEC_OPEN,
1219 M2M_WIFI_SEC_WPA_PSK,
1222 M2M_WIFI_SEC_WEP,
1225 M2M_WIFI_SEC_802_1X,
1228 M2M_WIFI_NUM_AUTH_TYPES
1231 } tenuM2mSecType;
1232
1233
1241 typedef enum {
1242 SSID_MODE_VISIBLE = 0,
1245 SSID_MODE_HIDDEN
1248 } tenuM2mSsidMode;
1249
1260 typedef enum {
1261 M2M_WIFI_CH_1 = ((uint8) 1),
1262 M2M_WIFI_CH_2,
1263 M2M_WIFI_CH_3,
1264 M2M_WIFI_CH_4,
1265 M2M_WIFI_CH_5,
1266 M2M_WIFI_CH_6,
1267 M2M_WIFI_CH_7,
1268 M2M_WIFI_CH_8,
1269 M2M_WIFI_CH_9,
1270 M2M_WIFI_CH_10,
1271 M2M_WIFI_CH_11,
1272 M2M_WIFI_CH_12,
1273 M2M_WIFI_CH_13,
1274 M2M_WIFI_CH_14,
1275 M2M_WIFI_CH_ALL = ((uint8) 255)
1276 } tenuM2mScanCh;
1277
1285 typedef enum {
1286
1287 REG_CH_1 = ((uint16) 1 << 0),
1288 REG_CH_2 = ((uint16) 1 << 1),
1289 REG_CH_3 = ((uint16) 1 << 2),
1290 REG_CH_4 = ((uint16) 1 << 3),
1291 REG_CH_5 = ((uint16) 1 << 4),
1292 REG_CH_6 = ((uint16) 1 << 5),
1293 REG_CH_7 = ((uint16) 1 << 6),
1294 REG_CH_8 = ((uint16) 1 << 7),
1295 REG_CH_9 = ((uint16) 1 << 8),
1296 REG_CH_10 = ((uint16) 1 << 9),
1297 REG_CH_11 = ((uint16) 1 << 10),
1298 REG_CH_12 = ((uint16) 1 << 11),
1299 REG_CH_13 = ((uint16) 1 << 12),
1300 REG_CH_14 = ((uint16) 1 << 13),
1301 REG_CH_ALL = ((uint16) 0x3FFF),
1302 NORTH_AMERICA = ((uint16) 0x7FF),
1305 EUROPE = ((uint16) 0x1FFF),
1308 ASIA = ((uint16) 0x3FFF)
1309 /* 14 channel
1310 */
1311 } tenuM2mScanRegion;
1312
1313
1321 typedef enum {
1322 M2M_NO_PS,
1325 M2M_PS_AUTOMATIC,
1331 M2M_PS_H_AUTOMATIC,
1336 M2M_PS_DEEP_AUTOMATIC,
1340 M2M_PS_MANUAL
1343 } tenuPowerSaveModes;
1344
1352 typedef enum {
1353 M2M_WIFI_MODE_NORMAL = ((uint8) 1),
1356 M2M_WIFI_MODE_ATE_HIGH,
1359 M2M_WIFI_MODE_ATE_LOW,
1362 M2M_WIFI_MODE_ETHERNET,
1365 M2M_WIFI_MODE_MAX
1366 } tenuM2mWifiMode;
1367
1375 typedef enum {
1376 WPS_PIN_TRIGGER = 0,
1379 WPS_PBC_TRIGGER = 4
1382 } tenuWPSTrigger;
1383
1391 typedef enum {
1392 SNTP_DISABLE_DHCP = 0,
1395 SNTP_ENABLE_DHCP = 1
1398 } tenuSNTPUseDHCP;
1399
1407 typedef struct {
1408 uint16 u8PPAGFor11B;
1416 uint16 u8PPAGFor11GN;
1424 } tstrM2mWifiGainsParams;
1425
1433 typedef struct {
1434 uint16 u16CredSize;
1439 uint8 u8CredStoreFlags;
1446 uint8 u8Channel;
1448 } tstrM2mConnCredHdr;
1449 #ifndef _lint
1450 #ifdef __GNUC__
1451 _Static_assert((sizeof(tstrM2mConnCredHdr)%4)==0, "Structure alignment error");
1452 #else
1453 static_assert((sizeof(tstrM2mConnCredHdr)%4)==0, "Structure alignment error");
1454 #endif
1455 #endif
1456
1464 typedef struct {
1465 uint8 u8SsidLen;
1467 uint8 au8Ssid[M2M_MAX_SSID_LEN-1];
1469 uint8 u8Options;
1473 uint8 au8Bssid[M2M_MAC_ADDRES_LEN];
1475 uint8 u8AuthType;
1477 uint8 au8Rsv[3];
1479 } tstrM2mConnCredCmn;
1480 #ifndef _lint
1481 #ifdef __GNUC__
1482 _Static_assert((sizeof(tstrM2mConnCredCmn)%4)==0, "Structure alignment error");
1483 #else
1484 static_assert((sizeof(tstrM2mConnCredCmn)%4)==0, "Structure alignment error");
1485 #endif
1486 #endif
1487
1495 typedef struct {
1496 uint8 u8KeyIndex;
1498 uint8 u8KeyLen;
1500 uint8 au8WepKey[WEP_104_KEY_SIZE];
1502 uint8 u8Rsv;
1504 } tstrM2mWifiWep;
1505 #ifndef _lint
1506 #ifdef __GNUC__
1507 _Static_assert((sizeof(tstrM2mWifiWep)%4)==0, "Structure alignment error");
1508 #else
1509 static_assert((sizeof(tstrM2mWifiWep)%4)==0, "Structure alignment error");
1510 #endif
1511 #endif
1512
1520 typedef struct {
1521 uint8 u8PassphraseLen;
1523 uint8 au8Passphrase[M2M_MAX_PSK_LEN-1];
1525 uint8 au8Psk[PSK_CALC_LEN];
1527 uint8 u8PskCalculated;
1529 uint8 au8Rsv[2];
1531 } tstrM2mWifiPsk;
1532 #ifndef _lint
1533 #ifdef __GNUC__
1534 _Static_assert((sizeof(tstrM2mWifiPsk)%4)==0, "Structure alignment error");
1535 #else
1536 static_assert((sizeof(tstrM2mWifiPsk)%4)==0, "Structure alignment error");
1537 #endif
1538 #endif
1539
1548 typedef struct {
1549 uint8 u8Flags;
1556 uint8 u8DomainLength;
1558 uint8 u8UserNameLength;
1560 uint8 u8HdrLength;
1564 uint16 u16PrivateKeyOffset;
1566 uint16 u16PrivateKeyLength;
1568 uint16 u16CertificateOffset;
1570 uint16 u16CertificateLength;
1572 uint8 au8TlsSpecificRootNameSha1[20];
1574 uint32 u32Rsv1;
1576 uint32 u32TlsHsFlags;
1578 uint32 u32Rsv2;
1580 uint8 au81xAuthDetails[];
1583 } tstrM2mWifi1xHdr;
1584 #ifndef _lint
1585 #ifdef __GNUC__
1586 _Static_assert((sizeof(tstrM2mWifi1xHdr)%4)==0, "Structure alignment error");
1587 #else
1588 static_assert((sizeof(tstrM2mWifi1xHdr)%4)==0, "Structure alignment error");
1589 #endif
1590 #endif
1591
1600 typedef struct {
1601 uint8 u8Type;
1605 uint8 au8Rsv[3];
1607 uint16 u16InfoPos;
1609 uint16 u16InfoLen;
1611 uint8 au8Info[];
1613 } tstrM2mWifiAuthInfoHdr;
1614 #ifndef _lint
1615 #ifdef __GNUC__
1616 _Static_assert((sizeof(tstrM2mWifiAuthInfoHdr)%4)==0, "Structure alignment error");
1617 #else
1618 static_assert((sizeof(tstrM2mWifiAuthInfoHdr)%4)==0, "Structure alignment error");
1619 #endif
1620 #endif
1621
1636 typedef struct {
1637 tstrM2mConnCredHdr strConnCredHdr;
1639 tstrM2mConnCredCmn strConnCredCmn;
1641 } tstrM2mWifiConnHdr;
1642 #ifndef _lint
1643 #ifdef __GNUC__
1644 _Static_assert((sizeof(tstrM2mWifiConnHdr)%4)==0, "Structure alignment error");
1645 #else
1646 static_assert((sizeof(tstrM2mWifiConnHdr)%4)==0, "Structure alignment error");
1647 #endif
1648 #endif
1649
1657 typedef struct {
1658 uint8 au8SSID[M2M_MAX_SSID_LEN];
1663 uint8 __PAD__[3];
1666 } tstrM2mWifiApId;
1667 #ifndef _lint
1668 #ifdef __GNUC__
1669 _Static_assert((sizeof(tstrM2mWifiApId)%4)==0, "Structure alignment error");
1670 #else
1671 static_assert((sizeof(tstrM2mWifiApId)%4)==0, "Structure alignment error");
1672 #endif
1673 #endif
1674
1682 typedef struct {
1683 sint8 s8ErrorCode;
1689 uint8 __PAD24__[3];
1690 } tstrM2MGenericResp;
1691 #ifndef _lint
1692 #ifdef __GNUC__
1693 _Static_assert((sizeof(tstrM2MGenericResp)%4)==0, "Structure alignment error");
1694 #else
1695 static_assert((sizeof(tstrM2MGenericResp)%4)==0, "Structure alignment error");
1696 #endif
1697 #endif
1698
1709 typedef struct {
1710 uint8 u8TriggerType;
1713 char acPinNumber[8];
1716 uint8 __PAD24__[3];
1719 } tstrM2MWPSConnect;
1720 #ifndef _lint
1721 #ifdef __GNUC__
1722 _Static_assert((sizeof(tstrM2MWPSConnect)%4)==0, "Structure alignment error");
1723 #else
1724 static_assert((sizeof(tstrM2MWPSConnect)%4)==0, "Structure alignment error");
1725 #endif
1726 #endif
1727
1741 typedef struct {
1742 uint8 u8AuthType;
1745 uint8 u8Ch;
1748 uint8 au8SSID[M2M_MAX_SSID_LEN];
1751 uint8 au8PSK[M2M_MAX_PSK_LEN];
1754 } tstrM2MWPSInfo;
1755
1756
1768 typedef struct {
1769 sint8 s8ErrorCode;
1775 uint8 __PAD24__[3];
1776 } tstrM2MDefaultConnResp;
1777 #ifndef _lint
1778 #ifdef __GNUC__
1779 _Static_assert((sizeof(tstrM2MDefaultConnResp)%4)==0, "Structure alignment error");
1780 #else
1781 static_assert((sizeof(tstrM2MDefaultConnResp)%4)==0, "Structure alignment error");
1782 #endif
1783 #endif
1784
1796 typedef struct {
1797 uint8 u8NumOfSlot;
1802 uint8 u8SlotTime;
1808 uint8 u8ProbesPerSlot;
1815 sint8 s8RssiThresh;
1824 } tstrM2MScanOption;
1825
1826 #ifndef _lint
1827 #ifdef __GNUC__
1828 _Static_assert((sizeof(tstrM2MScanOption)%4)==0, "Structure alignment error");
1829 #else
1830 static_assert((sizeof(tstrM2MScanOption)%4)==0, "Structure alignment error");
1831 #endif
1832 #endif
1833
1834
1845 typedef struct {
1846 uint8 u8StopOnFirstResult;
1852 uint8 au8Rsv[3];
1855 } tstrM2MStopScanOption;
1856
1857 #ifndef _lint
1858 #ifdef __GNUC__
1859 _Static_assert((sizeof(tstrM2MStopScanOption)%4)==0, "Structure alignment error");
1860 #else
1861 static_assert((sizeof(tstrM2MStopScanOption)%4)==0, "Structure alignment error");
1862 #endif
1863 #endif
1864
1875 typedef struct {
1876 uint16 u16ScanRegion;
1877 /*|< Specifies the number of channels allowed in the region (e.g. North America = 11 ... etc.).
1878 */
1879 uint8 __PAD16__[2];
1881 } tstrM2MScanRegion;
1882 #ifndef _lint
1883 #ifdef __GNUC__
1884 _Static_assert((sizeof(tstrM2MScanRegion)%4)==0, "Structure alignment error");
1885 #else
1886 static_assert((sizeof(tstrM2MScanRegion)%4)==0, "Structure alignment error");
1887 #endif
1888 #endif
1889
1901 typedef struct {
1902 uint8 u8ChNum;
1905 uint8 __RSVD8__[1];
1908 uint16 u16PassiveScanTime;
1914 } tstrM2MScan;
1915
1923 typedef struct {
1924 sint8 s8Resp;
1925 /***/
1926 uint8 __PAD24__[3];
1927 /*
1928 */
1929 } tstrCyptoResp;
1930 #ifndef _lint
1931 #ifdef __GNUC__
1932 _Static_assert((sizeof(tstrCyptoResp)%4)==0, "Structure alignment error");
1933 #else
1934 static_assert((sizeof(tstrCyptoResp)%4)==0, "Structure alignment error");
1935 #endif
1936 #endif
1937
1945 typedef struct {
1946 uint8 u8NumofCh;
1949 sint8 s8ScanState;
1952 uint8 __PAD16__[2];
1955 } tstrM2mScanDone;
1956 #ifndef _lint
1957 #ifdef __GNUC__
1958 _Static_assert((sizeof(tstrM2mScanDone)%4)==0, "Structure alignment error");
1959 #else
1960 static_assert((sizeof(tstrM2mScanDone)%4)==0, "Structure alignment error");
1961 #endif
1962 #endif
1963
1972 typedef struct {
1973 uint8 u8Index;
1976 uint8 __PAD24__[3];
1979 } tstrM2mReqScanResult;
1980 #ifndef _lint
1981 #ifdef __GNUC__
1982 _Static_assert((sizeof(tstrM2mReqScanResult)%4)==0, "Structure alignment error");
1983 #else
1984 static_assert((sizeof(tstrM2mReqScanResult)%4)==0, "Structure alignment error");
1985 #endif
1986 #endif
1987
1996 typedef struct {
1997 uint8 u8index;
2000 sint8 s8rssi;
2003 uint8 u8AuthType;
2006 uint8 u8ch;
2009 uint8 au8BSSID[6];
2012 uint8 au8SSID[M2M_MAX_SSID_LEN];
2015 uint8 _PAD8_;
2018 } tstrM2mWifiscanResult;
2019 #ifndef _lint
2020 #ifdef __GNUC__
2021 _Static_assert((sizeof(tstrM2mWifiscanResult)%4)==0, "Structure alignment error");
2022 #else
2023 static_assert((sizeof(tstrM2mWifiscanResult)%4)==0, "Structure alignment error");
2024 #endif
2025 #endif
2026
2037 typedef struct {
2038 uint8 u8CurrState;
2041 uint8 u8ErrCode;
2044 uint8 __PAD16__[2];
2047 } tstrM2mWifiStateChanged;
2048 #ifndef _lint
2049 #ifdef __GNUC__
2050 _Static_assert((sizeof(tstrM2mWifiStateChanged)%4)==0, "Structure alignment error");
2051 #else
2052 static_assert((sizeof(tstrM2mWifiStateChanged)%4)==0, "Structure alignment error");
2053 #endif
2054 #endif
2055
2066 typedef struct {
2067 uint8 u8PsType;
2070 uint8 u8BcastEn;
2073 uint8 __PAD16__[2];
2076 } tstrM2mPsType;
2077 #ifndef _lint
2078 #ifdef __GNUC__
2079 _Static_assert((sizeof(tstrM2mPsType)%4)==0, "Structure alignment error");
2080 #else
2081 static_assert((sizeof(tstrM2mPsType)%4)==0, "Structure alignment error");
2082 #endif
2083 #endif
2084
2093 typedef struct {
2096 uint32 u32SleepTime;
2097
2098 } tstrM2mSlpReqTime;
2099
2109 typedef struct {
2110 uint16 u16LsnInt;
2113 uint8 __PAD16__[2];
2116 } tstrM2mLsnInt;
2117 #ifndef _lint
2118 #ifdef __GNUC__
2119 _Static_assert((sizeof(tstrM2mLsnInt)%4)==0, "Structure alignment error");
2120 #else
2121 static_assert((sizeof(tstrM2mLsnInt)%4)==0, "Structure alignment error");
2122 #endif
2123 #endif
2124
2134 typedef struct {
2135 uint8 u8ChannelID;
2136 /* !< RF Channel ID. It must use values from tenuM2mScanCh
2137 */
2138 uint8 u8FrameType;
2141 uint8 u8FrameSubtype;
2144 uint8 au8SrcMacAddress[6];
2145 /* ZERO means DO NOT FILTER Source address.
2146 */
2147 uint8 au8DstMacAddress[6];
2148 /* ZERO means DO NOT FILTER Destination address.
2149 */
2150 uint8 au8BSSID[6];
2151 /* ZERO means DO NOT FILTER BSSID.
2152 */
2153 uint8 u8EnRecvHdr;
2154 /*
2155 Enable receive the full header before the payload
2156 */
2157 uint8 __PAD16__[2];
2160 } tstrM2MWifiMonitorModeCtrl;
2161 #ifndef _lint
2162 #ifdef __GNUC__
2163 _Static_assert((sizeof(tstrM2MWifiMonitorModeCtrl)%4)==0, "Structure alignment error");
2164 #else
2165 static_assert((sizeof(tstrM2MWifiMonitorModeCtrl)%4)==0, "Structure alignment error");
2166 #endif
2167 #endif
2168
2178 typedef struct {
2179 uint8 u8FrameType;
2182 uint8 u8FrameSubtype;
2185 uint8 u8ServiceClass;
2188 uint8 u8Priority;
2191 uint8 u8HeaderLength;
2194 uint8 u8CipherType;
2197 uint8 au8SrcMacAddress[6];
2198 /* ZERO means DO NOT FILTER Source address.
2199 */
2200 uint8 au8DstMacAddress[6];
2201 /* ZERO means DO NOT FILTER Destination address.
2202 */
2203 uint8 au8BSSID[6];
2204 /* ZERO means DO NOT FILTER BSSID.
2205 */
2206 uint16 u16DataLength;
2209 uint16 u16FrameLength;
2212 uint32 u32DataRateKbps;
2215 sint8 s8RSSI;
2218 uint8 __PAD24__[3];
2221 } tstrM2MWifiRxPacketInfo;
2222 #ifndef _lint
2223 #ifdef __GNUC__
2224 _Static_assert((sizeof(tstrM2MWifiRxPacketInfo)%4)==0, "Structure alignment error");
2225 #else
2226 static_assert((sizeof(tstrM2MWifiRxPacketInfo)%4)==0, "Structure alignment error");
2227 #endif
2228 #endif
2229
2239 typedef struct {
2240 uint16 u16PacketSize;
2243 uint16 u16HeaderLength;
2246 } tstrM2MWifiTxPacketInfo;
2247
2257 typedef struct {
2261 uint8 au8SSID[M2M_MAX_SSID_LEN];
2264 uint8 u8ListenChannel;
2267 uint8 u8KeyIndx;
2270 uint8 u8KeySz;
2273 uint8 au8WepKey[WEP_104_KEY_STRING_SIZE + 1];
2276 uint8 u8SecType;
2279 uint8 u8SsidHide;
2282 uint8 au8DHCPServerIP[4];
2285 uint8 au8Key[M2M_MAX_PSK_LEN];
2288 uint8 __PAD16__[2];
2291 } tstrM2MAPConfig;
2292 #ifndef _lint
2293 #ifdef __GNUC__
2294 _Static_assert((sizeof(tstrM2MAPConfig)%4)==0, "Structure alignment error");
2295 #else
2296 static_assert((sizeof(tstrM2MAPConfig)%4)==0, "Structure alignment error");
2297 #endif
2298 #endif
2299
2312 typedef struct {
2313 uint8 au8DefRouterIP[4];
2316 uint8 au8DNSServerIP[4];
2319 uint8 au8SubnetMask[4];
2322 } tstrM2MAPConfigExt;
2323 #ifndef _lint
2324 #ifdef __GNUC__
2325 _Static_assert((sizeof(tstrM2MAPConfigExt)%4)==0, "Structure alignment error");
2326 #else
2327 static_assert((sizeof(tstrM2MAPConfigExt)%4)==0, "Structure alignment error");
2328 #endif
2329 #endif
2330
2341 typedef struct {
2342 tstrM2MAPConfig strApConfig;
2346 tstrM2MAPConfigExt strApConfigExt;
2350 } tstrM2MAPModeConfig;
2351 #ifndef _lint
2352 #ifdef __GNUC__
2353 _Static_assert((sizeof(tstrM2MAPModeConfig)%4)==0, "Structure alignment error");
2354 #else
2355 static_assert((sizeof(tstrM2MAPModeConfig)%4)==0, "Structure alignment error");
2356 #endif
2357 #endif
2358
2366 typedef struct {
2367 uint8 u8Channel;
2370 uint8 __PAD24__[3];
2373 } tstrM2mServerInit;
2374 #ifndef _lint
2375 #ifdef __GNUC__
2376 _Static_assert((sizeof(tstrM2mServerInit)%4)==0, "Structure alignment error");
2377 #else
2378 static_assert((sizeof(tstrM2mServerInit)%4)==0, "Structure alignment error");
2379 #endif
2380 #endif
2381
2389 typedef struct {
2390 uint8 u8State;
2393 uint8 __PAD24__[3];
2396 } tstrM2mClientState;
2397 #ifndef _lint
2398 #ifdef __GNUC__
2399 _Static_assert((sizeof(tstrM2mClientState)%4)==0, "Structure alignment error");
2400 #else
2401 static_assert((sizeof(tstrM2mClientState)%4)==0, "Structure alignment error");
2402 #endif
2403 #endif
2404
2412 typedef struct {
2413 uint8 u8cmd;
2416 uint8 __PAD24__[3];
2419 } tstrM2Mservercmd;
2420 #ifndef _lint
2421 #ifdef __GNUC__
2422 _Static_assert((sizeof(tstrM2Mservercmd)%4)==0, "Structure alignment error");
2423 #else
2424 static_assert((sizeof(tstrM2Mservercmd)%4)==0, "Structure alignment error");
2425 #endif
2426 #endif
2427
2439 typedef struct {
2440 uint8 au8Mac[6];
2443 uint8 __PAD16__[2];
2446 } tstrM2mSetMacAddress;
2447 #ifndef _lint
2448 #ifdef __GNUC__
2449 _Static_assert((sizeof(tstrM2mSetMacAddress)%4)==0, "Structure alignment error");
2450 #else
2451 static_assert((sizeof(tstrM2mSetMacAddress)%4)==0, "Structure alignment error");
2452 #endif
2453 #endif
2454
2464 typedef struct {
2465 uint8 au8DeviceName[M2M_DEVICE_NAME_MAX];
2468 } tstrM2MDeviceNameConfig;
2469
2470
2481 typedef struct {
2482 uint32 u32StaticIP;
2485 uint32 u32Gateway;
2488 uint32 u32DNS;
2491 uint32 u32AlternateDNS;
2494 uint32 u32SubnetMask;
2497 uint32 u32DhcpLeaseTime;
2500 } tstrM2MIPConfig;
2501
2510 typedef struct {
2511 uint16 u16PktSz;
2512 uint16 u16PktOffset;
2513 } tstrM2mIpRsvdPkt;
2514
2515
2524 typedef struct {
2525 tstrM2MAPConfig strApConfig;
2529 char acHttpServerDomainName[64];
2533 uint8 u8EnableRedirect;
2540 tstrM2MAPConfigExt strApConfigExt;
2544 uint8 __PAD24__[3];
2545 } tstrM2MProvisionModeConfig;
2546 #ifndef _lint
2547 #ifdef __GNUC__
2548 _Static_assert((sizeof(tstrM2MProvisionModeConfig)%4)==0, "Structure alignment error");
2549 #else
2550 static_assert((sizeof(tstrM2MProvisionModeConfig)%4)==0, "Structure alignment error");
2551 #endif
2552 #endif
2553
2561 typedef struct {
2562 uint8 au8SSID[M2M_MAX_SSID_LEN];
2566 uint8 au8Password[M2M_MAX_PSK_LEN];
2570 uint8 u8SecType;
2574 uint8 u8Status;
2580 } tstrM2MProvisionInfo;
2581
2582
2590 typedef struct {
2591 char acSSID[M2M_MAX_SSID_LEN];
2593 uint8 u8SecType;
2595 uint8 au8IPAddr[4];
2597 uint8 au8MACAddress[6];
2599 sint8 s8RSSI;
2601 uint8 u8CurrChannel;
2603 uint8 __PAD16__[2];
2605 } tstrM2MConnInfo;
2606 #ifndef _lint
2607 #ifdef __GNUC__
2608 _Static_assert((sizeof(tstrM2MConnInfo)%4)==0, "Structure alignment error");
2609 #else
2610 static_assert((sizeof(tstrM2MConnInfo)%4)==0, "Structure alignment error");
2611 #endif
2612 #endif
2613
2623 typedef enum {
2624 M2M_WIFI_REQ_P2P_INT_CONNECT = M2M_P2P_CMD_BASE,
2628 M2M_WIFI_REQ_ENABLE_P2P,
2631 M2M_WIFI_REQ_DISABLE_P2P,
2634 M2M_WIFI_REQ_P2P_REPOST,
2638 M2M_WIFI_MAX_P2P_ALL
2639 } tenuM2mP2pCmd;
2640
2648 typedef struct {
2649 uint8 u8ListenChannel;
2652 uint8 __PAD24__[3];
2655 } tstrM2MP2PConnect;
2656 #ifndef _lint
2657 #ifdef __GNUC__
2658 _Static_assert((sizeof(tstrM2MP2PConnect)%4)==0, "Structure alignment error");
2659 #else
2660 static_assert((sizeof(tstrM2MP2PConnect)%4)==0, "Structure alignment error");
2661 #endif
2662 #endif
2663 //P2P_DOC
2664
2673 typedef struct {
2677 char acNTPServer[M2M_NTP_MAX_SERVER_NAME_LENGTH + 1];
2680 tenuSNTPUseDHCP enuUseDHCP;
2683 #if tstrM2MSNTPConfig_PAD != 4
2684 uint8 __PAD8__[tstrM2MSNTPConfig_PAD];
2687 #endif
2688 } tstrM2MSNTPConfig;
2689 #ifndef _lint
2690 #ifdef __GNUC__
2691 _Static_assert((sizeof(tstrM2MSNTPConfig)%4)==0, "Structure alignment error");
2692 #else
2693 static_assert((sizeof(tstrM2MSNTPConfig)%4)==0, "Structure alignment error");
2694 #endif
2695 #endif
2696
2704 typedef struct {
2705 uint16 u16Year;
2706 uint8 u8Month;
2707 uint8 u8Day;
2708 uint8 u8Hour;
2709 uint8 u8Minute;
2710 uint8 u8Second;
2711 uint8 __PAD8__;
2712 } tstrSystemTime;
2713 #ifndef _lint
2714 #ifdef __GNUC__
2715 _Static_assert((sizeof(tstrSystemTime)%4)==0, "Structure alignment error");
2716 #else
2717 static_assert((sizeof(tstrSystemTime)%4)==0, "Structure alignment error");
2718 #endif
2719 #endif
2720
2728 typedef struct {
2729 uint8 au8macaddress[M2M_MAC_ADDRES_LEN];
2733 uint8 u8AddRemove;
2737 uint8 __PAD8__;
2740 } tstrM2MMulticastMac;
2741 #ifndef _lint
2742 #ifdef __GNUC__
2743 _Static_assert((sizeof(tstrM2MMulticastMac)%4)==0, "Structure alignment error");
2744 #else
2745 static_assert((sizeof(tstrM2MMulticastMac)%4)==0, "Structure alignment error");
2746 #endif
2747 #endif
2748
2756 typedef struct {
2760 uint8 *pu8RngBuff;
2764 uint16 u16PrngSize;
2768 uint8 __PAD16__[2];
2769 } tstrPrng;
2770 #ifndef _lint
2771 #ifdef __GNUC__
2772 _Static_assert((sizeof(tstrPrng)%4)==0, "Structure alignment error");
2773 #else
2774 static_assert((sizeof(tstrPrng)%4)==0, "Structure alignment error");
2775 #endif
2776 #endif
2777
2784 typedef enum {
2785 TX_RATE_AUTO = 0xFF,
2786 TX_RATE_LOWEST = 0xFE,
2787 TX_RATE_1 = 0x00, /* 1 Mbps */
2788 TX_RATE_2 = 0x01, /* 2 Mbps */
2789 TX_RATE_5_5 = 0x02, /* 5 Mbps */
2790 TX_RATE_11 = 0x03, /* 11 Mbps */
2791 TX_RATE_6 = 0x0B, /* 6 Mbps */
2792 TX_RATE_9 = 0x0F, /* 9 Mbps */
2793 TX_RATE_12 = 0x0A, /* 12 Mbps */
2794 TX_RATE_18 = 0x0E, /* 18 Mbps */
2795 TX_RATE_24 = 0x09, /* 24 Mbps */
2796 TX_RATE_36 = 0x0D, /* 36 Mbps */
2797 TX_RATE_48 = 0x08, /* 48 Mbps */
2798 TX_RATE_54 = 0x0C, /* 54 Mbps */
2799 TX_RATE_MCS_0 = 0x80, /* MCS-0: 6.5 Mbps */
2800 TX_RATE_MCS_1 = 0x81, /* MCS-1: 13 Mbps */
2801 TX_RATE_MCS_2 = 0x82, /* MCS-2: 19.5 Mbps */
2802 TX_RATE_MCS_3 = 0x83, /* MCS-3: 26 Mbps */
2803 TX_RATE_MCS_4 = 0x84, /* MCS-4: 39 Mbps */
2804 TX_RATE_MCS_5 = 0x85, /* MCS-5: 52 Mbps */
2805 TX_RATE_MCS_6 = 0x86, /* MCS-6: 58.5 Mbps */
2806 TX_RATE_MCS_7 = 0x87, /* MCS-7: 65 Mbps */
2807 } tenuWlanTxRate;
2808
2816 typedef struct {
2817 uint16 u16ArMaxRecoveryFailThreshold;
2835 uint16 u16ArMinRecoveryFailThreshold;
2849 tenuWlanTxRate enuWlanTxRate;
2858 tenuWlanTxRate enuArInitialRateSel;
2871 uint8 u8ArEnoughTxThreshold;
2877 uint8 u8ArSuccessTXThreshold;
2885 uint8 u8ArFailTxThreshold;
2893 uint8 __PAD24__[3];
2896 } tstrConfAutoRate;
2897 #ifndef _lint
2898 #ifdef __GNUC__
2899 _Static_assert((sizeof(tstrConfAutoRate)%4)==0, "Structure alignment error");
2900 #else
2901 static_assert((sizeof(tstrConfAutoRate)%4)==0, "Structure alignment error");
2902 #endif
2903 #endif
2904 //WlanEnums
2905
2909 typedef enum {
2910 M2M_SSL_REQ_CERT_VERIF,
2912 M2M_SSL_REQ_ECC,
2914 M2M_SSL_RESP_ECC,
2916 M2M_SSL_IND_CRL,
2918 M2M_SSL_REQ_WRITE_OWN_CERTS,
2920 M2M_SSL_REQ_SET_CS_LIST,
2922 M2M_SSL_RESP_SET_CS_LIST,
2924 M2M_SSL_RESP_WRITE_OWN_CERTS
2926 } tenuM2mSslCmd;
2927
2928 /*
2929 * TLS certificate revocation list
2930 * Typedefs common between fw and host
2931 */
2932
2940 typedef struct {
2941 uint8 u8DataLen;
2943 uint8 au8Data[TLS_CRL_DATA_MAX_LEN];
2945 uint8 __PAD24__[3];
2947 } tstrTlsCrlEntry;
2948 #ifndef _lint
2949 #ifdef __GNUC__
2950 _Static_assert((sizeof(tstrTlsCrlEntry)%4)==0, "Structure alignment error");
2951 #else
2952 static_assert((sizeof(tstrTlsCrlEntry)%4)==0, "Structure alignment error");
2953 #endif
2954 #endif
2955
2963 typedef struct {
2964 uint8 u8CrlType;
2966 uint8 u8Rsv1;
2968 uint8 u8Rsv2;
2970 uint8 u8Rsv3;
2972 tstrTlsCrlEntry astrTlsCrl[TLS_CRL_MAX_ENTRIES];
2974 } tstrTlsCrlInfo;
2975
2982 typedef enum {
2983 SSL_CERT_EXP_CHECK_DISABLE,
2989 SSL_CERT_EXP_CHECK_ENABLE,
2995 SSL_CERT_EXP_CHECK_EN_IF_SYS_TIME
3002 } tenuSslCertExpSettings;
3003
3011 typedef struct {
3012 char acFileName[TLS_FILE_NAME_MAX];
3014 uint32 u32FileSize;
3016 uint32 u32FileAddr;
3018 } tstrTlsSrvSecFileEntry;
3019
3027 typedef struct {
3028 uint8 au8SecStartPattern[TLS_SRV_SEC_START_PATTERN_LEN];
3030 uint32 u32nEntries;
3032 uint32 u32NextWriteAddr;
3033 /* */
3034 tstrTlsSrvSecFileEntry astrEntries[TLS_SRV_SEC_MAX_FILES];
3036 uint32 u32CRC;
3038 } tstrTlsSrvSecHdr;
3039
3040 typedef enum {
3041 TLS_FLASH_OK,
3043 TLS_FLASH_OK_NO_CHANGE,
3045 TLS_FLASH_ERR_CORRUPT,
3047 TLS_FLASH_ERR_NO_CHANGE,
3049 TLS_FLASH_ERR_UNKNOWN
3051 } tenuTlsFlashStatus;
3052
3053 typedef struct {
3054 uint16 u16Sig;
3055 uint16 u16TotalSize32;
3056 uint16 u16Offset32;
3057 uint16 u16Size32;
3058 } tstrTlsSrvChunkHdr;
3059
3060 typedef struct {
3061 uint32 u32CsBMP;
3062 } tstrSslSetActiveCsList; //SSLEnums
3064
3075 typedef enum {
3076 OTA_SUCCESS = (0),
3078 OTA_ERR_WORKING_IMAGE_LOAD_FAIL = ((sint8) -1),
3080 OTA_ERR_INVALID_CONTROL_SEC = ((sint8) -2),
3082 M2M_ERR_OTA_SWITCH_FAIL = ((sint8) -3),
3084 M2M_ERR_OTA_START_UPDATE_FAIL = ((sint8) -4),
3090 M2M_ERR_OTA_ROLLBACK_FAIL = ((sint8) -5),
3092 M2M_ERR_OTA_INVALID_FLASH_SIZE = ((sint8) -6),
3094 M2M_ERR_OTA_INVALID_ARG = ((sint8) -7),
3096 M2M_ERR_OTA_INPROGRESS = ((sint8) -8)
3098 } tenuOtaError;
3099
3107 typedef enum {
3108 M2M_OTA_REQ_NOTIF_SET_URL = M2M_OTA_CMD_BASE,
3109 M2M_OTA_REQ_NOTIF_CHECK_FOR_UPDATE,
3110 M2M_OTA_REQ_NOTIF_SCHED,
3111 M2M_OTA_REQ_START_FW_UPDATE,
3113 M2M_OTA_REQ_SWITCH_FIRMWARE,
3115 M2M_OTA_REQ_ROLLBACK_FW,
3117 M2M_OTA_RESP_NOTIF_UPDATE_INFO,
3118 M2M_OTA_RESP_UPDATE_STATUS,
3120 M2M_OTA_REQ_TEST,
3121 M2M_OTA_REQ_START_CRT_UPDATE,
3122 M2M_OTA_REQ_SWITCH_CRT_IMG,
3123 M2M_OTA_REQ_ROLLBACK_CRT,
3124 M2M_OTA_REQ_ABORT,
3126 M2M_OTA_REQ_HOST_FILE_STATUS,
3127 M2M_OTA_RESP_HOST_FILE_STATUS,
3128 M2M_OTA_REQ_HOST_FILE_DOWNLOAD,
3129 M2M_OTA_RESP_HOST_FILE_DOWNLOAD,
3130 M2M_OTA_REQ_HOST_FILE_READ,
3131 M2M_OTA_RESP_HOST_FILE_READ,
3132 M2M_OTA_REQ_HOST_FILE_ERASE,
3133 M2M_OTA_RESP_HOST_FILE_ERASE,
3134 M2M_OTA_REQ_START_FW_UPDATE_V2,
3135 M2M_OTA_MAX_ALL,
3136 } tenuM2mOtaCmd;
3137
3145 typedef enum {
3146 OTA_STATUS_SUCCESS = 0,
3148 OTA_STATUS_FAIL = 1,
3150 OTA_STATUS_INVALID_ARG = 2,
3152 OTA_STATUS_INVALID_RB_IMAGE = 3,
3154 OTA_STATUS_INVALID_FLASH_SIZE = 4,
3156 OTA_STATUS_ALREADY_ENABLED = 5,
3158 OTA_STATUS_UPDATE_INPROGRESS = 6,
3160 OTA_STATUS_IMAGE_VERIF_FAILED = 7,
3162 OTA_STATUS_CONNECTION_ERROR = 8,
3164 OTA_STATUS_SERVER_ERROR = 9,
3166 OTA_STATUS_ABORTED = 10,
3168 } tenuOtaUpdateStatus;
3169
3177 typedef enum {
3178 DL_STATUS = 1,
3180 SW_STATUS = 2,
3182 RB_STATUS = 3,
3184 AB_STATUS = 4,
3186 HFD_STATUS = 5,
3188 } tenuOtaUpdateStatusType;
3189
3197 typedef struct {
3198 uint32 u32OtaMagicValue;
3201 uint32 u32OtaPayloadSize;
3203 } tstrOtaInitHdr;
3204
3213 typedef struct {
3214 uint32 u32OtaMagicValue;
3216 uint32 u32OtaFormatVersion;
3222 uint32 u32OtaSequenceNumber;
3224 uint32 u32OtaLastCheckTime;
3226 uint32 u32OtaCurrentworkingImagOffset;
3228 uint32 u32OtaCurrentworkingImagFirmwareVer;
3230 uint32 u32OtaRollbackImageOffset;
3234 uint32 u32OtaRollbackImageValidStatus;
3236 uint32 u32OtaRollbackImagFirmwareVer;
3238 uint32 u32OtaCortusAppWorkingOffset;
3243 uint32 u32OtaCortusAppWorkingValidSts;
3248 uint32 u32OtaCortusAppWorkingVer;
3253 uint32 u32OtaCortusAppRollbackOffset;
3258 uint32 u32OtaCortusAppRollbackValidSts;
3263 uint32 u32OtaCortusAppRollbackVer;
3268 uint32 u32OtaControlSecCrc;
3270 } tstrOtaControlSec;
3271
3282 typedef struct {
3283 uint8 u8OtaUpdateStatusType;
3285 uint8 u8OtaUpdateStatus;
3287 uint8 _PAD16_[2];
3288 } tstrOtaUpdateStatusResp;
3289 #ifndef _lint
3290 #ifdef __GNUC__
3291 _Static_assert((sizeof(tstrOtaUpdateStatusResp)%4)==0, "Structure alignment error");
3292 #else
3293 static_assert((sizeof(tstrOtaUpdateStatusResp)%4)==0, "Structure alignment error");
3294 #endif
3295 #endif
3296
3307 typedef struct {
3308 uint32 u8NcfUpgradeVersion;
3310 uint32 u8NcfCurrentVersion;
3312 uint32 u8NcdUpgradeVersion;
3314 uint8 u8NcdRequiredUpgrade;
3316 uint8 u8DownloadUrlOffset;
3318 uint8 u8DownloadUrlSize;
3320 uint8 __PAD8__;
3322 } tstrOtaUpdateInfo;
3323 #ifndef _lint
3324 #ifdef __GNUC__
3325 _Static_assert((sizeof(tstrOtaUpdateInfo)%4)==0, "Structure alignment error");
3326 #else
3327 static_assert((sizeof(tstrOtaUpdateInfo)%4)==0, "Structure alignment error");
3328 #endif
3329 #endif
3330
3338 typedef struct {
3339 uint32 u32OtaFileSize;
3344 uint8 u8OtaFileGetStatus;
3349 uint8 u8CFHandler;
3354 uint8 __PAD16__[2];
3356 } tstrOtaHostFileGetStatusResp;
3357
3358 #ifndef _lint
3359 #ifdef __GNUC__
3360 _Static_assert((sizeof(tstrOtaHostFileGetStatusResp)%4)==0, "Structure alignment error");
3361 #else
3362 static_assert((sizeof(tstrOtaHostFileGetStatusResp)%4)==0, "Structure alignment error");
3363 #endif
3364 #endif
3365
3373 typedef struct {
3374 uint16 u16FileBlockSz;
3379 uint8 u8OtaFileReadStatus;
3384 uint8 __PAD8__;
3386 uint8 pFileBuf[MAX_FILE_READ_STEP];
3391 } tstrOtaHostFileReadStatusResp;
3392 #ifndef _lint
3393 #ifdef __GNUC__
3394 _Static_assert((sizeof(tstrOtaHostFileReadStatusResp)%4)==0, "Structure alignment error");
3395 #else
3396 static_assert((sizeof(tstrOtaHostFileReadStatusResp)%4)==0, "Structure alignment error");
3397 #endif
3398 #endif
3399
3407 typedef struct {
3408 uint8 u8OtaFileEraseStatus;
3413 uint8 __PAD24__[3];
3415 } tstrOtaHostFileEraseStatusResp;
3416 #ifndef _lint
3417 #ifdef __GNUC__
3418 _Static_assert((sizeof(tstrOtaHostFileEraseStatusResp)%4)==0, "Structure alignment error");
3419 #else
3420 static_assert((sizeof(tstrOtaHostFileEraseStatusResp)%4)==0, "Structure alignment error");
3421 #endif
3422 #endif
3423
3424 typedef struct {
3425 uint32 u32TotalLen;
3427 char acUrl[256];
3429 char acSNI[64];
3431 uint8 u8SSLFlags;
3433 uint8 __PAD24__[3];
3435 } tstrOtaStart;
3436 #ifndef _lint
3437 #ifdef __GNUC__
3438 _Static_assert((sizeof(tstrOtaStart)%4)==0, "Structure alignment error");
3439 #else
3440 static_assert((sizeof(tstrOtaStart)%4)==0, "Structure alignment error");
3441 #endif
3442 #endif
3443 //OTATYPEDEF
3445
3446 #endif
WEP_104_KEY_SIZE
#define WEP_104_KEY_SIZE
Definition: m2m_types.h:355
M2M_WIFI_CH_1
Definition: m2m_types.h:1261
tstrM2MWifiRxPacketInfo::u8HeaderLength
uint8 u8HeaderLength
Definition: m2m_types.h:2191
TLS_CRL_DATA_MAX_LEN
#define TLS_CRL_DATA_MAX_LEN
Definition: m2m_types.h:406
tstrM2MWifiRxPacketInfo::u8FrameSubtype
uint8 u8FrameSubtype
Definition: m2m_types.h:2182
M2M_WIFI_CH_11
Definition: m2m_types.h:1271
M2M_WIFI_MODE_MAX
Definition: m2m_types.h:1365
tstrM2mWiFiRoaming::u8EnableRoaming
uint8 u8EnableRoaming
Definition: m2m_types.h:766
tstrM2MDefaultConnResp
Response error of the m2m_default_connect.
Definition: m2m_types.h:1768
M2M_OTA_REQ_NOTIF_CHECK_FOR_UPDATE
Definition: m2m_types.h:3109
M2M_WIFI_REQ_SET_MAC_MCAST
Definition: m2m_types.h:951
tstrM2MWifiMonitorModeCtrl::u8FrameType
uint8 u8FrameType
Definition: m2m_types.h:2138
M2M_SIGMA_TA_START
Definition: m2m_types.h:1171
tstrM2MProvisionInfo::u8Status
uint8 u8Status
Definition: m2m_types.h:2574
M2M_WIFI_REQ_ENABLE_SNTP_CLIENT
Definition: m2m_types.h:890
TLS_FLASH_ERR_CORRUPT
Definition: m2m_types.h:3045
tenuM2mStaCmd
tenuM2mStaCmd
This enum contains WINC commands while in Station mode.
Definition: m2m_types.h:993
M2M_OTA_REQ_SWITCH_CRT_IMG
Definition: m2m_types.h:3122
M2M_WIFI_REQ_SET_TX_POWER
Definition: m2m_types.h:928
tstrM2mWifiWep::u8KeyLen
uint8 u8KeyLen
Definition: m2m_types.h:1498
M2M_WIFI_REQRSP_DELETE_APID
Definition: m2m_types.h:978
tstrM2MScanRegion::u16ScanRegion
uint16 u16ScanRegion
Definition: m2m_types.h:1876
REG_CH_14
Definition: m2m_types.h:1300
M2M_WIFI_CH_ALL
Definition: m2m_types.h:1275
M2M_WIFI_RESP_PROVISION_INFO
Definition: m2m_types.h:878
tstrM2mWifi1xHdr::u8HdrLength
uint8 u8HdrLength
Definition: m2m_types.h:1560
tstrM2mConnCredHdr::u8CredStoreFlags
uint8 u8CredStoreFlags
Definition: m2m_types.h:1439
M2M_WIFI_MODE_ATE_HIGH
Definition: m2m_types.h:1356
tstrM2mWifiStateChanged::u8CurrState
uint8 u8CurrState
Definition: m2m_types.h:2038
tstrM2mLsnInt
Listen interval.
Definition: m2m_types.h:2109
tenuWPSTrigger
tenuWPSTrigger
WPS Triggering Methods.
Definition: m2m_types.h:1375
tstrM2MWifiRxPacketInfo::u16FrameLength
uint16 u16FrameLength
Definition: m2m_types.h:2209
M2M_SSL_REQ_ECC
Definition: m2m_types.h:2912
OTA_STATUS_INVALID_FLASH_SIZE
Definition: m2m_types.h:3154
WPS_PBC_TRIGGER
Definition: m2m_types.h:1379
tstrM2MAPConfigExt
AP Configuration Extension.
Definition: m2m_types.h:2312
M2M_OTA_RESP_HOST_FILE_ERASE
Definition: m2m_types.h:3133
tstrOtaHostFileGetStatusResp::u8CFHandler
uint8 u8CFHandler
Definition: m2m_types.h:3349
M2M_REQ_GROUP_OTA
Definition: m2m_types.h:821
M2M_WIFI_REQ_DHCP_CONF
Definition: m2m_types.h:1025
tenuFlashLUTEntryID
tenuFlashLUTEntryID
Definition: m2m_types.h:531
M2M_WIFI_SEC_WPA_PSK
Definition: m2m_types.h:1219
M2M_WIFI_WEP_KEY_INDEX_3
Definition: m2m_types.h:602
tstrPrng::pu8RngBuff
uint8 * pu8RngBuff
Definition: m2m_types.h:2760
tstrM2MWPSInfo::u8AuthType
uint8 u8AuthType
Definition: m2m_types.h:1742
M2M_OTA_REQ_START_FW_UPDATE
Definition: m2m_types.h:3111
M2M_SIGMA_TA_STATS
Definition: m2m_types.h:1172
REG_CH_7
Definition: m2m_types.h:1293
tstrM2MScanOption::u8SlotTime
uint8 u8SlotTime
Definition: m2m_types.h:1802
tstrM2MWifiMonitorModeCtrl
Wi-Fi Monitor Mode Filter.
Definition: m2m_types.h:2134
ASIA
Definition: m2m_types.h:1308
tstrM2mWifi1xHdr::u32Rsv1
uint32 u32Rsv1
Definition: m2m_types.h:1574
tstrOtaHostFileEraseStatusResp::u8OtaFileEraseStatus
uint8 u8OtaFileEraseStatus
Definition: m2m_types.h:3408
M2M_CRYPTO_RESP_SHA256_FINISH
Definition: m2m_types.h:1139
tstrTlsCrlEntry
Certificate data for inclusion in a revocation list (CRL)
Definition: m2m_types.h:2940
tenuM2mOtaCmd
tenuM2mOtaCmd
This enum contains all the WINC commands used for OTA operation.
Definition: m2m_types.h:3107
tstrM2mTxPwrLevel::u8TxPwrLevel
uint8 u8TxPwrLevel
Definition: m2m_types.h:673
M2M_DEFAULT_CONN_EMPTY_LIST
Definition: m2m_types.h:560
TX_RATE_12
Definition: m2m_types.h:2793
M2M_GEN_CMD_BASE
#define M2M_GEN_CMD_BASE
Definition: m2m_types.h:328
tstrM2mWifi1xHdr::u8UserNameLength
uint8 u8UserNameLength
Definition: m2m_types.h:1558
M2M_ERR_OTA_INPROGRESS
Definition: m2m_types.h:3096
tstrM2MSNTPConfig
SNTP Client Configuration.
Definition: m2m_types.h:2673
M2M_WIFI_SEC_OPEN
Definition: m2m_types.h:1216
tstrM2mPsType
Power Save Configuration.
Definition: m2m_types.h:2066
tstrM2mWifi1xHdr::u16PrivateKeyOffset
uint16 u16PrivateKeyOffset
Definition: m2m_types.h:1564
tstrM2mWifi1xHdr::u8Flags
uint8 u8Flags
Definition: m2m_types.h:1549
tstrM2mServerInit
PS Server initialization.
Definition: m2m_types.h:2366
tstrM2MWifiRxPacketInfo::u32DataRateKbps
uint32 u32DataRateKbps
Definition: m2m_types.h:2212
M2M_ERR_OTA_SWITCH_FAIL
Definition: m2m_types.h:3082
M2M_WIFI_REQ_SET_MAC_ADDRESS
Definition: m2m_types.h:851
OTA_STATUS_FAIL
Definition: m2m_types.h:3148
M2M_OTA_REQ_START_CRT_UPDATE
Definition: m2m_types.h:3121
tstrM2MIPConfig::u32DNS
uint32 u32DNS
Definition: m2m_types.h:2488
tenuM2mConnChangedErrcode
tenuM2mConnChangedErrcode
Definition: m2m_types.h:575
M2M_WIFI_CH_5
Definition: m2m_types.h:1265
M2M_WIFI_REQ_CONFIG_SNTP
Definition: m2m_types.h:972
M2M_WIFI_MODE_ATE_LOW
Definition: m2m_types.h:1359
tstrTlsSrvChunkHdr
Definition: m2m_types.h:3053
tstrTlsSrvSecHdr::u32NextWriteAddr
uint32 u32NextWriteAddr
Definition: m2m_types.h:3032
tstrSystemTime::u8Month
uint8 u8Month
Definition: m2m_types.h:2706
tstrM2mWiFiGainIdx::u8GainTableIdx
uint8 u8GainTableIdx
Definition: m2m_types.h:696
tenuOtaError
tenuOtaError
OTA Error codes.
Definition: m2m_types.h:3075
tstrM2MGenericResp::s8ErrorCode
sint8 s8ErrorCode
Definition: m2m_types.h:1683
tstrM2mServerInit::u8Channel
uint8 u8Channel
Definition: m2m_types.h:2367
M2M_WIFI_RESP_GET_SYS_TIME
Definition: m2m_types.h:941
TX_RATE_18
Definition: m2m_types.h:2794
TX_RATE_11
Definition: m2m_types.h:2790
tenuPowerSaveModes
tenuPowerSaveModes
Power Save Modes.
Definition: m2m_types.h:1321
M2M_ERR_JOIN_FAIL
Definition: m2m_types.h:579
tenuM2mConfigCmd
tenuM2mConfigCmd
This enum contains host commands used to configure the WINC board.
Definition: m2m_types.h:846
ENTRY_ID_TLSCLIENT
Definition: m2m_types.h:535
tstrM2mScanDone::u8NumofCh
uint8 u8NumofCh
Definition: m2m_types.h:1946
tstrM2MProvisionModeConfig::strApConfigExt
tstrM2MAPConfigExt strApConfigExt
Definition: m2m_types.h:2540
tstrM2Mservercmd::u8cmd
uint8 u8cmd
Definition: m2m_types.h:2413
tstrM2mPwrMode::u8PwrMode
uint8 u8PwrMode
Definition: m2m_types.h:634
tstrOtaHostFileReadStatusResp::u16FileBlockSz
uint16 u16FileBlockSz
Definition: m2m_types.h:3374
NORTH_AMERICA
Definition: m2m_types.h:1302
ENTRY_ID_HOSTFILE
Definition: m2m_types.h:540
M2M_WIFI_REQ_ENABLE_MONITORING
Definition: m2m_types.h:1036
M2M_WIFI_REQ_SET_DEVICE_NAME
Definition: m2m_types.h:870
tstrOtaInitHdr::u32OtaMagicValue
uint32 u32OtaMagicValue
Definition: m2m_types.h:3198
tstrTlsSrvChunkHdr::u16Offset32
uint16 u16Offset32
Definition: m2m_types.h:3056
tstrM2mWifiscanResult::u8index
uint8 u8index
Definition: m2m_types.h:1997
tstrM2mConnCredHdr::u8Channel
uint8 u8Channel
Definition: m2m_types.h:1446
M2M_OTA_REQ_NOTIF_SET_URL
Definition: m2m_types.h:3108
tstrSystemTime::u8Minute
uint8 u8Minute
Definition: m2m_types.h:2709
OTA_STATUS_SUCCESS
Definition: m2m_types.h:3146
M2M_REQ_GROUP_CRYPTO
Definition: m2m_types.h:823
REG_CH_5
Definition: m2m_types.h:1291
tstrM2mPwrMode
Power Mode.
Definition: m2m_types.h:633
tenuOtaUpdateStatus
tenuOtaUpdateStatus
This struct contains the OTA return status.
Definition: m2m_types.h:3145
M2M_NO_PS
Definition: m2m_types.h:1322
tstrTlsCrlInfo::u8Rsv3
uint8 u8Rsv3
Definition: m2m_types.h:2970
tstrOtaControlSec::u32OtaCortusAppWorkingVer
uint32 u32OtaCortusAppWorkingVer
Definition: m2m_types.h:3248
tstrPrng
M2M Request PRNG.
Definition: m2m_types.h:2756
M2M_WIFI_REQ_GET_PRNG
Definition: m2m_types.h:954
tstrM2MAPModeConfig
AP Configuration.
Definition: m2m_types.h:2341
tstrM2mConnCredHdr::u16CredSize
uint16 u16CredSize
Definition: m2m_types.h:1434
M2M_WIFI_REQ_CUST_INFO_ELEMENT
Definition: m2m_types.h:904
tstrM2MScanOption::s8RssiThresh
sint8 s8RssiThresh
Definition: m2m_types.h:1815
tstrM2mWifiscanResult::u8AuthType
uint8 u8AuthType
Definition: m2m_types.h:2003
tstrConfAutoRate::u8ArFailTxThreshold
uint8 u8ArFailTxThreshold
Definition: m2m_types.h:2885
OTA_STATUS_SERVER_ERROR
Definition: m2m_types.h:3164
M2M_WIFI_ROAMED
Definition: m2m_types.h:1197
tstrM2MScan
Wi-Fi Scan Request.
Definition: m2m_types.h:1901
tstrM2mWifiApId
Specify an access point (by SSID)
Definition: m2m_types.h:1657
tenuM2mWepKeyIndex
tenuM2mWepKeyIndex
Definition: m2m_types.h:599
tstrM2MScan::u16PassiveScanTime
uint16 u16PassiveScanTime
Definition: m2m_types.h:1908
tstrM2MScanOption::u8ProbesPerSlot
uint8 u8ProbesPerSlot
Definition: m2m_types.h:1808
tstrM2mBatteryVoltage::u16BattVolt
uint16 u16BattVolt
Definition: m2m_types.h:743
M2M_WIFI_REQ_WPS
Definition: m2m_types.h:1015
ENTRY_ID_TLSSERVER
Definition: m2m_types.h:536
tstrM2mReqScanResult
Scan Result Request.
Definition: m2m_types.h:1972
tstrSystemTime::u8Second
uint8 u8Second
Definition: m2m_types.h:2710
SW_STATUS
Definition: m2m_types.h:3180
M2M_CRYPTO_MAX_ALL
Definition: m2m_types.h:1144
TX_RATE_9
Definition: m2m_types.h:2792
M2M_WIFI_RESP_GET_PRNG
Definition: m2m_types.h:957
M2M_WIFI_RESP_DEFAULT_CONNECT
Definition: m2m_types.h:1000
M2M_OTA_REQ_ABORT
Definition: m2m_types.h:3124
M2M_OTA_RESP_NOTIF_UPDATE_INFO
Definition: m2m_types.h:3117
M2M_ERR_OTA_START_UPDATE_FAIL
Definition: m2m_types.h:3084
M2M_WIFI_WEP_KEY_INDEX_2
Definition: m2m_types.h:601
tstrOtaControlSec::u32OtaMagicValue
uint32 u32OtaMagicValue
Definition: m2m_types.h:3214
TX_PWR_MED
Definition: m2m_types.h:659
ENTRY_ID_TLSCOMMON
Definition: m2m_types.h:539
tstrOtaControlSec::u32OtaRollbackImagFirmwareVer
uint32 u32OtaRollbackImagFirmwareVer
Definition: m2m_types.h:3236
tstrOtaControlSec::u32OtaRollbackImageValidStatus
uint32 u32OtaRollbackImageValidStatus
Definition: m2m_types.h:3234
M2M_OTA_CMD_BASE
#define M2M_OTA_CMD_BASE
Definition: m2m_types.h:335
M2M_ERR_OTA_INVALID_ARG
Definition: m2m_types.h:3094
M2M_CRYPTO_RESP_RSA_SIGN_VERIFY
Definition: m2m_types.h:1143
tstrM2MConnInfo::s8RSSI
sint8 s8RSSI
Definition: m2m_types.h:2599
TLS_FLASH_OK
Definition: m2m_types.h:3041
M2M_STA_CMD_BASE
#define M2M_STA_CMD_BASE
Definition: m2m_types.h:311
tenuM2mSsidMode
tenuM2mSsidMode
Definition: m2m_types.h:1241
SSL_CERT_EXP_CHECK_ENABLE
Definition: m2m_types.h:2989
ENTRY_ID_HTTPFILES
Definition: m2m_types.h:538
tstrM2mWifiConnHdr
Wi-Fi Connect Request (new format) for use with M2M_WIFI_REQ_CONN. This structure is sent across the ...
Definition: m2m_types.h:1636
tstrM2mScanDone::s8ScanState
sint8 s8ScanState
Definition: m2m_types.h:1949
PWR_AUTO
Definition: m2m_types.h:616
tstrTlsSrvSecFileEntry::u32FileSize
uint32 u32FileSize
Definition: m2m_types.h:3014
TLS_FLASH_ERR_NO_CHANGE
Definition: m2m_types.h:3047
tstrM2MMulticastMac::u8AddRemove
uint8 u8AddRemove
Definition: m2m_types.h:2733
M2M_WIFI_REQ_SCAN_RESULT
Definition: m2m_types.h:913
tstrM2MIPConfig::u32AlternateDNS
uint32 u32AlternateDNS
Definition: m2m_types.h:2491
M2M_REQ_GROUP_INTERNAL
Definition: m2m_types.h:825
tstrSystemTime
Used for time storage.
Definition: m2m_types.h:2704
M2M_REQ_GROUP_IP
Definition: m2m_types.h:819
tstrOtaUpdateInfo
This struct contains the OTA update information.
Definition: m2m_types.h:3307
M2M_REQ_GROUP_SIGMA
Definition: m2m_types.h:824
M2M_WIFI_REQ_DISABLE_SNTP_CLIENT
Definition: m2m_types.h:895
M2M_WIFI_REQ_DISCONNECT
Definition: m2m_types.h:1003
tstrM2mWifi1xHdr::u16CertificateOffset
uint16 u16CertificateOffset
Definition: m2m_types.h:1568
M2M_WIFI_UNDEF
Definition: m2m_types.h:1200
tstrSslSetActiveCsList::u32CsBMP
uint32 u32CsBMP
Definition: m2m_types.h:3061
tstrSslSetActiveCsList
Definition: m2m_types.h:3060
M2M_WIFI_CH_7
Definition: m2m_types.h:1267
tstrOtaControlSec::u32OtaCortusAppRollbackValidSts
uint32 u32OtaCortusAppRollbackValidSts
Definition: m2m_types.h:3258
WEP_104_KEY_STRING_SIZE
#define WEP_104_KEY_STRING_SIZE
Definition: m2m_types.h:362
tstrTlsCrlInfo::u8Rsv1
uint8 u8Rsv1
Definition: m2m_types.h:2966
tenuOtaUpdateStatusType
tenuOtaUpdateStatusType
This struct contains the OTA update status type.
Definition: m2m_types.h:3177
M2M_CRYPTO_REQ_RSA_SIGN_GEN
Definition: m2m_types.h:1140
REG_CH_4
Definition: m2m_types.h:1290
M2M_ERR_SCAN_FAIL
Definition: m2m_types.h:576
tstrM2mWifiscanResult::_PAD8_
uint8 _PAD8_
Definition: m2m_types.h:2015
OTA_ERR_INVALID_CONTROL_SEC
Definition: m2m_types.h:3080
M2M_OTA_REQ_START_FW_UPDATE_V2
Definition: m2m_types.h:3134
tstrTlsSrvSecHdr::u32CRC
uint32 u32CRC
Definition: m2m_types.h:3036
M2M_REQ_GROUP_WIFI
Definition: m2m_types.h:818
tstrM2MStopScanOption
This struct holds additional configuration options for Wi-Fi scan.
Definition: m2m_types.h:1845
M2M_WIFI_REQ_START_WPS
Definition: m2m_types.h:1018
tstrM2MGenericResp
Generic success/error response.
Definition: m2m_types.h:1682
M2M_WIFI_REQ_DOZE
Definition: m2m_types.h:1051
TX_RATE_AUTO
Definition: m2m_types.h:2785
M2M_WIFI_REQ_CURRENT_RSSI
Definition: m2m_types.h:855
M2M_WIFI_MODE_NORMAL
Definition: m2m_types.h:1353
REG_CH_3
Definition: m2m_types.h:1289
M2M_WIFI_REQ_ROAMING
Definition: m2m_types.h:1111
M2M_OTA_MAX_ALL
Definition: m2m_types.h:3135
tstrOtaControlSec::u32OtaLastCheckTime
uint32 u32OtaLastCheckTime
Definition: m2m_types.h:3224
M2M_WIFI_REQ_SERVER_INIT
Definition: m2m_types.h:1099
tstrM2MMulticastMac
M2M add/remove multi-cast mac address.
Definition: m2m_types.h:2728
M2M_WIFI_RESP_SCAN_DONE
Definition: m2m_types.h:910
tstrM2mWifiStateChanged
Wi-Fi Connection State.
Definition: m2m_types.h:2037
M2M_OTA_REQ_HOST_FILE_ERASE
Definition: m2m_types.h:3132
tstrOtaUpdateInfo::u8NcfCurrentVersion
uint32 u8NcfCurrentVersion
Definition: m2m_types.h:3310
M2M_SIGMA_SECURITY_POLICY
Definition: m2m_types.h:1179
tstrM2mPsType::u8BcastEn
uint8 u8BcastEn
Definition: m2m_types.h:2070
tenuM2mTxPwrLevel
tenuM2mTxPwrLevel
Definition: m2m_types.h:656
M2M_ERR_AUTH_FAIL
Definition: m2m_types.h:582
M2M_WIFI_CH_4
Definition: m2m_types.h:1264
M2M_WIFI_REQ_CONN
Definition: m2m_types.h:1054
tstrM2MWPSConnect
WPS Configuration parameters.
Definition: m2m_types.h:1709
M2M_OTA_REQ_ROLLBACK_FW
Definition: m2m_types.h:3115
tstrPrng::u16PrngSize
uint16 u16PrngSize
Definition: m2m_types.h:2764
M2M_WIFI_REQ_SET_SCAN_OPTION
Definition: m2m_types.h:919
M2M_OTA_RESP_HOST_FILE_DOWNLOAD
Definition: m2m_types.h:3129
M2M_REQ_GROUP_MAIN
Definition: m2m_types.h:817
M2M_WIFI_REQ_DISABLE_AP
Definition: m2m_types.h:1079
M2M_WIFI_REQ_DEFAULT_CONNECT
Definition: m2m_types.h:997
tstrM2mSetMacAddress
Sets the MAC address from application. The WINC load the mac address from the effuse by default to th...
Definition: m2m_types.h:2439
PWR_LOW2
Definition: m2m_types.h:620
PWR_HIGH
Definition: m2m_types.h:622
TX_RATE_2
Definition: m2m_types.h:2788
tstrM2MProvisionModeConfig::u8EnableRedirect
uint8 u8EnableRedirect
Definition: m2m_types.h:2533
tstrM2mWiFiGainIdx
Gain Table index selection corresponding to specific WiFi region.
Definition: m2m_types.h:695
tstrOtaControlSec::u32OtaSequenceNumber
uint32 u32OtaSequenceNumber
Definition: m2m_types.h:3222
TLS_SRV_SEC_START_PATTERN_LEN
#define TLS_SRV_SEC_START_PATTERN_LEN
Definition: m2m_types.h:398
tstrTlsCrlInfo::u8CrlType
uint8 u8CrlType
Definition: m2m_types.h:2964
TX_RATE_48
Definition: m2m_types.h:2797
REG_CH_8
Definition: m2m_types.h:1294
tstrM2MConnInfo::u8CurrChannel
uint8 u8CurrChannel
Definition: m2m_types.h:2601
tstrM2mWifiscanResult
Wi-Fi Scan Result.
Definition: m2m_types.h:1996
tstrM2mWifi1xHdr::u32Rsv2
uint32 u32Rsv2
Definition: m2m_types.h:1578
tstrM2MConnInfo::u8SecType
uint8 u8SecType
Definition: m2m_types.h:2593
tstrM2mWiFiXOSleepEnable::u8EnableXODuringSleep
uint8 u8EnableXODuringSleep
Definition: m2m_types.h:793
tstrOtaUpdateInfo::u8DownloadUrlOffset
uint8 u8DownloadUrlOffset
Definition: m2m_types.h:3316
tstrM2mSlpReqTime::u32SleepTime
uint32 u32SleepTime
Definition: m2m_types.h:2096
tenuM2mConnState
tenuM2mConnState
Wi-Fi Connection State.
Definition: m2m_types.h:1190
M2M_WIFI_REQ_RESTART
Definition: m2m_types.h:847
tstrConfAutoRate::u8ArEnoughTxThreshold
uint8 u8ArEnoughTxThreshold
Definition: m2m_types.h:2871
tstrM2mWifiWep::u8Rsv
uint8 u8Rsv
Definition: m2m_types.h:1502
M2M_MAX_PSK_LEN
#define M2M_MAX_PSK_LEN
Definition: m2m_types.h:206
tstrM2mWifiscanResult::s8rssi
sint8 s8rssi
Definition: m2m_types.h:2000
tstrM2mWifiAuthInfoHdr::u16InfoLen
uint16 u16InfoLen
Definition: m2m_types.h:1609
M2M_WIFI_NUM_AUTH_TYPES
Definition: m2m_types.h:1228
tstrConfAutoRate::enuWlanTxRate
tenuWlanTxRate enuWlanTxRate
Definition: m2m_types.h:2849
tstrOtaHostFileGetStatusResp
Host File OTA Information.
Definition: m2m_types.h:3338
SSID_MODE_VISIBLE
Definition: m2m_types.h:1242
OTA_STATUS_CONNECTION_ERROR
Definition: m2m_types.h:3162
tenuM2mReqGroup
tenuM2mReqGroup
Definition: m2m_types.h:816
PWR_LOW1
Definition: m2m_types.h:618
OTA_STATUS_ALREADY_ENABLED
Definition: m2m_types.h:3156
tstrM2MIPConfig
IP configuration (static/DHCP). The same structure is used for DCHP callback as well as static IP con...
Definition: m2m_types.h:2481
M2M_WIFI_MAX_GEN_ALL
Definition: m2m_types.h:1123
tstrOtaControlSec::u32OtaCortusAppWorkingOffset
uint32 u32OtaCortusAppWorkingOffset
Definition: m2m_types.h:3238
M2M_IP_REQ_ENABLE_DHCP
Definition: m2m_types.h:1157
tstrM2MProvisionModeConfig
M2M Provisioning Mode Configuration.
Definition: m2m_types.h:2524
M2M_WIFI_REQ_DISABLE_WPS
Definition: m2m_types.h:1022
ENTRY_ID_FW
Definition: m2m_types.h:532
TX_RATE_MCS_3
Definition: m2m_types.h:2802
M2M_WIFI_REQ_CLIENT_CTRL
Definition: m2m_types.h:1097
M2M_WIFI_SEC_802_1X
Definition: m2m_types.h:1225
tenuM2mPwrMode
tenuM2mPwrMode
Definition: m2m_types.h:615
M2M_WIFI_REQ_SCAN_SSID_LIST
Definition: m2m_types.h:960
tstrM2mWifiGainsParams::u8PPAGFor11GN
uint16 u8PPAGFor11GN
Definition: m2m_types.h:1416
tstrM2mIpRsvdPkt::u16PktSz
uint16 u16PktSz
Definition: m2m_types.h:2511
tstrM2mSlpReqTime
Manual power save request sleep time.
Definition: m2m_types.h:2093
REG_CH_11
Definition: m2m_types.h:1297
M2M_WIFI_RESP_CURRENT_RSSI
Definition: m2m_types.h:859
tstrM2MProvisionInfo
M2M Provisioning Information obtained from the HTTP Provisioning server.
Definition: m2m_types.h:2561
tstrM2mWifiPsk::u8PassphraseLen
uint8 u8PassphraseLen
Definition: m2m_types.h:1521
M2M_MAC_ADDRES_LEN
#define M2M_MAC_ADDRES_LEN
Definition: m2m_types.h:186
M2M_WIFI_RESP_CONN_INFO
Definition: m2m_types.h:866
tstrM2mConnCredCmn::u8SsidLen
uint8 u8SsidLen
Definition: m2m_types.h:1465
TX_PWR_LOW
Definition: m2m_types.h:661
tstrOtaControlSec::u32OtaRollbackImageOffset
uint32 u32OtaRollbackImageOffset
Definition: m2m_types.h:3230
tstrSystemTime::u8Hour
uint8 u8Hour
Definition: m2m_types.h:2708
M2M_WIFI_CH_3
Definition: m2m_types.h:1263
tstrM2MWifiRxPacketInfo::u8ServiceClass
uint8 u8ServiceClass
Definition: m2m_types.h:2185
REG_CH_13
Definition: m2m_types.h:1299
tstrM2mWifi1xHdr::u8DomainLength
uint8 u8DomainLength
Definition: m2m_types.h:1556
tstrTlsSrvSecHdr::u32nEntries
uint32 u32nEntries
Definition: m2m_types.h:3030
M2M_SIGMA_ICMP_TX
Definition: m2m_types.h:1176
AB_STATUS
Definition: m2m_types.h:3184
TX_RATE_MCS_2
Definition: m2m_types.h:2801
tenuM2mWifiMode
tenuM2mWifiMode
Wi-Fi Operation Mode.
Definition: m2m_types.h:1352
M2M_WIFI_CH_2
Definition: m2m_types.h:1262
tenuTlsFlashStatus
tenuTlsFlashStatus
Definition: m2m_types.h:3040
tstrM2mWifiAuthInfoHdr::u16InfoPos
uint16 u16InfoPos
Definition: m2m_types.h:1607
tenuWlanTxRate
tenuWlanTxRate
All possible supported 802.11 WLAN TX rates.
Definition: m2m_types.h:2784
tstrOtaHostFileGetStatusResp::u32OtaFileSize
uint32 u32OtaFileSize
Definition: m2m_types.h:3339
M2M_WIFI_MAX_CONFIG_ALL
Definition: m2m_types.h:983
M2M_WIFI_REQ_SET_ENABLE_LOGS
Definition: m2m_types.h:934
M2M_CRYPTO_REQ_RSA_SIGN_VERIFY
Definition: m2m_types.h:1142
tstrOtaControlSec
Control Section Structure. The Control Section is used to define the working image and the validity o...
Definition: m2m_types.h:3213
tstrOtaUpdateInfo::u8NcfUpgradeVersion
uint32 u8NcfUpgradeVersion
Definition: m2m_types.h:3308
tenuM2mSecType
tenuM2mSecType
Wi-Fi Supported Security types.
Definition: m2m_types.h:1212
M2M_WIFI_REQ_DHCP_FAILURE
Definition: m2m_types.h:1062
tstrM2MStopScanOption::u8StopOnFirstResult
uint8 u8StopOnFirstResult
Definition: m2m_types.h:1846
M2M_WIFI_REQ_ENABLE_AP
Definition: m2m_types.h:1076
M2M_WIFI_REQ_SET_BATTERY_VOLTAGE
Definition: m2m_types.h:931
M2M_SERVER_CMD_BASE
#define M2M_SERVER_CMD_BASE
Definition: m2m_types.h:325
M2M_SSL_REQ_WRITE_OWN_CERTS
Definition: m2m_types.h:2918
tstrConfAutoRate::enuArInitialRateSel
tenuWlanTxRate enuArInitialRateSel
Definition: m2m_types.h:2858
tstrTlsSrvSecHdr
This struct contains a set of TLS certificates.
Definition: m2m_types.h:3027
tstrM2MScan::u8ChNum
uint8 u8ChNum
Definition: m2m_types.h:1902
M2M_CRYPTO_RESP_SHA256_UPDATE
Definition: m2m_types.h:1137
tstrM2MAPConfig::u8ListenChannel
uint8 u8ListenChannel
Definition: m2m_types.h:2264
tenuSslCertExpSettings
tenuSslCertExpSettings
SSL Certificate Expiry Validation Options.
Definition: m2m_types.h:2982
tstrM2MAPConfig::u8SsidHide
uint8 u8SsidHide
Definition: m2m_types.h:2279
M2M_WIFI_REQ_CONG_AUTO_RATE
Definition: m2m_types.h:969
M2M_WIFI_RESP_IP_CONFLICT
Definition: m2m_types.h:1032
M2M_DEFAULT_CONN_FAIL
Definition: m2m_types.h:551
tstrOtaControlSec::u32OtaCortusAppRollbackVer
uint32 u32OtaCortusAppRollbackVer
Definition: m2m_types.h:3263
tstrM2MWifiRxPacketInfo::u16DataLength
uint16 u16DataLength
Definition: m2m_types.h:2206
uint32
unsigned long uint32
Range of values between 0 to 4294967295.
Definition: nm_bsp.h:114
TX_RATE_MCS_7
Definition: m2m_types.h:2806
RB_STATUS
Definition: m2m_types.h:3182
tstrM2mIpRsvdPkt
Received Packet Size and Data Offset.
Definition: m2m_types.h:2510
tenuM2mDefaultConnErrcode
tenuM2mDefaultConnErrcode
Definition: m2m_types.h:546
tstrTlsSrvSecFileEntry
This struct contains a TLS certificate.
Definition: m2m_types.h:3011
tstrConfAutoRate
Auto TX rate selection parameters passed to m2m_wifi_conf_auto_rate.
Definition: m2m_types.h:2816
tstrM2MIPConfig::u32Gateway
uint32 u32Gateway
Definition: m2m_types.h:2485
OTA_STATUS_INVALID_RB_IMAGE
Definition: m2m_types.h:3152
tstrOtaUpdateInfo::__PAD8__
uint8 __PAD8__
Definition: m2m_types.h:3320
M2M_SIGMA_UDP_TX_DEFER
Definition: m2m_types.h:1178
M2M_OTA_REQ_NOTIF_SCHED
Definition: m2m_types.h:3110
M2M_CONFIG_CMD_BASE
#define M2M_CONFIG_CMD_BASE
Definition: m2m_types.h:308
TLS_CRL_MAX_ENTRIES
#define TLS_CRL_MAX_ENTRIES
Definition: m2m_types.h:410
M2M_SIGMA_ICMP_ARP
Definition: m2m_types.h:1174
M2M_SSL_RESP_WRITE_OWN_CERTS
Definition: m2m_types.h:2924
M2M_WIFI_CH_10
Definition: m2m_types.h:1270
EUROPE
Definition: m2m_types.h:1305
tstrOtaControlSec::u32OtaControlSecCrc
uint32 u32OtaControlSecCrc
Definition: m2m_types.h:3268
tstrM2mTxPwrLevel
Tx power level.
Definition: m2m_types.h:672
M2M_CRYPTO_REQ_SHA256_UPDATE
Definition: m2m_types.h:1136
tstrM2MAPModeConfig::strApConfigExt
tstrM2MAPConfigExt strApConfigExt
Definition: m2m_types.h:2346
M2M_WIFI_REQ_SCAN
Definition: m2m_types.h:907
M2M_WIFI_WEP_KEY_INDEX_4
Definition: m2m_types.h:603
M2M_CRYPTO_REQ_SHA256_INIT
Definition: m2m_types.h:1134
tenuM2mSslCmd
tenuM2mSslCmd
Definition: m2m_types.h:2909
tenuM2mGenCmd
tenuM2mGenCmd
This enum contains additional WINC commands (overflow of previous enums).
Definition: m2m_types.h:1110
M2M_WIFI_REQ_START_PROVISION_MODE
Definition: m2m_types.h:874
tstrTlsCrlEntry::u8DataLen
uint8 u8DataLen
Definition: m2m_types.h:2941
tstrOtaStart::u32TotalLen
uint32 u32TotalLen
Definition: m2m_types.h:3425
TX_RATE_MCS_4
Definition: m2m_types.h:2803
M2M_OTA_REQ_ROLLBACK_CRT
Definition: m2m_types.h:3123
M2M_WIFI_REQ_SLEEP
Definition: m2m_types.h:1009
tenuSNTPUseDHCP
tenuSNTPUseDHCP
Use NTP server provided by the DHCP server.
Definition: m2m_types.h:1391
M2M_IP_REQ_DISABLE_DHCP
Definition: m2m_types.h:1158
tstrM2MWifiRxPacketInfo::u8FrameType
uint8 u8FrameType
Definition: m2m_types.h:2179
M2M_DEFAULT_CONN_INPROGRESS
Definition: m2m_types.h:547
TX_RATE_54
Definition: m2m_types.h:2798
TLS_FILE_NAME_MAX
#define TLS_FILE_NAME_MAX
Definition: m2m_types.h:392
M2M_SSL_REQ_SET_CS_LIST
Definition: m2m_types.h:2920
M2M_WIFI_RESP_MEMORY_RECOVER
Definition: m2m_types.h:900
M2M_OTA_RESP_UPDATE_STATUS
Definition: m2m_types.h:3118
M2M_CRYPTO_REQ_SHA256_FINISH
Definition: m2m_types.h:1138
REG_CH_2
Definition: m2m_types.h:1288
tstrM2MAPConfig::u8SecType
uint8 u8SecType
Definition: m2m_types.h:2276
tstrM2MProvisionModeConfig::strApConfig
tstrM2MAPConfig strApConfig
Definition: m2m_types.h:2525
M2M_WIFI_REQ_SET_SCAN_REGION
Definition: m2m_types.h:922
tstrM2MWPSInfo
WPS Result.
Definition: m2m_types.h:1741
M2M_WIFI_REQ_SEND_WIFI_PACKET
Definition: m2m_types.h:1045
tstrM2MWifiRxPacketInfo::s8RSSI
sint8 s8RSSI
Definition: m2m_types.h:2215
TX_RATE_36
Definition: m2m_types.h:2796
M2M_WIFI_REQ_STOP_PROVISION_MODE
Definition: m2m_types.h:882
M2M_WIFI_MAX_STA_ALL
Definition: m2m_types.h:1065
tstrM2MIPConfig::u32DhcpLeaseTime
uint32 u32DhcpLeaseTime
Definition: m2m_types.h:2497
tstrM2MWifiRxPacketInfo::u8CipherType
uint8 u8CipherType
Definition: m2m_types.h:2194
tstrM2MAPConfig
AP Configuration.
Definition: m2m_types.h:2257
M2M_WIFI_REQ_SET_POWER_PROFILE
Definition: m2m_types.h:925
M2M_WIFI_REQ_SET_SYS_TIME
Definition: m2m_types.h:886
TLS_FLASH_ERR_UNKNOWN
Definition: m2m_types.h:3049
tstrOtaControlSec::u32OtaCortusAppWorkingValidSts
uint32 u32OtaCortusAppWorkingValidSts
Definition: m2m_types.h:3243
M2M_SSL_RESP_ECC
Definition: m2m_types.h:2914
tstrM2MWifiTxPacketInfo::u16HeaderLength
uint16 u16HeaderLength
Definition: m2m_types.h:2243
tenuM2mCryptoCmd
tenuM2mCryptoCmd
Definition: m2m_types.h:1133
M2M_AP_CMD_BASE
#define M2M_AP_CMD_BASE
Definition: m2m_types.h:314
tstrCyptoResp
crypto response
Definition: m2m_types.h:1923
M2M_WIFI_REQ_GET_CONN_INFO
Definition: m2m_types.h:863
tstrM2mWifiPsk
Passphrase and PSK for WPA(2) PSK.
Definition: m2m_types.h:1520
tstrM2MWifiRxPacketInfo
Wi-Fi RX Frame Header.
Definition: m2m_types.h:2178
tstrM2MIPConfig::u32SubnetMask
uint32 u32SubnetMask
Definition: m2m_types.h:2494
SNTP_ENABLE_DHCP
Definition: m2m_types.h:1395
tstrM2mConnCredCmn
Wi-Fi Connect Credentials Common section.
Definition: m2m_types.h:1464
tstrM2MConnInfo
M2M Provisioning Information obtained from the HTTP Provisioning server.
Definition: m2m_types.h:2590
tstrOtaUpdateStatusResp::u8OtaUpdateStatusType
uint8 u8OtaUpdateStatusType
Definition: m2m_types.h:3283
tstrOtaInitHdr
This struct contains the OTA image header.
Definition: m2m_types.h:3197
M2M_REQ_GROUP_HIF
Definition: m2m_types.h:820
tstrM2MProvisionInfo::u8SecType
uint8 u8SecType
Definition: m2m_types.h:2570
M2M_DEVICE_NAME_MAX
#define M2M_DEVICE_NAME_MAX
Definition: m2m_types.h:217
TX_RATE_5_5
Definition: m2m_types.h:2789
M2M_ERR_ASSOC_FAIL
Definition: m2m_types.h:585
M2M_SIGMA_SET_SYSTIME
Definition: m2m_types.h:1180
TX_RATE_MCS_6
Definition: m2m_types.h:2805
tstrTlsSrvSecFileEntry::u32FileAddr
uint32 u32FileAddr
Definition: m2m_types.h:3016
M2M_OTA_REQ_HOST_FILE_READ
Definition: m2m_types.h:3130
M2M_WIFI_REQ_PASSIVE_SCAN
Definition: m2m_types.h:966
tstrOtaHostFileReadStatusResp
Host File OTA Information.
Definition: m2m_types.h:3373
TX_RATE_6
Definition: m2m_types.h:2791
tstrOtaUpdateInfo::u8NcdRequiredUpgrade
uint8 u8NcdRequiredUpgrade
Definition: m2m_types.h:3314
tstrM2mWifiGainsParams::u8PPAGFor11B
uint16 u8PPAGFor11B
Definition: m2m_types.h:1408
tstrOtaControlSec::u32OtaCurrentworkingImagFirmwareVer
uint32 u32OtaCurrentworkingImagFirmwareVer
Definition: m2m_types.h:3228
sint8
signed char sint8
Range of values between -128 to 127.
Definition: nm_bsp.h:121
tstrM2mWifiAuthInfoHdr
Generic Wi-Fi authentication information to be sent in a separate HIF message of type M2M_WIFI_IND_CO...
Definition: m2m_types.h:1600
M2M_WIFI_REQ_SET_GAIN_TABLE_IDX
Definition: m2m_types.h:975
M2M_MAX_SSID_LEN
#define M2M_MAX_SSID_LEN
Definition: m2m_types.h:200
M2M_WIFI_REQ_RESTART_AP
Definition: m2m_types.h:1082
tstrM2mWifiPsk::u8PskCalculated
uint8 u8PskCalculated
Definition: m2m_types.h:1527
M2M_WIFI_REQ_XO_SLEEP_ENABLE
Definition: m2m_types.h:1115
M2M_WIFI_CH_8
Definition: m2m_types.h:1268
SSID_MODE_HIDDEN
Definition: m2m_types.h:1245
tstrM2mWiFiXOSleepEnable
Choose to keep the XO on or off over deep sleep.
Definition: m2m_types.h:792
M2M_SIGMA_ENABLE
Definition: m2m_types.h:1170
tstrM2MWifiMonitorModeCtrl::u8EnRecvHdr
uint8 u8EnRecvHdr
Definition: m2m_types.h:2153
tstrOtaHostFileEraseStatusResp
Host File OTA Information.
Definition: m2m_types.h:3407
M2M_WIFI_CH_6
Definition: m2m_types.h:1266
tstrSystemTime::__PAD8__
uint8 __PAD8__
Definition: m2m_types.h:2711
M2M_ERR_CONN_INPROGRESS
Definition: m2m_types.h:588
REG_CH_ALL
Definition: m2m_types.h:1301
tstrM2Mservercmd
PS Server CMD.
Definition: m2m_types.h:2412
M2M_DEFAULT_CONN_SCAN_MISMATCH
Definition: m2m_types.h:555
HFD_STATUS
Definition: m2m_types.h:3186
tstrOtaUpdateInfo::u8DownloadUrlSize
uint8 u8DownloadUrlSize
Definition: m2m_types.h:3318
ENTRY_ID_PLLGAIN
Definition: m2m_types.h:533
tstrOtaUpdateInfo::u8NcdUpgradeVersion
uint32 u8NcdUpgradeVersion
Definition: m2m_types.h:3312
M2M_CRYPTO_CMD_BASE
#define M2M_CRYPTO_CMD_BASE
Definition: m2m_types.h:343
M2M_WIFI_REQ_LSN_INT
Definition: m2m_types.h:1048
M2M_PS_H_AUTOMATIC
Definition: m2m_types.h:1331
TX_RATE_MCS_0
Definition: m2m_types.h:2799
M2M_PS_DEEP_AUTOMATIC
Definition: m2m_types.h:1336
TX_RATE_MCS_1
Definition: m2m_types.h:2800
M2M_WIFI_MAX_SERVER_ALL
Definition: m2m_types.h:1100
REG_CH_9
Definition: m2m_types.h:1295
tstrM2mWiFiRoaming
Roaming related information .
Definition: m2m_types.h:765
tstrM2MScanRegion
Wi-Fi channel regulation region information.
Definition: m2m_types.h:1875
M2M_SIGMA_UDP_TX
Definition: m2m_types.h:1177
M2M_SSL_IND_CRL
Definition: m2m_types.h:2916
tstrM2mScanDone
Wi-Fi Scan Result.
Definition: m2m_types.h:1945
M2M_WIFI_MODE_ETHERNET
Definition: m2m_types.h:1362
tstrM2MAPConfig::u8KeySz
uint8 u8KeySz
Definition: m2m_types.h:2270
tstrM2MWifiTxPacketInfo
Wi-Fi TX Packet Info.
Definition: m2m_types.h:2239
tstrOtaStart
Definition: m2m_types.h:3424
ENTRY_ID_TLSROOT
Definition: m2m_types.h:534
M2M_OTA_REQ_SWITCH_FIRMWARE
Definition: m2m_types.h:3113
M2M_OTA_RESP_HOST_FILE_STATUS
Definition: m2m_types.h:3127
tstrM2mClientState
PS Client State.
Definition: m2m_types.h:2389
tstrM2MScanOption
This struct contains the configuration options for Wi-Fi scan.
Definition: m2m_types.h:1796
tstrTlsSrvChunkHdr::u16Sig
uint16 u16Sig
Definition: m2m_types.h:3054
M2M_OTA_REQ_TEST
Definition: m2m_types.h:3120
M2M_SIGMA_TA_RECEIVE_STOP
Definition: m2m_types.h:1173
M2M_WIFI_REQ_WPS_SCAN
Definition: m2m_types.h:1012
MAX_FILE_READ_STEP
#define MAX_FILE_READ_STEP
Definition: m2m_types.h:512
tstrM2mWifiConnHdr::strConnCredHdr
tstrM2mConnCredHdr strConnCredHdr
Definition: m2m_types.h:1637
tstrM2mWifi1xHdr::u32TlsHsFlags
uint32 u32TlsHsFlags
Definition: m2m_types.h:1576
tstrOtaControlSec::u32OtaFormatVersion
uint32 u32OtaFormatVersion
Definition: m2m_types.h:3216
tstrOtaControlSec::u32OtaCurrentworkingImagOffset
uint32 u32OtaCurrentworkingImagOffset
Definition: m2m_types.h:3226
TX_RATE_1
Definition: m2m_types.h:2787
tstrOtaHostFileReadStatusResp::u8OtaFileReadStatus
uint8 u8OtaFileReadStatus
Definition: m2m_types.h:3379
M2M_REQ_CONFIG_PKT
Definition: m2m_types.h:835
M2M_CRYPTO_RESP_SHA256_INIT
Definition: m2m_types.h:1135
M2M_REQ_DATA_PKT
Definition: m2m_types.h:836
tstrM2MWifiTxPacketInfo::u16PacketSize
uint16 u16PacketSize
Definition: m2m_types.h:2240
tenuM2mApCmd
tenuM2mApCmd
This enum contains WINC commands while in AP mode.
Definition: m2m_types.h:1075
TLS_FLASH_OK_NO_CHANGE
Definition: m2m_types.h:3043
M2M_WIFI_REQ_CONNECT
Definition: m2m_types.h:994
ENTRY_ID_CONNPARAMS
Definition: m2m_types.h:537
tstrM2mWifi1xHdr::u16PrivateKeyLength
uint16 u16PrivateKeyLength
Definition: m2m_types.h:1566
M2M_WIFI_REQ_GET_SYS_TIME
Definition: m2m_types.h:937
SSL_CERT_EXP_CHECK_DISABLE
Definition: m2m_types.h:2983
M2M_WIFI_CONNECTED
Definition: m2m_types.h:1194
tstrM2mEnableLogs
Enable Firmware logs.
Definition: m2m_types.h:718
M2M_WIFI_DISCONNECTED
Definition: m2m_types.h:1191
tstrOtaUpdateStatusResp
This struct contains the OTA update status.
Definition: m2m_types.h:3282
tstrM2MAPConfig::u8KeyIndx
uint8 u8KeyIndx
Definition: m2m_types.h:2267
M2M_ERR_OTA_ROLLBACK_FAIL
Definition: m2m_types.h:3090
SNTP_DISABLE_DHCP
Definition: m2m_types.h:1392
tstrSystemTime::u16Year
uint16 u16Year
Definition: m2m_types.h:2705
M2M_WIFI_SEC_INVALID
Definition: m2m_types.h:1213
tstrM2MSNTPConfig::enuUseDHCP
tenuSNTPUseDHCP enuUseDHCP
Definition: m2m_types.h:2680
tstrM2mBatteryVoltage
Battery Voltage.
Definition: m2m_types.h:741
M2M_IP_REQ_STATIC_IP_CONF
Definition: m2m_types.h:1156
tstrOtaUpdateStatusResp::u8OtaUpdateStatus
uint8 u8OtaUpdateStatus
Definition: m2m_types.h:3285
REG_CH_1
Definition: m2m_types.h:1287
tstrSystemTime::u8Day
uint8 u8Day
Definition: m2m_types.h:2707
tenuM2mServerCmd
tenuM2mServerCmd
This enum contains WINC commands while in PS mode. These command are currently not supported...
Definition: m2m_types.h:1096
M2M_SSL_REQ_CERT_VERIF
Definition: m2m_types.h:2910
tstrOtaStart::u8SSLFlags
uint8 u8SSLFlags
Definition: m2m_types.h:3431
M2M_WIFI_CH_13
Definition: m2m_types.h:1273
tstrOtaInitHdr::u32OtaPayloadSize
uint32 u32OtaPayloadSize
Definition: m2m_types.h:3201
M2M_WIFI_RESP_CLIENT_INFO
Definition: m2m_types.h:1098
M2M_WIFI_REQ_SET_GAINS
Definition: m2m_types.h:963
tstrM2mWifiGainsParams
Gain Values.
Definition: m2m_types.h:1407
M2M_OTA_REQ_HOST_FILE_STATUS
Definition: m2m_types.h:3126
tstrTlsCrlInfo
Certificate revocation list details.
Definition: m2m_types.h:2963
M2M_CRYPTO_RESP_RSA_SIGN_GEN
Definition: m2m_types.h:1141
M2M_PS_AUTOMATIC
Definition: m2m_types.h:1325
tstrM2mPsType::u8PsType
uint8 u8PsType
Definition: m2m_types.h:2067
tenuM2mReqpkt
tenuM2mReqpkt
Definition: m2m_types.h:834
REG_CH_10
Definition: m2m_types.h:1296
M2M_WIFI_RESP_ETHERNET_RX_PACKET
Definition: m2m_types.h:948
tstrM2mWifiscanResult::u8ch
uint8 u8ch
Definition: m2m_types.h:2006
tstrM2mConnCredHdr
Wi-Fi Connect Credentials Header.
Definition: m2m_types.h:1433
tenuM2mScanRegion
tenuM2mScanRegion
Wi-Fi RF Channels.
Definition: m2m_types.h:1285
TX_RATE_LOWEST
Definition: m2m_types.h:2786
tstrOtaControlSec::u32OtaCortusAppRollbackOffset
uint32 u32OtaCortusAppRollbackOffset
Definition: m2m_types.h:3253
M2M_WIFI_CH_12
Definition: m2m_types.h:1272
TLS_SRV_SEC_MAX_FILES
#define TLS_SRV_SEC_MAX_FILES
Definition: m2m_types.h:395
M2M_WIFI_CH_14
Definition: m2m_types.h:1274
TX_PWR_HIGH
Definition: m2m_types.h:657
M2M_OTA_RESP_HOST_FILE_READ
Definition: m2m_types.h:3131
tstrOtaHostFileReadStatusResp::__PAD8__
uint8 __PAD8__
Definition: m2m_types.h:3384
TX_RATE_24
Definition: m2m_types.h:2795
tstrM2MDeviceNameConfig
Device name.
Definition: m2m_types.h:2464
tstrM2mConnCredCmn::u8Options
uint8 u8Options
Definition: m2m_types.h:1469
tstrM2MWifiMonitorModeCtrl::u8FrameSubtype
uint8 u8FrameSubtype
Definition: m2m_types.h:2141
tstrTlsSrvChunkHdr::u16Size32
uint16 u16Size32
Definition: m2m_types.h:3057
M2M_SIGMA_ICMP_RX
Definition: m2m_types.h:1175
M2M_WIFI_REQ_SET_STOP_SCAN_OPTION
Definition: m2m_types.h:1119
M2M_NTP_MAX_SERVER_NAME_LENGTH
#define M2M_NTP_MAX_SERVER_NAME_LENGTH
Definition: m2m_types.h:221
tstrTlsCrlInfo::u8Rsv2
uint8 u8Rsv2
Definition: m2m_types.h:2968
M2M_PS_MANUAL
Definition: m2m_types.h:1340
tstrConfAutoRate::u16ArMaxRecoveryFailThreshold
uint16 u16ArMaxRecoveryFailThreshold
Definition: m2m_types.h:2817
M2M_WIFI_WEP_KEY_INDEX_1
Definition: m2m_types.h:600
tstrOtaHostFileGetStatusResp::u8OtaFileGetStatus
uint8 u8OtaFileGetStatus
Definition: m2m_types.h:3344
M2M_WIFI_REQ_DISABLE_MONITORING
Definition: m2m_types.h:1039
M2M_WIFI_SEC_WEP
Definition: m2m_types.h:1222
tenuM2mIpCmd
tenuM2mIpCmd
Definition: m2m_types.h:1154
tstrM2MIPConfig::u32StaticIP
uint32 u32StaticIP
Definition: m2m_types.h:2482
M2M_WIFI_RESP_IP_CONFIGURED
Definition: m2m_types.h:1028
OTA_STATUS_INVALID_ARG
Definition: m2m_types.h:3150
tstrCyptoResp::s8Resp
sint8 s8Resp
Definition: m2m_types.h:1924
TX_RATE_MCS_5
Definition: m2m_types.h:2804
tstrM2mWiFiRoaming::u8EnableDhcp
uint8 u8EnableDhcp
Definition: m2m_types.h:769
tstrM2MAPModeConfig::strApConfig
tstrM2MAPConfig strApConfig
Definition: m2m_types.h:2342
DL_STATUS
Definition: m2m_types.h:3178
M2M_WIFI_REQ_SEND_ETHERNET_PACKET
Definition: m2m_types.h:945
tstrM2mWifi1xHdr
Wi-Fi Authentication 802.1x header for parameters. The parameters (Domain, UserName, PrivateKey/Password) are appended to this structure.
Definition: m2m_types.h:1548
M2M_REQ_GROUP_SSL
Definition: m2m_types.h:822
OTA_STATUS_ABORTED
Definition: m2m_types.h:3166
tstrM2mReqScanResult::u8Index
uint8 u8Index
Definition: m2m_types.h:1973
tstrM2mWifiWep
WEP security key header.
Definition: m2m_types.h:1495
WPS_PIN_TRIGGER
Definition: m2m_types.h:1376
M2M_ERR_OTA_INVALID_FLASH_SIZE
Definition: m2m_types.h:3092
tstrM2MScanOption::u8NumOfSlot
uint8 u8NumOfSlot
Definition: m2m_types.h:1797
M2M_SSL_RESP_SET_CS_LIST
Definition: m2m_types.h:2922
M2M_WIFI_IND_CONN_PARAM
Definition: m2m_types.h:1059
tstrM2mConnCredCmn::u8AuthType
uint8 u8AuthType
Definition: m2m_types.h:1475
OTA_STATUS_UPDATE_INPROGRESS
Definition: m2m_types.h:3158
tstrM2mWifiConnHdr::strConnCredCmn
tstrM2mConnCredCmn strConnCredCmn
Definition: m2m_types.h:1639
OTA_ERR_WORKING_IMAGE_LOAD_FAIL
Definition: m2m_types.h:3078
M2M_OTA_REQ_HOST_FILE_DOWNLOAD
Definition: m2m_types.h:3128
tstrM2MWPSInfo::u8Ch
uint8 u8Ch
Definition: m2m_types.h:1745
OTA_STATUS_IMAGE_VERIF_FAILED
Definition: m2m_types.h:3160
tstrM2MMulticastMac::__PAD8__
uint8 __PAD8__
Definition: m2m_types.h:2737
tstrM2mClientState::u8State
uint8 u8State
Definition: m2m_types.h:2390
tstrM2MWifiRxPacketInfo::u8Priority
uint8 u8Priority
Definition: m2m_types.h:2188
M2M_WIFI_CH_9
Definition: m2m_types.h:1269
OTA_SUCCESS
Definition: m2m_types.h:3076
M2M_WIFI_RESP_SCAN_RESULT
Definition: m2m_types.h:916
REG_CH_12
Definition: m2m_types.h:1298
M2M_WIFI_RESP_WIFI_RX_PACKET
Definition: m2m_types.h:1042
uint8
unsigned char uint8
Range of values between 0 to 255.
Definition: nm_bsp.h:100
PSK_CALC_LEN
#define PSK_CALC_LEN
Definition: m2m_types.h:295
tstrM2mWifiWep::u8KeyIndex
uint8 u8KeyIndex
Definition: m2m_types.h:1496
tstrM2mWifiAuthInfoHdr::u8Type
uint8 u8Type
Definition: m2m_types.h:1601
tstrConfAutoRate::u8ArSuccessTXThreshold
uint8 u8ArSuccessTXThreshold
Definition: m2m_types.h:2877
M2M_WIFI_MAX_AP_ALL
Definition: m2m_types.h:1085
tstrM2mWifiStateChanged::u8ErrCode
uint8 u8ErrCode
Definition: m2m_types.h:2041
tenuM2mScanCh
tenuM2mScanCh
Wi-Fi RF Channels.
Definition: m2m_types.h:1260
tstrM2MWifiMonitorModeCtrl::u8ChannelID
uint8 u8ChannelID
Definition: m2m_types.h:2135
tstrM2mWifi1xHdr::u16CertificateLength
uint16 u16CertificateLength
Definition: m2m_types.h:1570
uint16
unsigned short uint16
Range of values between 0 to 65535.
Definition: nm_bsp.h:107
tstrM2MDefaultConnResp::s8ErrorCode
sint8 s8ErrorCode
Definition: m2m_types.h:1769
tstrConfAutoRate::u16ArMinRecoveryFailThreshold
uint16 u16ArMinRecoveryFailThreshold
Definition: m2m_types.h:2835
REG_CH_6
Definition: m2m_types.h:1292
tstrTlsSrvChunkHdr::u16TotalSize32
uint16 u16TotalSize32
Definition: m2m_types.h:3055
tstrM2mIpRsvdPkt::u16PktOffset
uint16 u16PktOffset
Definition: m2m_types.h:2512
SSL_CERT_EXP_CHECK_EN_IF_SYS_TIME
Definition: m2m_types.h:2995
M2M_WIFI_RESP_CON_STATE_CHANGED
Definition: m2m_types.h:1006
tstrM2MWPSConnect::u8TriggerType
uint8 u8TriggerType
Definition: m2m_types.h:1710
tstrM2mEnableLogs::u8Enable
uint8 u8Enable
Definition: m2m_types.h:719
tstrM2mLsnInt::u16LsnInt
uint16 u16LsnInt
Definition: m2m_types.h:2110
tenuM2mSigmaCmd
tenuM2mSigmaCmd
Definition: m2m_types.h:1168
Generated on Tue Sep 27 2022 16:17:30 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: m2m_wifi.h Source File

m2m_wifi.h
1
114 #ifndef __M2M_WIFI_H__
115 #define __M2M_WIFI_H__
116
117 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
118 INCLUDES
119 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
120
121 #include "common/include/nm_common.h"
122 #include "driver/include/m2m_types.h"
123 #include "driver/source/nmdrv.h"
124
125 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
126 MACROS
127 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
128
173 typedef void (*tpfAppWifiCb)(uint8 u8MsgType, void *pvMsg);
174
206 typedef void (*tpfAppEthCb)(uint8 u8MsgType, void *pvMsg, void *pvCtrlBuf);
207
239 typedef void (*tpfAppMonCb)(tstrM2MWifiRxPacketInfo *pstrWifiRxPacket, uint8 *pu8Payload, uint16 u16PayloadSize); //MON_DOC //WLANCallbacks
242
258 typedef enum {
259 WIFI_STATE_DEINIT,
261 WIFI_STATE_INIT,
263 WIFI_STATE_START,
265 } tenuWifiState;
266
267 typedef enum {
268 WIFI_CRED_DONTSAVE,
270 WIFI_CRED_SAVE_UNENCRYPTED,
272 WIFI_CRED_SAVE_ENCRYPTED
278 } tenuCredStoreOption;
279
288 typedef enum {
289 WIFI_1X_BYPASS_SERVER_AUTH,
294 WIFI_1X_SESSION_CACHING,
300 WIFI_1X_SPECIFIC_ROOTCERT,
305 WIFI_1X_TIME_VERIF_MODE,
310 } tenu1xOption;
311
332 typedef struct {
333 tpfAppWifiCb pfAppWifiCb;
334 tpfAppEthCb pfAppEthCb;
335 uint8 *au8ethRcvBuf;
336 uint16 u16ethRcvBufSize;
337 uint8 u8EthernetEnable;
338 uint8 __PAD8__;
339 } tstrEthInitParam;
340
364 typedef struct {
365 uint16 u16DataSize;
366 uint16 u16RemainingDataSize;
367 } tstrM2mIpCtrlBuf;
368
386 typedef struct {
387 tpfAppWifiCb pfAppWifiCb;
388 tpfAppMonCb pfAppMonCb;
389 tstrEthInitParam strEthInitParam ;
390 } tstrWifiInitParam;
391
392 typedef struct {
393 uint8 *pu8Bssid;
396 uint8 *pu8Ssid;
398 uint8 u8SsidLen;
400 tenuM2mScanCh enuChannel;
404 } tstrNetworkId;
405
406 /* Legacy Wep param structure. */
407 typedef struct {
408 uint8 u8KeyIndx;
409 uint8 u8KeySz;
410 uint8 au8WepKey[WEP_104_KEY_STRING_SIZE + 1]; // NULL terminated
411 uint8 __PAD24__[3];
412 } tstrM2mWifiWepParams;
413
414 /* Legacy 802.1x MsChapv2 param structure. */
415 typedef struct {
416 uint8 au8UserName[21]; // NULL terminated
417 uint8 au8Passwd[41]; // NULL terminated
418 } tstr1xAuthCredentials;
419
420 typedef struct {
421 uint8 *pu8Psk;
424 uint8 *pu8Passphrase;
427 uint8 u8PassphraseLen;
430 } tstrAuthPsk;
431
432 typedef struct {
433 uint8 *pu8WepKey;
436 uint8 u8KeySz;
439 uint8 u8KeyIndx;
441 } tstrAuthWep;
442
443 typedef struct {
444 uint8 *pu8Domain;
453 uint8 *pu8UserName;
458 uint8 *pu8Password;
461 uint16 u16DomainLen;
466 uint16 u16UserNameLen;
470 uint16 u16PasswordLen;
473 bool bUnencryptedUserName;
479 bool bPrependDomain;
483 } tstrAuth1xMschap2;
484
485 typedef struct {
486 uint8 *pu8Domain;
495 uint8 *pu8UserName;
500 uint8 *pu8PrivateKey_Mod;
503 uint8 *pu8PrivateKey_Exp;
506 uint8 *pu8Certificate;
509 uint16 u16DomainLen;
514 uint16 u16UserNameLen;
518 uint16 u16PrivateKeyLen;
522 uint16 u16CertificateLen;
525 bool bUnencryptedUserName;
531 bool bPrependDomain;
535 } tstrAuth1xTls; //WlanEnums
537
538 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
539 FUNCTION PROTOTYPES
540 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
541
542 #ifdef __cplusplus
543 extern "C" {
544 #endif
545
568 NMI_API sint8 m2m_wifi_download_mode(void);
569
629 NMI_API sint8 m2m_wifi_init(tstrWifiInitParam *pWifiInitParam);
630
665 NMI_API sint8 m2m_wifi_deinit(void *arg);
666
679 NMI_API sint8 m2m_wifi_init_hold(void);
680
699 NMI_API sint8 m2m_wifi_init_start(tstrWifiInitParam *pWifiInitParam);
700
723 NMI_API sint8 m2m_wifi_reinit(tstrWifiInitParam *pWifiInitParam);
724
741 NMI_API sint8 m2m_wifi_reinit_hold(void);
742
762 NMI_API sint8 m2m_wifi_reinit_start(tstrWifiInitParam *pWifiInitParam);
763
784 NMI_API void m2m_wifi_yield(void);
785
817 NMI_API sint8 m2m_wifi_handle_events(void *arg);
818
832 sint8 m2m_wifi_send_crl(tstrTlsCrlInfo *pCRL);
833
868 sint8 m2m_wifi_delete_sc(char *pcSsid, uint8 u8SsidLen);
869
905 NMI_API sint8 m2m_wifi_default_connect(void);
906
947 sint8 m2m_wifi_connect_open(tenuCredStoreOption enuCredStoreOption, tstrNetworkId *pstrNetworkId);
948
992 sint8 m2m_wifi_connect_wep(tenuCredStoreOption enuCredStoreOption, tstrNetworkId *pstrNetworkId, tstrAuthWep *pstrAuthWep);
993
1037 sint8 m2m_wifi_connect_psk(tenuCredStoreOption enuCredStoreOption, tstrNetworkId *pstrNetworkId, tstrAuthPsk *pstrAuthPsk);
1038
1071 sint8 m2m_wifi_1x_set_option(tenu1xOption enuOptionName, const void *pOptionValue, size_t OptionLen);
1072
1102 sint8 m2m_wifi_1x_get_option(tenu1xOption enuOptionName, void *pOptionValue, size_t *pOptionLen);
1103
1148 sint8 m2m_wifi_connect_1x_mschap2(tenuCredStoreOption enuCredStoreOption, tstrNetworkId *pstrNetworkId, tstrAuth1xMschap2 *pstrAuth1xMschap2);
1149
1194 sint8 m2m_wifi_connect_1x_tls(tenuCredStoreOption enuCredStoreOption, tstrNetworkId *pstrNetworkId, tstrAuth1xTls *pstrAuth1xTls);
1195
1276 NMI_API sint8 m2m_wifi_connect(char *pcSsid, uint8 u8SsidLen, uint8 u8SecType, void *pvAuthInfo, uint16 u16Ch);
1277
1360 NMI_API sint8 m2m_wifi_connect_sc(char *pcSsid, uint8 u8SsidLen, uint8 u8SecType, void *pvAuthInfo, uint16 u16Ch, uint8 u8NoSaveCred);
1361
1392 NMI_API sint8 m2m_wifi_disconnect(void);
1393
1517 NMI_API sint8 m2m_wifi_start_provision_mode(tstrM2MAPConfig *pstrAPConfig, char *pcHttpServerDomainName, uint8 bEnableHttpRedirect);
1518
1654 NMI_API sint8 m2m_wifi_start_provision_mode_ext(tstrM2MAPModeConfig *pstrAPModeConfig, char *pcHttpServerDomainName, uint8 bEnableHttpRedirect);
1655
1677 NMI_API sint8 m2m_wifi_stop_provision_mode(void);
1678
1770 NMI_API sint8 m2m_wifi_get_connection_info(void);
1771
1790 NMI_API sint8 m2m_wifi_set_mac_address(uint8 au8MacAddress[6]);
1791
1898 NMI_API sint8 m2m_wifi_wps(uint8 u8TriggerType, const char *pcPinNumber);
1899
1917 NMI_API sint8 m2m_wifi_wps_disable(void);
1918
1929 NMI_API sint8 m2m_wifi_p2p(uint8 u8Channel);
1930
1939 NMI_API sint8 m2m_wifi_p2p_disconnect(void); //P2P_DOC
1941
2034 NMI_API sint8 m2m_wifi_enable_ap(CONST tstrM2MAPConfig *pstrM2MAPConfig);
2035
2140 NMI_API sint8 m2m_wifi_enable_ap_ext(CONST tstrM2MAPModeConfig *pstrM2MAPModeConfig);
2141
2160 NMI_API sint8 m2m_wifi_disable_ap(void);
2161
2198 NMI_API sint8 m2m_wifi_set_static_ip(tstrM2MIPConfig *pstrStaticIPConf);
2199
2218 NMI_API sint8 m2m_wifi_request_dhcp_client(void);
2219
2235 NMI_API sint8 m2m_wifi_request_dhcp_server(uint8 *addr);
2236
2263 NMI_API sint8 m2m_wifi_enable_dhcp(uint8 u8DhcpEn);
2264
2287 NMI_API sint8 m2m_wifi_set_scan_options(tstrM2MScanOption *ptstrM2MScanOption);
2288
2316 NMI_API sint8 m2m_wifi_set_stop_scan_on_first(uint8 u8StopScanOption);
2317
2345 NMI_API sint8 m2m_wifi_set_scan_region(uint16 ScanRegion);
2346
2475 NMI_API sint8 m2m_wifi_request_scan(uint8 ch);
2476
2516 NMI_API sint8 m2m_wifi_request_scan_passive(uint8 ch, uint16 scan_time);
2517
2676 NMI_API sint8 m2m_wifi_request_scan_ssid_list(uint8 ch, uint8 *u8Ssidlist);
2677
2793 NMI_API uint8 m2m_wifi_get_num_ap_found(void);
2794
2920 NMI_API sint8 m2m_wifi_req_scan_result(uint8 index);
2921
2984 NMI_API sint8 m2m_wifi_req_curr_rssi(void);
2985
3018 NMI_API sint8 m2m_wifi_get_otp_mac_address(uint8 *pu8MacAddr, uint8 *pu8IsValid);
3019
3045 NMI_API sint8 m2m_wifi_get_mac_address(uint8 *pu8MacAddr);
3046
3082 NMI_API sint8 m2m_wifi_set_sleep_mode(uint8 PsTyp, uint8 BcastEn);
3083
3118 NMI_API sint8 m2m_wifi_request_sleep(uint32 u32SlpReqTime);
3119
3135 NMI_API uint8 m2m_wifi_get_sleep_mode(void);
3136
3164 NMI_API sint8 m2m_wifi_req_client_ctrl(uint8 cmd);
3165
3190 NMI_API sint8 m2m_wifi_req_server_init(uint8 ch);
3191
3223 NMI_API sint8 m2m_wifi_set_device_name(uint8 *pu8DeviceName, uint8 u8DeviceNameLength);
3224
3259 NMI_API sint8 m2m_wifi_configure_sntp(uint8 *pu8NTPServerName, uint8 u8NTPServerNameLength, tenuSNTPUseDHCP useDHCP);
3260
3291 NMI_API sint8 m2m_wifi_set_lsn_int(tstrM2mLsnInt *pstrM2mLsnInt);
3292
3408 NMI_API sint8 m2m_wifi_enable_monitoring_mode(tstrM2MWifiMonitorModeCtrl *pstrMtrCtrl, uint8 *pu8PayloadBuffer,
3409 uint16 u16BufferSize, uint16 u16DataOffset);
3410
3429 NMI_API sint8 m2m_wifi_disable_monitoring_mode(void);
3430
3464 NMI_API sint8 m2m_wifi_send_wlan_pkt(uint8 *pu8WlanPacket, uint16 u16WlanHeaderLength, uint16 u16WlanPktSize); //MON_DOC
3466
3499 NMI_API sint8 m2m_wifi_send_ethernet_pkt(uint8 *pu8Packet, uint16 u16PacketSize);
3500
3532 NMI_API sint8 m2m_wifi_enable_sntp(uint8 bEnable);
3533
3561 NMI_API sint8 m2m_wifi_set_system_time(uint32 u32UTCSeconds);
3562
3587 NMI_API sint8 m2m_wifi_get_system_time(void);
3588
3661 NMI_API sint8 m2m_wifi_set_cust_InfoElement(uint8 *pau8M2mCustInfoElement);
3662
3685 sint8 m2m_wifi_set_power_profile(uint8 u8PwrMode);
3686
3708 sint8 m2m_wifi_set_tx_power(uint8 u8TxPwrLevel);
3709
3731 sint8 m2m_wifi_set_gain_table_idx(uint8 u8GainTableIdx);
3732
3757 sint8 m2m_wifi_enable_firmware_logs(uint8 u8Enable);
3758
3779 sint8 m2m_wifi_set_battery_voltage(uint16 u16BattVoltx100);
3780
3801 sint8 m2m_wifi_set_gains(tstrM2mWifiGainsParams *pstrM2mGain);
3802
3803 #ifdef ETH_MODE
3804
3838 NMI_API sint8 m2m_wifi_enable_mac_mcast(uint8 *pu8MulticastMacAddress, uint8 u8AddRemove);
3839
3873 NMI_API sint8 m2m_wifi_set_receive_buffer(void *pvBuffer, uint16 u16BufferLen);
3874 #endif /* ETH_MODE */
3875
3900 sint8 m2m_wifi_prng_get_random_bytes(uint8 *pu8PrngBuff, uint16 u16PrngSize);
3901
3928 NMI_API sint8 m2m_wifi_conf_auto_rate(tstrConfAutoRate *pstrConfAutoRate);
3929
3960 sint8 m2m_wifi_enable_roaming(uint8 bEnableDhcp);
3961
3979 sint8 m2m_wifi_disable_roaming(void);
3980
4001 NMI_API uint8 m2m_wifi_get_state(void);
4002
4028 NMI_API sint8 m2m_wifi_get_firmware_version(tstrM2mRev *pstrRev);
4029
4049 sint8 m2m_wifi_enable_XO_during_sleep(uint8 bXOSleepEnable);
4050
4051 #ifdef __cplusplus
4052 }
4053 #endif
4054 #endif /* __M2M_WIFI_H__ */
4055
m2m_wifi_get_num_ap_found
NMI_API uint8 m2m_wifi_get_num_ap_found(void)
Synchronous function to retrieve the number of AP's found during the last scan operation.
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...
tenuWifiState
tenuWifiState
Enumeration for Wi-Fi state The following is used to track the state of the wifi (not initialized...
Definition: m2m_wifi.h:258
WIFI_1X_BYPASS_SERVER_AUTH
Definition: m2m_wifi.h:289
m2m_wifi_init_hold
NMI_API sint8 m2m_wifi_init_hold(void)
First part of m2m_wifi_init, up to the point of initializing SPI for flash access.
tstrAuth1xTls::u16UserNameLen
uint16 u16UserNameLen
Definition: m2m_wifi.h:514
tstrAuth1xTls::u16CertificateLen
uint16 u16CertificateLen
Definition: m2m_wifi.h:522
tstrAuthWep::u8KeySz
uint8 u8KeySz
Definition: m2m_wifi.h:436
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.
tstrM2mLsnInt
Listen interval.
Definition: m2m_types.h:2109
tstrAuthPsk::pu8Psk
uint8 * pu8Psk
Definition: m2m_wifi.h:421
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:386
m2m_wifi_deinit
NMI_API sint8 m2m_wifi_deinit(void *arg)
De-initialize the WINC driver and host interface.
m2m_wifi_disconnect
NMI_API sint8 m2m_wifi_disconnect(void)
Synchronous API to request disconnection from a network.
WIFI_1X_TIME_VERIF_MODE
Definition: m2m_wifi.h:305
tstrAuth1xMschap2::u16DomainLen
uint16 u16DomainLen
Definition: m2m_wifi.h:461
tstrM2mWifiWepParams::u8KeyIndx
uint8 u8KeyIndx
Definition: m2m_wifi.h:408
tstrM2MWifiMonitorModeCtrl
Wi-Fi Monitor Mode Filter.
Definition: m2m_types.h:2134
tstrAuth1xTls::pu8Domain
uint8 * pu8Domain
Definition: m2m_wifi.h:486
tstrEthInitParam::pfAppWifiCb
tpfAppWifiCb pfAppWifiCb
Definition: m2m_wifi.h:333
m2m_wifi_get_state
NMI_API uint8 m2m_wifi_get_state(void)
Get the wifi state.
m2m_wifi_request_scan
NMI_API sint8 m2m_wifi_request_scan(uint8 ch)
Asynchronous API to request the WINC IC to scan for networks.
m2m_wifi_connect_1x_tls
sint8 m2m_wifi_connect_1x_tls(tenuCredStoreOption enuCredStoreOption, tstrNetworkId *pstrNetworkId, tstrAuth1xTls *pstrAuth1xTls)
Asynchronous API to connect to an access point using WPA(2) Enterprise authentication with MS-CHAP-V2...
m2m_wifi_set_tx_power
sint8 m2m_wifi_set_tx_power(uint8 u8TxPwrLevel)
Set the TX power tenuM2mTxPwrLevel.
tstrAuth1xTls
Definition: m2m_wifi.h:485
tstrNetworkId::pu8Bssid
uint8 * pu8Bssid
Definition: m2m_wifi.h:393
m2m_wifi_handle_events
NMI_API sint8 m2m_wifi_handle_events(void *arg)
Synchronous M2M event handler function.
m2m_wifi_init
NMI_API sint8 m2m_wifi_init(tstrWifiInitParam *pWifiInitParam)
Synchronous API to initialize the WINC driver.
m2m_wifi_connect_wep
sint8 m2m_wifi_connect_wep(tenuCredStoreOption enuCredStoreOption, tstrNetworkId *pstrNetworkId, tstrAuthWep *pstrAuthWep)
Asynchronous API to connect to an access point using WEP authentication.
m2m_wifi_connect_open
sint8 m2m_wifi_connect_open(tenuCredStoreOption enuCredStoreOption, tstrNetworkId *pstrNetworkId)
Asynchronous API to connect to an access point using open authentication.
m2m_wifi_reinit
NMI_API sint8 m2m_wifi_reinit(tstrWifiInitParam *pWifiInitParam)
De-initialize and then initialize wifi. Resets the WINC.
tstrAuth1xTls::pu8PrivateKey_Exp
uint8 * pu8PrivateKey_Exp
Definition: m2m_wifi.h:503
tstrEthInitParam::u16ethRcvBufSize
uint16 u16ethRcvBufSize
Definition: m2m_wifi.h:336
tstrAuth1xTls::pu8UserName
uint8 * pu8UserName
Definition: m2m_wifi.h:495
tstrAuth1xTls::u16DomainLen
uint16 u16DomainLen
Definition: m2m_wifi.h:509
WIFI_1X_SESSION_CACHING
Definition: m2m_wifi.h:294
tstrAuth1xMschap2::pu8UserName
uint8 * pu8UserName
Definition: m2m_wifi.h:453
tstrAuth1xTls::u16PrivateKeyLen
uint16 u16PrivateKeyLen
Definition: m2m_wifi.h:518
m2m_wifi_connect_sc
NMI_API sint8 m2m_wifi_connect_sc(char *pcSsid, uint8 u8SsidLen, uint8 u8SecType, void *pvAuthInfo, uint16 u16Ch, uint8 u8NoSaveCred)
DEPRECATED in v19.6.1 - Kept only for legacy purposes. Legacy asynchronous API to request connection...
m2m_wifi_1x_get_option
sint8 m2m_wifi_1x_get_option(tenu1xOption enuOptionName, void *pOptionValue, size_t *pOptionLen)
API to get (read) options relating to Wi-Fi connection using WPA(2) Enterprise authentication.
tstrM2MAPModeConfig
AP Configuration.
Definition: m2m_types.h:2341
tstrM2mIpCtrlBuf
Structure holding the incoming buffer's data size information, indicating the data size of the buffer...
Definition: m2m_wifi.h:364
tstrAuth1xMschap2::u16UserNameLen
uint16 u16UserNameLen
Definition: m2m_wifi.h:466
m2m_wifi_set_gains
sint8 m2m_wifi_set_gains(tstrM2mWifiGainsParams *pstrM2mGain)
Set the chip PPA gain for 11b/11gn.
tstrEthInitParam::pfAppEthCb
tpfAppEthCb pfAppEthCb
Definition: m2m_wifi.h:334
m2m_wifi_connect
NMI_API sint8 m2m_wifi_connect(char *pcSsid, uint8 u8SsidLen, uint8 u8SecType, void *pvAuthInfo, uint16 u16Ch)
DEPRECATED in v19.6.1 - Kept only for legacy purposes. Legacy asynchronous API to request connection...
tstrEthInitParam::__PAD8__
uint8 __PAD8__
Definition: m2m_wifi.h:338
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.
tstrAuth1xTls::pu8Certificate
uint8 * pu8Certificate
Definition: m2m_wifi.h:506
m2m_wifi_1x_set_option
sint8 m2m_wifi_1x_set_option(tenu1xOption enuOptionName, const void *pOptionValue, size_t OptionLen)
API to set (write) options relating to Wi-Fi connection using WPA(2) Enterprise authentication.
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.
CONST
#define CONST
Definition: nm_bsp.h:64
m2m_wifi_enable_mac_mcast
NMI_API sint8 m2m_wifi_enable_mac_mcast(uint8 *pu8MulticastMacAddress, uint8 u8AddRemove)
Synchronous function for filtering received MAC addresses.
m2m_wifi_request_scan_passive
NMI_API sint8 m2m_wifi_request_scan_passive(uint8 ch, uint16 scan_time)
Similar to m2m_wifi_request_scan but performs passive scanning instead of active scanning.
m2m_wifi_default_connect
NMI_API sint8 m2m_wifi_default_connect(void)
Asynchronous API that attempts to reconnect to the last-associated access point.
WEP_104_KEY_STRING_SIZE
#define WEP_104_KEY_STRING_SIZE
Definition: m2m_types.h:362
m2m_wifi_init_start
NMI_API sint8 m2m_wifi_init_start(tstrWifiInitParam *pWifiInitParam)
Second part of m2m_wifi_init, continuing from where m2m_wifi_init_hold left off.
tstrM2mIpCtrlBuf::u16RemainingDataSize
uint16 u16RemainingDataSize
Definition: m2m_wifi.h:366
tstrAuth1xMschap2
Definition: m2m_wifi.h:443
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 by the device.
m2m_wifi_disable_roaming
sint8 m2m_wifi_disable_roaming(void)
Disable WiFi STA roaming.
m2m_wifi_yield
NMI_API void m2m_wifi_yield(void)
Yield from processing more synchronous M2M events.
tstrWifiInitParam::strEthInitParam
tstrEthInitParam strEthInitParam
Definition: m2m_wifi.h:389
m2m_wifi_request_dhcp_server
NMI_API sint8 m2m_wifi_request_dhcp_server(uint8 *addr)
Dhcp requested by the firmware automatically in STA/AP mode).
tstrM2MIPConfig
IP configuration (static/DHCP). The same structure is used for DCHP callback as well as static IP con...
Definition: m2m_types.h:2481
tstrNetworkId::enuChannel
tenuM2mScanCh enuChannel
Definition: m2m_wifi.h:400
tstrEthInitParam
Structure to hold Ethernet interface parameters. Structure is to be defined and have its attributes s...
Definition: m2m_wifi.h:332
m2m_wifi_get_system_time
NMI_API sint8 m2m_wifi_get_system_time(void)
Asynchronous API to obtain the system time in use by the WINC IC.
m2m_wifi_stop_provision_mode
NMI_API sint8 m2m_wifi_stop_provision_mode(void)
Synchronous API for terminating provisioning mode on the WINC IC.
tstrEthInitParam::au8ethRcvBuf
uint8 * au8ethRcvBuf
Definition: m2m_wifi.h:335
m2m_wifi_set_cust_InfoElement
NMI_API sint8 m2m_wifi_set_cust_InfoElement(uint8 *pau8M2mCustInfoElement)
API to add or remove a user-defined Information Element.
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.
tstrAuth1xTls::pu8PrivateKey_Mod
uint8 * pu8PrivateKey_Mod
Definition: m2m_wifi.h:500
m2m_wifi_start_provision_mode_ext
NMI_API sint8 m2m_wifi_start_provision_mode_ext(tstrM2MAPModeConfig *pstrAPModeConfig, char *pcHttpServerDomainName, uint8 bEnableHttpRedirect)
Asynchronous API for control of Wi-Fi provisioning functionality with extended options.
tstrAuth1xMschap2::bPrependDomain
bool bPrependDomain
Definition: m2m_wifi.h:479
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. ...
tstrAuthWep::u8KeyIndx
uint8 u8KeyIndx
Definition: m2m_wifi.h:439
m2m_wifi_set_stop_scan_on_first
NMI_API sint8 m2m_wifi_set_stop_scan_on_first(uint8 u8StopScanOption)
Synchronous API for enabling/disabling the stop scan on first result of the WINC IC's network scannin...
uint32
unsigned long uint32
Range of values between 0 to 4294967295.
Definition: nm_bsp.h:114
m2m_wifi_set_power_profile
sint8 m2m_wifi_set_power_profile(uint8 u8PwrMode)
Change the power profile mode.
WIFI_CRED_DONTSAVE
Definition: m2m_wifi.h:268
m2m_wifi_connect_1x_mschap2
sint8 m2m_wifi_connect_1x_mschap2(tenuCredStoreOption enuCredStoreOption, tstrNetworkId *pstrNetworkId, tstrAuth1xMschap2 *pstrAuth1xMschap2)
Asynchronous API to connect to an access point using WPA(2) Enterprise authentication with MS-CHAP-V2...
tstrConfAutoRate
Auto TX rate selection parameters passed to m2m_wifi_conf_auto_rate.
Definition: m2m_types.h:2816
m2m_wifi_enable_XO_during_sleep
sint8 m2m_wifi_enable_XO_during_sleep(uint8 bXOSleepEnable)
Specifies whether the crystal oscillator is left on or off during deep sleep (defaults to off)...
m2m_wifi_send_ethernet_pkt
NMI_API sint8 m2m_wifi_send_ethernet_pkt(uint8 *pu8Packet, uint16 u16PacketSize)
Synchronous function to transmit an Ethernet packet.
tstrAuthWep
Definition: m2m_wifi.h:432
WIFI_STATE_DEINIT
Definition: m2m_wifi.h:259
tenuSNTPUseDHCP
tenuSNTPUseDHCP
Use NTP server provided by the DHCP server.
Definition: m2m_types.h:1391
m2m_wifi_req_scan_result
NMI_API sint8 m2m_wifi_req_scan_result(uint8 index)
Synchronous call to read the AP information from the SCAN Result list.
tstrM2mWifiWepParams::u8KeySz
uint8 u8KeySz
Definition: m2m_wifi.h:409
tstrAuth1xMschap2::bUnencryptedUserName
bool bUnencryptedUserName
Definition: m2m_wifi.h:473
tstrEthInitParam::u8EthernetEnable
uint8 u8EthernetEnable
Definition: m2m_wifi.h:337
m2m_wifi_set_lsn_int
NMI_API sint8 m2m_wifi_set_lsn_int(tstrM2mLsnInt *pstrM2mLsnInt)
API to set Wi-Fi listen interval for power save operation.
tstrM2MAPConfig
AP Configuration.
Definition: m2m_types.h:2257
NMI_API
#define NMI_API
Definition: nm_bsp.h:60
m2m_wifi_get_connection_info
NMI_API sint8 m2m_wifi_get_connection_info(void)
Asynchronous API for retrieving the WINC IC's connection status.
m2m_wifi_reinit_start
NMI_API sint8 m2m_wifi_reinit_start(tstrWifiInitParam *pWifiInitParam)
Second part of m2m_wifi_reinit, continuing from where m2m_wifi_reinit_hold left off.
tstrM2MWifiRxPacketInfo
Wi-Fi RX Frame Header.
Definition: m2m_types.h:2178
tstrM2mIpCtrlBuf::u16DataSize
uint16 u16DataSize
Definition: m2m_wifi.h:365
tstrM2mWifiWepParams
Definition: m2m_wifi.h:407
tstrAuthWep::pu8WepKey
uint8 * pu8WepKey
Definition: m2m_wifi.h:433
m2m_wifi_get_firmware_version
NMI_API sint8 m2m_wifi_get_firmware_version(tstrM2mRev *pstrRev)
Get Firmware version info.
tstrAuth1xTls::bPrependDomain
bool bPrependDomain
Definition: m2m_wifi.h:531
sint8
signed char sint8
Range of values between -128 to 127.
Definition: nm_bsp.h:121
tstrWifiInitParam::pfAppMonCb
tpfAppMonCb pfAppMonCb
Definition: m2m_wifi.h:388
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.
WIFI_CRED_SAVE_UNENCRYPTED
Definition: m2m_wifi.h:270
m2m_wifi_set_device_name
NMI_API sint8 m2m_wifi_set_device_name(uint8 *pu8DeviceName, uint8 u8DeviceNameLength)
Asynchronous API to set the "Device Name" of the WINC IC.
WIFI_STATE_INIT
Definition: m2m_wifi.h:261
tstrNetworkId
Definition: m2m_wifi.h:392
tstrM2MScanOption
This struct contains the configuration options for Wi-Fi scan.
Definition: m2m_types.h:1796
tstrAuth1xMschap2::pu8Password
uint8 * pu8Password
Definition: m2m_wifi.h:458
m2m_wifi_connect_psk
sint8 m2m_wifi_connect_psk(tenuCredStoreOption enuCredStoreOption, tstrNetworkId *pstrNetworkId, tstrAuthPsk *pstrAuthPsk)
Asynchronous API to connect to an access point using WPA(2) PSK authentication.
m2m_wifi_set_receive_buffer
NMI_API sint8 m2m_wifi_set_receive_buffer(void *pvBuffer, uint16 u16BufferLen)
Synchronous function for setting or modifying the receiver buffer's length.
m2m_wifi_enable_roaming
sint8 m2m_wifi_enable_roaming(uint8 bEnableDhcp)
Enable WiFi STA roaming.
tstrNetworkId::u8SsidLen
uint8 u8SsidLen
Definition: m2m_wifi.h:398
tpfAppWifiCb
void(* tpfAppWifiCb)(uint8 u8MsgType, void *pvMsg)
Wi-Fi's main callback function handler, for handling the M2M_WIFI events received on the Wi-Fi interf...
Definition: m2m_wifi.h:173
tstrAuthPsk
Definition: m2m_wifi.h:420
m2m_wifi_enable_sntp
NMI_API sint8 m2m_wifi_enable_sntp(uint8 bEnable)
Synchronous function to enable/disable the native Simple Network Time Protocol(SNTP) client in the WI...
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.
m2m_wifi_reinit_hold
NMI_API sint8 m2m_wifi_reinit_hold(void)
First part of m2m_wifi_reinit, up to the point of initializing SPI for flash access.
tstrAuthPsk::u8PassphraseLen
uint8 u8PassphraseLen
Definition: m2m_wifi.h:427
WIFI_CRED_SAVE_ENCRYPTED
Definition: m2m_wifi.h:272
m2m_wifi_prng_get_random_bytes
sint8 m2m_wifi_prng_get_random_bytes(uint8 *pu8PrngBuff, uint16 u16PrngSize)
Asynchronous function for retrieving from the firmware a pseudo-random set of bytes.
m2m_wifi_set_gain_table_idx
sint8 m2m_wifi_set_gain_table_idx(uint8 u8GainTableIdx)
Set the Gain table index corresponding to specific WiFi region.
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...
tstrM2mWifiGainsParams
Gain Values.
Definition: m2m_types.h:1407
tstrTlsCrlInfo
Certificate revocation list details.
Definition: m2m_types.h:2963
m2m_wifi_enable_dhcp
NMI_API sint8 m2m_wifi_enable_dhcp(uint8 u8DhcpEn)
Enable/Disable the DHCP client after connection.
m2m_wifi_get_sleep_mode
NMI_API uint8 m2m_wifi_get_sleep_mode(void)
Synchronous power save mode retrieval function.
m2m_wifi_request_scan_ssid_list
NMI_API sint8 m2m_wifi_request_scan_ssid_list(uint8 ch, uint8 *u8Ssidlist)
Asynchronous wi-fi scan request on the given channel and the hidden scan list.
tenu1xOption
tenu1xOption
Definition: m2m_wifi.h:288
tstrNetworkId::pu8Ssid
uint8 * pu8Ssid
Definition: m2m_wifi.h:396
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's network scanning functions.
tstrAuth1xMschap2::u16PasswordLen
uint16 u16PasswordLen
Definition: m2m_wifi.h:470
WIFI_STATE_START
Definition: m2m_wifi.h:263
tstrAuthPsk::pu8Passphrase
uint8 * pu8Passphrase
Definition: m2m_wifi.h:424
m2m_wifi_conf_auto_rate
NMI_API sint8 m2m_wifi_conf_auto_rate(tstrConfAutoRate *pstrConfAutoRate)
Configures WLAN automatic TX rate adaptation algorithm.
m2m_wifi_request_sleep
NMI_API sint8 m2m_wifi_request_sleep(uint32 u32SlpReqTime)
API to place the WINC IC into sleep mode for a specified period of time.
WIFI_1X_SPECIFIC_ROOTCERT
Definition: m2m_wifi.h:300
tstrWifiInitParam::pfAppWifiCb
tpfAppWifiCb pfAppWifiCb
Definition: m2m_wifi.h:387
m2m_wifi_disable_ap
NMI_API sint8 m2m_wifi_disable_ap(void)
Synchronous API to disable access point mode on the WINC IC.
tenuCredStoreOption
tenuCredStoreOption
Definition: m2m_wifi.h:267
tstrAuth1xTls::bUnencryptedUserName
bool bUnencryptedUserName
Definition: m2m_wifi.h:525
m2m_wifi_delete_sc
sint8 m2m_wifi_delete_sc(char *pcSsid, uint8 u8SsidLen)
Asynchronous API that deletes connection credentials (PSK, WEP key, 802.1X password) from WINC flash...
uint8
unsigned char uint8
Range of values between 0 to 255.
Definition: nm_bsp.h:100
m2m_wifi_configure_sntp
NMI_API sint8 m2m_wifi_configure_sntp(uint8 *pu8NTPServerName, uint8 u8NTPServerNameLength, tenuSNTPUseDHCP useDHCP)
Configures what NTP server the SNTP client should use.
m2m_wifi_set_system_time
NMI_API sint8 m2m_wifi_set_system_time(uint32 u32UTCSeconds)
Function for setting the system time within the WINC IC.
tstr1xAuthCredentials
Definition: m2m_wifi.h:415
tenuM2mScanCh
tenuM2mScanCh
Wi-Fi RF Channels.
Definition: m2m_types.h:1260
uint16
unsigned short uint16
Range of values between 0 to 65535.
Definition: nm_bsp.h:107
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:206
tstrAuth1xMschap2::pu8Domain
uint8 * pu8Domain
Definition: m2m_wifi.h:444
m2m_wifi_download_mode
NMI_API sint8 m2m_wifi_download_mode(void)
Prepares the WINC board before downloading any data (Firmware, Certificates, etc).
m2m_wifi_enable_ap_ext
NMI_API sint8 m2m_wifi_enable_ap_ext(CONST tstrM2MAPModeConfig *pstrM2MAPModeConfig)
Asynchronous API to enable access point (AKA "hot-spot") mode on the WINC IC with extended options...
Generated on Tue Sep 27 2022 16:17:30 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: nm_bsp.h Source File

nm_bsp.h
1
57 #ifndef _NM_BSP_H_
58 #define _NM_BSP_H_
59
60 #define NMI_API
61
64 #define CONST const
65
70 #ifndef NULL
71 #define NULL ((void*)0)
72 #endif
73
77 #define BSP_MIN(x,y) ((x)>(y)?(y):(x))
78 //BSPDefine
82
92 typedef void (*tpfNmBspIsr)(void);
93
99 typedef unsigned char uint8;
100
106 typedef unsigned short uint16;
107
113 typedef unsigned long uint32;
114
120 typedef signed char sint8;
121
127 typedef signed short sint16;
128
134 typedef signed long sint32; //DataTypes
136
137 #ifndef CORTUS_APP
138
139 #ifdef __cplusplus
140 extern "C" {
141 #endif
142
170 sint8 nm_bsp_init(void); //NmBspInitFn
172
173
195 sint8 nm_bsp_deinit(void); //NmBspDeinitFn
197
224 void nm_bsp_reset(void); //NmBspResetFn
226
246 void nm_bsp_sleep(uint32 u32TimeMsec); //NmBspSleepFn
248
269 void nm_bsp_register_isr(tpfNmBspIsr pfIsr); //NmBspRegisterFn
271
291 void nm_bsp_interrupt_ctrl(uint8 u8Enable); //NmBspInterruptCtrl
293
294 #ifdef __cplusplus
295 }
296 #endif
297
298 #endif
299
304 #ifdef _NM_BSP_BIG_END
305
306 #define NM_BSP_B_L_32(x) \
307 ((((x) & 0x000000FF) << 24) + \
308 (((x) & 0x0000FF00) << 8) + \
309 (((x) & 0x00FF0000) >> 8) + \
310 (((x) & 0xFF000000) >> 24))
311
313 #define NM_BSP_B_L_16(x) \
314 ((((x) & 0x00FF) << 8) + \
315 (((x) & 0xFF00) >> 8))
316 #else
317
318 #define NM_BSP_B_L_32(x) (x)
319
320 #define NM_BSP_B_L_16(x) (x)
321 #endif
322 //BSPDefine
323
324 #endif /*_NM_BSP_H_*/
nm_bsp_sleep
void nm_bsp_sleep(uint32 u32TimeMsec)
Used to put the host to sleep for the specified duration (in milliseconds). Forcing the host to sleep...
nm_bsp_interrupt_ctrl
void nm_bsp_interrupt_ctrl(uint8 u8Enable)
Enable/Disable interrupts from the WINC.
nm_bsp_init
sint8 nm_bsp_init(void)
This function is used to initialize the Board Support Package (BSP) in order to prepare the WINC befo...
uint32
unsigned long uint32
Range of values between 0 to 4294967295.
Definition: nm_bsp.h:114
sint32
signed long sint32
Range of values between -2147483648 to 2147483647.
Definition: nm_bsp.h:135
nm_bsp_reset
void nm_bsp_reset(void)
Performs a hardware reset to the WINC board.
sint8
signed char sint8
Range of values between -128 to 127.
Definition: nm_bsp.h:121
nm_bsp_register_isr
void nm_bsp_register_isr(tpfNmBspIsr pfIsr)
Register the host interface interrupt service routine.
sint16
signed short sint16
Range of values between -32768 to 32767.
Definition: nm_bsp.h:128
nm_bsp_deinit
sint8 nm_bsp_deinit(void)
This function is used to de-initialize the BSP and turn off the WINC board.
uint8
unsigned char uint8
Range of values between 0 to 255.
Definition: nm_bsp.h:100
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:93
uint16
unsigned short uint16
Range of values between 0 to 65535.
Definition: nm_bsp.h:107
Generated on Tue Sep 27 2022 16:17:30 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: nm_common.h Source File

nm_common.h
1
49 #ifndef _NM_COMMON_H_
50 #define _NM_COMMON_H_
51
52 #include "bsp/include/nm_bsp.h"
53 #include "common/include/nm_debug.h"
54
58 #define M2M_TIME_OUT_DELAY 10000
59
60 /*states*/
61 #define M2M_SUCCESS ((sint8)0)
62 #define M2M_ERR_SEND ((sint8)-1)
63 #define M2M_ERR_RCV ((sint8)-2)
64 #define M2M_ERR_MEM_ALLOC ((sint8)-3)
65 #define M2M_ERR_TIME_OUT ((sint8)-4)
66 #define M2M_ERR_INIT ((sint8)-5)
67 #define M2M_ERR_BUS_FAIL ((sint8)-6)
68 #define M2M_NOT_YET ((sint8)-7)
69 #define M2M_ERR_FIRMWARE ((sint8)-8)
70 #define M2M_SPI_FAIL ((sint8)-9)
71 #define M2M_ERR_FIRMWARE_bURN ((sint8)-10)
72 #define M2M_ACK ((sint8)-11)
73 #define M2M_ERR_FAIL ((sint8)-12)
74 #define M2M_ERR_FW_VER_MISMATCH ((sint8)-13)
75 #define M2M_ERR_SCAN_IN_PROGRESS ((sint8)-14)
76
77 /* Invalid argument */
78 #define M2M_ERR_INVALID_ARG ((sint8)-15)
79 #define M2M_ERR_INVALID ((sint8)-16)
80
81 /* I2C MASTER ERR */
82 #define I2C_ERR_LARGE_ADDRESS 0xE1UL
83 #define I2C_ERR_TX_ABRT 0xE2UL
84 #define I2C_ERR_OVER_SIZE 0xE3UL
85 #define ERR_PREFIX_NMIS 0xE4UL
86 #define ERR_FIRMWARE_EXCEED_SIZE 0xE5UL
88 #define PROGRAM_START 0x26961735UL
89 #define BOOT_SUCCESS 0x10add09eUL
90 #define BOOT_START 0x12345678UL
91
92 #define NBIT31 (0x80000000)
93 #define NBIT30 (0x40000000)
94 #define NBIT29 (0x20000000)
95 #define NBIT28 (0x10000000)
96 #define NBIT27 (0x08000000)
97 #define NBIT26 (0x04000000)
98 #define NBIT25 (0x02000000)
99 #define NBIT24 (0x01000000)
100 #define NBIT23 (0x00800000)
101 #define NBIT22 (0x00400000)
102 #define NBIT21 (0x00200000)
103 #define NBIT20 (0x00100000)
104 #define NBIT19 (0x00080000)
105 #define NBIT18 (0x00040000)
106 #define NBIT17 (0x00020000)
107 #define NBIT16 (0x00010000)
108 #define NBIT15 (0x00008000)
109 #define NBIT14 (0x00004000)
110 #define NBIT13 (0x00002000)
111 #define NBIT12 (0x00001000)
112 #define NBIT11 (0x00000800)
113 #define NBIT10 (0x00000400)
114 #define NBIT9 (0x00000200)
115 #define NBIT8 (0x00000100)
116 #define NBIT7 (0x00000080)
117 #define NBIT6 (0x00000040)
118 #define NBIT5 (0x00000020)
119 #define NBIT4 (0x00000010)
120 #define NBIT3 (0x00000008)
121 #define NBIT2 (0x00000004)
122 #define NBIT1 (0x00000002)
123 #define NBIT0 (0x00000001)
124
126 #define M2M_MAX(A,B) ((A) > (B) ? (A) : (B))
127
128 #define M2M_SEL(x,m1,m2,m3) ((x>1)?((x>2)?(m3):(m2)):(m1))
129
130 #define WORD_ALIGN(val) (((val) & 0x03) ? ((val) + 4 - ((val) & 0x03)) : (val))
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
171 NMI_API void m2m_memcpy(uint8 *pDst, uint8 *pSrc, uint32 sz);
172
185 NMI_API void m2m_memset(uint8 *pBuf, uint8 val, uint32 sz);
186
195 NMI_API uint16 m2m_strlen(uint8 *pcStr);
196
209 NMI_API sint8 m2m_memcmp(uint8 *pu8Buff1, uint8 *pu8Buff2, uint32 u32Size);
210
223 NMI_API uint8 m2m_strncmp(uint8 *pcS1, uint8 *pcS2, uint16 u16Len);
224
235 NMI_API uint8 *m2m_strstr(uint8 *pcIn, uint8 *pcStr);
236
247 NMI_API uint8 m2m_checksum(uint8 *buf, int sz);
248
261 sint8 hexstr_2_bytes(uint8 *pu8Out, uint8 *pu8In, uint8 u8SizeOut);
262
268 NMI_API void (*at_sb_printf)(const char *_format, ...);
269 #ifdef __cplusplus
270 }
271 #endif
272 #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:268
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:114
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:60
m2m_strlen
NMI_API uint16 m2m_strlen(uint8 *pcStr)
Returns the length of a null terminated string buffer.
sint8
signed char sint8
Range of values between -128 to 127.
Definition: nm_bsp.h:121
hexstr_2_bytes
sint8 hexstr_2_bytes(uint8 *pu8Out, uint8 *pu8In, uint8 u8SizeOut)
Converts a string of hex characters to bytes.
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:100
uint16
unsigned short uint16
Range of values between 0 to 65535.
Definition: nm_bsp.h:107
Generated on Tue Sep 27 2022 16:17:30 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: Related Pages

Related Pages
Here is a list of all related documentation pages:
License
Generated on Tue Sep 27 2022 16:17:33 for WINC1500 IoT Software APIs by doxygen 1.8.10


WINC1500 IoT Software APIs: socket.h Source File

socket.h
1
42 #ifndef __SOCKET_H__
43 #define __SOCKET_H__
44
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48
56 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
57 INCLUDES
58 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
59
60 #include "common/include/nm_common.h"
61 #include "driver/include/m2m_types.h"
62
63 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
64 MACROS
65 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
76 /*
77 * HOSTNAME_MAX_SIZE is defined here and also in host_drv/socket/include/m2m_socket_host_if.h
78 * The two definitions must match.
79 */
80 #define HOSTNAME_MAX_SIZE 64
81
86 #define SOCKET_BUFFER_MAX_LENGTH 1400
87
92 #define AF_INET 2
93
98 #define SOCK_STREAM 1
99
104 #define SOCK_DGRAM 2
105
110 #define SOCKET_FLAGS_SSL 0x01
111
119 #define SOCKET_CONFIG_SSL_OFF 0
120
124 #define SOCKET_CONFIG_SSL_ON 1
125
130 #define SOCKET_CONFIG_SSL_DELAY 2
131
139 #define TCP_SOCK_MAX (7)
140
144 #define UDP_SOCK_MAX 4
145
149 #define MAX_SOCKET (TCP_SOCK_MAX + UDP_SOCK_MAX)
150
154 #define SOL_SOCKET 1
155
160 #define SOL_SSL_SOCKET 2
161
166 #define SO_SET_UDP_SEND_CALLBACK 0x00
167
181 #define IP_ADD_MEMBERSHIP 0x01
182
187 #define IP_DROP_MEMBERSHIP 0x02
188
193 #define SO_TCP_KEEPALIVE 0x04
194
207 #define SO_TCP_KEEPIDLE 0x05
208
220 #define SO_TCP_KEEPINTVL 0x06
221
233 #define SO_TCP_KEEPCNT 0x07
234 //IPDefines
246
247
251 #define ALPN_LIST_MAX_APP_LENGTH 30
252 // TLSDefines
257
271 #define SO_SSL_BYPASS_X509_VERIF 0x01
272
286 #define SO_SSL_SNI 0x02
287
298 #define SO_SSL_ENABLE_SESSION_CACHING 0x03
299
313 #define SO_SSL_ENABLE_SNI_VALIDATION 0x04
314
327 #define SO_SSL_ALPN 0x05
328 //SSLSocketOptions
336
344 #define SSL_ENABLE_RSA_SHA_SUITES 0x01
345
350 #define SSL_ENABLE_RSA_SHA256_SUITES 0x02
351
356 #define SSL_ENABLE_DHE_SHA_SUITES 0x04
357
362 #define SSL_ENABLE_DHE_SHA256_SUITES 0x08
363
368 #define SSL_ENABLE_RSA_GCM_SUITES 0x10
369
374 #define SSL_ENABLE_DHE_GCM_SUITES 0x20
375
380 #define SSL_ENABLE_ALL_SUITES 0x0000003F
381 //LegacySSLCipherSuite
385
394 #define SSL_CIPHER_RSA_WITH_AES_128_CBC_SHA NBIT0
395 #define SSL_CIPHER_RSA_WITH_AES_128_CBC_SHA256 NBIT1
396 #define SSL_CIPHER_DHE_RSA_WITH_AES_128_CBC_SHA NBIT2
397 #define SSL_CIPHER_DHE_RSA_WITH_AES_128_CBC_SHA256 NBIT3
398 #define SSL_CIPHER_RSA_WITH_AES_128_GCM_SHA256 NBIT4
399 #define SSL_CIPHER_DHE_RSA_WITH_AES_128_GCM_SHA256 NBIT5
400 #define SSL_CIPHER_RSA_WITH_AES_256_CBC_SHA NBIT6
401 #define SSL_CIPHER_RSA_WITH_AES_256_CBC_SHA256 NBIT7
402 #define SSL_CIPHER_DHE_RSA_WITH_AES_256_CBC_SHA NBIT8
403 #define SSL_CIPHER_DHE_RSA_WITH_AES_256_CBC_SHA256 NBIT9
404 #define SSL_CIPHER_ECDHE_RSA_WITH_AES_128_CBC_SHA NBIT10
405 #define SSL_CIPHER_ECDHE_RSA_WITH_AES_256_CBC_SHA NBIT11
406 #define SSL_CIPHER_ECDHE_RSA_WITH_AES_128_CBC_SHA256 NBIT12
407 #define SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 NBIT13
408 #define SSL_CIPHER_ECDHE_RSA_WITH_AES_128_GCM_SHA256 NBIT14
409 #define SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 NBIT15
410
411 #define SSL_ECC_ONLY_CIPHERS \
412 (\
413 SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 | \
414 SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 \
415 )
416
421 #define SSL_ECC_ALL_CIPHERS \
422 (\
423 SSL_CIPHER_ECDHE_RSA_WITH_AES_128_CBC_SHA | \
424 SSL_CIPHER_ECDHE_RSA_WITH_AES_128_CBC_SHA256 | \
425 SSL_CIPHER_ECDHE_RSA_WITH_AES_128_GCM_SHA256 | \
426 SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 | \
427 SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 \
428 )
429
435 #define SSL_NON_ECC_CIPHERS_AES_128 \
436 (\
437 SSL_CIPHER_RSA_WITH_AES_128_CBC_SHA | \
438 SSL_CIPHER_RSA_WITH_AES_128_CBC_SHA256 | \
439 SSL_CIPHER_DHE_RSA_WITH_AES_128_CBC_SHA | \
440 SSL_CIPHER_DHE_RSA_WITH_AES_128_CBC_SHA256 | \
441 SSL_CIPHER_RSA_WITH_AES_128_GCM_SHA256 | \
442 SSL_CIPHER_DHE_RSA_WITH_AES_128_GCM_SHA256 \
443 )
444
448 #define SSL_ECC_CIPHERS_AES_256 \
449 (\
450 SSL_CIPHER_ECDHE_RSA_WITH_AES_256_CBC_SHA \
451 )
452
456 #define SSL_NON_ECC_CIPHERS_AES_256 \
457 (\
458 SSL_CIPHER_RSA_WITH_AES_256_CBC_SHA | \
459 SSL_CIPHER_RSA_WITH_AES_256_CBC_SHA256 | \
460 SSL_CIPHER_DHE_RSA_WITH_AES_256_CBC_SHA | \
461 SSL_CIPHER_DHE_RSA_WITH_AES_256_CBC_SHA256 \
462 )
463
470 #define SSL_CIPHER_ALL \
471 (\
472 SSL_CIPHER_RSA_WITH_AES_128_CBC_SHA | \
473 SSL_CIPHER_RSA_WITH_AES_128_CBC_SHA256 | \
474 SSL_CIPHER_DHE_RSA_WITH_AES_128_CBC_SHA | \
475 SSL_CIPHER_DHE_RSA_WITH_AES_128_CBC_SHA256 | \
476 SSL_CIPHER_RSA_WITH_AES_128_GCM_SHA256 | \
477 SSL_CIPHER_DHE_RSA_WITH_AES_128_GCM_SHA256 | \
478 SSL_CIPHER_RSA_WITH_AES_256_CBC_SHA | \
479 SSL_CIPHER_RSA_WITH_AES_256_CBC_SHA256 | \
480 SSL_CIPHER_DHE_RSA_WITH_AES_256_CBC_SHA | \
481 SSL_CIPHER_DHE_RSA_WITH_AES_256_CBC_SHA256 | \
482 SSL_CIPHER_ECDHE_RSA_WITH_AES_128_CBC_SHA | \
483 SSL_CIPHER_ECDHE_RSA_WITH_AES_128_CBC_SHA256 | \
484 SSL_CIPHER_ECDHE_RSA_WITH_AES_128_GCM_SHA256 | \
485 SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 | \
486 SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 | \
487 SSL_CIPHER_ECDHE_RSA_WITH_AES_256_CBC_SHA \
488 )
489 //SSLCipherSuiteID
493
494 /**************
495 Socket Errors
496 **************/
503 #define SOCK_ERR_NO_ERROR 0
504
509 #define SOCK_ERR_INVALID_ADDRESS -1
510
515 #define SOCK_ERR_ADDR_ALREADY_IN_USE -2
516
522 #define SOCK_ERR_MAX_TCP_SOCK -3
523
528 #define SOCK_ERR_MAX_UDP_SOCK -4
529
534 #define SOCK_ERR_INVALID_ARG -6
535
539 #define SOCK_ERR_MAX_LISTEN_SOCK -7
540
545 #define SOCK_ERR_INVALID -9
546
551 #define SOCK_ERR_ADDR_IS_REQUIRED -11
552
557 #define SOCK_ERR_CONN_ABORTED -12
558
562 #define SOCK_ERR_TIMEOUT -13
563
567 #define SOCK_ERR_BUFFER_FULL -14
568 //SocketErrorCode
572
578 #ifdef _NM_BSP_BIG_END
579 #define _htonl(m) (m)
580 #define _htons(A) (A)
581
582 #else
583
584 #define _htonl(m) \
585 (uint32)(((uint32)(m << 24)) | ((uint32)((m & 0x0000FF00) << 8)) | ((uint32)((m & 0x00FF0000) >> 8)) | ((uint32)(((uint32)m) >> 24)))
586
590 #define _htons(A) (uint16)((((uint16) (A)) << 8) | (((uint16) (A)) >> 8))
591
594 #endif
595
596 #define _ntohl _htonl
597
601 #define _ntohs _htons
602 //SOCKETBYTEORDER
606
607 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
608 DATA TYPES
609 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
624 typedef sint8 SOCKET;
625
636 typedef enum {
637 SOCKET_ERR_UNKNOWN = 0,
641 SOCKET_ERR_TLS_REMOTE,
645 SOCKET_ERR_TLS_LOCAL
649 } tenuSockErrSource;
650
651
663 typedef struct {
664 uint32 s_addr;
669 } in_addr;
670
681 struct sockaddr {
682 uint16 sa_family;
686 uint8 sa_data[14];
690 };
691
700 struct sockaddr_in {
701 uint16 sin_family;
707 uint16 sin_port;
714 in_addr sin_addr;
720 uint8 sin_zero[8];
724 };
725
733 typedef struct {
734 tenuSockErrSource enuErrSource;
738 uint8 u8ErrCode;
743 } tstrSockErr; //SocketEnums
745
772 typedef enum {
773 SOCKET_MSG_BIND = 1,
777 SOCKET_MSG_LISTEN,
781 SOCKET_MSG_DNS_RESOLVE,
785 SOCKET_MSG_ACCEPT,
789 SOCKET_MSG_CONNECT,
793 SOCKET_MSG_RECV,
797 SOCKET_MSG_SEND,
801 SOCKET_MSG_SENDTO,
805 SOCKET_MSG_RECVFROM,
809 SOCKET_MSG_SECURE
813 } tenuSocketCallbackMsgType;
814
826 typedef struct {
827 sint8 status;
833 } tstrSocketBindMsg;
834
846 typedef struct {
847 sint8 status;
852 } tstrSocketListenMsg;
853
863 typedef struct {
864 SOCKET sock;
869 struct sockaddr_in strAddr;
873 } tstrSocketAcceptMsg;
874
886 typedef struct {
887 SOCKET sock;
891 sint8 s8Error;
897 } tstrSocketConnectMsg;
898
916 typedef struct {
917 uint8 *pu8Buffer;
921 sint16 s16BufferSize;
926 uint16 u16RemainingSize;
930 struct sockaddr_in strRemoteAddr;
934 } tstrSocketRecvMsg; //AsyncCallback
936
983 typedef void (*tpfAppSocketCb)(SOCKET sock, uint8 u8Msg, void *pvMsg);
984
1000 typedef void (*tpfAppResolveCb)(uint8 *pu8DomainName, uint32 u32ServerIP);
1001
1023 typedef void (*tpfPingCb)(uint32 u32IPAddr, uint32 u32RTT, uint8 u8ErrorCode); //SocketCallbacks
1025
1026 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
1027 FUNCTION PROTOTYPES
1028 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
1090 NMI_API void socketInit(void); //SocketInitializationFn
1092
1106 NMI_API void socketDeinit(void); //SocketDeInitializationFn
1108
1122 NMI_API uint8 IsSocketReady(void); //SocketStateFn
1124
1204 NMI_API void registerSocketCallback(tpfAppSocketCb socket_cb, tpfAppResolveCb resolve_cb); //SocketCallbackFn
1206
1294 NMI_API SOCKET socket(uint16 u16Domain, uint8 u8Type, uint8 u8Config); //SocketFn
1296
1372 NMI_API sint8 bind(SOCKET sock, struct sockaddr *pstrAddr, uint8 u8AddrLen); //BindFn
1374
1492 NMI_API sint8 listen(SOCKET sock, uint8 backlog); //ListenFn
1494
1523 NMI_API sint8 accept(SOCKET sock, struct sockaddr *addr, uint8 *addrlen); //AcceptFn
1525
1632 NMI_API sint8 connect(SOCKET sock, struct sockaddr *pstrAddr, uint8 u8AddrLen);
1633 //ConnectFn
1635
1673 sint8 secure(SOCKET sock);
1674 //SecureFn
1676
1781 NMI_API sint16 recv(SOCKET sock, void *pvRecvBuf, uint16 u16BufLen, uint32 u32Timeoutmsec); //ReceiveFn
1783
1894 NMI_API sint16 recvfrom(SOCKET sock, void *pvRecvBuf, uint16 u16BufLen, uint32 u32Timeoutmsec); //ReceiveFromSocketFn
1896
1958 NMI_API sint16 send(SOCKET sock, void *pvSendBuffer, uint16 u16SendLength, uint16 u16Flags); //SendFn
1960
2018 NMI_API sint16 sendto(SOCKET sock, void *pvSendBuffer, uint16 u16SendLength, uint16 flags, struct sockaddr *pstrDestAddr, uint8 u8AddrLen); //SendToSocketFn
2020
2048 NMI_API sint8 close(SOCKET sock); //CloseSocketFn
2050
2071 NMI_API uint32 nmi_inet_addr(char *pcIpAddr); //InetAddressFn
2073
2099 NMI_API sint8 gethostbyname(uint8 *pcHostName); //gethostbynameFn
2101
2119 NMI_API sint8 sslEnableCertExpirationCheck(tenuSslCertExpSettings enuValidationSetting); //sslEnableCertExpirationCheckFn
2121
2166 NMI_API sint8 setsockopt(SOCKET socket, uint8 u8Level, uint8 option_name,
2167 const void *option_value, uint16 u16OptionLen); //SetSocketOptionFn
2169
2195 NMI_API sint8 getsockopt(SOCKET sock, uint8 u8Level, uint8 u8OptName, const void *pvOptValue, uint8 *pu8OptLen); //GetSocketOptionsFn
2197
2223 NMI_API sint8 m2m_ping_req(uint32 u32DstIP, uint8 u8TTL, tpfPingCb fpPingCb);
2224
2292 sint8 set_alpn_list(SOCKET sock, const char *pcProtocolList);
2311 sint8 get_alpn_index(SOCKET sock);
2312
2331 sint8 get_error_detail(SOCKET sock, tstrSockErr *pstrErr); //PingFn
2333
2334 #ifdef __cplusplus
2335 }
2336 #endif /* __cplusplus */
2337
2338 #endif /* __SOCKET_H__ */
gethostbyname
NMI_API sint8 gethostbyname(uint8 *pcHostName)
listen
NMI_API sint8 listen(SOCKET sock, uint8 backlog)
sockaddr_in::sin_family
uint16 sin_family
Definition: socket.h:704
SOCKET_ERR_TLS_REMOTE
Definition: socket.h:644
SOCKET_MSG_SENDTO
Definition: socket.h:804
getsockopt
NMI_API sint8 getsockopt(SOCKET sock, uint8 u8Level, uint8 u8OptName, const void *pvOptValue, uint8 *pu8OptLen)
SOCKET_MSG_CONNECT
Definition: socket.h:792
accept
NMI_API sint8 accept(SOCKET sock, struct sockaddr *addr, uint8 *addrlen)
tstrSocketBindMsg
Socket bind status.
Definition: socket.h:829
tstrSocketRecvMsg
Socket recv status.
Definition: socket.h:919
SOCKET_ERR_TLS_LOCAL
Definition: socket.h:648
sockaddr_in::sin_zero
uint8 sin_zero[8]
Definition: socket.h:723
registerSocketCallback
NMI_API void registerSocketCallback(tpfAppSocketCb socket_cb, tpfAppResolveCb resolve_cb)
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:986
sockaddr_in
Socket address structure for IPV4 addresses. Used to specify socket address information to connect to...
Definition: socket.h:703
SOCKET_MSG_ACCEPT
Definition: socket.h:788
sockaddr_in::sin_port
uint16 sin_port
Definition: socket.h:710
recvfrom
NMI_API sint16 recvfrom(SOCKET sock, void *pvRecvBuf, uint16 u16BufLen, uint32 u32Timeoutmsec)
SOCKET_MSG_LISTEN
Definition: socket.h:780
SOCKET_MSG_SECURE
Definition: socket.h:812
tpfAppResolveCb
void(* tpfAppResolveCb)(uint8 *pu8DomainName, uint32 u32ServerIP)
DNS resolution callback function. Applications requiring DNS resolution should register their callba...
Definition: socket.h:1003
connect
NMI_API sint8 connect(SOCKET sock, struct sockaddr *pstrAddr, uint8 u8AddrLen)
socketDeinit
NMI_API void socketDeinit(void)
Socket Layer De-initialization.
tstrSocketAcceptMsg
Socket accept status.
Definition: socket.h:866
SOCKET
sint8 SOCKET
Definition for socket handler data type. Socket ID,used with all socket operations to uniquely identi...
Definition: socket.h:627
tstrSocketListenMsg
Socket listen status.
Definition: socket.h:849
set_alpn_list
sint8 set_alpn_list(SOCKET sock, const char *pcProtocolList)
sockaddr
Generic socket address structure.
Definition: socket.h:684
tenuSockErrSource
tenuSockErrSource
Source of socket error (local, remote or unknown).
Definition: socket.h:639
tenuSslCertExpSettings
tenuSslCertExpSettings
SSL Certificate Expiry Validation Options.
Definition: m2m_types.h:2982
sockaddr_in::sin_addr
in_addr sin_addr
Definition: socket.h:717
uint32
unsigned long uint32
Range of values between 0 to 4294967295.
Definition: nm_bsp.h:114
in_addr
IPv4 address representation.
Definition: socket.h:666
SOCKET_MSG_RECVFROM
Definition: socket.h:808
secure
sint8 secure(SOCKET sock)
NMI_API
#define NMI_API
Definition: nm_bsp.h:60
sockaddr::sa_data
uint8 sa_data[14]
Definition: socket.h:689
close
NMI_API sint8 close(SOCKET sock)
get_alpn_index
sint8 get_alpn_index(SOCKET sock)
sint8
signed char sint8
Range of values between -128 to 127.
Definition: nm_bsp.h:121
send
NMI_API sint16 send(SOCKET sock, void *pvSendBuffer, uint16 u16SendLength, uint16 u16Flags)
recv
NMI_API sint16 recv(SOCKET sock, void *pvRecvBuf, uint16 u16BufLen, uint32 u32Timeoutmsec)
tstrSocketConnectMsg
Socket connect status.
Definition: socket.h:889
sint16
signed short sint16
Range of values between -32768 to 32767.
Definition: nm_bsp.h:128
SOCKET_MSG_BIND
Definition: socket.h:776
SOCKET_ERR_UNKNOWN
Definition: socket.h:640
get_error_detail
sint8 get_error_detail(SOCKET sock, tstrSockErr *pstrErr)
SOCKET_MSG_DNS_RESOLVE
Definition: socket.h:784
sslEnableCertExpirationCheck
NMI_API sint8 sslEnableCertExpirationCheck(tenuSslCertExpSettings enuValidationSetting)
sockaddr::sa_family
uint16 sa_family
Definition: socket.h:685
sendto
NMI_API sint16 sendto(SOCKET sock, void *pvSendBuffer, uint16 u16SendLength, uint16 flags, struct sockaddr *pstrDestAddr, uint8 u8AddrLen)
bind
NMI_API sint8 bind(SOCKET sock, struct sockaddr *pstrAddr, uint8 u8AddrLen)
setsockopt
NMI_API sint8 setsockopt(SOCKET socket, uint8 u8Level, uint8 option_name, const void *option_value, uint16 u16OptionLen)
IsSocketReady
NMI_API uint8 IsSocketReady(void)
socket
NMI_API SOCKET socket(uint16 u16Domain, uint8 u8Type, uint8 u8Config)
tstrSockErr
Detail about socket failures. Used with get_error_detail.
Definition: socket.h:736
socketInit
NMI_API void socketInit(void)
m2m_ping_req
NMI_API sint8 m2m_ping_req(uint32 u32DstIP, uint8 u8TTL, tpfPingCb fpPingCb)
nmi_inet_addr
NMI_API uint32 nmi_inet_addr(char *pcIpAddr)
uint8
unsigned char uint8
Range of values between 0 to 255.
Definition: nm_bsp.h:100
tenuSocketCallbackMsgType
tenuSocketCallbackMsgType
Asynchronous APIs make use of callback functions in-order to return back the results once the corresp...
Definition: socket.h:775
uint16
unsigned short uint16
Range of values between 0 to 65535.
Definition: nm_bsp.h:107
tpfPingCb
void(* tpfPingCb)(uint32 u32IPAddr, uint32 u32RTT, uint8 u8ErrorCode)
PING Callback.
Definition: socket.h:1026
SOCKET_MSG_RECV
Definition: socket.h:796
SOCKET_MSG_SEND
Definition: socket.h:800
Generated on Tue Sep 27 2022 16:17:30 for WINC1500 IoT Software APIs by doxygen 1.8.10