TI's CC3100 websocket camera demo with Arducam mini ov5642 and freertos. Should work with other M3's. Work in progress test demo.

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers cc3100_wlan.h Source File

cc3100_wlan.h

00001 /*
00002  * wlan.h - CC31xx/CC32xx Host Driver Implementation
00003  *
00004  * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
00005  *
00006  *
00007  *  Redistribution and use in source and binary forms, with or without
00008  *  modification, are permitted provided that the following conditions
00009  *  are met:
00010  *
00011  *    Redistributions of source code must retain the above copyright
00012  *    notice, this list of conditions and the following disclaimer.
00013  *
00014  *    Redistributions in binary form must reproduce the above copyright
00015  *    notice, this list of conditions and the following disclaimer in the
00016  *    documentation and/or other materials provided with the
00017  *    distribution.
00018  *
00019  *    Neither the name of Texas Instruments Incorporated nor the names of
00020  *    its contributors may be used to endorse or promote products derived
00021  *    from this software without specific prior written permission.
00022  *
00023  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00024  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00025  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00026  *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00027  *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00028  *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00029  *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00030  *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00031  *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00032  *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00033  *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00034  *
00035 */
00036 
00037 /*****************************************************************************/
00038 /* Include files                                                             */
00039 /*****************************************************************************/
00040 #include "cc3100_simplelink.h"
00041 
00042 #ifndef WLAN_H_
00043 #define    WLAN_H_
00044 
00045 namespace mbed_cc3100 {
00046 
00047 /*****************************************************************************/
00048 /* Macro declarations                                                        */
00049 /*****************************************************************************/
00050 
00051 /*!
00052 
00053     \addtogroup wlan
00054     @{
00055 
00056 */
00057 
00058 const uint8_t SL_BSSID_LENGTH                                                                             =    (6);
00059 const uint8_t MAXIMAL_SSID_LENGTH                                                                         =    (32);
00060 
00061 const uint8_t NUM_OF_RATE_INDEXES                                                                         =    (20);
00062 const uint8_t SIZE_OF_RSSI_HISTOGRAM                                                                      =    (6);
00063 
00064 /* WLAN Disconnect Reason Codes */
00065 const uint8_t  SL_DISCONNECT_RESERVED_0                                                                   =    (0);
00066 const uint8_t  SL_DISCONNECT_UNSPECIFIED_REASON                                                           =    (1);
00067 const uint8_t  SL_PREVIOUS_AUTHENTICATION_NO_LONGER_VALID                                                 =    (2);
00068 const uint8_t  SL_DEAUTHENTICATED_BECAUSE_SENDING_STATION_IS_LEAVING                                      =    (3);
00069 const uint8_t  SL_DISASSOCIATED_DUE_TO_INACTIVITY                                                         =    (4);
00070 const uint8_t  SL_DISASSOCIATED_BECAUSE_AP_IS_UNABLE_TO_HANDLE_ALL_CURRENTLY_ASSOCIATED_STATIONS          =    (5);
00071 const uint8_t  SL_CLASS_2_FRAME_RECEIVED_FROM_NONAUTHENTICATED_STATION                                    =    (6);
00072 const uint8_t  SL_CLASS_3_FRAME_RECEIVED_FROM_NONASSOCIATED_STATION                                       =    (7);
00073 const uint8_t  SL_DISASSOCIATED_BECAUSE_SENDING_STATION_IS_LEAVING_BSS                                    =    (8);
00074 const uint8_t  SL_STATION_REQUESTING_ASSOCIATION_IS_NOT_AUTHENTICATED_WITH_RESPONDING_STATION             =    (9);
00075 const uint8_t  SL_DISASSOCIATED_BECAUSE_THE_INFORMATION_IN_THE_POWER_CAPABILITY_ELEMENT_IS_UNACCEPTABLE   =    (10);
00076 const uint8_t  SL_DISASSOCIATED_BECAUSE_THE_INFORMATION_IN_THE_SUPPORTED_CHANNELS_ELEMENT_IS_UNACCEPTABLE =    (11);
00077 const uint8_t  SL_DISCONNECT_RESERVED_1                                                                   =    (12);
00078 const uint8_t  SL_INVALID_INFORMATION_ELEMENT                                                             =    (13);
00079 const uint8_t  SL_MESSAGE_INTEGRITY_CODE_MIC_FAILURE                                                      =    (14);
00080 const uint8_t  SL_FOUR_WAY_HANDSHAKE_TIMEOUT                                                              =    (15);
00081 const uint8_t  SL_GROUP_KEY_HANDSHAKE_TIMEOUT                                                             =    (16);
00082 const uint8_t  SL_RE_ASSOCIATION_REQUEST_PROBE_RESPONSE_BEACON_FRAME                                      =    (17);
00083 const uint8_t  SL_INVALID_GROUP_CIPHER                                                                    =    (18);
00084 const uint8_t  SL_INVALID_PAIRWISE_CIPHER                                                                 =    (19);
00085 const uint8_t  SL_INVALID_AKMP                                                                            =    (20);
00086 const uint8_t  SL_UNSUPPORTED_RSN_INFORMATION_ELEMENT_VERSION                                             =    (21);
00087 const uint8_t  SL_INVALID_RSN_INFORMATION_ELEMENT_CAPABILITIES                                            =    (22);
00088 const uint8_t  SL_IEEE_802_1X_AUTHENTICATION_FAILED                                                       =    (23);
00089 const uint8_t  SL_CIPHER_SUITE_REJECTED_BECAUSE_OF_THE_SECURITY_POLICY                                    =    (24);
00090 const uint8_t  SL_DISCONNECT_RESERVED_2                                                                   =    (25);
00091 const uint8_t  SL_DISCONNECT_RESERVED_3                                                                   =    (26);
00092 const uint8_t  SL_DISCONNECT_RESERVED_4                                                                   =    (27);
00093 const uint8_t  SL_DISCONNECT_RESERVED_5                                                                   =    (28);
00094 const uint8_t  SL_DISCONNECT_RESERVED_6                                                                   =    (29);
00095 const uint8_t  SL_DISCONNECT_RESERVED_7                                                                   =    (30);
00096 const uint8_t  SL_DISCONNECT_RESERVED_8                                                                   =    (31);
00097 const uint8_t  SL_USER_INITIATED_DISCONNECTION                                                            =    (200);
00098 
00099 /* Wlan error codes */
00100 const int8_t  SL_ERROR_KEY_ERROR                                                                          =   (-3);
00101 const int8_t  SL_ERROR_INVALID_ROLE                                                                       =   (-71);
00102 const int8_t  SL_ERROR_INVALID_SECURITY_TYPE                                                              =   (-84);
00103 const int8_t  SL_ERROR_PASSPHRASE_TOO_LONG                                                                =   (-85);
00104 const int8_t  SL_ERROR_WPS_NO_PIN_OR_WRONG_PIN_LEN                                                        =   (-87);
00105 const int8_t  SL_ERROR_EAP_WRONG_METHOD                                                                   =   (-88);
00106 const int8_t  SL_ERROR_PASSWORD_ERROR                                                                     =   (-89);
00107 const int8_t  SL_ERROR_EAP_ANONYMOUS_LEN_ERROR                                                            =   (-90);
00108 const int8_t  SL_ERROR_SSID_LEN_ERROR                                                                     =   (-91);
00109 const int8_t  SL_ERROR_USER_ID_LEN_ERROR                                                                  =   (-92);
00110 const int8_t  SL_ERROR_ILLEGAL_WEP_KEY_INDEX                                                              =   (-95);
00111 const int8_t  SL_ERROR_INVALID_DWELL_TIME_VALUES                                                          =   (-96);
00112 const int8_t  SL_ERROR_INVALID_POLICY_TYPE                                                                =   (-97);
00113 const int8_t  SL_ERROR_PM_POLICY_INVALID_OPTION                                                           =   (-98);
00114 const int8_t  SL_ERROR_PM_POLICY_INVALID_PARAMS                                                           =   (-99);
00115 const int16_t  SL_ERROR_WIFI_ALREADY_DISCONNECTED                                                         =   (-129);
00116 const int8_t  SL_ERROR_WIFI_NOT_CONNECTED                                                                 =   (-59);
00117 
00118 
00119 
00120 const uint8_t SL_SEC_TYPE_OPEN                                                                            =    (0);
00121 const uint8_t SL_SEC_TYPE_WEP                                                                             =    (1);
00122 const uint8_t SL_SEC_TYPE_WPA                                                                             =    (2); /* deprecated */
00123 const uint8_t SL_SEC_TYPE_WPA_WPA2                                                                        =    (2);
00124 const uint8_t SL_SEC_TYPE_WPS_PBC                                                                         =    (3);
00125 const uint8_t SL_SEC_TYPE_WPS_PIN                                                                         =    (4);
00126 const uint8_t SL_SEC_TYPE_WPA_ENT                                                                         =    (5);
00127 const uint8_t SL_SEC_TYPE_P2P_PBC                                                                         =    (6);
00128 const uint8_t SL_SEC_TYPE_P2P_PIN_KEYPAD                                                                  =    (7);
00129 const uint8_t SL_SEC_TYPE_P2P_PIN_DISPLAY                                                                 =    (8);
00130 const uint8_t SL_SEC_TYPE_P2P_PIN_AUTO                                                                    =    (9); /* NOT Supported yet */
00131 
00132 
00133 
00134 const uint8_t SL_SCAN_SEC_TYPE_OPEN                                                                        =   (0);
00135 const uint8_t SL_SCAN_SEC_TYPE_WEP                                                                         =   (1);
00136 const uint8_t SL_SCAN_SEC_TYPE_WPA                                                                         =   (2);
00137 const uint8_t SL_SCAN_SEC_TYPE_WPA2                                                                        =   (3);
00138 
00139 
00140 
00141 const uint8_t TLS                           =     (0x1);
00142 const uint8_t MSCHAP                        =     (0x0);
00143 const uint8_t PSK                           =     (0x2);
00144 const uint8_t TTLS                          =     (0x10);
00145 const uint8_t PEAP0                         =     (0x20);
00146 const uint8_t PEAP1                         =     (0x40);
00147 const uint8_t FAST                          =     (0x80);
00148 
00149 const uint8_t FAST_AUTH_PROVISIONING        =     (0x02);
00150 const uint8_t FAST_UNAUTH_PROVISIONING      =     (0x01);
00151 const uint8_t FAST_NO_PROVISIONING          =     (0x00);
00152 
00153 const uint8_t EAPMETHOD_PHASE2_SHIFT        =     (8);
00154 const uint8_t EAPMETHOD_PAIRWISE_CIPHER_SHIFT =   (19);
00155 const uint8_t EAPMETHOD_GROUP_CIPHER_SHIFT  =     (27);
00156 
00157 const uint8_t WPA_CIPHER_CCMP               =     (0x1);
00158 const uint8_t WPA_CIPHER_TKIP               =     (0x2);
00159 const uint8_t CC31XX_DEFAULT_CIPHER         =     (WPA_CIPHER_CCMP | WPA_CIPHER_TKIP);
00160 
00161 #define EAPMETHOD(phase1,phase2,pairwise_cipher,group_cipher) \
00162 ((phase1) | \
00163  ((phase2) << EAPMETHOD_PHASE2_SHIFT ) |\
00164  ((uint32_t)(pairwise_cipher) << EAPMETHOD_PAIRWISE_CIPHER_SHIFT ) |\
00165  ((uint32_t)(group_cipher) << EAPMETHOD_GROUP_CIPHER_SHIFT ))
00166 
00167 /*                                                            phase1  phase2                     pairwise_cipher         group_cipher         */
00168 #define SL_ENT_EAP_METHOD_TLS                       EAPMETHOD(TLS   , 0                        , CC31XX_DEFAULT_CIPHER , CC31XX_DEFAULT_CIPHER)
00169 #define SL_ENT_EAP_METHOD_TTLS_TLS                  EAPMETHOD(TTLS  , TLS                      , CC31XX_DEFAULT_CIPHER , CC31XX_DEFAULT_CIPHER)
00170 #define SL_ENT_EAP_METHOD_TTLS_MSCHAPv2             EAPMETHOD(TTLS  , MSCHAP                   , CC31XX_DEFAULT_CIPHER , CC31XX_DEFAULT_CIPHER)
00171 #define SL_ENT_EAP_METHOD_TTLS_PSK                  EAPMETHOD(TTLS  , PSK                      , CC31XX_DEFAULT_CIPHER , CC31XX_DEFAULT_CIPHER)
00172 #define SL_ENT_EAP_METHOD_PEAP0_TLS                 EAPMETHOD(PEAP0 , TLS                      , CC31XX_DEFAULT_CIPHER , CC31XX_DEFAULT_CIPHER)
00173 #define SL_ENT_EAP_METHOD_PEAP0_MSCHAPv2            EAPMETHOD(PEAP0 , MSCHAP                   , CC31XX_DEFAULT_CIPHER , CC31XX_DEFAULT_CIPHER)
00174 #define SL_ENT_EAP_METHOD_PEAP0_PSK                 EAPMETHOD(PEAP0 , PSK                      , CC31XX_DEFAULT_CIPHER , CC31XX_DEFAULT_CIPHER)
00175 #define SL_ENT_EAP_METHOD_PEAP1_TLS                 EAPMETHOD(PEAP1 , TLS                      , CC31XX_DEFAULT_CIPHER , CC31XX_DEFAULT_CIPHER)
00176 #define SL_ENT_EAP_METHOD_PEAP1_MSCHAPv2            EAPMETHOD(PEAP1 , MSCHAP                   , CC31XX_DEFAULT_CIPHER , CC31XX_DEFAULT_CIPHER)
00177 #define SL_ENT_EAP_METHOD_PEAP1_PSK                 EAPMETHOD(PEAP1 , PSK                      , CC31XX_DEFAULT_CIPHER , CC31XX_DEFAULT_CIPHER)
00178 #define SL_ENT_EAP_METHOD_FAST_AUTH_PROVISIONING    EAPMETHOD(FAST  , FAST_AUTH_PROVISIONING   , CC31XX_DEFAULT_CIPHER , CC31XX_DEFAULT_CIPHER)
00179 #define SL_ENT_EAP_METHOD_FAST_UNAUTH_PROVISIONING  EAPMETHOD(FAST  , FAST_UNAUTH_PROVISIONING , CC31XX_DEFAULT_CIPHER , CC31XX_DEFAULT_CIPHER)
00180 #define SL_ENT_EAP_METHOD_FAST_NO_PROVISIONING      EAPMETHOD(FAST  , FAST_NO_PROVISIONING     , CC31XX_DEFAULT_CIPHER , CC31XX_DEFAULT_CIPHER)
00181 
00182 const uint8_t SL_LONG_PREAMBLE                  =  (0);
00183 const uint8_t SL_SHORT_PREAMBLE                 =  (1);
00184 
00185 const uint8_t SL_RAW_RF_TX_PARAMS_CHANNEL_SHIFT =  (0);
00186 const uint8_t SL_RAW_RF_TX_PARAMS_RATE_SHIFT    =  (6);
00187 const uint8_t SL_RAW_RF_TX_PARAMS_POWER_SHIFT   =  (11);
00188 const uint8_t SL_RAW_RF_TX_PARAMS_PREAMBLE_SHIFT = (15);
00189 
00190 #define SL_RAW_RF_TX_PARAMS(chan,rate,power,preamble) \
00191     ((chan << SL_RAW_RF_TX_PARAMS_CHANNEL_SHIFT) | \
00192     (rate << SL_RAW_RF_TX_PARAMS_RATE_SHIFT) | \
00193     (power << SL_RAW_RF_TX_PARAMS_POWER_SHIFT) | \
00194     (preamble << SL_RAW_RF_TX_PARAMS_PREAMBLE_SHIFT))
00195 
00196 
00197 /* wlan config application IDs */
00198 const uint8_t SL_WLAN_CFG_AP_ID                  =  (0);
00199 const uint8_t SL_WLAN_CFG_GENERAL_PARAM_ID       =  (1);
00200 const uint8_t SL_WLAN_CFG_P2P_PARAM_ID           =  (2);
00201 
00202 /* wlan AP Config set/get options */
00203 const uint8_t WLAN_AP_OPT_SSID                   =  (0);
00204 const uint8_t WLAN_AP_OPT_CHANNEL                =  (3);
00205 const uint8_t WLAN_AP_OPT_HIDDEN_SSID            =  (4);
00206 const uint8_t WLAN_AP_OPT_SECURITY_TYPE          =  (6);
00207 const uint8_t WLAN_AP_OPT_PASSWORD               =  (7);
00208 const uint8_t WLAN_GENERAL_PARAM_OPT_COUNTRY_CODE = (9);
00209 const uint8_t WLAN_GENERAL_PARAM_OPT_STA_TX_POWER = (10);
00210 const uint8_t WLAN_GENERAL_PARAM_OPT_AP_TX_POWER  = (11);
00211 
00212 const uint8_t WLAN_P2P_OPT_DEV_NAME              =  (12);
00213 const uint8_t WLAN_P2P_OPT_DEV_TYPE              =  (13);
00214 const uint8_t WLAN_P2P_OPT_CHANNEL_N_REGS        =  (14);
00215 const uint8_t WLAN_GENERAL_PARAM_OPT_INFO_ELEMENT = (16);
00216 const uint8_t WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS  = (18);      /* change the scan channels and RSSI threshold using this configuration option */
00217 
00218 /* SmartConfig CIPHER options */
00219 const uint8_t SMART_CONFIG_CIPHER_SFLASH         =  (0);      /* password is not delivered by the application. The Simple Manager should */
00220 /* check if the keys are stored in the Flash.                              */
00221 const uint8_t SMART_CONFIG_CIPHER_AES            =  (1);      /* AES (other types are not supported)                                     */
00222 const uint8_t SMART_CONFIG_CIPHER_NONE           =  (0xFF);   /* do not check in the flash                                               */
00223 
00224 
00225 const uint8_t SL_POLICY_CONNECTION               =  (0x10);
00226 const uint8_t SL_POLICY_SCAN                     =  (0x20);
00227 const uint8_t SL_POLICY_PM                       =  (0x30);
00228 const uint8_t SL_POLICY_P2P                      =  (0x40);
00229 
00230 #define VAL_2_MASK(position,value)           ((1 & (value))<<(position))
00231 #define MASK_2_VAL(position,mask)            (((1 << position) & (mask)) >> (position))
00232 
00233 #define SL_CONNECTION_POLICY(Auto,Fast,Open,anyP2P,autoSmartConfig)                (VAL_2_MASK(0,Auto) | VAL_2_MASK(1,Fast) | VAL_2_MASK(2,Open) | VAL_2_MASK(3,anyP2P) | VAL_2_MASK(4,autoSmartConfig))
00234 #define SL_SCAN_POLICY_EN(policy)            (MASK_2_VAL(0,policy))
00235 #define SL_SCAN_POLICY(Enable)               (VAL_2_MASK(0,Enable))
00236 
00237 
00238 const uint8_t SL_NORMAL_POLICY                   = (0);
00239 const uint8_t SL_LOW_LATENCY_POLICY              = (1);
00240 const uint8_t SL_LOW_POWER_POLICY                = (2);
00241 const uint8_t SL_ALWAYS_ON_POLICY                = (3);
00242 const uint8_t SL_LONG_SLEEP_INTERVAL_POLICY      = (4);
00243 
00244 const uint8_t SL_P2P_ROLE_NEGOTIATE              = (3);
00245 const uint8_t SL_P2P_ROLE_GROUP_OWNER            = (15);
00246 const uint8_t SL_P2P_ROLE_CLIENT                 = (0);
00247 
00248 const uint8_t SL_P2P_NEG_INITIATOR_ACTIVE        = (0);
00249 const uint8_t SL_P2P_NEG_INITIATOR_PASSIVE       = (1);
00250 const uint8_t SL_P2P_NEG_INITIATOR_RAND_BACKOFF  = (2);
00251 
00252 #define POLICY_VAL_2_OPTIONS(position,mask,policy)    ((mask & policy) << position )
00253 
00254 #define SL_P2P_POLICY(p2pNegType,p2pNegInitiator)   (POLICY_VAL_2_OPTIONS(0,0xF,(p2pNegType > SL_P2P_ROLE_GROUP_OWNER ? SL_P2P_ROLE_GROUP_OWNER : p2pNegType)) | \
00255                                                      POLICY_VAL_2_OPTIONS(4,0x1,(p2pNegType > SL_P2P_ROLE_GROUP_OWNER ? 1:0)) | \
00256                                                      POLICY_VAL_2_OPTIONS(5,0x3, p2pNegInitiator))
00257 
00258 
00259 /* Info elements */
00260 
00261 const uint8_t INFO_ELEMENT_DEFAULT_ID            =  (0); /* 221 will be used */
00262 
00263 /* info element size is up to 252 bytes (+ 3 bytes of OUI). */
00264 const uint8_t INFO_ELEMENT_MAX_SIZE              =  (252);
00265 
00266 /* For AP - the total length of all info elements is 300 bytes (for example - 4 info elements of 75 bytes each) */
00267 const uint16_t INFO_ELEMENT_MAX_TOTAL_LENGTH_AP  =   (300);
00268 /* For P2P - the total length of all info elements is 150 bytes (for example - 4 info elements of 40 bytes each) */
00269 const uint8_t INFO_ELEMENT_MAX_TOTAL_LENGTH_P2P_GO (160);
00270 
00271 const uint8_t INFO_ELEMENT_AP_ROLE               =  (0);
00272 const uint8_t INFO_ELEMENT_P2P_GO_ROLE           =  (1);
00273 
00274 /* we support up to 4 info elements per Role. */
00275 const uint8_t MAX_PRIVATE_INFO_ELEMENTS_SUPPROTED = (4);
00276 
00277 const uint8_t INFO_ELEMENT_DEFAULT_OUI_0         =  (0x08);
00278 const uint8_t INFO_ELEMENT_DEFAULT_OUI_1         =  (0x00);
00279 const uint8_t INFO_ELEMENT_DEFAULT_OUI_2         =  (0x28);
00280 
00281 const uint32_t INFO_ELEMENT_DEFAULT_OUI          =   (0x000000);  /* 08, 00, 28 will be used */
00282 
00283 
00284 /*****************************************************************************/
00285 /* Structure/Enum declarations                                               */
00286 /*****************************************************************************/
00287 
00288 typedef enum {
00289     RATE_1M         = 1,
00290     RATE_2M         = 2,
00291     RATE_5_5M       = 3,
00292     RATE_11M        = 4,
00293     RATE_6M         = 6,
00294     RATE_9M         = 7,
00295     RATE_12M        = 8,
00296     RATE_18M        = 9,
00297     RATE_24M        = 10,
00298     RATE_36M        = 11,
00299     RATE_48M        = 12,
00300     RATE_54M        = 13,
00301     RATE_MCS_0      = 14,
00302     RATE_MCS_1      = 15,
00303     RATE_MCS_2      = 16,
00304     RATE_MCS_3      = 17,
00305     RATE_MCS_4      = 18,
00306     RATE_MCS_5      = 19,
00307     RATE_MCS_6      = 20,
00308     RATE_MCS_7      = 21,
00309     MAX_NUM_RATES   = 0xFF
00310 } SlRateIndex_e;
00311 
00312 typedef enum {
00313     DEV_PW_DEFAULT=0,
00314     DEV_PW_PIN_KEYPAD=1,
00315     DEV_PW_PUSH_BUTTON=4,
00316     DEV_PW_PIN_DISPLAY=5
00317 } sl_p2p_dev_password_method;
00318 
00319 
00320 typedef struct {
00321     uint32_t    status;
00322     uint32_t    ssid_len;
00323     uint8_t     ssid[32];
00324     uint32_t    private_token_len;
00325     uint8_t     private_token[32];
00326 } slSmartConfigStartAsyncResponse_t;
00327 
00328 typedef struct {
00329     uint16_t    status;
00330     uint16_t    padding;
00331 } slSmartConfigStopAsyncResponse_t;
00332 
00333 typedef struct {
00334     uint16_t    status;
00335     uint16_t    padding;
00336 } slWlanConnFailureAsyncResponse_t;
00337 
00338 typedef struct {
00339     uint8_t     connection_type;/* 0-STA,3-P2P_CL */
00340     uint8_t     ssid_len;
00341     uint8_t     ssid_name[32];
00342     uint8_t     go_peer_device_name_len;
00343     uint8_t     go_peer_device_name[32];
00344     uint8_t     bssid[6];
00345     uint8_t     reason_code;
00346     uint8_t     padding[2];
00347 } slWlanConnectAsyncResponse_t;
00348 
00349 typedef struct {
00350     uint8_t     go_peer_device_name[32];
00351     uint8_t     mac[6];
00352     uint8_t     go_peer_device_name_len;
00353     uint8_t     wps_dev_password_id;
00354     uint8_t     own_ssid[32];/* relevant for event sta-connected only */
00355     uint8_t     own_ssid_len;/* relevant for event sta-connected only */
00356     uint8_t     padding[3];
00357 } slPeerInfoAsyncResponse_t;
00358 
00359 
00360 typedef union {
00361     slSmartConfigStartAsyncResponse_t        smartConfigStartResponse; /*SL_WLAN_SMART_CONFIG_COMPLETE_EVENT*/
00362     slSmartConfigStopAsyncResponse_t         smartConfigStopResponse;  /*SL_WLAN_SMART_CONFIG_STOP_EVENT */
00363     slPeerInfoAsyncResponse_t                APModeStaConnected;       /* SL_WLAN_STA_CONNECTED_EVENT - relevant only in AP mode - holds information regarding a new STA connection */
00364     slPeerInfoAsyncResponse_t                APModestaDisconnected;    /* SL_WLAN_STA_DISCONNECTED_EVENT - relevant only in AP mode - holds information regarding a STA disconnection */
00365     slWlanConnectAsyncResponse_t             STAandP2PModeWlanConnected;   /* SL_WLAN_CONNECT_EVENT - relevant only in STA and P2P mode - holds information regarding a new connection */
00366     slWlanConnectAsyncResponse_t             STAandP2PModeDisconnected;   /* SL_WLAN_DISCONNECT_EVENT - relevant only in STA and P2P mode - holds information regarding a disconnection */
00367     slPeerInfoAsyncResponse_t                P2PModeDevFound;             /* SL_WLAN_P2P_DEV_FOUND_EVENT - relevant only in P2P mode */
00368     slPeerInfoAsyncResponse_t                P2PModeNegReqReceived;       /* SL_WLAN_P2P_NEG_REQ_RECEIVED_EVENT - relevant only in P2P mode */
00369     slWlanConnFailureAsyncResponse_t         P2PModewlanConnectionFailure;   /* SL_WLAN_CONNECTION_FAILED_EVENT - relevant only in P2P mode */
00370 
00371 } SlWlanEventData_u;
00372 
00373 typedef struct {
00374     uint32_t     Event;
00375     SlWlanEventData_u        EventData;
00376 } SlWlanEvent_t;
00377 
00378 
00379 typedef struct {
00380     uint32_t  ReceivedValidPacketsNumber;                     /* sum of the packets that been received OK (include filtered) */
00381     uint32_t  ReceivedFcsErrorPacketsNumber;                  /* sum of the packets that been dropped due to FCS error */
00382     uint32_t  ReceivedAddressMismatchPacketsNumber;           /* sum of the packets that been received but filtered out by one of the HW filters */
00383     int16_t   AvarageDataCtrlRssi;                            /* average RSSI for all valid data packets received */
00384     int16_t   AvarageMgMntRssi;                               /* average RSSI for all valid management packets received */
00385     uint16_t  RateHistogram[NUM_OF_RATE_INDEXES];             /* rate histogram for all valid packets received */
00386     uint16_t  RssiHistogram[SIZE_OF_RSSI_HISTOGRAM];          /* RSSI histogram from -40 until -87 (all below and above\n RSSI will appear in the first and last cells */
00387     uint32_t  StartTimeStamp;                                 /* the time stamp started collecting the statistics in uSec */
00388     uint32_t  GetTimeStamp;                                   /* the time stamp called the get statistics command */
00389 } SlGetRxStatResponse_t;
00390 
00391 
00392 typedef struct {
00393     uint8_t ssid[MAXIMAL_SSID_LENGTH];
00394     uint8_t ssid_len;
00395     uint8_t sec_type;
00396     uint8_t bssid[SL_BSSID_LENGTH];
00397     int8_t rssi;
00398     int8_t reserved[3];
00399 } Sl_WlanNetworkEntry_t;
00400 
00401 
00402 typedef struct {
00403     uint8_t   Type;
00404     int8_t*  Key;
00405     uint8_t   KeyLen;
00406 } SlSecParams_t;
00407 
00408 typedef struct {
00409     int8_t*  User;
00410     uint8_t   UserLen;
00411     int8_t*  AnonUser;
00412     uint8_t   AnonUserLen;
00413     uint8_t   CertIndex;  /* not supported */
00414     uint32_t  EapMethod;
00415 } SlSecParamsExt_t;
00416 
00417 typedef struct {
00418     int8_t   User[32];
00419     uint8_t   UserLen;
00420     int8_t   AnonUser[32];
00421     uint8_t   AnonUserLen;
00422     uint8_t   CertIndex;  //not supported
00423     uint32_t  EapMethod;
00424 } SlGetSecParamsExt_t;
00425 
00426 typedef enum {
00427     ROLE_STA   =   0,
00428     ROLE_AP    =   2,
00429     ROLE_P2P     =   3,
00430     ROLE_STA_ERR =  -1,         /* Failure to load MAC/PHY in STA role */
00431     ROLE_AP_ERR  =  -ROLE_AP,   /* Failure to load MAC/PHY in AP role */
00432     ROLE_P2P_ERR =  -ROLE_P2P   /* Failure to load MAC/PHY in P2P role */
00433 } SlWlanMode_t;
00434 
00435 typedef struct {
00436     uint32_t   G_Channels_mask;
00437     int32_t   rssiThershold;
00438 } slWlanScanParamCommand_t;
00439 
00440 
00441 typedef struct {
00442     uint8_t   id;
00443     uint8_t   oui[3];
00444     uint16_t  length;
00445     uint8_t   data[252];
00446 } sl_protocol_InfoElement_t;
00447 
00448 typedef struct {
00449     uint8_t                       index;  /* 0 - MAX_PRIVATE_INFO_ELEMENTS_SUPPROTED */
00450     uint8_t                       role;   /* bit0: AP = 0, GO = 1                    */
00451     sl_protocol_InfoElement_t   ie;
00452 } sl_protocol_WlanSetInfoElement_t;
00453 
00454 
00455 class cc3100_wlan_rx_filters;
00456 class cc3100_wlan
00457 {
00458 
00459 public:
00460 
00461     cc3100_wlan(cc3100_driver &driver, cc3100_wlan_rx_filters  &wlan_rx_filters);
00462 
00463     ~cc3100_wlan();
00464 
00465 
00466     /*****************************************************************************/
00467     /* Function prototypes                                                                       */
00468     /*****************************************************************************/
00469 
00470 
00471     /*!
00472         \brief Connect to wlan network as a station
00473 
00474         \param[in]      pName       up to 32 bytes in case of STA the name is the SSID of the Access Point
00475         \param[in]      NameLen     name length
00476         \param[in]      pMacAddr    6 bytes for MAC address
00477         \param[in]      pSecParams  Security parameters (use NULL key for SL_SEC_TYPE_OPEN)
00478         Security types options: \n
00479                                 - SL_SEC_TYPE_OPEN
00480                                 - SL_SEC_TYPE_WEP
00481                                 - SL_SEC_TYPE_WPA_WPA2
00482                                 - SL_SEC_TYPE_WPA_ENT
00483                                 - SL_SEC_TYPE_WPS_PBC
00484                                 - SL_SEC_TYPE_WPS_PIN
00485         \param[in]      pSecExtParams  Enterprise parameters (set NULL in case Enterprise parameters is not in use)
00486 
00487         \return         On success, zero is returned. On error, negative is returned
00488                         In case error number (-71) is returned, it indicates a connection was activated while the device it running in AP role
00489 
00490         \sa             sl_WlanDisconnect
00491         \note           belongs to \ref ext_api
00492         \warning        In this version only single enterprise mode could be used
00493                         SL_SEC_TYPE_WPA is a deprecated definition, the new definition is SL_SEC_TYPE_WPA_WPA2
00494     */
00495 #if _SL_INCLUDE_FUNC(sl_WlanConnect)
00496     int16_t sl_WlanConnect(const signed char*  pName, const int16_t NameLen, const uint8_t *pMacAddr, const SlSecParams_t* pSecParams, const SlSecParamsExt_t* pSecExtParams);
00497 #endif
00498 
00499     /*!
00500         \brief wlan disconnect
00501 
00502         Disconnect connection
00503 
00504         \return         0 disconnected done, other already disconnected
00505 
00506         \sa             sl_WlanConnect
00507         \note           belongs to \ref ext_api
00508         \warning
00509     */
00510 #if _SL_INCLUDE_FUNC(sl_WlanDisconnect)
00511     int16_t sl_WlanDisconnect(void);
00512 #endif
00513 
00514     /*!
00515         \brief add profile
00516 
00517         When auto start is enabled, the device connects to a
00518         station from the profiles table. Up to 7 profiles are
00519         supported. If several profiles configured the device chose
00520         the highest priority profile, within each priority group,
00521         device will chose profile based on security policy, signal
00522         strength, etc parameters.
00523 
00524 
00525         \param[in]      pName          up to 32 bytes in case of STA the name is the
00526                                        SSID of the Access Point
00527                                        in case of P2P the name is the remote device name
00528         \param[in]      NameLen     name length
00529         \param[in]      pMacAddr    6 bytes for MAC address
00530         \param[in]      pSecParams     Security parameters - security type
00531                                        (SL_SEC_TYPE_OPEN,SL_SEC_TYPE_WEP,SL_SEC_TYPE_WPA_WPA2,
00532                                         SL_SEC_TYPE_P2P_PBC,SL_SEC_TYPE_P2P_PIN_KEYPAD,SL_SEC_TYPE_P2P_PIN_DISPLAY, SL_SEC_TYPE_WPA_ENT), key, and key length
00533                                        in case of p2p security type pin the key refers to pin code
00534         \param[in]      pSecExtParams  Enterprise parameters - identity, identity length,
00535                                        Anonymous, Anonymous length, CertIndex (not supported,
00536                                        certificates need to be placed in a specific file ID),
00537                                        EapMethod.Use NULL in case Enterprise parameters is not in use
00538 
00539         \param[in]      Priority    profile priority. Lowest priority: 0
00540         \param[in]      Options     Not supported
00541 
00542         \return         On success, profile stored index is returned. On error, negative value is returned
00543 
00544         \sa             sl_WlanProfileGet , sl_WlanProfileDel
00545         \note           belongs to \ref ext_api
00546         \warning        Only one Enterprise profile is supported.
00547                         Please Note that in case of adding an existing profile (compared by pName,pMACAddr and security type)
00548                         the old profile will be deleted and the same index will be returned.
00549                         SL_SEC_TYPE_WPA is a deprecated definition, the new definition is SL_SEC_TYPE_WPA_WPA2
00550 
00551     */
00552 #if _SL_INCLUDE_FUNC(sl_WlanProfileAdd)
00553     int16_t sl_WlanProfileAdd(const int8_t*  pName, 
00554                               const int16_t NameLen, 
00555                               const uint8_t *pMacAddr, 
00556                               const SlSecParams_t* pSecParams , 
00557                               const SlSecParamsExt_t* pSecExtParams, 
00558                               const uint32_t  Priority, 
00559                               const uint32_t  Options);
00560 #endif
00561 
00562     /*!
00563         \brief get profile
00564 
00565         read profile from the device
00566 
00567         \param[in]      Index          profile stored index, if index does not exists
00568                                        error is return
00569         \param[out]     pName          up to 32 bytes, in case of sta mode the name of the Access Point
00570                                        in case of p2p mode the name of the Remote Device
00571         \param[out]     pNameLen       name length
00572         \param[out]     pMacAddr       6 bytes for MAC address
00573         \param[out]     pSecParams     security parameters - security type
00574                                        (SL_SEC_TYPE_OPEN, SL_SEC_TYPE_WEP, SL_SEC_TYPE_WPA_WPA2 or
00575                                        SL_SEC_TYPE_WPS_PBC, SL_SEC_TYPE_WPS_PIN, SL_SEC_TYPE_WPA_ENT,SL_SEC_TYPE_P2P_PBC,SL_SEC_TYPE_P2P_PIN_KEYPAD or SL_SEC_TYPE_P2P_PIN_DISPLAY), 
00576                                        key and key length are not                  
00577                                        in case of p2p security type pin the key refers to pin code
00578                                        return due to security reasons.
00579         \param[out]     pSecExtParams  enterprise parameters - identity, identity
00580                                        length, Anonymous, Anonymous length
00581                                        CertIndex (not supported), EapMethod.
00582         \param[out]     Priority       profile priority
00583 
00584         \return         On success, Profile security type is returned (0 or positive number). On error, -1 is
00585                         returned
00586 
00587         \sa             sl_WlanProfileAdd , sl_WlanProfileDel
00588         \note           belongs to \ref ext_api
00589         \warning
00590     */
00591 #if _SL_INCLUDE_FUNC(sl_WlanProfileGet)
00592     int16_t sl_WlanProfileGet(const int16_t Index,int8_t*  pName, int16_t *pNameLen, uint8_t *pMacAddr, SlSecParams_t* pSecParams, SlGetSecParamsExt_t* pSecExtParams, uint32_t *pPriority);
00593 #endif
00594 
00595     /*!
00596         \brief Delete WLAN profile
00597 
00598         Delete WLAN profile
00599 
00600         \param[in]   index  number of profile to delete.Possible values are 0 to 6.
00601                      Index value 255 will delete all saved profiles
00602 
00603         \return  On success, zero is returned. On error, -1 is
00604                    returned
00605 
00606         \sa   sl_WlanProfileAdd , sl_WlanProfileGet
00607         \note           belongs to \ref ext_api
00608         \warning
00609     */
00610 #if _SL_INCLUDE_FUNC(sl_WlanProfileDel)
00611     int16_t sl_WlanProfileDel(const int16_t Index);
00612 #endif
00613 
00614     /*!
00615         \brief Set policy values
00616 
00617         \param[in]      Type      Type of policy to be modified. The Options are:\n
00618                                   - SL_POLICY_CONNECTION
00619                                   - SL_POLICY_SCAN
00620                                   - SL_POLICY_PM
00621                                   - SL_POLICY_P2P
00622         \param[in]      Policy    The option value which depends on action type
00623         \param[in]      pVal      An optional value pointer
00624         \param[in]      ValLen    An optional value length, in bytes
00625         \return         On success, zero is returned. On error, -1 is
00626                         returned
00627         \sa             sl_WlanPolicyGet
00628         \note           belongs to \ref ext_api
00629         \warning
00630         \par
00631         SL_POLICY_CONNECTION type defines three options available to connect the CC31xx device to the AP: \n
00632 
00633         -  If Auto Connect is set, the CC31xx device tries to automatically reconnect to one of its stored profiles, each time the connection fails or the device is rebooted.\n
00634            To set this option, use: \n
00635            <b> sl_WlanPolicySet(SL_POLICY_CONNECTION,SL_CONNECTION_POLICY(1,0,0,0,0),NULL,0) </b>
00636         -  If Fast Connect is set, the CC31xx device tries to establish a fast connection to AP. \n
00637            To set this option, use: \n
00638            <b> sl_WlanPolicySet(SL_POLICY_CONNECTION,SL_CONNECTION_POLICY(0,1,0,0,0),NULL,0) </b>
00639         -  (relevant for P2P mode only) - If Any P2P is set,  CC31xx/CC32xx device tries to automatically connect to the first P2P device available, \n
00640            supporting push button only. To set this option, use: \n
00641            <b> sl_WlanPolicySet(SL_POLICY_CONNECTION,SL_CONNECTION_POLICY(0,0,0,1,0),NULL,0) </b>
00642         -  For auto smart config upon restart (any command from Host will end this state) use: \n
00643            <b> sl_WlanPolicySet(SL_POLICY_CONNECTION,SL_CONNECTION_POLICY(0,0,0,0,1),NULL,0) </b> \n
00644         The options above could be combined to a single action, if more than one action is required. \n
00645         \par
00646         SL_POLICY_SCAN defines system scan time interval.Default interval is 10 minutes. \n
00647         After settings scan interval, an immediate scan is activated. The next scan will be based on the interval settings. \n
00648                         -  For example, setting scan interval to 1 minute interval use: \n
00649                            uint32_t intervalInSeconds = 60;    \n
00650                            #define SL_SCAN_ENABLE  1       \n<b>
00651                            sl_WlanPolicySet(SL_POLICY_SCAN,SL_SCAN_ENABLE, (uint8_t *)&intervalInSeconds,sizeof(intervalInSeconds)); </b>\n
00652 
00653                         -  For example, disable scan:    \n
00654                            #define SL_SCAN_DISABLE  0     \n<b>
00655                            sl_WlanPolicySet(SL_POLICY_SCAN,SL_SCAN_DISABLE,0,0); </b>\n
00656         \par
00657         SL_POLICY_PM defines a power management policy for Station mode only:
00658                         -  For setting normal power management (default) policy use: <b> sl_WlanPolicySet(SL_POLICY_PM , SL_NORMAL_POLICY, NULL,0) </b>
00659                         -  For setting low latency power management policy use: <b> sl_WlanPolicySet(SL_POLICY_PM , SL_LOW_LATENCY_POLICY, NULL,0) </b>
00660                         -  For setting low power management policy use: <b> sl_WlanPolicySet(SL_POLICY_PM , SL_LOW_POWER_POLICY, NULL,0) </b>
00661                         -  For setting always on power management policy use: <b> sl_WlanPolicySet(SL_POLICY_PM , SL_ALWAYS_ON_POLICY, NULL,0) </b>
00662                         -  For setting Long Sleep Interval policy use: \n
00663                                 uint16_t PolicyBuff[4] = {0,0,800,0}; // PolicyBuff[2] is max sleep time in mSec \n<b>
00664                                 sl_WlanPolicySet(SL_POLICY_PM , SL_LONG_SLEEP_INTERVAL_POLICY, (uint8_t*)PolicyBuff,sizeof(PolicyBuff));  </b>\n
00665 
00666         SL_POLICY_P2P defines p2p negotiation policy parameters for P2P role:
00667                         - To set intent negotiation value, set on of the following:
00668                             SL_P2P_ROLE_NEGOTIATE   - intent 3
00669                             SL_P2P_ROLE_GROUP_OWNER - intent 15
00670                             SL_P2P_ROLE_CLIENT      - intent 0
00671                         - To set negotiation initiator value (initiator policy of first negotiation action frame), set on of the following:
00672                             SL_P2P_NEG_INITIATOR_ACTIVE
00673                             SL_P2P_NEG_INITIATOR_PASSIVE
00674                             SL_P2P_NEG_INITIATOR_RAND_BACKOFF
00675                         For example: \n
00676                         <b>sl_WlanPolicySet(SL_POLICY_P2P, SL_P2P_POLICY(SL_P2P_ROLE_NEGOTIATE,SL_P2P_NEG_INITIATOR_RAND_BACKOFF),NULL,0) </b>
00677 
00678     */
00679 #if _SL_INCLUDE_FUNC(sl_WlanPolicySet)
00680     int16_t sl_WlanPolicySet(const uint8_t Type , const uint8_t Policy, uint8_t *pVal,const uint8_t ValLen);
00681 #endif
00682     /*!
00683         \brief get policy values
00684 
00685         \param[in]      Type     SL_POLICY_CONNECTION, SL_POLICY_SCAN, SL_POLICY_PM,SL_POLICY_P2P \n
00686 
00687         \param[in]      Policy   argument may be set to any value \n
00688 
00689         \param[out]     The returned values, depends on each policy type, will be stored in the allocated buffer pointed by pVal
00690                         with a maximum buffer length set by the calling function and pointed to by argument *pValLen
00691 
00692         \return         On success, zero is returned. On error, -1 is returned
00693 
00694         \sa             sl_WlanPolicySet
00695 
00696         \note           belongs to \ref ext_api
00697 
00698         \warning        The value pointed by the argument *pValLen should be set to a value different from 0 and
00699                         greater than the buffer length returned from the SL device. Otherwise, an error will be returned.
00700 
00701     */
00702 #if _SL_INCLUDE_FUNC(sl_WlanPolicyGet)
00703     int16_t sl_WlanPolicyGet(const uint8_t Type , uint8_t Policy,uint8_t *pVal,uint8_t *pValLen);
00704 #endif
00705     /*!
00706         \brief Gets the WLAN scan operation results
00707 
00708         Gets scan results , gets entry from scan result table
00709 
00710         \param[in]   Index - Starting index identifier (range 0-19) for getting scan results
00711         \param[in]   Count - How many entries to fetch. Max is (20-"Index").
00712         \param[out]  pEntries - pointer to an allocated Sl_WlanNetworkEntry_t.
00713                                 the number of array items should match "Count"
00714                                 sec_type: SL_SCAN_SEC_TYPE_OPEN, SL_SCAN_SEC_TYPE_WEP, SL_SCAN_SEC_TYPE_WPA or SL_SCAN_SEC_TYPE_WPA2
00715 
00716 
00717         \return  Number of valid networks list items
00718 
00719         \sa
00720         \note       belongs to \ref ext_api
00721         \warning    This command do not initiate any active scanning action
00722         \par        Example:
00723         \code       An example of fetching max 10 results:
00724 
00725                     Sl_WlanNetworkEntry_t netEntries[10];
00726                     int16_t resultsCount = sl_WlanGetNetworkList(0,10,&netEntries[0]);
00727                     for(i=0; i< resultsCount; i++)
00728                     {
00729                           printf("%s\n",netEntries[i].ssid);
00730                     }
00731         \endcode
00732     */
00733 #if _SL_INCLUDE_FUNC(sl_WlanGetNetworkList)
00734     int16_t sl_WlanGetNetworkList(const uint8_t Index, const uint8_t Count, Sl_WlanNetworkEntry_t *pEntries);
00735 #endif
00736 
00737     /*!
00738         \brief   Start collecting wlan RX statistics, for unlimited time.
00739 
00740         \return  On success, zero is returned. On error, -1 is returned
00741 
00742         \sa     sl_WlanRxStatStop      sl_WlanRxStatGet
00743         \note   belongs to \ref ext_api
00744         \warning  
00745         \par        Example:
00746         \code       Getting wlan RX statistics:
00747 
00748         void RxStatCollectTwice()
00749         {
00750             SlGetRxStatResponse_t rxStat;
00751             int16_t rawSocket;
00752             int8_t DataFrame[200];
00753             struct SlTimeval_t timeval;
00754             timeval.tv_sec =  0;             // Seconds
00755             timeval.tv_usec = 20000;         // Microseconds. 10000 microseconds resolution
00756 
00757             sl_WlanRxStatStart();  // set statistics mode
00758 
00759             rawSocket = sl_Socket(SL_AF_RF, SL_SOCK_RAW, eChannel);
00760             // set timeout - in case we have no activity for the specified channel
00761             sl_SetSockOpt(rawSocket,SL_SOL_SOCKET,SL_SO_RCVTIMEO, &timeval, sizeof(timeval));    // Enable receive timeout
00762             status = sl_Recv(rawSocket, DataFrame, sizeof(DataFrame), 0);
00763 
00764             Sleep(1000); // sleep for 1 sec
00765             sl_WlanRxStatGet(&rxStat,0); // statistics has been cleared upon read
00766             Sleep(1000); // sleep for 1 sec
00767             sl_WlanRxStatGet(&rxStat,0);
00768 
00769         }
00770         \endcode
00771     */
00772 #if _SL_INCLUDE_FUNC(sl_WlanRxStatStart)
00773     int16_t sl_WlanRxStatStart(void);
00774 #endif
00775 
00776 
00777     /*!
00778         \brief    Stop collecting wlan RX statistic, (if previous called sl_WlanRxStatStart)
00779 
00780         \return   On success, zero is returned. On error, -1 is returned
00781 
00782         \sa     sl_WlanRxStatStart      sl_WlanRxStatGet
00783         \note           belongs to \ref ext_api
00784         \warning  
00785     */
00786 #if _SL_INCLUDE_FUNC(sl_WlanRxStatStop)
00787     int16_t sl_WlanRxStatStop(void);
00788 #endif
00789 
00790 
00791     /*!
00792         \brief Get wlan RX statistics. upon calling this command, the statistics counters will be cleared.
00793 
00794         \param[in]  Flags should be 0  ( not applicable right now, will be added the future )
00795         \param[in]  pRxStat a pointer to SlGetRxStatResponse_t filled with Rx statistics results
00796         \return     On success, zero is returned. On error, -1 is returned
00797 
00798         \sa   sl_WlanRxStatStart  sl_WlanRxStatStop
00799         \note           belongs to \ref ext_api
00800         \warning
00801     */
00802 #if _SL_INCLUDE_FUNC(sl_WlanRxStatGet)
00803     int16_t sl_WlanRxStatGet(SlGetRxStatResponse_t *pRxStat, const uint32_t Flags);
00804 #endif
00805 
00806 
00807     /*!
00808         \brief Stop Smart Config procedure. Once Smart Config will be stopped,
00809                Asynchronous event will be received - SL_OPCODE_WLAN_SMART_CONFIG_STOP_ASYNC_RESPONSE.
00810 
00811         \param[in]  none
00812         \param[out] none
00813 
00814         \return     0 - if Stop Smart Config is about to be executed without errors.
00815 
00816         \sa         sl_WlanSmartConfigStart
00817         \note           belongs to \ref ext_api
00818         \warning      
00819 
00820     */
00821 #if _SL_INCLUDE_FUNC(sl_WlanSmartConfigStop)
00822     int16_t sl_WlanSmartConfigStop(void);
00823 #endif
00824 
00825     /*!
00826         \brief  Start Smart Config procedure
00827         \par
00828                 The target of the procedure is to let the                      \n
00829                 device to gain the network parameters: SSID and Password (if network is secured)             \n
00830                 and to connect to it once located in the network range.                                      \n
00831                 An external application should be used on a device connected to any mobile network.          \n
00832                 The external application will transmit over the air the network parameters in secured manner.\n
00833                 The Password may be decrypted using a Key.                                                   \n
00834                 The decryption method may be decided in the command or embedded in the Flash.                \n
00835                 The procedure can be activated for 1-3 group ID in the range of BIT_0 - BIT_15 where the default group ID id 0 (BIT_0) \n
00836                 Once Smart Config has ended successfully, Asynchronous event will be received -              \n
00837                 SL_OPCODE_WLAN_SMART_CONFIG_START_ASYNC_RESPONSE.                                            \n
00838                 The Event will hold the SSID and an extra field that might have been delivered as well (i.e. - device name)
00839 
00840         \param[in]  groupIdBitmask - each bit represent a group ID that should be searched.
00841                                      The Default group ID id BIT_0. 2 more group can be searched
00842                                      in addition. The range is BIT_0 - BIT_15.
00843         \param[in]  chiper - 0: check in flash, 1 - AES, 0xFF - do not check in flash
00844         \param[in]  publicKeyLen - public key len (used for the default group ID - BIT_0)
00845         \param[in]  group1KeyLen - group ID1 length
00846         \param[in]  group2KeyLen - group ID2 length
00847         \param[in]  publicKey    - public key (used for the default group ID - BIT_0)
00848         \param[in]  group1Key    - group ID1 key
00849         \param[in]  group2Key    - group ID2 key
00850 
00851         \param[out] none
00852 
00853         \return     0 - if Smart Config started successfully.
00854 
00855         \sa         sl_WlanSmartConfigStop
00856         \note           belongs to \ref ext_api
00857         \warning
00858         \par
00859         \code       An example of starting smart Config on group ID's 0 + 1 + 2
00860 
00861                     sl_WlanSmartConfigStart(7,      //group ID's (BIT_0 | BIT_1 | BIT_2)
00862                                             1,      //decrypt key by AES method
00863                                             16,     //decryption key length for group ID0
00864                                             16,     //decryption key length for group ID1
00865                                             16,     //decryption key length for group ID2
00866                                             "Key0Key0Key0Key0", //decryption key for group ID0
00867                                             "Key1Key1Key1Key1", //decryption key for group ID1
00868                                             "Key2Key2Key2Key2"  //decryption key for group ID2
00869                                             );
00870         \endcode
00871     */
00872 #if _SL_INCLUDE_FUNC(sl_WlanSmartConfigStart)
00873     int16_t sl_WlanSmartConfigStart(const uint32_t    groupIdBitmask,
00874                                     const uint8_t    cipher,
00875                                     const uint8_t    publicKeyLen,
00876                                     const uint8_t    group1KeyLen,
00877                                     const uint8_t    group2KeyLen,
00878                                     const uint8_t*    publicKey,
00879                                     const uint8_t*    group1Key,
00880                                     const uint8_t*    group2Key);
00881 #endif
00882 
00883 
00884     /*!
00885         \brief Wlan set mode
00886 
00887         Setting WLAN mode
00888 
00889         \param[in] mode - WLAN mode to start the CC31xx device. Possible options are:
00890                         - ROLE_STA - for WLAN station mode
00891                         - ROLE_AP  - for WLAN AP mode
00892                         - ROLE_P2P  -for WLAN P2P mode
00893         \return   0 - if mode was set correctly
00894         \sa        sl_Start sl_Stop
00895         \note           belongs to \ref ext_api
00896         \warning   After setting the mode the system must be restarted for activating the new mode
00897         \par       Example:
00898         \code
00899                     //Switch from any role to STA:
00900                     sl_WlanSetMode(ROLE_STA);
00901                     sl_Stop(0);
00902                     sl_Start(NULL,NULL,NULL);
00903         \endcode
00904 
00905     */
00906 #if _SL_INCLUDE_FUNC(sl_WlanSetMode)
00907     int16_t sl_WlanSetMode(const uint8_t mode);
00908 #endif
00909 
00910 
00911     /*!
00912         \brief     Internal function for setting WLAN configurations
00913 
00914         \return    On success, zero is returned. On error one of the following error codes  returned:
00915                    - CONF_ERROR                        (-1)
00916                    - CONF_NVMEM_ACCESS_FAILED          (-2)
00917                    - CONF_OLD_FILE_VERSION             (-3)
00918                    - CONF_ERROR_NO_SUCH_COUNTRY_CODE   (-4)
00919 
00920 
00921         \param[in] ConfigId -  configuration id
00922                               - <b>SL_WLAN_CFG_AP_ID</b>
00923                               - <b>SL_WLAN_CFG_GENERAL_PARAM_ID</b>
00924                               - <b>SL_WLAN_CFG_P2P_PARAM_ID</b>
00925 
00926         \param[in] ConfigOpt - configurations option
00927                               - <b>SL_WLAN_CFG_AP_ID</b>
00928                                   - <b>WLAN_AP_OPT_SSID</b> \n
00929                                           Set SSID for AP mode. \n
00930                                           This options takes <b>uint8_t</b> buffer as parameter
00931                                   - <b>WLAN_AP_OPT_CHANNEL</b> \n
00932                                           Set channel for AP mode. \n
00933                                           The channel is dependant on the country code which is set. i.e. for "US" the channel should be in the range of [1-11] \n
00934                                           This option takes <b>uint8_t</b> as a parameter
00935                                   - <b>WLAN_AP_OPT_HIDDEN_SSID</b> \n
00936                                           Set Hidden SSID Mode for AP mode.Hidden options: \n
00937                                              0: disabled \n
00938                                              1: Send empty (length=0) SSID in beacon and ignore probe request for broadcast SSID \n
00939                                              2: Clear SSID (ASCII 0), but keep the original length (this may be required with some \n
00940                                                 clients that do not support empty SSID) and ignore probe requests for broadcast SSID \n
00941                                           This option takes <b>uint8_t</b> as a parameter
00942                                   - <b>WLAN_AP_OPT_SECURITY_TYPE</b> \n
00943                                           Set Security type for AP mode. Security options are:
00944                                           - Open security: SL_SEC_TYPE_OPEN
00945                                           - WEP security:  SL_SEC_TYPE_WEP
00946                                           - WPA security:  SL_SEC_TYPE_WPA_WPA2  \n
00947                                           This option takes <b>uint8_t</b> pointer as a parameter
00948                                   - <b>WLAN_AP_OPT_PASSWORD</b> \n
00949                                           Set Password for for AP mode (for WEP or for WPA): \n
00950                                           Password - for WPA: 8 - 63 characters \n
00951                                           for WEP: 5 / 13 characters (ascii) \n
00952                                           This options takes <b>uint8_t</b> buffer as parameter
00953                               - <b>SL_WLAN_CFG_GENERAL_PARAM_ID</b>
00954                               - <b> WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS </b> \n
00955                                       Set scan parameters.
00956                                       This option uses slWlanScanParamCommand_t as parameter
00957                                   - <b>WLAN_GENERAL_PARAM_OPT_COUNTRY_CODE</b> \n
00958                                           Set Country Code for AP mode \n
00959                                           This options takes <b>uint8_t</b> 2 bytes buffer as parameter
00960                                   - <b>WLAN_GENERAL_PARAM_OPT_STA_TX_POWER</b> \n
00961                                           Set STA mode Tx power level \n
00962                                           Number between 0-15, as dB offset from max power (0 will set MAX power) \n
00963                                           This options takes <b>uint8_t</b> as parameter
00964                                   - <b>WLAN_GENERAL_PARAM_OPT_AP_TX_POWER</b>
00965                                           Set AP mode Tx power level \n
00966                                           Number between 0-15, as dB offset from max power (0 will set MAX power) \n
00967                                           This options takes <b>uint8_t</b> as parameter
00968                                   - <b>WLAN_GENERAL_PARAM_OPT_INFO_ELEMENT</b>
00969                                           Set Info Element for AP mode. \n
00970                                           The Application can set up to MAX_PRIVATE_INFO_ELEMENTS_SUPPROTED info elements per Role (AP / P2P GO).  \n
00971                                           To delete an info element use the relevant index and length = 0. \n
00972                                           The Application can set up to MAX_PRIVATE_INFO_ELEMENTS_SUPPROTED to the same role. \n
00973                                           However, for AP - no more than INFO_ELEMENT_MAX_TOTAL_LENGTH_AP bytes can be stored for all info elements. \n
00974                                           For P2P GO - no more than INFO_ELEMENT_MAX_TOTAL_LENGTH_P2P_GO bytes can be stored for all info elements.  \n
00975                                           This option takes sl_protocol_WlanSetInfoElement_t as parameter
00976                               - <b>SL_WLAN_CFG_P2P_PARAM_ID</b>
00977                                   - <b>WLAN_P2P_OPT_DEV_TYPE</b> \n
00978                                           Set P2P Device type.Maximum length of 17 characters. Device type is published under P2P I.E, \n
00979                                           allows to make devices easier to recognize. \n
00980                                           In case no device type is set, the default type is "1-0050F204-1"  \n
00981                                           This options takes <b>uint8_t</b> buffer as parameter
00982                                   - <b>WLAN_P2P_OPT_CHANNEL_N_REGS</b> \n
00983                                          Set P2P Channels. \n
00984                                          listen channel (either 1/6/11 for 2.4GHz) \n
00985                                          listen regulatory class (81 for 2.4GHz)   \n
00986                                          oper channel (either 1/6/11 for 2.4GHz)   \n
00987                                          oper regulatory class (81 for 2.4GHz)     \n
00988                                          listen channel and regulatory class will determine the device listen channel during p2p find listen phase \n
00989                                          oper channel and regulatory class will determine the operating channel preferred by this device (in case it is group owner this will be the operating channel) \n
00990                                          channels should be one of the social channels (1/6/11). In case no listen/oper channel selected, a random 1/6/11 will be selected.
00991                                          This option takes pointer to <b>uint8_t[4]</b> as parameter
00992 
00993         \param[in] ConfigLen - configurations len
00994 
00995         \param[in] pValues -   configurations values
00996 
00997         \sa
00998         \note
00999         \warning
01000         \par   Examples:
01001         \par
01002               <b> WLAN_AP_OPT_SSID: </b>
01003         \code
01004                 uint8_t  str[33];
01005                 memset(str, 0, 33);
01006                 memcpy(str, ssid, len);  // ssid string of 32 characters
01007                 sl_WlanSet(SL_WLAN_CFG_AP_ID, WLAN_AP_OPT_SSID, strlen(ssid), str);
01008         \endcode
01009        \par
01010               <b> WLAN_AP_OPT_CHANNEL: </b>
01011         \code
01012                 uint8_t  val = channel;
01013                 sl_WlanSet(SL_WLAN_CFG_AP_ID, WLAN_AP_OPT_CHANNEL, 1, (uint8_t *)&val);
01014         \endcode
01015         \par
01016               <b>  WLAN_AP_OPT_HIDDEN_SSID: </b>
01017          \code
01018                 uint8_t  val = hidden;
01019                 sl_WlanSet(SL_WLAN_CFG_AP_ID, WLAN_AP_OPT_HIDDEN_SSID, 1, (uint8_t *)&val);
01020         \endcode
01021         \par
01022               <b> WLAN_AP_OPT_SECURITY_TYPE: </b>
01023          \code
01024                uint8_t  val = SL_SEC_TYPE_WPA_WPA2;
01025                sl_WlanSet(SL_WLAN_CFG_AP_ID, WLAN_AP_OPT_SECURITY_TYPE, 1, (uint8_t *)&val);
01026         \endcode
01027         \par
01028               <b>  WLAN_AP_OPT_PASSWORD: </b>
01029          \code
01030                uint8_t  str[65];
01031                uint16_t  len = strlen(password);
01032                memset(str, 0, 65);
01033                memcpy(str, password, len);
01034                sl_WlanSet(SL_WLAN_CFG_AP_ID, WLAN_AP_OPT_PASSWORD, len, (uint8_t *)str);
01035         \endcode
01036         \par
01037              <b> WLAN_GENERAL_PARAM_OPT_STA_TX_POWER: </b>
01038          \code
01039              uint8_t  stapower=(uint8_t)power;
01040              sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID, WLAN_GENERAL_PARAM_OPT_STA_TX_POWER,1,(uint8_t *)&stapower);
01041         \endcode
01042         \par   
01043           <b> WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS: </b>
01044         \code   
01045           slWlanScanParamCommand_t ScanParamConfig;
01046           ScanParamConfig.G_Channels_mask = 0x01;  // bit mask for channels:1 means channel 1 is enabled, 3 means channels 1 + 2 are enabled
01047           ScanParamConfig.rssiThershold = -70;     // only for RSSI level which is higher than -70
01048           sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID ,WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS,sizeof(slWlanScanParamCommand_t),(_u8*)&ScanParamConfig);
01049        \endcode
01050        \par
01051               <b> WLAN_GENERAL_PARAM_OPT_COUNTRY_CODE: </b>
01052         \code
01053                 uint8_t*  str = (uint8_t *) country;  // string of 2 characters. i.e. - "US"
01054                 sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID, WLAN_GENERAL_PARAM_OPT_COUNTRY_CODE, 2, str);
01055         \endcode
01056        \par
01057               <b> WLAN_GENERAL_PARAM_OPT_AP_TX_POWER: </b>
01058         \code
01059              uint8_t  appower=(uint8_t)power;
01060              sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID, WLAN_GENERAL_PARAM_OPT_AP_TX_POWER,1,(uint8_t *)&appower);
01061         \endcode
01062        \par
01063               <b> WLAN_P2P_OPT_DEV_TYPE: </b>
01064         \code
01065              uint8_t   str[17];
01066              uint16_t  len = strlen(device_type);
01067              memset(str, 0, 17);
01068              memcpy(str, device_type, len);
01069              sl_WlanSet(SL_WLAN_CFG_P2P_PARAM_ID, WLAN_P2P_OPT_DEV_TYPE, len, str);
01070         \endcode
01071         \par
01072               <b> WLAN_P2P_OPT_CHANNEL_N_REGS: </b>
01073         \code
01074             uint8_t  str[4];
01075             str[0] = (uint8_t)11;           // listen channel
01076             str[1] = (uint8_t)81;            // listen regulatory class
01077             str[2] = (uint8_t)6;            // oper channel
01078             str[3] = (uint8_t)81;            // oper regulatory class
01079             sl_WlanSet(SL_WLAN_CFG_P2P_PARAM_ID, WLAN_P2P_OPT_CHANNEL_N_REGS, 4, str);
01080         \endcode
01081        \par
01082               <b> WLAN_GENERAL_PARAM_OPT_INFO_ELEMENT: </b>
01083          \code
01084             sl_protocol_WlanSetInfoElement_t    infoele;
01085             infoele.index     = Index;                  // Index of the info element. range: 0 - MAX_PRIVATE_INFO_ELEMENTS_SUPPROTED
01086             infoele.role      = Role;                   // INFO_ELEMENT_AP_ROLE (0) or INFO_ELEMENT_P2P_GO_ROLE (1)
01087             infoele.ie.id     =  Id;                    // Info element ID. if INFO_ELEMENT_DEFAULT_ID (0) is set, ID will be set to 221.
01088             // Organization unique ID. If all 3 bytes are zero - it will be replaced with 08,00,28.
01089             infoele.ie.oui[0] =  Oui0;                  // Organization unique ID first Byte
01090             infoele.ie.oui[1] =  Oui1;                  // Organization unique ID second Byte
01091             infoele.ie.oui[2] =  Oui2;                  // Organization unique ID third Byte
01092             infoele.ie.length = Len;                    // Length of the info element. must be smaller than 253 bytes
01093             memset(infoele.ie.data, 0, INFO_ELEMENT_MAX_SIZE);
01094             if ( Len <= INFO_ELEMENT_MAX_SIZE )
01095             {
01096                 memcpy(infoele.ie.data, IE, Len);           // Info element. length of the info element is [0-252]
01097                 sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID,WLAN_GENERAL_PARAM_OPT_INFO_ELEMENT,sizeof(sl_protocol_WlanSetInfoElement_t),(uint8_t* ) &infoele);
01098             }
01099             sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID,WLAN_GENERAL_PARAM_OPT_INFO_ELEMENT,sizeof(sl_protocol_WlanSetInfoElement_t),(uint8_t* ) &infoele);
01100         \endcode
01101 
01102     */
01103 #if _SL_INCLUDE_FUNC(sl_WlanSet)
01104     int16_t sl_WlanSet(const uint16_t ConfigId ,const uint16_t ConfigOpt, const uint16_t ConfigLen, const uint8_t *pValues);
01105 #endif
01106 
01107     /*!
01108         \brief     Internal function for getting WLAN configurations
01109 
01110         \return    On success, zero is returned. On error, -1 is
01111                    returned
01112 
01113         \param[in] ConfigId -  configuration id
01114                               - <b>SL_WLAN_CFG_AP_ID</b>
01115                               - <b>SL_WLAN_CFG_GENERAL_PARAM_ID</b>
01116                               - <b>SL_WLAN_CFG_P2P_PARAM_ID</b>
01117 
01118         \param[out] pConfigOpt - get configurations option
01119                               - <b>SL_WLAN_CFG_AP_ID</b>
01120                                   - <b>WLAN_AP_OPT_SSID</b> \n
01121                                           Get SSID for AP mode. \n
01122                                           Get up to 32 characters of SSID \n
01123                                           This options takes <b>uint8_t</b> as parameter
01124                                   - <b>WLAN_AP_OPT_CHANNEL</b> \n
01125                                           Get channel for AP mode. \n
01126                                           This option takes <b>uint8_t</b> as a parameter
01127                                   - <b>WLAN_AP_OPT_HIDDEN_SSID</b> \n
01128                                           Get Hidden SSID Mode for AP mode.Hidden options: \n
01129                                              0: disabled \n
01130                                              1: Send empty (length=0) SSID in beacon and ignore probe request for broadcast SSID \n
01131                                              2: Clear SSID (ASCII 0), but keep the original length (this may be required with some \n
01132                                                 clients that do not support empty SSID) and ignore probe requests for broadcast SSID \n
01133                                           This option takes <b>uint8_t</b> as a parameter
01134                                   - <b>WLAN_AP_OPT_SECURITY_TYPE</b> \n
01135                                           Get Security type for AP mode. Security options are:
01136                                           - Open security: SL_SEC_TYPE_OPEN
01137                                           - WEP security:  SL_SEC_TYPE_WEP
01138                                           - WPA security:  SL_SEC_TYPE_WPA_WPA2  \n
01139                                           This option takes <b>uint8_t</b> as a parameter
01140                                   - <b>WLAN_AP_OPT_PASSWORD</b> \n
01141                                           Get Password for for AP mode (for WEP or for WPA): \n
01142                                           Returns password - string, fills up to 64 characters. \n
01143                                           This options takes <b>uint8_t</b> buffer as parameter
01144                               - <b>SL_WLAN_CFG_GENERAL_PARAM_ID</b>
01145                                   - <b> WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS </b> \n
01146                                           Get scan parameters.
01147                                           This option uses slWlanScanParamCommand_t as parameter
01148                                   - <b>WLAN_GENERAL_PARAM_OPT_COUNTRY_CODE</b> \n
01149                                           Get Country Code for AP mode \n
01150                                           This options takes <b>uint8_t</b> buffer as parameter
01151                                   - <b>WLAN_GENERAL_PARAM_OPT_STA_TX_POWER</b> \n
01152                                           Get STA mode Tx power level \n
01153                                           Number between 0-15, as dB offset from max power (0 indicates MAX power) \n
01154                                           This options takes <b>uint8_t</b> as parameter
01155                                   - <b>WLAN_GENERAL_PARAM_OPT_AP_TX_POWER</b>
01156                                           Get AP mode Tx power level \n
01157                                           Number between 0-15, as dB offset from max power (0 indicates MAX power) \n
01158                                           This options takes <b>uint8_t</b> as parameter
01159                               - <b>SL_WLAN_CFG_P2P_PARAM_ID</b>
01160                                   - <b>WLAN_P2P_OPT_CHANNEL_N_REGS</b> \n
01161                                          Get P2P Channels. \n
01162                                          listen channel (either 1/6/11 for 2.4GHz) \n
01163                                          listen regulatory class (81 for 2.4GHz)   \n
01164                                          oper channel (either 1/6/11 for 2.4GHz)   \n
01165                                          oper regulatory class (81 for 2.4GHz)     \n
01166                                          listen channel and regulatory class will determine the device listen channel during p2p find listen phase \n
01167                                          oper channel and regulatory class will determine the operating channel preferred by this device (in case it is group owner this will be the operating channel) \n
01168                                          channels should be one of the social channels (1/6/11). In case no listen/oper channel selected, a random 1/6/11 will be selected. \n
01169                                          This option takes pointer to <b>uint8_t[4]</b> as parameter
01170 
01171         \param[out] pConfigLen - The length of the allocated memory as input, when the
01172                                             function complete, the value of this parameter would be
01173                                             the len that actually read from the device.
01174                                             If the device return length that is longer from the input
01175                                             value, the function will cut the end of the returned structure
01176                                             and will return SL_ESMALLBUF.
01177 
01178 
01179         \param[out] pValues - get configurations values
01180 
01181         \sa   sl_WlanSet
01182 
01183         \note
01184 
01185         \warning
01186 
01187         \par    Examples:
01188         \par
01189               <b> WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS: </b>
01190         \code
01191               slWlanScanParamCommand_t ScanParamConfig;
01192               uint16_t Option = WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS;
01193               uint16_t OptionLen = sizeof(slWlanScanParamCommand_t);
01194               sl_WlanGet(SL_WLAN_CFG_GENERAL_PARAM_ID ,&Option,&OptionLen,(uint8_t *)&ScanParamConfig);
01195         \endcode
01196         \par
01197                <b> WLAN_GENERAL_PARAM_OPT_AP_TX_POWER: </b>
01198         \code
01199                _i8 TXPower = 0;
01200                _u16 Option = WLAN_GENERAL_PARAM_OPT_AP_TX_POWER;
01201                _u16 OptionLen = sizeof(_i8);
01202            sl_WlanGet(SL_WLAN_CFG_GENERAL_PARAM_ID ,&Option,&OptionLen,(_u8 *)&TXPower);
01203         \endcode
01204         \par   
01205            <b> WLAN_GENERAL_PARAM_OPT_STA_TX_POWER: </b>
01206         \code           
01207            _i8 TXPower = 0;
01208            _u16 Option = WLAN_GENERAL_PARAM_OPT_STA_TX_POWER;
01209            _u16 OptionLen = sizeof(_i8);
01210 
01211                sl_WlanGet(SL_WLAN_CFG_GENERAL_PARAM_ID ,&Option,&OptionLen,(uint8_t *)&TXPower);
01212         \endcode
01213         \par
01214                <b> WLAN_P2P_OPT_DEV_TYPE: </b>
01215         \code
01216                int8_t device_type[18];
01217                uint16_t len = 18;
01218                uint16_t config_opt = WLAN_P2P_OPT_DEV_TYPE;
01219                sl_WlanGet(SL_WLAN_CFG_P2P_PARAM_ID, &config_opt , &len, (uint8_t* )device_type);
01220         \endcode
01221         \par
01222                <b> WLAN_AP_OPT_SSID: </b>
01223         \code
01224                int8_t ssid[32];
01225                uint16_t len = 32;
01226                uint16_t  config_opt = WLAN_AP_OPT_SSID;
01227                sl_WlanGet(SL_WLAN_CFG_AP_ID, &config_opt , &len, (uint8_t* )ssid);
01228         \endcode
01229         \par
01230                <b> WLAN_GENERAL_PARAM_OPT_COUNTRY_CODE: </b>
01231         \code
01232                int8_t country[3];
01233                uint16_t len = 3;
01234                uint16_t  config_opt = WLAN_GENERAL_PARAM_OPT_COUNTRY_CODE;
01235                sl_WlanGet(SL_WLAN_CFG_GENERAL_PARAM_ID, &config_opt, &len, (uint8_t* )country);
01236         \endcode
01237         \par
01238                <b> WLAN_AP_OPT_CHANNEL: </b>
01239         \code
01240                int8_t channel;
01241                uint16_t len = 1;
01242                uint16_t  config_opt = WLAN_AP_OPT_CHANNEL;
01243                sl_WlanGet(SL_WLAN_CFG_AP_ID, &config_opt, &len, (uint8_t* )&channel);
01244         \endcode
01245         \par
01246                <b> WLAN_AP_OPT_HIDDEN_SSID: </b>
01247         \code
01248               uint8_t hidden;
01249               uint16_t len = 1;
01250               uint16_t  config_opt = WLAN_AP_OPT_HIDDEN_SSID;
01251               sl_WlanGet(SL_WLAN_CFG_AP_ID, &config_opt, &len, (uint8_t* )&hidden);
01252         \endcode
01253         \par
01254                <b> WLAN_AP_OPT_SECURITY_TYPE: </b>
01255         \code
01256              uint8_t sec_type;
01257              uint16_t len = 1;
01258              uint16_t  config_opt = WLAN_AP_OPT_SECURITY_TYPE;
01259              sl_WlanGet(SL_WLAN_CFG_AP_ID, &config_opt, &len, (uint8_t* )&sec_type);
01260         \endcode
01261         \par
01262                <b> WLAN_AP_OPT_PASSWORD: </b>
01263         \code
01264              uint8_t password[64];
01265              uint16_t len = 64;
01266              memset(password,0,64);
01267              uint16_t config_opt = WLAN_AP_OPT_PASSWORD;
01268              sl_WlanGet(SL_WLAN_CFG_AP_ID, &config_opt, &len, (uint8_t* )password);
01269 
01270         \endcode
01271         \par
01272                <b> WLAN_P2P_OPT_CHANNEL_N_REGS: </b>
01273         \code
01274            uint16_t listen_channel,listen_reg,oper_channel,oper_reg;
01275            uint16_t len = 4;
01276            uint16_t  config_opt = WLAN_P2P_OPT_CHANNEL_N_REGS;
01277            uint8_t channel_n_regs[4];
01278            sl_WlanGet(SL_WLAN_CFG_P2P_PARAM_ID, &config_opt, &len, (uint8_t* )channel_n_regs);
01279            listen_channel = channel_n_regs[0];
01280            listen_reg = channel_n_regs[1];
01281            oper_channel = channel_n_regs[2];
01282            oper_reg = channel_n_regs[3];
01283         \endcode
01284     */
01285 
01286 #if _SL_INCLUDE_FUNC(sl_WlanGet)
01287     int16_t sl_WlanGet(const uint16_t ConfigId, uint16_t *pConfigOpt,uint16_t *pConfigLen, uint8_t *pValues);
01288 #endif
01289 
01290 private:
01291 
01292     cc3100_driver           &_driver;
01293     cc3100_wlan_rx_filters  &_wlan_filters;
01294 
01295     /*!
01296 
01297      Close the Doxygen group.
01298      @}
01299 
01300      */
01301 
01302 };//class
01303 
01304 }//namespace mbed_cc3100
01305 
01306 #endif    /*  __WLAN_H__ */
01307 
01308