NNN50 WIFI_API library

Dependents:   NNN50_CE_Test_UDP NNN50_linux_firmware NNN50_SoftAP_HelloWorld NNN50_BLEWIFISensor ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers m2m_types.h Source File

m2m_types.h

Go to the documentation of this file.
00001 /**
00002  *
00003  * \file
00004  *
00005  * \brief WINC Application Interface Internal Types.
00006  *
00007  * Copyright (c) 2016-2017 Atmel Corporation. All rights reserved.
00008  *
00009  * \asf_license_start
00010  *
00011  * \page License
00012  *
00013  * Redistribution and use in source and binary forms, with or without
00014  * modification, are permitted provided that the following conditions are met:
00015  *
00016  * 1. Redistributions of source code must retain the above copyright notice,
00017  *    this list of conditions and the following disclaimer.
00018  *
00019  * 2. Redistributions in binary form must reproduce the above copyright notice,
00020  *    this list of conditions and the following disclaimer in the documentation
00021  *    and/or other materials provided with the distribution.
00022  *
00023  * 3. The name of Atmel may not be used to endorse or promote products derived
00024  *    from this software without specific prior written permission.
00025  *
00026  * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
00027  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
00028  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
00029  * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
00030  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00031  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00032  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00033  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
00034  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
00035  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00036  * POSSIBILITY OF SUCH DAMAGE.
00037  *
00038  * \asf_license_stop
00039  *
00040  */
00041 
00042 #ifndef __M2M_WIFI_TYPES_H__
00043 #define __M2M_WIFI_TYPES_H__
00044 
00045 
00046 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
00047 INCLUDES
00048 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
00049 
00050 #ifndef _BOOT_
00051 #ifndef _FIRMWARE_
00052 #include "common/include/nm_common.h"
00053 #else
00054 #include "m2m_common.h"
00055 #endif
00056 #endif
00057 
00058 
00059 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
00060 MACROS
00061 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
00062 /**@defgroup  WlanDefines Defines
00063  * @ingroup m2m_wifi
00064  */
00065 /**@{*/
00066 #define M2M_MAJOR_SHIFT (8)
00067 #define M2M_MINOR_SHIFT (4)
00068 #define M2M_PATCH_SHIFT (0)
00069 
00070 #define M2M_DRV_VERSION_SHIFT (16)
00071 #define M2M_FW_VERSION_SHIFT (0)
00072 
00073 #define M2M_GET_MAJOR(ver_info_hword) ((uint8)((ver_info_hword) >> M2M_MAJOR_SHIFT) & 0xff)
00074 #define M2M_GET_MINOR(ver_info_hword) ((uint8)((ver_info_hword) >> M2M_MINOR_SHIFT) & 0x0f)
00075 #define M2M_GET_PATCH(ver_info_hword) ((uint8)((ver_info_hword) >> M2M_PATCH_SHIFT) & 0x0f)
00076 
00077 #define M2M_GET_FW_VER(ver_info_word)  ((uint16) ((ver_info_word) >> M2M_FW_VERSION_SHIFT))
00078 #define M2M_GET_DRV_VER(ver_info_word) ((uint16) ((ver_info_word) >> M2M_DRV_VERSION_SHIFT))
00079 
00080 #define M2M_GET_DRV_MAJOR(ver_info_word) M2M_GET_MAJOR(M2M_GET_DRV_VER(ver_info_word))
00081 #define M2M_GET_DRV_MINOR(ver_info_word) M2M_GET_MINOR(M2M_GET_DRV_VER(ver_info_word))
00082 #define M2M_GET_DRV_PATCH(ver_info_word) M2M_GET_PATCH(M2M_GET_DRV_VER(ver_info_word))
00083 
00084 #define M2M_GET_FW_MAJOR(ver_info_word) M2M_GET_MAJOR(M2M_GET_FW_VER(ver_info_word))
00085 #define M2M_GET_FW_MINOR(ver_info_word) M2M_GET_MINOR(M2M_GET_FW_VER(ver_info_word))
00086 #define M2M_GET_FW_PATCH(ver_info_word) M2M_GET_PATCH(M2M_GET_FW_VER(ver_info_word))
00087 
00088 #define M2M_MAKE_VERSION(major, minor, patch) ( \
00089     ((uint16)((major)  & 0xff)  << M2M_MAJOR_SHIFT) | \
00090     ((uint16)((minor)  & 0x0f)  << M2M_MINOR_SHIFT) | \
00091     ((uint16)((patch)  & 0x0f)  << M2M_PATCH_SHIFT))
00092 
00093 #define M2M_MAKE_VERSION_INFO(fw_major, fw_minor, fw_patch, drv_major, drv_minor, drv_patch) \
00094     ( \
00095     ( ((uint32)M2M_MAKE_VERSION((fw_major),  (fw_minor),  (fw_patch)))  << M2M_FW_VERSION_SHIFT) | \
00096     ( ((uint32)M2M_MAKE_VERSION((drv_major), (drv_minor), (drv_patch))) << M2M_DRV_VERSION_SHIFT))
00097 
00098 #define REL_19_5_2_VER          M2M_MAKE_VERSION_INFO(19,5,2,19,3,0)
00099 #define REL_19_5_1_VER          M2M_MAKE_VERSION_INFO(19,5,1,19,3,0)
00100 #define REL_19_5_0_VER          M2M_MAKE_VERSION_INFO(19,5,0,19,3,0)
00101 #define REL_19_4_6_VER          M2M_MAKE_VERSION_INFO(19,4,6,19,3,0)
00102 #define REL_19_4_5_VER          M2M_MAKE_VERSION_INFO(19,4,5,19,3,0)
00103 #define REL_19_4_4_VER          M2M_MAKE_VERSION_INFO(19,4,4,19,3,0)
00104 #define REL_19_4_3_VER          M2M_MAKE_VERSION_INFO(19,4,3,19,3,0)
00105 #define REL_19_4_2_VER          M2M_MAKE_VERSION_INFO(19,4,2,19,3,0)
00106 #define REL_19_4_1_VER          M2M_MAKE_VERSION_INFO(19,4,1,19,3,0)
00107 #define REL_19_4_0_VER          M2M_MAKE_VERSION_INFO(19,4,0,19,3,0)
00108 #define REL_19_3_1_VER          M2M_MAKE_VERSION_INFO(19,3,1,19,3,0)
00109 #define REL_19_3_0_VER          M2M_MAKE_VERSION_INFO(19,3,0,19,3,0)
00110 #define REL_19_2_2_VER          M2M_MAKE_VERSION_INFO(19,2,2,19,2,0)
00111 #define REL_19_2_1_VER          M2M_MAKE_VERSION_INFO(19,2,1,19,2,0)
00112 #define REL_19_2_0_VER          M2M_MAKE_VERSION_INFO(19,2,0,19,2,0)
00113 #define REL_19_1_0_VER          M2M_MAKE_VERSION_INFO(19,1,0,18,2,0)
00114 #define REL_19_0_0_VER          M2M_MAKE_VERSION_INFO(19,0,0,18,1,1)
00115 
00116 /*======*======*======*======*
00117         FIRMWARE VERSION NO INFO
00118  *======*======*======*======*/
00119 
00120 #define M2M_RELEASE_VERSION_MAJOR_NO                        (19)
00121 /*!< Firmware Major release version number.
00122 */
00123 
00124 
00125 #define M2M_RELEASE_VERSION_MINOR_NO                        (5)
00126 /*!< Firmware Minor release version number.
00127 */
00128 
00129 #define M2M_RELEASE_VERSION_PATCH_NO                        (2)
00130 /*!< Firmware patch release version number.
00131 */
00132 
00133 /*======*======*======*======*
00134   SUPPORTED DRIVER VERSION NO INFO
00135  *======*======*======*======*/
00136 
00137 #define M2M_MIN_REQ_DRV_VERSION_MAJOR_NO                        (19)
00138 /*!< Driver Major release version number.
00139 */
00140 
00141 
00142 #define M2M_MIN_REQ_DRV_VERSION_MINOR_NO                        (3)
00143 /*!< Driver Minor release version number.
00144 */
00145 
00146 #define M2M_MIN_REQ_DRV_VERSION_PATCH_NO                        (0)
00147 /*!< Driver patch release version number.
00148 */
00149 
00150 #define M2M_MIN_REQ_DRV_SVN_VERSION                             (0)
00151 /*!< Driver svn version.
00152 */
00153 
00154 
00155 
00156 #if !defined(M2M_RELEASE_VERSION_MAJOR_NO) || !defined(M2M_RELEASE_VERSION_MINOR_NO)
00157 #error Undefined version number
00158 #endif
00159 
00160 #define M2M_BUFFER_MAX_SIZE                             (1600UL - 4)
00161 /*!< Maximum size for the shared packet buffer.
00162  */
00163 
00164 
00165 #define M2M_MAC_ADDRES_LEN                               6
00166 /*!< The size fo 802 MAC address.
00167  */
00168 
00169 #define M2M_ETHERNET_HDR_OFFSET                         34
00170 /*!< The offset of the Ethernet header within the WLAN Tx Buffer.
00171  */
00172 
00173 
00174 #define M2M_ETHERNET_HDR_LEN                            14
00175 /*!< Length of the Etherenet header in bytes.
00176 */
00177 
00178 
00179 #define M2M_MAX_SSID_LEN                                33
00180 /*!< Maximum size for the Wi-Fi SSID including the NULL termination.
00181  */
00182 
00183 
00184 #define M2M_MAX_PSK_LEN                                 65
00185 /*!< Maximum size for the WPA PSK including the NULL termination.
00186  */
00187 
00188 #define M2M_MIN_PSK_LEN                                 9
00189 /*!< Maximum size for the WPA PSK including the NULL termination.
00190  */
00191 
00192 #define M2M_DEVICE_NAME_MAX                             48
00193 /*!< Maximum Size for the device name including the NULL termination.
00194  */
00195 
00196 
00197 #define M2M_LISTEN_INTERVAL                             1
00198 /*!< The STA uses the Listen Interval parameter to indicate to the AP how
00199     many beacon intervals it shall sleep before it retrieves the queued frames
00200     from the AP. 
00201 */
00202 
00203 #define MAX_HIDDEN_SITES                                4
00204 /*!<
00205     max number of hidden SSID suuported by scan request
00206 */
00207 
00208 
00209 #define M2M_1X_USR_NAME_MAX                             21
00210 /*!< The maximum size of the user name including the NULL termination.
00211     It is used for RADIUS authentication in case of connecting the device to
00212     an AP secured with WPA-Enterprise.
00213 */
00214 
00215 
00216 #define M2M_1X_PWD_MAX                                  41
00217 /*!< The maximum size of the password including the NULL termination.
00218     It is used for RADIUS authentication in case of connecting the device to
00219     an AP secured with WPA-Enterprise.
00220 */
00221 
00222 #define M2M_CUST_IE_LEN_MAX                             252
00223 /*!< The maximum size of IE (Information Element).
00224 */
00225 
00226 #define PWR_DEFAULT                                        PWR_HIGH
00227 /*********************
00228  *
00229  * WIFI GROUP requests
00230  */
00231 
00232 #define M2M_CONFIG_CMD_BASE                                 1
00233 /*!< The base value of all the host configuration commands opcodes.
00234 */
00235 #define M2M_STA_CMD_BASE                                    40
00236 /*!< The base value of all the station mode host commands opcodes.
00237 */
00238 #define M2M_AP_CMD_BASE                                     70
00239 /*!< The base value of all the Access Point mode host commands opcodes.
00240 */
00241 #define M2M_P2P_CMD_BASE                                    90
00242 /*!< The base value of all the P2P mode host commands opcodes.
00243 */
00244 #define M2M_SERVER_CMD_BASE                                 100
00245 /*!< The base value of all the power save mode host commands codes.
00246 */
00247 /**********************
00248  * OTA GROUP requests
00249  */
00250 #define M2M_OTA_CMD_BASE                                    100
00251 /*!< The base value of all the OTA mode host commands opcodes.
00252  * The OTA Have special group so can extended from 1-M2M_MAX_GRP_NUM_REQ
00253 */
00254 /***********************
00255  *
00256  * CRYPTO group requests
00257  */
00258 #define M2M_CRYPTO_CMD_BASE                                 1
00259 /*!< The base value of all the crypto mode host commands opcodes.
00260  * The crypto Have special group so can extended from 1-M2M_MAX_GRP_NUM_REQ
00261 */
00262 
00263 #define M2M_MAX_GRP_NUM_REQ                                 (127)
00264 /*!< max number of request in one group equal to 127 as the last bit reserved for config or data pkt
00265 */
00266 
00267 #define WEP_40_KEY_STRING_SIZE                              ((uint8)10)
00268 /*!< Indicate the wep key size in bytes for 40 bit string passphrase.
00269 */
00270 
00271 #define WEP_104_KEY_STRING_SIZE                             ((uint8)26)
00272 /*!< Indicate the wep key size in bytes for 104 bit string passphrase.
00273 */
00274 #define WEP_KEY_MAX_INDEX                                   ((uint8)4)
00275 /*!< Indicate the max key index value for WEP authentication
00276 */
00277 #define M2M_SHA256_CONTEXT_BUFF_LEN                         (128)
00278 /*!< sha256 context size
00279 */
00280 #define M2M_SCAN_DEFAULT_NUM_SLOTS                          (2)
00281 /*!< The default. number of scan slots performed by the WINC board.
00282 */
00283 #define M2M_SCAN_DEFAULT_SLOT_TIME                          (30)
00284 /*!< The default. duration in miliseconds of a scan slots performed by the WINC board.
00285 */
00286 #define M2M_SCAN_DEFAULT_NUM_PROBE                          (2)
00287 /*!< The default. number of scan slots performed by the WINC board.
00288 */
00289 
00290 
00291 /*======*======*======*======*
00292     CONNECTION ERROR DEFINITIONS
00293  *======*======*======*======*/
00294 typedef enum {      
00295     M2M_DEFAULT_CONN_INPROGRESS  = ((sint8)-23),         
00296     /*!<
00297     A failure that indicates that a default connection or forced connection is in progress
00298     */
00299     M2M_DEFAULT_CONN_FAIL ,              
00300     /*!<
00301     A failure response that indicates that the winc failed to connect to the cached network
00302     */
00303      M2M_DEFAULT_CONN_SCAN_MISMATCH ,                                                        
00304     /*!<
00305     A failure response that indicates that no one of the cached networks 
00306     was found in the scan results, as a result to the function call m2m_default_connect.
00307     */
00308     M2M_DEFAULT_CONN_EMPTY_LIST 
00309     /*!<
00310     A failure response that indicates an empty network list as 
00311     a result to the function call m2m_default_connect.
00312     */
00313 
00314 }tenuM2mDefaultConnErrcode ;
00315 
00316 
00317 
00318 /*======*======*======*======*
00319     TLS DEFINITIONS
00320  *======*======*======*======*/
00321 #define TLS_FILE_NAME_MAX                               48
00322 /*!<  Maximum length for each TLS certificate file name including null terminator.
00323 */
00324 #define TLS_SRV_SEC_MAX_FILES                           8
00325 /*!<  Maximum number of certificates allowed in TLS_SRV section.
00326 */
00327 #define TLS_SRV_SEC_START_PATTERN_LEN                   8
00328 /*!<  Length of certificate struct start pattern.
00329 */
00330 /*======*======*======*======*
00331     OTA DEFINITIONS
00332  *======*======*======*======*/
00333  
00334 #define OTA_STATUS_VALID                    (0x12526285)
00335 /*!< 
00336     Magic value updated in the Control structure in case of ROLLACK image Valid
00337 */
00338 #define OTA_STATUS_INVALID                  (0x23987718)
00339 /*!< 
00340     Magic value updated in the Control structure in case of ROLLACK image InValid
00341 */
00342 #define OTA_MAGIC_VALUE                     (0x1ABCDEF9)
00343 /*!< 
00344     Magic value set at the beginning of the OTA image header
00345 */
00346 #define M2M_MAGIC_APP                       (0xef522f61UL)
00347 /*!< 
00348     Magic value set at the beginning of the Cortus OTA image header
00349 */
00350 
00351 #define OTA_FORMAT_VER_0                    (0) /*Till 19.2.2 format*/
00352 #define OTA_FORMAT_VER_1                    (1) /*starting from 19.3.0 CRC is used and sequence number is used*/
00353 /*!<
00354     Control structure format version
00355 */
00356 #define OTA_SHA256_DIGEST_SIZE              (32)
00357 /*!< 
00358  Sha256 digest size in the OTA image,
00359  the sha256 digest is set at the beginning of image before the OTA header
00360  */
00361 
00362 /*======*======*======*======*
00363     SSL DEFINITIONS
00364  *======*======*======*======*/
00365 
00366 #define TLS_CRL_DATA_MAX_LEN    64
00367 /*<!
00368     Maximum data length in a CRL entry (= Hash length for SHA512)
00369 */
00370 #define TLS_CRL_MAX_ENTRIES     10
00371 /*<!
00372     Maximum number of entries in a CRL
00373 */
00374 
00375 #define TLS_CRL_TYPE_NONE       0
00376 /*<!
00377     No CRL check
00378 */
00379 #define TLS_CRL_TYPE_CERT_HASH  1
00380 /*<!
00381     CRL contains certificate hashes
00382 */
00383 
00384 /**@}*/
00385 
00386 /**
00387 * @addtogroup WlanEnums Enumerations and Typedefs
00388 * @ingroup m2m_wifi
00389 */
00390  /**@{*/
00391 
00392 typedef enum {
00393     OTA_SUCCESS  = (0),
00394     /*!<
00395      OTA Success status
00396      */
00397     OTA_ERR_WORKING_IMAGE_LOAD_FAIL  = ((sint8) -1),
00398     /*!<
00399      Failure to load the firmware image
00400      */
00401     OTA_ERR_INVAILD_CONTROL_SEC  = ((sint8) -2),
00402     /*!<
00403      Control structure is being corrupted
00404      */
00405     M2M_ERR_OTA_SWITCH_FAIL  = ((sint8) -3),
00406     /*!<
00407      switching to the updated image failed as may be the image is invalid
00408      */
00409     M2M_ERR_OTA_START_UPDATE_FAIL  = ((sint8) -4),
00410     /*!<
00411      OTA update fail due to multiple reasons
00412      - Connection failure
00413      - Image integrity fail
00414 
00415      */
00416     M2M_ERR_OTA_ROLLBACK_FAIL  = ((sint8) -5),
00417     /*!<
00418      Roll-back failed due to Roll-back image is not valid
00419      */
00420     M2M_ERR_OTA_INVAILD_FLASH_SIZE  = ((sint8) -6),
00421     /*!<
00422      The OTA Support at least 4MB flash size, if the above error will appear if the current flash is less than 4M
00423      */
00424     M2M_ERR_OTA_INVAILD_ARG  = ((sint8) -7),
00425     /*!<
00426      * Ota still in progress
00427      */
00428     M2M_ERR_OTA_INPROGRESS  = ((sint8) -8)
00429 /*!<
00430  Invalid argument in any OTA Function
00431  */
00432 } tenuOtaError ;
00433 
00434 /*!
00435 @enum   \
00436     tenuM2mConnChangedErrcode
00437     
00438 @brief
00439     
00440 */
00441 typedef enum {
00442      M2M_ERR_SCAN_FAIL  = ((uint8)1),
00443     /*!< Indicate that the WINC board has failed to perform the scan operation.
00444     */
00445      M2M_ERR_JOIN_FAIL ,                                 
00446     /*!< Indicate that the WINC board has failed to join the BSS .
00447     */
00448      M2M_ERR_AUTH_FAIL ,                                     
00449     /*!< Indicate that the WINC board has failed to authenticate with the AP.
00450     */
00451      M2M_ERR_ASSOC_FAIL ,
00452     /*!< Indicate that the WINC board has failed to associate with the AP.
00453     */
00454      M2M_ERR_CONN_INPROGRESS 
00455      /*!< Indicate that the WINC board has another connection request in progress.
00456     */
00457 }tenuM2mConnChangedErrcode ;
00458 /*!
00459 @enum   \
00460     tenuM2mWepKeyIndex
00461     
00462 @brief
00463     
00464 */
00465 typedef enum {
00466     M2M_WIFI_WEP_KEY_INDEX_1 = ((uint8) 1),
00467     M2M_WIFI_WEP_KEY_INDEX_2,
00468     M2M_WIFI_WEP_KEY_INDEX_3,
00469     M2M_WIFI_WEP_KEY_INDEX_4 
00470     /*!< Index for WEP key Authentication
00471     */
00472 }tenuM2mWepKeyIndex ;
00473 
00474 /*!
00475 @enum   \
00476     tenuM2mPwrMode
00477     
00478 @brief
00479     
00480 */
00481 typedef enum {
00482     PWR_AUTO  = ((uint8) 1),
00483     /*!< FW will decide the best power mode to use internally. */
00484     PWR_LOW1,
00485     /*low power mode #1*/
00486     PWR_LOW2,
00487     /*low power mode #2*/
00488     PWR_HIGH
00489     /* high power mode*/
00490 }tenuM2mPwrMode ;
00491 
00492 /*!
00493 @struct \
00494     tstrM2mPwrState
00495 
00496 @brief
00497     Power Mode
00498 */
00499 typedef struct {
00500     uint8   u8PwrMode; 
00501     /*!< power Save Mode
00502     */
00503     uint8   __PAD24__[3];
00504     /*!< Padding bytes for forcing 4-byte alignment
00505     */
00506 }tstrM2mPwrMode;
00507 /*!
00508 @enum   \
00509     tenuM2mTxPwrLevel
00510     
00511 @brief
00512     
00513 */
00514 typedef enum {
00515     TX_PWR_HIGH  = ((uint8) 1),
00516     /*!< PPA Gain 6dbm  PA Gain 18dbm */
00517     TX_PWR_MED ,
00518     /*!< PPA Gain 6dbm  PA Gain 12dbm */
00519     TX_PWR_LOW 
00520     /*!< PPA Gain 6dbm  PA Gain 6dbm */
00521 }tenuM2mTxPwrLevel ;
00522 
00523 /*!
00524 @struct \
00525     tstrM2mTxPwrLevel
00526 
00527 @brief
00528     Tx power level 
00529 */
00530 typedef struct {
00531     uint8   u8TxPwrLevel; 
00532     /*!< Tx power level
00533     */
00534     uint8   __PAD24__[3];
00535     /*!< Padding bytes for forcing 4-byte alignment
00536     */
00537 }tstrM2mTxPwrLevel;
00538 
00539 /*!
00540 @struct \
00541     tstrM2mEnableLogs
00542 
00543 @brief
00544     Enable Firmware logs
00545 */
00546 typedef struct {
00547     uint8   u8Enable; 
00548     /*!< Enable/Disable firmware logs
00549     */
00550     uint8   __PAD24__[3];
00551     /*!< Padding bytes for forcing 4-byte alignment
00552     */
00553 }tstrM2mEnableLogs;
00554 
00555 /*!
00556 @struct \
00557     tstrM2mBatteryVoltage
00558 
00559 @brief
00560     Battery Voltage
00561 */
00562 typedef struct {
00563     //Note: on SAMD D21 the size of double is 8 Bytes
00564     uint16  u16BattVolt; 
00565     /*!< Battery Voltage
00566     */
00567     uint8   __PAD16__[2];
00568     /*!< Padding bytes for forcing 4-byte alignment
00569     */
00570 }tstrM2mBatteryVoltage;
00571 
00572 /*!
00573 @enum   \
00574     tenuM2mReqGroup
00575 
00576 @brief
00577 */
00578 typedef enum{
00579     M2M_REQ_GROUP_MAIN = 0,
00580     M2M_REQ_GROUP_WIFI,
00581     M2M_REQ_GROUP_IP,
00582     M2M_REQ_GROUP_HIF,
00583     M2M_REQ_GROUP_OTA,
00584     M2M_REQ_GROUP_SSL,
00585     M2M_REQ_GROUP_CRYPTO,
00586     M2M_REQ_GROUP_SIGMA
00587 }tenuM2mReqGroup;
00588 
00589 /*!
00590 @enum   \
00591     tenuM2mReqpkt
00592 
00593 @brief
00594 */
00595 typedef enum{
00596     M2M_REQ_CONFIG_PKT,
00597     M2M_REQ_DATA_PKT = 0x80 /*BIT7*/
00598 }tenuM2mReqpkt;
00599 /*!
00600 @enum   \
00601     tenuM2mConfigCmd
00602 
00603 @brief
00604     This enum contains all the host commands used to configure the WINC board.
00605 
00606 */
00607 typedef enum {
00608     M2M_WIFI_REQ_RESTART  = M2M_CONFIG_CMD_BASE,
00609     /*!<
00610         Restart the WINC MAC layer, it's doesn't restart the IP layer.
00611     */
00612     M2M_WIFI_REQ_SET_MAC_ADDRESS ,
00613     /*!<
00614         Set the WINC mac address (not possible for production effused boards).
00615     */
00616     M2M_WIFI_REQ_CURRENT_RSSI ,
00617     /*!<
00618         Request the current connected AP RSSI.
00619     */
00620     M2M_WIFI_RESP_CURRENT_RSSI ,
00621     /*!<
00622         Response to M2M_WIFI_REQ_CURRENT_RSSI with the RSSI value.
00623     */
00624     M2M_WIFI_REQ_GET_CONN_INFO ,
00625     /*!< Request connection information command.
00626     */
00627     M2M_WIFI_RESP_CONN_INFO ,
00628 
00629     /*!< Connect with default AP response.
00630     */
00631     M2M_WIFI_REQ_SET_DEVICE_NAME ,
00632     /*!<
00633         Set the WINC device name property.
00634     */
00635     M2M_WIFI_REQ_START_PROVISION_MODE ,
00636     /*!<
00637         Start the provisioning mode for the M2M Device.
00638     */
00639     M2M_WIFI_RESP_PROVISION_INFO ,
00640     /*!<
00641         Send the provisioning information to the host.
00642     */
00643     M2M_WIFI_REQ_STOP_PROVISION_MODE ,
00644     /*!<
00645         Stop the current running provision mode.
00646     */
00647     M2M_WIFI_REQ_SET_SYS_TIME ,
00648     /*!<
00649         Set time of day from host.
00650     */
00651     M2M_WIFI_REQ_ENABLE_SNTP_CLIENT ,
00652     /*!<
00653         Enable the simple network time protocol to get the
00654         time from the Internet. this is required for security purposes.
00655     */
00656     M2M_WIFI_REQ_DISABLE_SNTP_CLIENT ,
00657     /*!<
00658         Disable the simple network time protocol for applications that
00659         do not need it.
00660     */
00661     M2M_WIFI_RESP_MEMORY_RECOVER ,
00662     /*!<
00663      * Reserved for debuging
00664      * */
00665     M2M_WIFI_REQ_CUST_INFO_ELEMENT ,
00666     /*!< Add Custom ELement to Beacon Managament Frame.
00667     */
00668     M2M_WIFI_REQ_SCAN ,
00669     /*!< Request scan command.
00670     */
00671     M2M_WIFI_RESP_SCAN_DONE ,
00672     /*!< Scan complete notification response.
00673     */
00674     M2M_WIFI_REQ_SCAN_RESULT ,
00675     /*!< Request Scan results command.
00676     */
00677     M2M_WIFI_RESP_SCAN_RESULT ,
00678     /*!< Request Scan results resopnse.
00679     */
00680     M2M_WIFI_REQ_SET_SCAN_OPTION ,
00681     /*!< Set Scan options "slot time, slot number .. etc" .
00682     */
00683     M2M_WIFI_REQ_SET_SCAN_REGION ,
00684     /*!< Set scan region.
00685     */
00686     M2M_WIFI_REQ_SET_POWER_PROFILE ,
00687     /*!< The API shall set power mode to one of 3 modes
00688     */
00689     M2M_WIFI_REQ_SET_TX_POWER ,
00690     /*!<  API to set TX power. 
00691     */
00692     M2M_WIFI_REQ_SET_BATTERY_VOLTAGE ,
00693     /*!<  API to set Battery Voltage. 
00694     */
00695     M2M_WIFI_REQ_SET_ENABLE_LOGS ,
00696     /*!<  API to set Battery Voltage. 
00697     */
00698     M2M_WIFI_REQ_GET_SYS_TIME ,
00699     /*!<
00700         REQ GET time of day from WINC.
00701     */
00702     M2M_WIFI_RESP_GET_SYS_TIME ,
00703     /*!<
00704         RESP time of day from host.
00705     */
00706     M2M_WIFI_REQ_SEND_ETHERNET_PACKET ,
00707     /*!< Send Ethernet packet in bypass mode.
00708     */
00709     M2M_WIFI_RESP_ETHERNET_RX_PACKET ,
00710     /*!< Receive Ethernet packet in bypass mode.
00711     */  
00712     M2M_WIFI_REQ_SET_MAC_MCAST ,
00713     /*!< Set the WINC multicast filters.
00714     */
00715     M2M_WIFI_REQ_GET_PRNG ,
00716     /*!< Request PRNG.
00717     */
00718     M2M_WIFI_RESP_GET_PRNG ,
00719     /*!< Response for PRNG.
00720     */
00721     M2M_WIFI_REQ_SCAN_SSID_LIST ,
00722     /*!< Request scan with list of hidden SSID plus the broadcast scan.
00723     */
00724     M2M_WIFI_REQ_SET_GAINS ,
00725     /*!< Request set the PPA gain
00726     */
00727     M2M_WIFI_REQ_PASSIVE_SCAN ,
00728     /*!< Request a passivr scan command.
00729     */
00730     M2M_WIFI_MAX_CONFIG_ALL
00731 }tenuM2mConfigCmd;
00732 
00733 /*!
00734 @enum   \
00735     tenuM2mStaCmd
00736     
00737 @brief
00738     This enum contains all the WINC commands while in Station mode.
00739 */
00740 typedef enum {
00741     M2M_WIFI_REQ_CONNECT  = M2M_STA_CMD_BASE,
00742     /*!< Connect with AP command.
00743     */
00744     M2M_WIFI_REQ_DEFAULT_CONNECT ,
00745     /*!< Connect with default AP command.
00746     */
00747     M2M_WIFI_RESP_DEFAULT_CONNECT ,
00748     /*!< Request connection information response.
00749     */
00750     M2M_WIFI_REQ_DISCONNECT ,
00751     /*!< Request to disconnect from AP command.
00752     */
00753     M2M_WIFI_RESP_CON_STATE_CHANGED ,
00754     /*!< Connection state changed response.
00755     */
00756     M2M_WIFI_REQ_SLEEP ,
00757     /*!< Set PS mode command.
00758     */
00759     M2M_WIFI_REQ_WPS_SCAN ,
00760     /*!< Request WPS scan command.
00761     */
00762     M2M_WIFI_REQ_WPS ,
00763     /*!< Request WPS start command.
00764     */
00765     M2M_WIFI_REQ_START_WPS ,
00766     /*!< This command is for internal use by the WINC and 
00767         should not be used by the host driver.
00768     */
00769     M2M_WIFI_REQ_DISABLE_WPS ,
00770     /*!< Request to disable WPS command.
00771     */
00772     M2M_WIFI_REQ_DHCP_CONF ,
00773     /*!< Response indicating that IP address was obtained.
00774     */
00775     M2M_WIFI_RESP_IP_CONFIGURED ,
00776     /*!< This command is for internal use by the WINC and 
00777         should not be used by the host driver.
00778     */
00779     M2M_WIFI_RESP_IP_CONFLICT ,
00780     /*!< Response indicating a conflict in obtained IP address.
00781         The user should re attempt the DHCP request.
00782     */
00783     M2M_WIFI_REQ_ENABLE_MONITORING ,
00784     /*!< Request to enable monitor mode  command.
00785     */
00786     M2M_WIFI_REQ_DISABLE_MONITORING ,
00787     /*!< Request to disable monitor mode  command.
00788     */
00789     M2M_WIFI_RESP_WIFI_RX_PACKET ,
00790     /*!< Indicate that a packet was received in monitor mode.
00791     */
00792     M2M_WIFI_REQ_SEND_WIFI_PACKET ,
00793     /*!< Send packet in monitor mode.
00794     */
00795     M2M_WIFI_REQ_LSN_INT ,
00796     /*!< Set WiFi listen interval.
00797     */
00798     M2M_WIFI_REQ_DOZE ,
00799     /*!< Used to force the WINC to sleep in manual PS mode.
00800     */
00801     M2M_WIFI_MAX_STA_ALL
00802 } tenuM2mStaCmd;
00803 
00804 /*!
00805 @enum   \
00806     tenuM2mApCmd
00807 
00808 @brief
00809     This enum contains all the WINC commands while in AP mode.
00810 */
00811 typedef enum {
00812     M2M_WIFI_REQ_ENABLE_AP  = M2M_AP_CMD_BASE,
00813     /*!< Enable AP mode command.
00814     */
00815     M2M_WIFI_REQ_DISABLE_AP ,
00816     /*!< Disable AP mode command.
00817     */
00818     M2M_WIFI_REQ_RESTART_AP,
00819     /*!<
00820     */
00821     M2M_WIFI_MAX_AP_ALL
00822 }tenuM2mApCmd;
00823 
00824 /*!
00825 @enum   \
00826     tenuM2mP2pCmd
00827 
00828 @brief
00829     This enum contains all the WINC commands while in P2P mode.
00830 */
00831 typedef enum {
00832     M2M_WIFI_REQ_P2P_INT_CONNECT  = M2M_P2P_CMD_BASE,
00833     /*!< This command is for internal use by the WINC and 
00834         should not be used by the host driver.
00835     */
00836     M2M_WIFI_REQ_ENABLE_P2P ,
00837     /*!< Enable P2P mode command.
00838     */
00839     M2M_WIFI_REQ_DISABLE_P2P ,
00840     /*!< Disable P2P mode command.
00841     */
00842     M2M_WIFI_REQ_P2P_REPOST ,
00843     /*!< This command is for internal use by the WINC and 
00844         should not be used by the host driver.
00845     */
00846     M2M_WIFI_MAX_P2P_ALL
00847 }tenuM2mP2pCmd;
00848 
00849 
00850 
00851 /*!
00852 @enum   \
00853     tenuM2mServerCmd
00854 
00855 @brief
00856     This enum contains all the WINC commands while in PS mode.
00857     These command are currently not supported.
00858 */
00859 typedef enum {
00860     M2M_WIFI_REQ_CLIENT_CTRL = M2M_SERVER_CMD_BASE,
00861     M2M_WIFI_RESP_CLIENT_INFO,
00862     M2M_WIFI_REQ_SERVER_INIT,
00863     M2M_WIFI_MAX_SERVER_ALL
00864 }tenuM2mServerCmd;
00865 
00866 
00867 
00868 /*!
00869 @enum   \
00870     tenuM2mOtaCmd
00871     
00872 @brief
00873 
00874 */
00875 typedef enum {
00876     M2M_OTA_REQ_NOTIF_SET_URL = M2M_OTA_CMD_BASE,
00877     M2M_OTA_REQ_NOTIF_CHECK_FOR_UPDATE,
00878     M2M_OTA_REQ_NOTIF_SCHED,
00879     M2M_OTA_REQ_START_FW_UPDATE,
00880     M2M_OTA_REQ_SWITCH_FIRMWARE,
00881     M2M_OTA_REQ_ROLLBACK_FW,
00882     M2M_OTA_RESP_NOTIF_UPDATE_INFO,
00883     M2M_OTA_RESP_UPDATE_STATUS,
00884     M2M_OTA_REQ_TEST,
00885     M2M_OTA_REQ_START_CRT_UPDATE,
00886     M2M_OTA_REQ_SWITCH_CRT_IMG,
00887     M2M_OTA_REQ_ROLLBACK_CRT,
00888     M2M_OTA_REQ_ABORT,
00889     M2M_OTA_MAX_ALL,
00890 }tenuM2mOtaCmd;
00891 
00892 /*!
00893 @enum   \
00894     tenuM2mCryptoCmd
00895 
00896 @brief
00897 
00898 */
00899 typedef enum {
00900     M2M_CRYPTO_REQ_SHA256_INIT = M2M_CRYPTO_CMD_BASE,
00901     M2M_CRYPTO_RESP_SHA256_INIT,
00902     M2M_CRYPTO_REQ_SHA256_UPDATE,
00903     M2M_CRYPTO_RESP_SHA256_UPDATE,
00904     M2M_CRYPTO_REQ_SHA256_FINSIH,
00905     M2M_CRYPTO_RESP_SHA256_FINSIH,
00906     M2M_CRYPTO_REQ_RSA_SIGN_GEN,
00907     M2M_CRYPTO_RESP_RSA_SIGN_GEN,
00908     M2M_CRYPTO_REQ_RSA_SIGN_VERIFY,
00909     M2M_CRYPTO_RESP_RSA_SIGN_VERIFY,
00910     M2M_CRYPTO_MAX_ALL
00911 }tenuM2mCryptoCmd;
00912 
00913 /*!
00914 @enum   \
00915     tenuM2mIpCmd
00916 
00917 @brief
00918 
00919 */
00920 typedef enum {
00921     /* Request IDs corresponding to the IP GROUP. */
00922     M2M_IP_REQ_STATIC_IP_CONF = ((uint8) 10),
00923     M2M_IP_REQ_ENABLE_DHCP,
00924     M2M_IP_REQ_DISABLE_DHCP
00925 } tenuM2mIpCmd;
00926 
00927 /*!
00928 @enum   \
00929     tenuM2mSigmaCmd
00930     
00931 @brief
00932 
00933 */
00934 typedef enum {
00935     /* Request IDs corresponding to the IP GROUP. */
00936     M2M_SIGMA_ENABLE = ((uint8) 3),
00937     M2M_SIGMA_TA_START,
00938     M2M_SIGMA_TA_STATS,
00939     M2M_SIGMA_TA_RECEIVE_STOP,
00940     M2M_SIGMA_ICMP_ARP,
00941     M2M_SIGMA_ICMP_RX,
00942     M2M_SIGMA_ICMP_TX,
00943     M2M_SIGMA_UDP_TX,
00944     M2M_SIGMA_UDP_TX_DEFER,
00945     M2M_SIGMA_SECURITY_POLICY,
00946     M2M_SIGMA_SET_SYSTIME
00947 } tenuM2mSigmaCmd;
00948 
00949 
00950 typedef enum{
00951     M2M_SSL_REQ_CERT_VERIF,
00952     M2M_SSL_REQ_ECC,
00953     M2M_SSL_RESP_ECC,
00954     M2M_SSL_IND_CRL,
00955     M2M_SSL_IND_CERTS_ECC,
00956     M2M_SSL_REQ_SET_CS_LIST,
00957     M2M_SSL_RESP_SET_CS_LIST
00958 }tenuM2mSslCmd;
00959 
00960 /*!
00961 @enum   \
00962     tenuM2mConnState
00963 
00964 @brief
00965     Wi-Fi Connection State.
00966 */
00967 typedef enum {
00968     M2M_WIFI_DISCONNECTED  = 0,
00969     /*!< Wi-Fi state is disconnected.
00970     */
00971     M2M_WIFI_CONNECTED ,
00972     /*!< Wi-Fi state is connected.
00973     */
00974     M2M_WIFI_UNDEF  = 0xff
00975     /*!< Undefined Wi-Fi State.
00976     */
00977 }tenuM2mConnState;
00978 
00979 /*!
00980 @enum   \
00981     tenuM2mSecType
00982 
00983 @brief
00984     Wi-Fi Supported Security types.
00985 */
00986 typedef enum {
00987     M2M_WIFI_SEC_INVALID  = 0,
00988     /*!< Invalid security type.
00989     */
00990     M2M_WIFI_SEC_OPEN ,
00991     /*!< Wi-Fi network is not secured.
00992     */
00993     M2M_WIFI_SEC_WPA_PSK ,
00994     /*!< Wi-Fi network is secured with WPA/WPA2 personal(PSK).
00995     */
00996     M2M_WIFI_SEC_WEP ,
00997     /*!< Security type WEP (40 or 104) OPEN OR SHARED.
00998     */
00999     M2M_WIFI_SEC_802_1X 
01000     /*!< Wi-Fi network is secured with WPA/WPA2 Enterprise.IEEE802.1x user-name/password authentication.
01001      */
01002 }tenuM2mSecType;
01003 
01004 
01005 /*!
01006 @enum   \
01007     tenuM2mSecType
01008 
01009 @brief
01010     Wi-Fi Supported SSID types.
01011 */
01012 typedef enum {
01013     SSID_MODE_VISIBLE  = 0,
01014     /*!< SSID is visible to others.
01015     */
01016     SSID_MODE_HIDDEN 
01017     /*!< SSID is hidden.
01018     */
01019 }tenuM2mSsidMode ;
01020 
01021 /*!
01022 @enum   \
01023     tenuM2mScanCh
01024 
01025 @brief
01026     Wi-Fi RF Channels.
01027 @sa
01028     tstrM2MScan
01029     tstrM2MScanOption
01030 */
01031 typedef enum {
01032     M2M_WIFI_CH_1 = ((uint8) 1),
01033     M2M_WIFI_CH_2,
01034     M2M_WIFI_CH_3,
01035     M2M_WIFI_CH_4,
01036     M2M_WIFI_CH_5,
01037     M2M_WIFI_CH_6,
01038     M2M_WIFI_CH_7,
01039     M2M_WIFI_CH_8,
01040     M2M_WIFI_CH_9,
01041     M2M_WIFI_CH_10,
01042     M2M_WIFI_CH_11,
01043     M2M_WIFI_CH_12,
01044     M2M_WIFI_CH_13,
01045     M2M_WIFI_CH_14,
01046     M2M_WIFI_CH_ALL = ((uint8) 255)
01047 }tenuM2mScanCh;
01048 
01049 /*!
01050 @enum   \
01051     tenuM2mScanRegion
01052 
01053 @brief
01054     Wi-Fi RF Channels.
01055 */
01056 typedef enum {
01057 
01058     REG_CH_1 = ((uint16) 1 << 0),
01059     REG_CH_2 = ((uint16) 1 << 1),
01060     REG_CH_3 = ((uint16) 1 << 2),
01061     REG_CH_4 = ((uint16) 1 << 3),
01062     REG_CH_5 = ((uint16) 1 << 4),
01063     REG_CH_6 = ((uint16) 1 << 5),
01064     REG_CH_7 = ((uint16) 1 << 6),
01065     REG_CH_8 = ((uint16) 1 << 7),
01066     REG_CH_9 = ((uint16) 1 << 8),
01067     REG_CH_10 = ((uint16) 1 << 9),
01068     REG_CH_11 = ((uint16) 1 << 10),
01069     REG_CH_12 = ((uint16) 1 << 11),
01070     REG_CH_13 = ((uint16) 1 << 12),
01071     REG_CH_14 = ((uint16) 1 << 13),
01072     REG_CH_ALL = ((uint16) 0x3FFF),
01073     NORTH_AMERICA = ((uint16) 0x7FF),
01074     /** 11 channel
01075     */
01076     EUROPE      =   ((uint16) 0x1FFF),
01077     /** 13 channel
01078     */
01079     ASIA        =   ((uint16) 0x3FFF)
01080     /* 14 channel
01081     */
01082 }tenuM2mScanRegion;
01083 
01084 
01085 /*!
01086 @enum   \
01087     tenuPowerSaveModes
01088 
01089 @brief
01090     Power Save Modes.
01091 */
01092 typedef enum {
01093     M2M_NO_PS ,
01094     /*!< Power save is disabled.
01095     */
01096     M2M_PS_AUTOMATIC ,
01097     /*!< Power save is done automatically by the WINC.
01098         This mode doesn't disable all of the WINC modules and 
01099         use higher amount of power than the H_AUTOMATIC and 
01100         the DEEP_AUTOMATIC modes..
01101     */
01102     M2M_PS_H_AUTOMATIC ,
01103     /*!< Power save is done automatically by the WINC.
01104         Achieve higher power save than the AUTOMATIC mode
01105         by shutting down more parts of the WINC board.
01106     */
01107     M2M_PS_DEEP_AUTOMATIC ,
01108     /*!< Power save is done automatically by the WINC.
01109         Achieve the highest possible power save.
01110     */
01111     M2M_PS_MANUAL 
01112     /*!< Power save is done manually by the user.
01113     */
01114 }tenuPowerSaveModes;
01115 
01116 /*!
01117 @enum   \
01118     tenuM2mWifiMode
01119     
01120 @brief
01121     Wi-Fi Operation Mode.
01122 */
01123 typedef enum {
01124     M2M_WIFI_MODE_NORMAL  = ((uint8) 1),
01125     /*!< Normal Mode means to run customer firmware version.
01126      */
01127     M2M_WIFI_MODE_ATE_HIGH ,
01128     /*!< Config Mode in HIGH POWER means to run production test firmware version which is known as ATE (Burst) firmware.
01129      */
01130     M2M_WIFI_MODE_ATE_LOW ,
01131     /*!< Config Mode in LOW POWER means to run production test firmware version which is known as ATE (Burst) firmware.
01132      */
01133     M2M_WIFI_MODE_ETHERNET ,
01134     /*!< etherent Mode
01135      */
01136     M2M_WIFI_MODE_MAX
01137 }tenuM2mWifiMode;
01138 
01139 /*!
01140 @enum   \
01141     tenuWPSTrigger
01142 
01143 @brief
01144     WPS Triggering Methods.
01145 */
01146 typedef enum{
01147     WPS_PIN_TRIGGER  = 0,
01148     /*!< WPS is triggered in PIN method.
01149     */
01150     WPS_PBC_TRIGGER  = 4
01151     /*!< WPS is triggered via push button.
01152     */
01153 }tenuWPSTrigger;
01154 
01155 /*!
01156 @struct \
01157     tstrM2mWifiGainsParams
01158 
01159 @brief
01160     Gain Values 
01161 */
01162 typedef struct{
01163     uint16  u8PPAGFor11B;
01164     /*!< PPA gain for 11B (as the RF document represenation)
01165     PPA_AGC<0:2> Every bit have 3dB gain control each.
01166     for example:
01167     1 ->3db
01168     3 ->6db
01169     7 ->9db
01170     */
01171     uint16  u8PPAGFor11GN;
01172     /*!< PPA gain for 11GN (as the RF document represented)
01173     PPA_AGC<0:2> Every bit have 3dB gain control each.
01174         for example:
01175     1 ->3db
01176     3 ->6db
01177     7 ->9db
01178     */
01179 }tstrM2mWifiGainsParams;
01180 
01181 /*!
01182 @struct \
01183     tstrM2mWifiWepParams
01184 
01185 @brief
01186     WEP security key parameters.
01187 */
01188 typedef struct{
01189     uint8   u8KeyIndx;
01190     /*!< Wep key Index.
01191     */
01192     uint8   u8KeySz;
01193     /*!< Wep key Size.
01194     */
01195     uint8   au8WepKey[WEP_104_KEY_STRING_SIZE + 1];
01196     /*!< WEP Key represented as a NULL terminated ASCII string.
01197     */
01198     uint8   __PAD24__[3];
01199     /*!< Padding bytes to keep the structure word alligned.
01200     */
01201 }tstrM2mWifiWepParams;
01202 
01203 
01204 /*!
01205 @struct \
01206     tstr1xAuthCredentials
01207 
01208 @brief
01209     Credentials for the user to authenticate with the AAA server (WPA-Enterprise Mode IEEE802.1x).
01210 */
01211 typedef struct{
01212     uint8   au8UserName[M2M_1X_USR_NAME_MAX];
01213     /*!< User Name. It must be Null terminated string.
01214     */
01215     uint8   au8Passwd[M2M_1X_PWD_MAX];
01216     /*!< Password corresponding to the user name. It must be Null terminated string.
01217     */
01218 }tstr1xAuthCredentials;
01219 
01220 
01221 /*!
01222 @union  \
01223     tuniM2MWifiAuth
01224 
01225 @brief
01226     Wi-Fi Security Parameters for all supported security modes.
01227 */
01228 typedef union{
01229     uint8               au8PSK[M2M_MAX_PSK_LEN];
01230     /*!< Pre-Shared Key in case of WPA-Personal security.
01231     */
01232     tstr1xAuthCredentials   strCred1x;
01233     /*!< Credentials for RADIUS server authentication in case of WPA-Enterprise security.
01234     */
01235     tstrM2mWifiWepParams    strWepInfo;
01236     /*!< WEP key parameters in case of WEP security.
01237     */
01238 }tuniM2MWifiAuth;
01239 
01240 
01241 /*!
01242 @struct \
01243     tstrM2MWifiSecInfo
01244 
01245 @brief
01246     Authentication credentials to connect to a Wi-Fi network.
01247 */
01248 typedef struct{
01249     tuniM2MWifiAuth     uniAuth;
01250     /*!< Union holding all possible authentication parameters corresponding the current security types.
01251     */
01252     uint8               u8SecType;
01253     /*!< Wi-Fi network security type. See tenuM2mSecType for supported security types.
01254     */
01255 #define __PADDING__     (4 - ((sizeof(tuniM2MWifiAuth) + 1) % 4))
01256     uint8               __PAD__[__PADDING__];
01257     /*!< Padding bytes for forcing 4-byte alignment
01258     */
01259 }tstrM2MWifiSecInfo;
01260 
01261 
01262 /*!
01263 @struct \
01264     tstrM2mWifiConnect
01265 
01266 @brief
01267     Wi-Fi Connect Request
01268 */
01269 typedef struct{
01270     tstrM2MWifiSecInfo      strSec;
01271     /*!< Security parameters for authenticating with the AP.
01272     */
01273     uint16              u16Ch;
01274     /*!< RF Channel for the target SSID.
01275     */
01276     uint8               au8SSID[M2M_MAX_SSID_LEN];
01277     /*!< SSID of the desired AP. It must be NULL terminated string.
01278     */
01279     uint8               u8NoSaveCred;
01280 #define __CONN_PAD_SIZE__       (4 - ((sizeof(tstrM2MWifiSecInfo) + M2M_MAX_SSID_LEN + 3) % 4))
01281     uint8               __PAD__[__CONN_PAD_SIZE__];
01282     /*!< Padding bytes for forcing 4-byte alignment
01283     */
01284 }tstrM2mWifiConnect;
01285 
01286 
01287 /*!
01288 @struct \
01289     tstrM2MWPSConnect
01290 
01291 @brief
01292     WPS Configuration parameters
01293 
01294 @sa
01295     tenuWPSTrigger
01296 */
01297 typedef struct {
01298     uint8   u8TriggerType;
01299     /*!< WPS triggering method (Push button or PIN)
01300     */
01301     char         acPinNumber[8];
01302     /*!< WPS PIN No (for PIN method)
01303     */
01304     uint8   __PAD24__[3];
01305     /*!< Padding bytes for forcing 4-byte alignment
01306     */
01307 }tstrM2MWPSConnect;
01308 
01309 
01310 /*!
01311 @struct \
01312     tstrM2MWPSInfo
01313 
01314 @brief  WPS Result
01315 
01316     This structure is passed to the application in response to a WPS request. If the WPS session is completed successfully, the
01317     structure will have Non-ZERO authentication type. If the WPS Session fails (due to error or timeout) the authentication type
01318     is set to ZERO.
01319 
01320 @sa
01321     tenuM2mSecType
01322 */
01323 typedef struct{
01324     uint8   u8AuthType;
01325     /*!< Network authentication type.
01326     */
01327     uint8       u8Ch;
01328     /*!< RF Channel for the AP.
01329     */
01330     uint8   au8SSID[M2M_MAX_SSID_LEN];
01331     /*!< SSID obtained from WPS.
01332     */
01333     uint8   au8PSK[M2M_MAX_PSK_LEN];
01334     /*!< PSK for the network obtained from WPS.
01335     */
01336 }tstrM2MWPSInfo;
01337 
01338 
01339 /*!
01340 @struct \
01341     tstrM2MDefaultConnResp
01342 
01343 @brief
01344     Response error of the m2m_default_connect
01345 
01346 @sa
01347     M2M_DEFAULT_CONN_SCAN_MISMATCH
01348     M2M_DEFAULT_CONN_EMPTY_LIST
01349 */
01350 typedef struct{
01351     sint8       s8ErrorCode;
01352     /*!<
01353         Default connect error code. possible values are:
01354         - M2M_DEFAULT_CONN_EMPTY_LIST
01355         - M2M_DEFAULT_CONN_SCAN_MISMATCH
01356     */
01357     uint8   __PAD24__[3];
01358 }tstrM2MDefaultConnResp;
01359 
01360 /*!
01361 @struct \
01362     tstrM2MScanOption
01363 
01364 @brief
01365     Scan options and configurations.
01366 
01367 @sa
01368     tenuM2mScanCh
01369     tstrM2MScan
01370 */
01371 typedef struct {
01372     uint8   u8NumOfSlot;
01373     /*|< The min number of slots is 2 for every channel,
01374     every slot the soc will send Probe Request on air, and wait/listen for PROBE RESP/BEACONS for the u16slotTime
01375     */
01376     uint8   u8SlotTime;
01377     /*|< the time that the Soc will wait on every channel listening to the frames on air
01378         when that time increaseed number of AP will increased in the scan results
01379         min time is 10 ms and the max is 250 ms
01380     */
01381     uint8  u8ProbesPerSlot;
01382     /*!< Number of probe requests to be sent per channel scan slot.
01383     */
01384     sint8   s8RssiThresh;
01385     /*! < The RSSI threshold of the AP which will be connected to directly.
01386     */
01387 
01388 }tstrM2MScanOption;
01389 
01390 /*!
01391 @struct \
01392     tstrM2MScanRegion
01393 
01394 @brief
01395     Wi-Fi channel regulation region information.
01396 
01397 @sa
01398     tenuM2mScanRegion
01399 */
01400 typedef struct {
01401     uint16   u16ScanRegion;
01402     /*|< Specifies the number of channels allowed in the region (e.g. North America = 11 ... etc.).
01403     */
01404     uint8 __PAD16__[2];
01405 
01406 }tstrM2MScanRegion;
01407 
01408 /*!
01409 @struct \
01410     tstrM2MScan
01411 
01412 @brief
01413     Wi-Fi Scan Request
01414 
01415 @sa
01416     tenuM2mScanCh
01417     tstrM2MScanOption
01418 */
01419 typedef struct {
01420     uint8   u8ChNum;
01421     /*!< The Wi-Fi RF Channel number
01422     */
01423     uint8   __RSVD8__[1];
01424     /*!< Reserved for future use.
01425     */
01426     uint16  u16PassiveScanTime;
01427     /*!< Passive Scan Timeout in ms. The field is ignored for active scan.
01428     */
01429 }tstrM2MScan;
01430 
01431 /*!
01432 @struct \
01433     tstrCyptoResp
01434 
01435 @brief
01436     crypto response
01437 */
01438 typedef struct {
01439     sint8 s8Resp;
01440     /***/
01441     uint8 __PAD24__[3];
01442     /*
01443     */
01444 }tstrCyptoResp;
01445 
01446 
01447 /*!
01448 @struct \
01449     tstrM2mScanDone
01450 
01451 @brief
01452     Wi-Fi Scan Result
01453 */
01454 typedef struct{
01455     uint8   u8NumofCh;
01456     /*!< Number of found APs
01457     */
01458     sint8   s8ScanState;
01459     /*!< Scan status
01460     */
01461     uint8   __PAD16__[2];
01462     /*!< Padding bytes for forcing 4-byte alignment
01463     */
01464 }tstrM2mScanDone;
01465 
01466 
01467 /*!
01468 @struct \
01469     tstrM2mReqScanResult
01470 
01471 @brief  Scan Result Request
01472 
01473     The Wi-Fi Scan results list is stored in Firmware. The application can request a certain scan result by its index.
01474 */
01475 typedef struct {
01476     uint8   u8Index;
01477     /*!< Index of the desired scan result
01478     */
01479     uint8   __PAD24__[3];
01480     /*!< Padding bytes for forcing 4-byte alignment
01481     */
01482 }tstrM2mReqScanResult;
01483 
01484 
01485 /*!
01486 @struct \
01487     tstrM2mWifiscanResult
01488 
01489 @brief  Wi-Fi Scan Result
01490 
01491     Information corresponding to an AP in the Scan Result list identified by its order (index) in the list.
01492 */
01493 typedef struct {
01494     uint8   u8index;
01495     /*!< AP index in the scan result list.
01496     */
01497     sint8   s8rssi;
01498     /*!< AP signal strength.
01499     */
01500     uint8   u8AuthType;
01501     /*!< AP authentication type.
01502     */
01503     uint8   u8ch;
01504     /*!< AP RF channel.
01505     */
01506     uint8   au8BSSID[6];
01507     /*!< BSSID of the AP.
01508     */
01509     uint8   au8SSID[M2M_MAX_SSID_LEN];
01510     /*!< AP ssid.
01511     */
01512     uint8   _PAD8_;
01513     /*!< Padding bytes for forcing 4-byte alignment
01514     */
01515 }tstrM2mWifiscanResult;
01516 
01517 
01518 /*!
01519 @struct \
01520     tstrM2mWifiStateChanged
01521 
01522 @brief
01523     Wi-Fi Connection State
01524 
01525 @sa
01526     M2M_WIFI_DISCONNECTED, M2M_WIFI_CONNECTED, M2M_WIFI_REQ_CON_STATE_CHANGED,tenuM2mConnChangedErrcode
01527 */
01528 typedef struct {
01529     uint8   u8CurrState;
01530     /*!< Current Wi-Fi connection state
01531     */
01532     uint8  u8ErrCode;
01533     /*!< Error type review tenuM2mConnChangedErrcode
01534     */
01535     uint8   __PAD16__[2];
01536     /*!< Padding bytes for forcing 4-byte alignment
01537     */
01538 }tstrM2mWifiStateChanged;
01539 
01540 
01541 /*!
01542 @struct \
01543     tstrM2mPsType
01544 
01545 @brief
01546     Power Save Configuration
01547 
01548 @sa
01549     tenuPowerSaveModes
01550 */
01551 typedef struct{
01552     uint8   u8PsType;
01553     /*!< Power save operating mode
01554     */
01555     uint8   u8BcastEn;
01556     /*!<
01557     */
01558     uint8   __PAD16__[2];
01559     /*!< Padding bytes for forcing 4-byte alignment
01560     */
01561 }tstrM2mPsType;
01562 
01563 /*!
01564 @struct \
01565     tstrM2mSlpReqTime
01566 
01567 @brief
01568     Manual power save request sleep time
01569 
01570 */
01571 typedef struct {
01572     /*!< Sleep time in ms
01573     */
01574     uint32 u32SleepTime;
01575 
01576 } tstrM2mSlpReqTime;
01577 
01578 /*!
01579 @struct \
01580     tstrM2mLsnInt
01581 
01582 @brief  Listen interval
01583 
01584     It is the value of the Wi-Fi STA listen interval for power saving. It is given in units of Beacon period. 
01585     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.
01586 */
01587 typedef struct {
01588     uint16  u16LsnInt;
01589     /*!< Listen interval in Beacon period count.
01590     */
01591     uint8   __PAD16__[2];
01592     /*!< Padding bytes for forcing 4-byte alignment
01593     */
01594 }tstrM2mLsnInt;
01595 
01596 
01597 /*!
01598 @struct \
01599     tstrM2MWifiMonitorModeCtrl
01600 
01601 @brief  Wi-Fi Monitor Mode Filter
01602 
01603     This structure sets the filtering criteria for WLAN packets when monitoring mode is enable. 
01604     The received packets matching the filtering parameters, are passed directly to the application.
01605 */
01606 typedef struct{
01607     uint8   u8ChannelID;
01608     /* !< RF Channel ID. It must use values from tenuM2mScanCh
01609     */
01610     uint8   u8FrameType;
01611     /*!< It must use values from tenuWifiFrameType.
01612     */
01613     uint8   u8FrameSubtype;
01614     /*!< It must use values from tenuSubTypes.
01615     */
01616     uint8   au8SrcMacAddress[6];
01617     /* ZERO means DO NOT FILTER Source address.
01618     */
01619     uint8   au8DstMacAddress[6];
01620     /* ZERO means DO NOT FILTER Destination address.
01621     */
01622     uint8   au8BSSID[6];
01623     /* ZERO means DO NOT FILTER BSSID.
01624     */
01625     uint8 u8EnRecvHdr;
01626     /*
01627      Enable recv the full hder before the payload   
01628     */
01629     uint8   __PAD16__[2];
01630     /*!< Padding bytes for forcing 4-byte alignment
01631     */
01632 }tstrM2MWifiMonitorModeCtrl;
01633 
01634 
01635 /*!
01636 @struct \
01637     tstrM2MWifiRxPacketInfo
01638 
01639 @brief  Wi-Fi RX Frame Header
01640 
01641     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.
01642     When a target Wi-Fi packet is received, the header information are extracted and assigned in this structure. 
01643 */
01644 typedef struct{
01645     uint8   u8FrameType;
01646     /*!< It must use values from tenuWifiFrameType.
01647     */
01648     uint8   u8FrameSubtype;
01649     /*!< It must use values from tenuSubTypes.
01650     */
01651     uint8   u8ServiceClass;
01652     /*!< Service class from Wi-Fi header.
01653     */
01654     uint8   u8Priority;
01655     /*!< Priority from Wi-Fi header.
01656     */
01657     uint8   u8HeaderLength;
01658     /*!< Frame Header length.
01659     */
01660     uint8   u8CipherType;
01661     /*!< Encryption type for the rx packet.
01662     */
01663     uint8   au8SrcMacAddress[6];
01664     /* ZERO means DO NOT FILTER Source address.
01665     */
01666     uint8   au8DstMacAddress[6];
01667     /* ZERO means DO NOT FILTER Destination address.
01668     */
01669     uint8   au8BSSID[6];
01670     /* ZERO means DO NOT FILTER BSSID.
01671     */
01672     uint16  u16DataLength;
01673     /*!< Data payload length (Header excluded).
01674     */
01675     uint16  u16FrameLength;
01676     /*!< Total frame length (Header + Data).
01677     */
01678     uint32  u32DataRateKbps;
01679     /*!< Data Rate in Kbps.
01680     */
01681     sint8       s8RSSI;
01682     /*!< RSSI.
01683     */
01684     uint8   __PAD24__[3];
01685     /*!< Padding bytes for forcing 4-byte alignment
01686     */
01687 }tstrM2MWifiRxPacketInfo;
01688 
01689 
01690 /*!
01691 @struct \
01692     tstrM2MWifiTxPacketInfo
01693 
01694 @brief  Wi-Fi TX Packet Info
01695 
01696     The M2M Application has the ability to compose a RAW Wi-Fi frames (under the application responsibility).
01697     When transmitting a Wi-Fi packet, the application must supply the firmware with this structure for sending the target frame.
01698 */
01699 typedef struct{
01700     uint16  u16PacketSize;
01701     /*!< Wlan frame length.
01702     */
01703     uint16  u16HeaderLength;
01704     /*!< Wlan frame header length.
01705     */
01706 }tstrM2MWifiTxPacketInfo;
01707 
01708 
01709 /*!
01710  @struct    \
01711     tstrM2MP2PConnect
01712 
01713  @brief
01714     Set the device to operate in the Wi-Fi Direct (P2P) mode.
01715 */
01716 typedef struct {
01717     uint8   u8ListenChannel;
01718     /*!< P2P Listen Channel (1, 6 or 11)
01719     */
01720     uint8   __PAD24__[3];
01721     /*!< Padding bytes for forcing 4-byte alignment
01722     */
01723 }tstrM2MP2PConnect;
01724 
01725 /*!
01726 @struct \
01727     tstrM2MAPConfig
01728 
01729 @brief  AP Configuration
01730 
01731     This structure holds the configuration parameters for the M2M AP mode. It should be set by the application when
01732     it requests to enable the M2M AP operation mode. The M2M AP mode currently supports only WEP security (with
01733     the NO Security option available of course).
01734 */
01735 typedef struct {
01736     /*!<
01737         Configuration parameters for the WiFi AP.
01738     */
01739     uint8   au8SSID[M2M_MAX_SSID_LEN];
01740     /*!< AP SSID
01741     */
01742     uint8   u8ListenChannel;
01743     /*!< Wi-Fi RF Channel which the AP will operate on
01744     */
01745     uint8   u8KeyIndx;
01746     /*!< Wep key Index
01747     */
01748     uint8   u8KeySz;
01749     /*!< Wep/WPA key Size
01750     */
01751     uint8   au8WepKey[WEP_104_KEY_STRING_SIZE + 1];
01752     /*!< Wep key
01753     */
01754     uint8   u8SecType;
01755     /*!< Security type: Open or WEP or WPA in the current implementation
01756     */
01757     uint8   u8SsidHide;
01758     /*!< SSID Status "Hidden(1)/Visible(0)"
01759     */
01760     uint8   au8DHCPServerIP[4];
01761     /*!< Ap IP server address
01762     */
01763     uint8   au8Key[M2M_MAX_PSK_LEN];
01764     /*!< WPA key
01765     */
01766     uint8   __PAD24__[2];
01767     /*!< Padding bytes for forcing alignment
01768     */
01769 }tstrM2MAPConfig;
01770 
01771 
01772 /*!
01773 @struct \
01774     tstrM2mServerInit
01775 
01776 @brief
01777     PS Server initialization.
01778 */
01779 typedef struct {
01780     uint8   u8Channel;
01781     /*!< Server Listen channel
01782     */
01783     uint8   __PAD24__[3];
01784     /*!< Padding bytes for forcing 4-byte alignment
01785     */
01786 }tstrM2mServerInit;
01787 
01788 
01789 /*!
01790 @struct \
01791     tstrM2mClientState
01792 
01793 @brief
01794     PS Client State.
01795 */
01796 typedef struct {
01797     uint8   u8State;
01798     /*!< PS Client State
01799     */
01800     uint8   __PAD24__[3];
01801     /*!< Padding bytes for forcing 4-byte alignment
01802     */
01803 }tstrM2mClientState;
01804 
01805 
01806 /*!
01807 @struct \
01808     tstrM2Mservercmd
01809 
01810 @brief
01811     PS Server CMD
01812 */
01813 typedef struct {
01814     uint8   u8cmd;
01815     /*!< PS Server Cmd
01816     */
01817     uint8   __PAD24__[3];
01818     /*!< Padding bytes for forcing 4-byte alignment
01819     */
01820 }tstrM2Mservercmd;
01821 
01822 
01823 /*!
01824 @struct \
01825     tstrM2mSetMacAddress
01826 
01827 @brief
01828     Sets the MAC address from application. The WINC load the mac address from the effuse by default to the WINC configuration memory, 
01829     but that function is used to let the application overwrite the configuration memory with the mac address from the host.
01830 
01831 @note
01832     It's recommended to call this only once before calling connect request and after the m2m_wifi_init
01833 */
01834 typedef struct {
01835     uint8   au8Mac[6];
01836     /*!< MAC address array
01837     */
01838     uint8   __PAD16__[2];
01839     /*!< Padding bytes for forcing 4-byte alignment
01840     */
01841 }tstrM2mSetMacAddress;
01842 
01843 
01844 /*!
01845 @struct \
01846     tstrM2MDeviceNameConfig
01847 
01848 @brief  Device name
01849 
01850     It is assigned by the application. It is used mainly for Wi-Fi Direct device
01851     discovery and WPS device information.
01852 */
01853 typedef struct {
01854     uint8   au8DeviceName[M2M_DEVICE_NAME_MAX];
01855     /*!< NULL terminated device name
01856     */
01857 }tstrM2MDeviceNameConfig;
01858 
01859 
01860 /*!
01861 @struct \
01862     tstrM2MIPConfig
01863 
01864 @brief
01865     Static IP configuration.
01866 
01867 @note
01868     All member IP addresses are expressed in Network Byte Order (eg. "192.168.10.1" will be expressed as 0x010AA8C0).
01869  */
01870 typedef struct {
01871     uint32  u32StaticIP;
01872     /*!< The static IP assigned to the device.
01873     */
01874     uint32  u32Gateway;
01875     /*!< IP of the Default internet gateway.
01876     */
01877     uint32  u32DNS;
01878     /*!< IP for the DNS server.
01879     */
01880     uint32  u32SubnetMask;
01881     /*!< Subnet mask for the local area network.
01882     */
01883     uint32 u32DhcpLeaseTime;
01884     /*!< Dhcp Lease Time in sec
01885     */
01886 } tstrM2MIPConfig;
01887 
01888 /*!
01889 @struct \
01890     tstrM2mIpRsvdPkt
01891 
01892 @brief
01893     Received Packet Size and Data Offset
01894 
01895  */
01896 typedef struct{
01897     uint16  u16PktSz;
01898     uint16  u16PktOffset;
01899 } tstrM2mIpRsvdPkt;
01900 
01901 
01902 /*!
01903 @struct \
01904     tstrM2MProvisionModeConfig
01905 
01906 @brief
01907     M2M Provisioning Mode Configuration
01908  */
01909 
01910 typedef struct {
01911     tstrM2MAPConfig     strApConfig;
01912     /*!<
01913         Configuration parameters for the WiFi AP.
01914     */
01915     char                acHttpServerDomainName[64];
01916     /*!<
01917         The device domain name for HTTP provisioning.
01918     */
01919     uint8               u8EnableRedirect;
01920     /*!<
01921         A flag to enable/disable HTTP redirect feature for the HTTP Provisioning server. If the Redirect is enabled,
01922         all HTTP traffic (http://URL) from the device associated with WINC AP will be redirected to the HTTP Provisioning Web page.
01923         - 0 : Disable HTTP Redirect.
01924         - 1 : Enable HTTP Redirect.
01925     */
01926     uint8           __PAD24__[3];
01927 }tstrM2MProvisionModeConfig;
01928 
01929 
01930 /*!
01931 @struct \
01932     tstrM2MProvisionInfo
01933 
01934 @brief
01935     M2M Provisioning Information obtained from the HTTP Provisioning server.
01936  */
01937 typedef struct{
01938     uint8   au8SSID[M2M_MAX_SSID_LEN];
01939     /*!<
01940         Provisioned SSID.
01941     */
01942     uint8   au8Password[M2M_MAX_PSK_LEN];
01943     /*!<
01944         Provisioned Password.
01945     */
01946     uint8   u8SecType;
01947     /*!<
01948         Wifi Security type.
01949     */
01950     uint8   u8Status;
01951     /*!<
01952         Provisioning status. It must be checked before reading the provisioning information. It may be
01953         - M2M_SUCCESS   : Provision successful.
01954         - M2M_FAIL      : Provision Failed.
01955     */
01956 }tstrM2MProvisionInfo;
01957 
01958 
01959 /*!
01960 @struct \
01961     tstrM2MConnInfo
01962 
01963 @brief
01964     M2M Provisioning Information obtained from the HTTP Provisioning server.
01965  */
01966 typedef struct{
01967     char        acSSID[M2M_MAX_SSID_LEN];
01968     /*!< AP connection SSID name  */
01969     uint8   u8SecType;
01970     /*!< Security type */
01971     uint8   au8IPAddr[4];
01972     /*!< Connection IP address */
01973     uint8   au8MACAddress[6];
01974     /*!< MAC address of the peer Wi-Fi station */ 
01975     sint8   s8RSSI;
01976     /*!< Connection RSSI signal */
01977     uint8   __PAD24__[3];
01978     /*!< Padding bytes for forcing 4-byte alignment */
01979 }tstrM2MConnInfo;
01980 
01981 /*!
01982 @struct \
01983     tstrOtaInitHdr
01984 
01985 @brief
01986     OTA Image Header 
01987  */
01988 
01989 typedef struct{
01990     uint32 u32OtaMagicValue;
01991     /*!< Magic value kept in the OTA image after the 
01992     sha256 Digest buffer to define the Start of OTA Header */
01993     uint32 u32OtaPayloadSzie;
01994     /*!<
01995     The Total OTA image payload size, include the sha256 key size
01996     */
01997 
01998 }tstrOtaInitHdr;
01999     
02000 
02001 /*!
02002 @struct \
02003     tstrOtaControlSec
02004 
02005 @brief
02006     Control section structure is used to define the working image and 
02007     the validity of the roll-back image and its offset, also both firmware versions is kept in that structure.
02008  */
02009 
02010 typedef struct {
02011     uint32 u32OtaMagicValue;
02012 /*!<
02013     Magic value used to ensure the structure is valid or not 
02014 */
02015     uint32 u32OtaFormatVersion;
02016 /*!<
02017         NA   NA   NA   Flash version   cs struct version
02018         00   00   00   00              00 
02019     Control structure format version, the value will be incremented in case of structure changed or updated
02020 */
02021     uint32 u32OtaSequenceNumber;
02022 /*!<
02023     Sequence number is used while update the control structure to keep track of how many times that section updated 
02024 */
02025     uint32 u32OtaLastCheckTime;
02026 /*!<
02027     Last time OTA check for update
02028 */
02029     uint32 u32OtaCurrentworkingImagOffset;
02030 /*!<
02031     Current working offset in flash 
02032 */
02033     uint32 u32OtaCurrentworkingImagFirmwareVer;
02034 /*!<
02035     current working image version ex 18.0.1
02036 */
02037     uint32 u32OtaRollbackImageOffset;
02038 /*!<
02039     Roll-back image offset in flash 
02040 */
02041     uint32 u32OtaRollbackImageValidStatus;
02042 /*!<
02043     roll-back image valid status 
02044 */
02045     uint32 u32OtaRollbackImagFirmwareVer;
02046 /*!<
02047     Roll-back image version (ex 18.0.3)
02048 */
02049     uint32 u32OtaCortusAppWorkingOffset;
02050 /*!<
02051     cortus app working offset in flash 
02052 */
02053     uint32 u32OtaCortusAppWorkingValidSts;
02054 /*!<
02055     Working Cortus app valid status 
02056 */
02057     uint32 u32OtaCortusAppWorkingVer;
02058 /*!<
02059     Working cortus app version (ex 18.0.3)
02060 */
02061     uint32 u32OtaCortusAppRollbackOffset;
02062 /*!<
02063     cortus app rollback offset in flash 
02064 */
02065     uint32 u32OtaCortusAppRollbackValidSts;
02066 /*!<
02067     roll-back cortus app valid status 
02068 */
02069     uint32 u32OtaCortusAppRollbackVer;
02070 /*!<
02071     Roll-back cortus app version (ex 18.0.3)
02072 */
02073     uint32 u32OtaControlSecCrc;
02074 /*!<
02075     CRC for the control structure to ensure validity 
02076 */
02077 } tstrOtaControlSec;
02078 
02079 /*!
02080 @enum   \
02081     tenuOtaUpdateStatus
02082 
02083 @brief
02084     OTA return status
02085 */
02086 typedef enum {
02087     OTA_STATUS_SUCSESS         = 0,
02088     /*!< OTA Success with not errors. */
02089     OTA_STATUS_FAIL            = 1,
02090     /*!< OTA generic fail. */
02091     OTA_STATUS_INVAILD_ARG     = 2,
02092     /*!< Invalid or malformed download URL. */
02093     OTA_STATUS_INVAILD_RB_IMAGE     = 3,
02094     /*!< Invalid rollback image. */
02095     OTA_STATUS_INVAILD_FLASH_SIZE     = 4,
02096     /*!< Flash size on device is not enough for OTA. */
02097     OTA_STATUS_AlREADY_ENABLED     = 5,
02098     /*!< An OTA operation is already enabled. */
02099     OTA_STATUS_UPDATE_INPROGRESS     = 6,
02100     /*!< An OTA operation update is in progress */
02101     OTA_STATUS_IMAGE_VERIF_FAILED  = 7,
02102     /*!<  OTA Verfication failed */
02103     OTA_STATUS_CONNECTION_ERROR  = 8,
02104     /*!< OTA connection error */
02105     OTA_STATUS_SERVER_ERROR  = 9,
02106     /*!< OTA server Error (file not found or else ...) */
02107     OTA_STATUS_ABORTED         = 10
02108     /*!< OTA download has been aborted by the application. */
02109 } tenuOtaUpdateStatus;
02110 /*!
02111 @enum   \
02112     tenuOtaUpdateStatusType
02113 
02114 @brief
02115     OTA update Status type
02116 */
02117 typedef enum {
02118 
02119     DL_STATUS         = 1,
02120     /*!< Download OTA file status
02121     */
02122     SW_STATUS         = 2,
02123     /*!< Switching to the upgrade firmware status
02124     */
02125     RB_STATUS         = 3,
02126     /*!< Roll-back status
02127     */
02128     AB_STATUS         = 4
02129     /*!< Abort status
02130     */
02131 }tenuOtaUpdateStatusType;
02132 
02133 
02134 /*!
02135 @struct \
02136     tstrOtaUpdateStatusResp
02137 
02138 @brief
02139     OTA Update Information
02140 
02141 @sa
02142     tenuWPSTrigger
02143 */
02144 typedef struct {
02145     uint8   u8OtaUpdateStatusType;
02146     /*!<
02147         Status type tenuOtaUpdateStatusType
02148     */
02149     uint8   u8OtaUpdateStatus;
02150     /*!<
02151     OTA_SUCCESS                         
02152     OTA_ERR_WORKING_IMAGE_LOAD_FAIL     
02153     OTA_ERR_INVAILD_CONTROL_SEC         
02154     M2M_ERR_OTA_SWITCH_FAIL             
02155     M2M_ERR_OTA_START_UPDATE_FAIL       
02156     M2M_ERR_OTA_ROLLBACK_FAIL           
02157     M2M_ERR_OTA_INVAILD_FLASH_SIZE      
02158     M2M_ERR_OTA_INVAILD_ARG          
02159     */
02160     uint8 _PAD16_[2];
02161 }tstrOtaUpdateStatusResp;
02162 
02163 /*!
02164 @struct \
02165     tstrOtaUpdateInfo
02166 
02167 @brief
02168     OTA Update Information
02169 
02170 @sa
02171     tenuWPSTrigger
02172 */
02173 typedef struct {
02174     uint32  u8NcfUpgradeVersion;
02175     /*!< NCF OTA Upgrade Version
02176     */
02177     uint32  u8NcfCurrentVersion;
02178     /*!< NCF OTA Current firmware version
02179     */
02180     uint32  u8NcdUpgradeVersion;
02181     /*!< NCD (host) upgraded version (if the u8NcdRequiredUpgrade == true)
02182     */
02183     uint8   u8NcdRequiredUpgrade;
02184     /*!< NCD Required upgrade to the above version
02185     */
02186     uint8   u8DownloadUrlOffset;
02187     /*!< Download URL offset in the received packet
02188     */
02189     uint8   u8DownloadUrlSize;
02190     /*!< Download URL size in the received packet
02191     */
02192     uint8   __PAD8__;
02193     /*!< Padding bytes for forcing 4-byte alignment
02194     */
02195 } tstrOtaUpdateInfo;
02196 
02197 /*!
02198 @struct \
02199     tstrSystemTime
02200 
02201 @brief
02202     Used for time storage.
02203 */
02204 typedef struct{
02205     uint16  u16Year;
02206     uint8   u8Month;
02207     uint8   u8Day;
02208     uint8   u8Hour;
02209     uint8   u8Minute;
02210     uint8   u8Second;
02211     uint8   __PAD8__;
02212 }tstrSystemTime;
02213 
02214 /*!
02215 @struct \
02216     tstrM2MMulticastMac
02217 
02218 @brief
02219     M2M add/remove multi-cast mac address
02220  */
02221  typedef struct {
02222     uint8 au8macaddress[M2M_MAC_ADDRES_LEN];
02223     /*!<
02224         Mac address needed to be added or removed from filter.
02225     */
02226     uint8 u8AddRemove;
02227     /*!<
02228         set by 1 to add or 0 to remove from filter.
02229     */
02230     uint8   __PAD8__;
02231     /*!< Padding bytes for forcing 4-byte alignment
02232     */
02233 }tstrM2MMulticastMac;
02234 
02235 /*!
02236 @struct \
02237     tstrPrng
02238 
02239 @brief
02240     M2M Request PRNG
02241  */
02242  typedef struct {
02243      /*!<
02244         return buffer address
02245     */
02246     uint8 *pu8RngBuff;
02247      /*!<
02248         PRNG size requested
02249     */
02250     uint16  u16PrngSize;
02251     /*!<
02252         PRNG pads
02253     */
02254     uint8 __PAD16__[2];
02255 }tstrPrng;
02256 
02257 /*
02258  * TLS certificate revocation list
02259  * Typedefs common between fw and host
02260  */
02261 
02262 /*!
02263 @struct \
02264     tstrTlsCrlEntry
02265 
02266 @brief
02267     Certificate data for inclusion in a revocation list (CRL)
02268 */
02269 typedef struct {
02270     uint8   u8DataLen;
02271     /*!<
02272         Length of certificate data (maximum possible is @ref TLS_CRL_DATA_MAX_LEN)
02273     */
02274     uint8   au8Data[TLS_CRL_DATA_MAX_LEN];
02275     /*!<
02276         Certificate data
02277     */
02278     uint8   __PAD24__[3];
02279     /*!<
02280         Padding bytes for forcing 4-byte alignment
02281     */
02282 }tstrTlsCrlEntry;
02283 
02284 /*!
02285 @struct \
02286     tstrTlsCrlInfo
02287 
02288 @brief
02289     Certificate revocation list details
02290 */
02291 typedef struct {
02292     uint8           u8CrlType;
02293     /*!<
02294         Type of certificate data contained in list
02295     */
02296     uint8           u8Rsv1;
02297     /*!<
02298         Reserved for future use
02299     */
02300     uint8           u8Rsv2;
02301     /*!<
02302         Reserved for future use
02303     */
02304     uint8           u8Rsv3;
02305     /*!<
02306         Reserved for future use
02307     */
02308     tstrTlsCrlEntry astrTlsCrl[TLS_CRL_MAX_ENTRIES];
02309     /*!<
02310         List entries
02311     */
02312 }tstrTlsCrlInfo;
02313 
02314  /*!
02315 @enum\
02316     tenuSslCertExpSettings
02317 
02318 @brief  SSL Certificate Expiry Validation Options   
02319 */
02320 typedef enum{
02321     SSL_CERT_EXP_CHECK_DISABLE ,
02322     /*!<
02323         ALWAYS OFF.
02324         Ignore certificate expiration date validation. If a certificate is
02325         expired or there is no configured system time, the SSL connection SUCCEEDs.
02326     */
02327     SSL_CERT_EXP_CHECK_ENABLE ,
02328     /*!<
02329         ALWAYS ON.
02330         Validate certificate expiration date. If a certificate is expired or 
02331         there is no configured system time, the SSL connection FAILs.
02332     */
02333     SSL_CERT_EXP_CHECK_EN_IF_SYS_TIME 
02334     /*!<
02335         CONDITIONAL VALIDATION (Default setting at startup).
02336         Validate the certificate expiration date only if there is a configured system time.
02337         If there is no configured system time, the certificate expiration is bypassed and the
02338         SSL connection SUCCEEDs.
02339     */
02340 }tenuSslCertExpSettings;
02341 
02342 
02343 /*!
02344 @struct \
02345     tstrTlsSrvSecFileEntry
02346 
02347 @brief
02348     This struct contains a TLS certificate.
02349  */
02350 typedef struct{
02351     char    acFileName[TLS_FILE_NAME_MAX];
02352     /*!< Name of the certificate.   */
02353     uint32  u32FileSize;
02354     /*!< Size of the certificate.   */
02355     uint32  u32FileAddr;
02356     /*!< Error Code.    */
02357 }tstrTlsSrvSecFileEntry;
02358 
02359 /*!
02360 @struct \
02361     tstrTlsSrvSecHdr
02362 
02363 @brief
02364     This struct contains a set of TLS certificates.
02365  */
02366 typedef struct{
02367     uint8                   au8SecStartPattern[TLS_SRV_SEC_START_PATTERN_LEN];
02368     /*!< Start pattern. */  
02369     uint32                  u32nEntries;
02370     /*!< Number of certificates stored in the struct.   */
02371     uint32                  u32NextWriteAddr;
02372     /*!< TLS Certificates.  */
02373     tstrTlsSrvSecFileEntry  astrEntries[TLS_SRV_SEC_MAX_FILES];
02374 }tstrTlsSrvSecHdr;
02375 
02376 typedef struct{
02377     uint32  u32CsBMP;
02378 }tstrSslSetActiveCsList;
02379 
02380 
02381  /**@}*/
02382 
02383 #endif
02384