wlan.h 64 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308
  1. /*
  2. * wlan.h - CC31xx/CC32xx Host Driver Implementation
  3. *
  4. * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
  5. *
  6. *
  7. * Redistribution and use in source and binary forms, with or without
  8. * modification, are permitted provided that the following conditions
  9. * are met:
  10. *
  11. * Redistributions of source code must retain the above copyright
  12. * notice, this list of conditions and the following disclaimer.
  13. *
  14. * Redistributions in binary form must reproduce the above copyright
  15. * notice, this list of conditions and the following disclaimer in the
  16. * documentation and/or other materials provided with the
  17. * distribution.
  18. *
  19. * Neither the name of Texas Instruments Incorporated nor the names of
  20. * its contributors may be used to endorse or promote products derived
  21. * from this software without specific prior written permission.
  22. *
  23. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  24. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  25. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  26. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  27. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  28. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  29. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  30. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  31. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  32. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  33. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  34. *
  35. */
  36. /*****************************************************************************/
  37. /* Include files */
  38. /*****************************************************************************/
  39. #include "simplelink.h"
  40. #ifndef __WLAN_H__
  41. #define __WLAN_H__
  42. #ifdef __cplusplus
  43. extern "C" {
  44. #endif
  45. /*****************************************************************************/
  46. /* Macro declarations */
  47. /*****************************************************************************/
  48. /*!
  49. \addtogroup wlan
  50. @{
  51. */
  52. #define SL_BSSID_LENGTH (6)
  53. #define MAXIMAL_SSID_LENGTH (32)
  54. #define NUM_OF_RATE_INDEXES (20)
  55. #define SIZE_OF_RSSI_HISTOGRAM (6)
  56. /* WLAN Disconnect Reason Codes */
  57. #define SL_DISCONNECT_RESERVED_0 (0)
  58. #define SL_DISCONNECT_UNSPECIFIED_REASON (1)
  59. #define SL_PREVIOUS_AUTHENTICATION_NO_LONGER_VALID (2)
  60. #define SL_DEAUTHENTICATED_BECAUSE_SENDING_STATION_IS_LEAVING (3)
  61. #define SL_DISASSOCIATED_DUE_TO_INACTIVITY (4)
  62. #define SL_DISASSOCIATED_BECAUSE_AP_IS_UNABLE_TO_HANDLE_ALL_CURRENTLY_ASSOCIATED_STATIONS (5)
  63. #define SL_CLASS_2_FRAME_RECEIVED_FROM_NONAUTHENTICATED_STATION (6)
  64. #define SL_CLASS_3_FRAME_RECEIVED_FROM_NONASSOCIATED_STATION (7)
  65. #define SL_DISASSOCIATED_BECAUSE_SENDING_STATION_IS_LEAVING_BSS (8)
  66. #define SL_STATION_REQUESTING_ASSOCIATION_IS_NOT_AUTHENTICATED_WITH_RESPONDING_STATION (9)
  67. #define SL_DISASSOCIATED_BECAUSE_THE_INFORMATION_IN_THE_POWER_CAPABILITY_ELEMENT_IS_UNACCEPTABLE (10)
  68. #define SL_DISASSOCIATED_BECAUSE_THE_INFORMATION_IN_THE_SUPPORTED_CHANNELS_ELEMENT_IS_UNACCEPTABLE (11)
  69. #define SL_DISCONNECT_RESERVED_1 (12)
  70. #define SL_INVALID_INFORMATION_ELEMENT (13)
  71. #define SL_MESSAGE_INTEGRITY_CODE_MIC_FAILURE (14)
  72. #define SL_FOUR_WAY_HANDSHAKE_TIMEOUT (15)
  73. #define SL_GROUP_KEY_HANDSHAKE_TIMEOUT (16)
  74. #define SL_RE_ASSOCIATION_REQUEST_PROBE_RESPONSE_BEACON_FRAME (17)
  75. #define SL_INVALID_GROUP_CIPHER (18)
  76. #define SL_INVALID_PAIRWISE_CIPHER (19)
  77. #define SL_INVALID_AKMP (20)
  78. #define SL_UNSUPPORTED_RSN_INFORMATION_ELEMENT_VERSION (21)
  79. #define SL_INVALID_RSN_INFORMATION_ELEMENT_CAPABILITIES (22)
  80. #define SL_IEEE_802_1X_AUTHENTICATION_FAILED (23)
  81. #define SL_CIPHER_SUITE_REJECTED_BECAUSE_OF_THE_SECURITY_POLICY (24)
  82. #define SL_DISCONNECT_RESERVED_2 (25)
  83. #define SL_DISCONNECT_RESERVED_3 (26)
  84. #define SL_DISCONNECT_RESERVED_4 (27)
  85. #define SL_DISCONNECT_RESERVED_5 (28)
  86. #define SL_DISCONNECT_RESERVED_6 (29)
  87. #define SL_DISCONNECT_RESERVED_7 (30)
  88. #define SL_DISCONNECT_RESERVED_8 (31)
  89. #define SL_USER_INITIATED_DISCONNECTION (200)
  90. /* Wlan error codes */
  91. #define SL_ERROR_KEY_ERROR (-3)
  92. #define SL_ERROR_INVALID_ROLE (-71)
  93. #define SL_ERROR_INVALID_SECURITY_TYPE (-84)
  94. #define SL_ERROR_PASSPHRASE_TOO_LONG (-85)
  95. #define SL_ERROR_WPS_NO_PIN_OR_WRONG_PIN_LEN (-87)
  96. #define SL_ERROR_EAP_WRONG_METHOD (-88)
  97. #define SL_ERROR_PASSWORD_ERROR (-89)
  98. #define SL_ERROR_EAP_ANONYMOUS_LEN_ERROR (-90)
  99. #define SL_ERROR_SSID_LEN_ERROR (-91)
  100. #define SL_ERROR_USER_ID_LEN_ERROR (-92)
  101. #define SL_ERROR_ILLEGAL_WEP_KEY_INDEX (-95)
  102. #define SL_ERROR_INVALID_DWELL_TIME_VALUES (-96)
  103. #define SL_ERROR_INVALID_POLICY_TYPE (-97)
  104. #define SL_ERROR_PM_POLICY_INVALID_OPTION (-98)
  105. #define SL_ERROR_PM_POLICY_INVALID_PARAMS (-99)
  106. #define SL_ERROR_WIFI_ALREADY_DISCONNECTED (-129)
  107. #define SL_ERROR_WIFI_NOT_CONNECTED (-59)
  108. #define SL_SEC_TYPE_OPEN (0)
  109. #define SL_SEC_TYPE_WEP (1)
  110. #define SL_SEC_TYPE_WPA (2) /* deprecated */
  111. #define SL_SEC_TYPE_WPA_WPA2 (2)
  112. #define SL_SEC_TYPE_WPS_PBC (3)
  113. #define SL_SEC_TYPE_WPS_PIN (4)
  114. #define SL_SEC_TYPE_WPA_ENT (5)
  115. #define SL_SEC_TYPE_P2P_PBC (6)
  116. #define SL_SEC_TYPE_P2P_PIN_KEYPAD (7)
  117. #define SL_SEC_TYPE_P2P_PIN_DISPLAY (8)
  118. #define SL_SEC_TYPE_P2P_PIN_AUTO (9) /* NOT Supported yet */
  119. #define SL_SCAN_SEC_TYPE_OPEN (0)
  120. #define SL_SCAN_SEC_TYPE_WEP (1)
  121. #define SL_SCAN_SEC_TYPE_WPA (2)
  122. #define SL_SCAN_SEC_TYPE_WPA2 (3)
  123. #define TLS (0x1)
  124. #define MSCHAP (0x0)
  125. #define PSK (0x2)
  126. #define TTLS (0x10)
  127. #define PEAP0 (0x20)
  128. #define PEAP1 (0x40)
  129. #define FAST (0x80)
  130. #define FAST_AUTH_PROVISIONING (0x02)
  131. #define FAST_UNAUTH_PROVISIONING (0x01)
  132. #define FAST_NO_PROVISIONING (0x00)
  133. #define EAPMETHOD_PHASE2_SHIFT (8)
  134. #define EAPMETHOD_PAIRWISE_CIPHER_SHIFT (19)
  135. #define EAPMETHOD_GROUP_CIPHER_SHIFT (27)
  136. #define WPA_CIPHER_CCMP (0x1)
  137. #define WPA_CIPHER_TKIP (0x2)
  138. #define CC31XX_DEFAULT_CIPHER (WPA_CIPHER_CCMP | WPA_CIPHER_TKIP)
  139. #define EAPMETHOD(phase1,phase2,pairwise_cipher,group_cipher) \
  140. ((phase1) | \
  141. ((phase2) << EAPMETHOD_PHASE2_SHIFT ) |\
  142. ((_u32)(pairwise_cipher) << EAPMETHOD_PAIRWISE_CIPHER_SHIFT ) |\
  143. ((_u32)(group_cipher) << EAPMETHOD_GROUP_CIPHER_SHIFT ))
  144. /* phase1 phase2 pairwise_cipher group_cipher */
  145. #define SL_ENT_EAP_METHOD_TLS EAPMETHOD(TLS , 0 , CC31XX_DEFAULT_CIPHER , CC31XX_DEFAULT_CIPHER)
  146. #define SL_ENT_EAP_METHOD_TTLS_TLS EAPMETHOD(TTLS , TLS , CC31XX_DEFAULT_CIPHER , CC31XX_DEFAULT_CIPHER)
  147. #define SL_ENT_EAP_METHOD_TTLS_MSCHAPv2 EAPMETHOD(TTLS , MSCHAP , CC31XX_DEFAULT_CIPHER , CC31XX_DEFAULT_CIPHER)
  148. #define SL_ENT_EAP_METHOD_TTLS_PSK EAPMETHOD(TTLS , PSK , CC31XX_DEFAULT_CIPHER , CC31XX_DEFAULT_CIPHER)
  149. #define SL_ENT_EAP_METHOD_PEAP0_TLS EAPMETHOD(PEAP0 , TLS , CC31XX_DEFAULT_CIPHER , CC31XX_DEFAULT_CIPHER)
  150. #define SL_ENT_EAP_METHOD_PEAP0_MSCHAPv2 EAPMETHOD(PEAP0 , MSCHAP , CC31XX_DEFAULT_CIPHER , CC31XX_DEFAULT_CIPHER)
  151. #define SL_ENT_EAP_METHOD_PEAP0_PSK EAPMETHOD(PEAP0 , PSK , CC31XX_DEFAULT_CIPHER , CC31XX_DEFAULT_CIPHER)
  152. #define SL_ENT_EAP_METHOD_PEAP1_TLS EAPMETHOD(PEAP1 , TLS , CC31XX_DEFAULT_CIPHER , CC31XX_DEFAULT_CIPHER)
  153. #define SL_ENT_EAP_METHOD_PEAP1_MSCHAPv2 EAPMETHOD(PEAP1 , MSCHAP , CC31XX_DEFAULT_CIPHER , CC31XX_DEFAULT_CIPHER)
  154. #define SL_ENT_EAP_METHOD_PEAP1_PSK EAPMETHOD(PEAP1 , PSK , CC31XX_DEFAULT_CIPHER , CC31XX_DEFAULT_CIPHER)
  155. #define SL_ENT_EAP_METHOD_FAST_AUTH_PROVISIONING EAPMETHOD(FAST , FAST_AUTH_PROVISIONING , CC31XX_DEFAULT_CIPHER , CC31XX_DEFAULT_CIPHER)
  156. #define SL_ENT_EAP_METHOD_FAST_UNAUTH_PROVISIONING EAPMETHOD(FAST , FAST_UNAUTH_PROVISIONING , CC31XX_DEFAULT_CIPHER , CC31XX_DEFAULT_CIPHER)
  157. #define SL_ENT_EAP_METHOD_FAST_NO_PROVISIONING EAPMETHOD(FAST , FAST_NO_PROVISIONING , CC31XX_DEFAULT_CIPHER , CC31XX_DEFAULT_CIPHER)
  158. #define SL_LONG_PREAMBLE (0)
  159. #define SL_SHORT_PREAMBLE (1)
  160. #define SL_RAW_RF_TX_PARAMS_CHANNEL_SHIFT (0)
  161. #define SL_RAW_RF_TX_PARAMS_RATE_SHIFT (6)
  162. #define SL_RAW_RF_TX_PARAMS_POWER_SHIFT (11)
  163. #define SL_RAW_RF_TX_PARAMS_PREAMBLE_SHIFT (15)
  164. #define SL_RAW_RF_TX_PARAMS(chan,rate,power,preamble) \
  165. ((chan << SL_RAW_RF_TX_PARAMS_CHANNEL_SHIFT) | \
  166. (rate << SL_RAW_RF_TX_PARAMS_RATE_SHIFT) | \
  167. (power << SL_RAW_RF_TX_PARAMS_POWER_SHIFT) | \
  168. (preamble << SL_RAW_RF_TX_PARAMS_PREAMBLE_SHIFT))
  169. /* wlan config application IDs */
  170. #define SL_WLAN_CFG_AP_ID (0)
  171. #define SL_WLAN_CFG_GENERAL_PARAM_ID (1)
  172. #define SL_WLAN_CFG_P2P_PARAM_ID (2)
  173. /* wlan AP Config set/get options */
  174. #define WLAN_AP_OPT_SSID (0)
  175. #define WLAN_AP_OPT_CHANNEL (3)
  176. #define WLAN_AP_OPT_HIDDEN_SSID (4)
  177. #define WLAN_AP_OPT_SECURITY_TYPE (6)
  178. #define WLAN_AP_OPT_PASSWORD (7)
  179. #define WLAN_GENERAL_PARAM_OPT_COUNTRY_CODE (9)
  180. #define WLAN_GENERAL_PARAM_OPT_STA_TX_POWER (10)
  181. #define WLAN_GENERAL_PARAM_OPT_AP_TX_POWER (11)
  182. #define WLAN_P2P_OPT_DEV_NAME (12)
  183. #define WLAN_P2P_OPT_DEV_TYPE (13)
  184. #define WLAN_P2P_OPT_CHANNEL_N_REGS (14)
  185. #define WLAN_GENERAL_PARAM_OPT_INFO_ELEMENT (16)
  186. #define WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS (18) /* change the scan channels and RSSI threshold using this configuration option */
  187. /* SmartConfig CIPHER options */
  188. #define SMART_CONFIG_CIPHER_SFLASH (0) /* password is not delivered by the application. The Simple Manager should */
  189. /* check if the keys are stored in the Flash. */
  190. #define SMART_CONFIG_CIPHER_AES (1) /* AES (other types are not supported) */
  191. #define SMART_CONFIG_CIPHER_NONE (0xFF) /* do not check in the flash */
  192. #define SL_POLICY_CONNECTION (0x10)
  193. #define SL_POLICY_SCAN (0x20)
  194. #define SL_POLICY_PM (0x30)
  195. #define SL_POLICY_P2P (0x40)
  196. #define VAL_2_MASK(position,value) ((1 & (value))<<(position))
  197. #define MASK_2_VAL(position,mask) (((1 << position) & (mask)) >> (position))
  198. #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))
  199. #define SL_SCAN_POLICY_EN(policy) (MASK_2_VAL(0,policy))
  200. #define SL_SCAN_POLICY(Enable) (VAL_2_MASK(0,Enable))
  201. #define SL_NORMAL_POLICY (0)
  202. #define SL_LOW_LATENCY_POLICY (1)
  203. #define SL_LOW_POWER_POLICY (2)
  204. #define SL_ALWAYS_ON_POLICY (3)
  205. #define SL_LONG_SLEEP_INTERVAL_POLICY (4)
  206. #define SL_P2P_ROLE_NEGOTIATE (3)
  207. #define SL_P2P_ROLE_GROUP_OWNER (15)
  208. #define SL_P2P_ROLE_CLIENT (0)
  209. #define SL_P2P_NEG_INITIATOR_ACTIVE (0)
  210. #define SL_P2P_NEG_INITIATOR_PASSIVE (1)
  211. #define SL_P2P_NEG_INITIATOR_RAND_BACKOFF (2)
  212. #define POLICY_VAL_2_OPTIONS(position,mask,policy) ((mask & policy) << position )
  213. #define SL_P2P_POLICY(p2pNegType,p2pNegInitiator) (POLICY_VAL_2_OPTIONS(0,0xF,(p2pNegType > SL_P2P_ROLE_GROUP_OWNER ? SL_P2P_ROLE_GROUP_OWNER : p2pNegType)) | \
  214. POLICY_VAL_2_OPTIONS(4,0x1,(p2pNegType > SL_P2P_ROLE_GROUP_OWNER ? 1:0)) | \
  215. POLICY_VAL_2_OPTIONS(5,0x3, p2pNegInitiator))
  216. /* Info elements */
  217. #define INFO_ELEMENT_DEFAULT_ID (0) /* 221 will be used */
  218. /* info element size is up to 252 bytes (+ 3 bytes of OUI). */
  219. #define INFO_ELEMENT_MAX_SIZE (252)
  220. /* For AP - the total length of all info elements is 300 bytes (for example - 4 info elements of 75 bytes each) */
  221. #define INFO_ELEMENT_MAX_TOTAL_LENGTH_AP (300)
  222. /* For P2P - the total length of all info elements is 150 bytes (for example - 4 info elements of 40 bytes each) */
  223. #define INFO_ELEMENT_MAX_TOTAL_LENGTH_P2P_GO (160)
  224. #define INFO_ELEMENT_AP_ROLE (0)
  225. #define INFO_ELEMENT_P2P_GO_ROLE (1)
  226. /* we support up to 4 info elements per Role. */
  227. #define MAX_PRIVATE_INFO_ELEMENTS_SUPPROTED (4)
  228. #define INFO_ELEMENT_DEFAULT_OUI_0 (0x08)
  229. #define INFO_ELEMENT_DEFAULT_OUI_1 (0x00)
  230. #define INFO_ELEMENT_DEFAULT_OUI_2 (0x28)
  231. #define INFO_ELEMENT_DEFAULT_OUI (0x000000) /* 08, 00, 28 will be used */
  232. /*****************************************************************************/
  233. /* Structure/Enum declarations */
  234. /*****************************************************************************/
  235. typedef enum
  236. {
  237. RATE_1M = 1,
  238. RATE_2M = 2,
  239. RATE_5_5M = 3,
  240. RATE_11M = 4,
  241. RATE_6M = 6,
  242. RATE_9M = 7,
  243. RATE_12M = 8,
  244. RATE_18M = 9,
  245. RATE_24M = 10,
  246. RATE_36M = 11,
  247. RATE_48M = 12,
  248. RATE_54M = 13,
  249. RATE_MCS_0 = 14,
  250. RATE_MCS_1 = 15,
  251. RATE_MCS_2 = 16,
  252. RATE_MCS_3 = 17,
  253. RATE_MCS_4 = 18,
  254. RATE_MCS_5 = 19,
  255. RATE_MCS_6 = 20,
  256. RATE_MCS_7 = 21,
  257. MAX_NUM_RATES = 0xFF
  258. }SlRateIndex_e;
  259. typedef enum {
  260. DEV_PW_DEFAULT=0,
  261. DEV_PW_PIN_KEYPAD=1,
  262. DEV_PW_PUSH_BUTTON=4,
  263. DEV_PW_PIN_DISPLAY=5
  264. } sl_p2p_dev_password_method;
  265. typedef struct
  266. {
  267. _u32 status;
  268. _u32 ssid_len;
  269. _u8 ssid[32];
  270. _u32 private_token_len;
  271. _u8 private_token[32];
  272. }slSmartConfigStartAsyncResponse_t;
  273. typedef struct
  274. {
  275. _u16 status;
  276. _u16 padding;
  277. }slSmartConfigStopAsyncResponse_t;
  278. typedef struct
  279. {
  280. _u16 status;
  281. _u16 padding;
  282. }slWlanConnFailureAsyncResponse_t;
  283. typedef struct
  284. {
  285. _u8 connection_type;/* 0-STA,3-P2P_CL */
  286. _u8 ssid_len;
  287. _u8 ssid_name[32];
  288. _u8 go_peer_device_name_len;
  289. _u8 go_peer_device_name[32];
  290. _u8 bssid[6];
  291. _u8 reason_code;
  292. _u8 padding[2];
  293. } slWlanConnectAsyncResponse_t;
  294. typedef struct
  295. {
  296. _u8 go_peer_device_name[32];
  297. _u8 mac[6];
  298. _u8 go_peer_device_name_len;
  299. _u8 wps_dev_password_id;
  300. _u8 own_ssid[32];/* relevant for event sta-connected only */
  301. _u8 own_ssid_len;/* relevant for event sta-connected only */
  302. _u8 padding[3];
  303. }slPeerInfoAsyncResponse_t;
  304. typedef union
  305. {
  306. slSmartConfigStartAsyncResponse_t smartConfigStartResponse; /*SL_WLAN_SMART_CONFIG_COMPLETE_EVENT*/
  307. slSmartConfigStopAsyncResponse_t smartConfigStopResponse; /*SL_WLAN_SMART_CONFIG_STOP_EVENT */
  308. slPeerInfoAsyncResponse_t APModeStaConnected; /* SL_WLAN_STA_CONNECTED_EVENT - relevant only in AP mode - holds information regarding a new STA connection */
  309. slPeerInfoAsyncResponse_t APModestaDisconnected; /* SL_WLAN_STA_DISCONNECTED_EVENT - relevant only in AP mode - holds information regarding a STA disconnection */
  310. slWlanConnectAsyncResponse_t STAandP2PModeWlanConnected; /* SL_WLAN_CONNECT_EVENT - relevant only in STA and P2P mode - holds information regarding a new connection */
  311. slWlanConnectAsyncResponse_t STAandP2PModeDisconnected; /* SL_WLAN_DISCONNECT_EVENT - relevant only in STA and P2P mode - holds information regarding a disconnection */
  312. slPeerInfoAsyncResponse_t P2PModeDevFound; /* SL_WLAN_P2P_DEV_FOUND_EVENT - relevant only in P2P mode */
  313. slPeerInfoAsyncResponse_t P2PModeNegReqReceived; /* SL_WLAN_P2P_NEG_REQ_RECEIVED_EVENT - relevant only in P2P mode */
  314. slWlanConnFailureAsyncResponse_t P2PModewlanConnectionFailure; /* SL_WLAN_CONNECTION_FAILED_EVENT - relevant only in P2P mode */
  315. } SlWlanEventData_u;
  316. typedef struct
  317. {
  318. _u32 Event;
  319. SlWlanEventData_u EventData;
  320. } SlWlanEvent_t;
  321. typedef struct
  322. {
  323. _u32 ReceivedValidPacketsNumber; /* sum of the packets that been received OK (include filtered) */
  324. _u32 ReceivedFcsErrorPacketsNumber; /* sum of the packets that been dropped due to FCS error */
  325. _u32 ReceivedAddressMismatchPacketsNumber; /* sum of the packets that been received but filtered out by one of the HW filters */
  326. _i16 AvarageDataCtrlRssi; /* average RSSI for all valid data packets received */
  327. _i16 AvarageMgMntRssi; /* average RSSI for all valid management packets received */
  328. _u16 RateHistogram[NUM_OF_RATE_INDEXES]; /* rate histogram for all valid packets received */
  329. _u16 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 */
  330. _u32 StartTimeStamp; /* the time stamp started collecting the statistics in uSec */
  331. _u32 GetTimeStamp; /* the time stamp called the get statistics command */
  332. }SlGetRxStatResponse_t;
  333. typedef struct
  334. {
  335. _u8 ssid[MAXIMAL_SSID_LENGTH];
  336. _u8 ssid_len;
  337. _u8 sec_type;
  338. _u8 bssid[SL_BSSID_LENGTH];
  339. _i8 rssi;
  340. _i8 reserved[3];
  341. }Sl_WlanNetworkEntry_t;
  342. typedef struct
  343. {
  344. _u8 Type;
  345. _i8* Key;
  346. _u8 KeyLen;
  347. }SlSecParams_t;
  348. typedef struct
  349. {
  350. _i8* User;
  351. _u8 UserLen;
  352. _i8* AnonUser;
  353. _u8 AnonUserLen;
  354. _u8 CertIndex; /* not supported */
  355. _u32 EapMethod;
  356. }SlSecParamsExt_t;
  357. typedef struct
  358. {
  359. _i8 User[32];
  360. _u8 UserLen;
  361. _i8 AnonUser[32];
  362. _u8 AnonUserLen;
  363. _u8 CertIndex; /* not supported */
  364. _u32 EapMethod;
  365. }SlGetSecParamsExt_t;
  366. typedef enum
  367. {
  368. ROLE_STA = 0,
  369. ROLE_AP = 2,
  370. ROLE_P2P = 3,
  371. ROLE_STA_ERR = -1, /* Failure to load MAC/PHY in STA role */
  372. ROLE_AP_ERR = -ROLE_AP, /* Failure to load MAC/PHY in AP role */
  373. ROLE_P2P_ERR = -ROLE_P2P /* Failure to load MAC/PHY in P2P role */
  374. }SlWlanMode_t;
  375. typedef struct
  376. {
  377. _u32 G_Channels_mask;
  378. _i32 rssiThershold;
  379. }slWlanScanParamCommand_t;
  380. typedef struct
  381. {
  382. _u8 id;
  383. _u8 oui[3];
  384. _u16 length;
  385. _u8 data[252];
  386. } sl_protocol_InfoElement_t;
  387. typedef struct
  388. {
  389. _u8 index; /* 0 - MAX_PRIVATE_INFO_ELEMENTS_SUPPROTED */
  390. _u8 role; /* bit0: AP = 0, GO = 1 */
  391. sl_protocol_InfoElement_t ie;
  392. } sl_protocol_WlanSetInfoElement_t;
  393. /*****************************************************************************/
  394. /* Function prototypes */
  395. /*****************************************************************************/
  396. /*!
  397. \brief Connect to wlan network as a station
  398. \param[in] pName up to 32 bytes in case of STA the name is the SSID of the Access Point
  399. \param[in] NameLen name length
  400. \param[in] pMacAddr 6 bytes for MAC address
  401. \param[in] pSecParams Security parameters (use NULL key for SL_SEC_TYPE_OPEN)
  402. Security types options: \n
  403. - SL_SEC_TYPE_OPEN
  404. - SL_SEC_TYPE_WEP
  405. - SL_SEC_TYPE_WPA_WPA2
  406. - SL_SEC_TYPE_WPA_ENT
  407. - SL_SEC_TYPE_WPS_PBC
  408. - SL_SEC_TYPE_WPS_PIN
  409. \param[in] pSecExtParams Enterprise parameters (set NULL in case Enterprise parameters is not in use)
  410. \return On success, zero is returned. On error, negative is returned
  411. In case error number (-71) is returned, it indicates a connection was activated while the device it running in AP role
  412. \sa sl_WlanDisconnect
  413. \note belongs to \ref ext_api
  414. \warning In this version only single enterprise mode could be used
  415. SL_SEC_TYPE_WPA is a deprecated definition, the new definition is SL_SEC_TYPE_WPA_WPA2
  416. */
  417. #if _SL_INCLUDE_FUNC(sl_WlanConnect)
  418. _i16 sl_WlanConnect(const _i8* pName,const _i16 NameLen,const _u8 *pMacAddr,const SlSecParams_t* pSecParams ,const SlSecParamsExt_t* pSecExtParams);
  419. #endif
  420. /*!
  421. \brief wlan disconnect
  422. Disconnect connection
  423. \return 0 disconnected done, other already disconnected
  424. \sa sl_WlanConnect
  425. \note belongs to \ref ext_api
  426. \warning
  427. */
  428. #if _SL_INCLUDE_FUNC(sl_WlanDisconnect)
  429. _i16 sl_WlanDisconnect(void);
  430. #endif
  431. /*!
  432. \brief add profile
  433. When auto start is enabled, the device connects to a
  434. station from the profiles table. Up to 7 profiles are
  435. supported. If several profiles configured the device chose
  436. the highest priority profile, within each priority group,
  437. device will chose profile based on security policy, signal
  438. strength, etc parameters.
  439. \param[in] pName up to 32 bytes in case of STA the name is the
  440. SSID of the Access Point
  441. in case of P2P the name is the remote device name
  442. \param[in] NameLen name length
  443. \param[in] pMacAddr 6 bytes for MAC address
  444. \param[in] pSecParams Security parameters - security type
  445. (SL_SEC_TYPE_OPEN,SL_SEC_TYPE_WEP,SL_SEC_TYPE_WPA_WPA2,
  446. 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
  447. in case of p2p security type pin the key refers to pin code
  448. \param[in] pSecExtParams Enterprise parameters - identity, identity length,
  449. Anonymous, Anonymous length, CertIndex (not supported,
  450. certificates need to be placed in a specific file ID),
  451. EapMethod.Use NULL in case Enterprise parameters is not in use
  452. \param[in] Priority profile priority. Lowest priority: 0
  453. \param[in] Options Not supported
  454. \return On success, profile stored index is returned. On error, negative value is returned
  455. \sa sl_WlanProfileGet , sl_WlanProfileDel
  456. \note belongs to \ref ext_api
  457. \warning Only one Enterprise profile is supported.
  458. Please Note that in case of adding an existing profile (compared by pName,pMACAddr and security type)
  459. the old profile will be deleted and the same index will be returned.
  460. SL_SEC_TYPE_WPA is a deprecated definition, the new definition is SL_SEC_TYPE_WPA_WPA2
  461. */
  462. #if _SL_INCLUDE_FUNC(sl_WlanProfileAdd)
  463. _i16 sl_WlanProfileAdd(const _i8* pName,const _i16 NameLen,const _u8 *pMacAddr,const SlSecParams_t* pSecParams ,const SlSecParamsExt_t* pSecExtParams,const _u32 Priority,const _u32 Options);
  464. #endif
  465. /*!
  466. \brief get profile
  467. read profile from the device
  468. \param[in] Index profile stored index, if index does not exists
  469. error is return
  470. \param[out] pName up to 32 bytes, in case of sta mode the name of the Access Point
  471. in case of p2p mode the name of the Remote Device
  472. \param[out] pNameLen name length
  473. \param[out] pMacAddr 6 bytes for MAC address
  474. \param[out] pSecParams security parameters - security type
  475. (SL_SEC_TYPE_OPEN, SL_SEC_TYPE_WEP, SL_SEC_TYPE_WPA_WPA2 or
  476. 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), key and key length are not
  477. in case of p2p security type pin the key refers to pin code
  478. return due to security reasons.
  479. \param[out] pSecExtParams enterprise parameters - identity, identity
  480. length, Anonymous, Anonymous length
  481. CertIndex (not supported), EapMethod.
  482. \param[out] Priority profile priority
  483. \return On success, Profile security type is returned (0 or positive number). On error, -1 is
  484. returned
  485. \sa sl_WlanProfileAdd , sl_WlanProfileDel
  486. \note belongs to \ref ext_api
  487. \warning
  488. */
  489. #if _SL_INCLUDE_FUNC(sl_WlanProfileGet)
  490. _i16 sl_WlanProfileGet(const _i16 Index,_i8* pName, _i16 *pNameLen, _u8 *pMacAddr, SlSecParams_t* pSecParams, SlGetSecParamsExt_t* pSecExtParams, _u32 *pPriority);
  491. #endif
  492. /*!
  493. \brief Delete WLAN profile
  494. Delete WLAN profile
  495. \param[in] index number of profile to delete.Possible values are 0 to 6.
  496. Index value 255 will delete all saved profiles
  497. \return On success, zero is returned. On error, -1 is
  498. returned
  499. \sa sl_WlanProfileAdd , sl_WlanProfileGet
  500. \note belongs to \ref ext_api
  501. \warning
  502. */
  503. #if _SL_INCLUDE_FUNC(sl_WlanProfileDel)
  504. _i16 sl_WlanProfileDel(const _i16 Index);
  505. #endif
  506. /*!
  507. \brief Set policy values
  508. \param[in] Type Type of policy to be modified. The Options are:\n
  509. - SL_POLICY_CONNECTION
  510. - SL_POLICY_SCAN
  511. - SL_POLICY_PM
  512. - SL_POLICY_P2P
  513. \param[in] Policy The option value which depends on action type
  514. \param[in] pVal An optional value pointer
  515. \param[in] ValLen An optional value length, in bytes
  516. \return On success, zero is returned. On error, -1 is
  517. returned
  518. \sa sl_WlanPolicyGet
  519. \note belongs to \ref ext_api
  520. \warning
  521. \par
  522. SL_POLICY_CONNECTION type defines three options available to connect the CC31xx device to the AP: \n
  523. - 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
  524. To set this option, use: \n
  525. <b> sl_WlanPolicySet(SL_POLICY_CONNECTION,SL_CONNECTION_POLICY(1,0,0,0,0),NULL,0) </b>
  526. - If Fast Connect is set, the CC31xx device tries to establish a fast connection to AP. \n
  527. To set this option, use: \n
  528. <b> sl_WlanPolicySet(SL_POLICY_CONNECTION,SL_CONNECTION_POLICY(0,1,0,0,0),NULL,0) </b>
  529. - (relevant for P2P mode only) - If Any P2P is set, CC31xx/CC32xx device tries to automatically connect to the first P2P device available, \n
  530. supporting push button only. To set this option, use: \n
  531. <b> sl_WlanPolicySet(SL_POLICY_CONNECTION,SL_CONNECTION_POLICY(0,0,0,1,0),NULL,0) </b>
  532. - For auto smart config upon restart (any command from Host will end this state) use: \n
  533. <b> sl_WlanPolicySet(SL_POLICY_CONNECTION,SL_CONNECTION_POLICY(0,0,0,0,1),NULL,0) </b> \n
  534. The options above could be combined to a single action, if more than one action is required. \n
  535. \par
  536. SL_POLICY_SCAN defines system scan time interval.Default interval is 10 minutes. \n
  537. After settings scan interval, an immediate scan is activated. The next scan will be based on the interval settings. \n
  538. - For example, setting scan interval to 1 minute interval use: \n
  539. _u32 intervalInSeconds = 60; \n
  540. #define SL_SCAN_ENABLE 1 \n<b>
  541. sl_WlanPolicySet(SL_POLICY_SCAN,SL_SCAN_ENABLE, (_u8 *)&intervalInSeconds,sizeof(intervalInSeconds)); </b>\n
  542. - For example, disable scan: \n
  543. #define SL_SCAN_DISABLE 0 \n<b>
  544. sl_WlanPolicySet(SL_POLICY_SCAN,SL_SCAN_DISABLE,0,0); </b>\n
  545. \par
  546. SL_POLICY_PM defines a power management policy for Station mode only:
  547. - For setting normal power management (default) policy use: <b> sl_WlanPolicySet(SL_POLICY_PM , SL_NORMAL_POLICY, NULL,0) </b>
  548. - For setting low latency power management policy use: <b> sl_WlanPolicySet(SL_POLICY_PM , SL_LOW_LATENCY_POLICY, NULL,0) </b>
  549. - For setting low power management policy use: <b> sl_WlanPolicySet(SL_POLICY_PM , SL_LOW_POWER_POLICY, NULL,0) </b>
  550. - For setting always on power management policy use: <b> sl_WlanPolicySet(SL_POLICY_PM , SL_ALWAYS_ON_POLICY, NULL,0) </b>
  551. - For setting Long Sleep Interval policy use: \n
  552. _u16 PolicyBuff[4] = {0,0,800,0}; // PolicyBuff[2] is max sleep time in mSec \n<b>
  553. sl_WlanPolicySet(SL_POLICY_PM , SL_LONG_SLEEP_INTERVAL_POLICY, (_u8*)PolicyBuff,sizeof(PolicyBuff)); </b>\n
  554. SL_POLICY_P2P defines p2p negotiation policy parameters for P2P role:
  555. - To set intent negotiation value, set on of the following:
  556. SL_P2P_ROLE_NEGOTIATE - intent 3
  557. SL_P2P_ROLE_GROUP_OWNER - intent 15
  558. SL_P2P_ROLE_CLIENT - intent 0
  559. - To set negotiation initiator value (initiator policy of first negotiation action frame), set on of the following:
  560. SL_P2P_NEG_INITIATOR_ACTIVE
  561. SL_P2P_NEG_INITIATOR_PASSIVE
  562. SL_P2P_NEG_INITIATOR_RAND_BACKOFF
  563. For example: \n
  564. <b>sl_WlanPolicySet(SL_POLICY_P2P, SL_P2P_POLICY(SL_P2P_ROLE_NEGOTIATE,SL_P2P_NEG_INITIATOR_RAND_BACKOFF),NULL,0) </b>
  565. */
  566. #if _SL_INCLUDE_FUNC(sl_WlanPolicySet)
  567. _i16 sl_WlanPolicySet(const _u8 Type , const _u8 Policy, _u8 *pVal,const _u8 ValLen);
  568. #endif
  569. /*!
  570. \brief get policy values
  571. \param[in] Type SL_POLICY_CONNECTION, SL_POLICY_SCAN, SL_POLICY_PM,SL_POLICY_P2P \n
  572. \param[in] Policy argument may be set to any value \n
  573. \param[out] The returned values, depends on each policy type, will be stored in the allocated buffer pointed by pVal
  574. with a maximum buffer length set by the calling function and pointed to by argument *pValLen
  575. \return On success, zero is returned. On error, -1 is returned
  576. \sa sl_WlanPolicySet
  577. \note belongs to \ref ext_api
  578. \warning The value pointed by the argument *pValLen should be set to a value different from 0 and
  579. greater than the buffer length returned from the SL device. Otherwise, an error will be returned.
  580. */
  581. #if _SL_INCLUDE_FUNC(sl_WlanPolicyGet)
  582. _i16 sl_WlanPolicyGet(const _u8 Type , _u8 Policy,_u8 *pVal,_u8 *pValLen);
  583. #endif
  584. /*!
  585. \brief Gets the WLAN scan operation results
  586. Gets scan results , gets entry from scan result table
  587. \param[in] Index - Starting index identifier (range 0-19) for getting scan results
  588. \param[in] Count - How many entries to fetch. Max is (20-"Index").
  589. \param[out] pEntries - pointer to an allocated Sl_WlanNetworkEntry_t.
  590. the number of array items should match "Count"
  591. sec_type: SL_SCAN_SEC_TYPE_OPEN, SL_SCAN_SEC_TYPE_WEP, SL_SCAN_SEC_TYPE_WPA or SL_SCAN_SEC_TYPE_WPA2
  592. \return Number of valid networks list items
  593. \sa
  594. \note belongs to \ref ext_api
  595. \warning This command do not initiate any active scanning action
  596. \par Example:
  597. \code An example of fetching max 10 results:
  598. Sl_WlanNetworkEntry_t netEntries[10];
  599. _i16 resultsCount = sl_WlanGetNetworkList(0,10,&netEntries[0]);
  600. for(i=0; i< resultsCount; i++)
  601. {
  602. printf("%s\n",netEntries[i].ssid);
  603. }
  604. \endcode
  605. */
  606. #if _SL_INCLUDE_FUNC(sl_WlanGetNetworkList)
  607. _i16 sl_WlanGetNetworkList(const _u8 Index,const _u8 Count, Sl_WlanNetworkEntry_t *pEntries);
  608. #endif
  609. /*!
  610. \brief Start collecting wlan RX statistics, for unlimited time.
  611. \return On success, zero is returned. On error, -1 is returned
  612. \sa sl_WlanRxStatStop sl_WlanRxStatGet
  613. \note belongs to \ref ext_api
  614. \warning
  615. \par Example:
  616. \code Getting wlan RX statistics:
  617. void RxStatCollectTwice()
  618. {
  619. SlGetRxStatResponse_t rxStat;
  620. _i16 rawSocket;
  621. _i8 DataFrame[200];
  622. struct SlTimeval_t timeval;
  623. timeval.tv_sec = 0; // Seconds
  624. timeval.tv_usec = 20000; // Microseconds. 10000 microseconds resolution
  625. sl_WlanRxStatStart(); // set statistics mode
  626. rawSocket = sl_Socket(SL_AF_RF, SL_SOCK_RAW, eChannel);
  627. // set timeout - in case we have no activity for the specified channel
  628. sl_SetSockOpt(rawSocket,SL_SOL_SOCKET,SL_SO_RCVTIMEO, &timeval, sizeof(timeval)); // Enable receive timeout
  629. status = sl_Recv(rawSocket, DataFrame, sizeof(DataFrame), 0);
  630. Sleep(1000); // sleep for 1 sec
  631. sl_WlanRxStatGet(&rxStat,0); // statistics has been cleared upon read
  632. Sleep(1000); // sleep for 1 sec
  633. sl_WlanRxStatGet(&rxStat,0);
  634. }
  635. \endcode
  636. */
  637. #if _SL_INCLUDE_FUNC(sl_WlanRxStatStart)
  638. _i16 sl_WlanRxStatStart(void);
  639. #endif
  640. /*!
  641. \brief Stop collecting wlan RX statistic, (if previous called sl_WlanRxStatStart)
  642. \return On success, zero is returned. On error, -1 is returned
  643. \sa sl_WlanRxStatStart sl_WlanRxStatGet
  644. \note belongs to \ref ext_api
  645. \warning
  646. */
  647. #if _SL_INCLUDE_FUNC(sl_WlanRxStatStop)
  648. _i16 sl_WlanRxStatStop(void);
  649. #endif
  650. /*!
  651. \brief Get wlan RX statistics. upon calling this command, the statistics counters will be cleared.
  652. \param[in] Flags should be 0 ( not applicable right now, will be added the future )
  653. \param[in] pRxStat a pointer to SlGetRxStatResponse_t filled with Rx statistics results
  654. \return On success, zero is returned. On error, -1 is returned
  655. \sa sl_WlanRxStatStart sl_WlanRxStatStop
  656. \note belongs to \ref ext_api
  657. \warning
  658. */
  659. #if _SL_INCLUDE_FUNC(sl_WlanRxStatGet)
  660. _i16 sl_WlanRxStatGet(SlGetRxStatResponse_t *pRxStat,const _u32 Flags);
  661. #endif
  662. /*!
  663. \brief Stop Smart Config procedure. Once Smart Config will be stopped,
  664. Asynchronous event will be received - SL_OPCODE_WLAN_SMART_CONFIG_STOP_ASYNC_RESPONSE.
  665. \param[in] none
  666. \param[out] none
  667. \return 0 - if Stop Smart Config is about to be executed without errors.
  668. \sa sl_WlanSmartConfigStart
  669. \note belongs to \ref ext_api
  670. \warning
  671. */
  672. #if _SL_INCLUDE_FUNC(sl_WlanSmartConfigStop)
  673. _i16 sl_WlanSmartConfigStop(void);
  674. #endif
  675. /*!
  676. \brief Start Smart Config procedure
  677. \par
  678. The target of the procedure is to let the \n
  679. device to gain the network parameters: SSID and Password (if network is secured) \n
  680. and to connect to it once located in the network range. \n
  681. An external application should be used on a device connected to any mobile network. \n
  682. The external application will transmit over the air the network parameters in secured manner.\n
  683. The Password may be decrypted using a Key. \n
  684. The decryption method may be decided in the command or embedded in the Flash. \n
  685. 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
  686. Once Smart Config has ended successfully, Asynchronous event will be received - \n
  687. SL_OPCODE_WLAN_SMART_CONFIG_START_ASYNC_RESPONSE. \n
  688. The Event will hold the SSID and an extra field that might have been delivered as well (i.e. - device name)
  689. \param[in] groupIdBitmask - each bit represent a group ID that should be searched.
  690. The Default group ID id BIT_0. 2 more group can be searched
  691. in addition. The range is BIT_0 - BIT_15.
  692. \param[in] chiper - 0: check in flash, 1 - AES, 0xFF - do not check in flash
  693. \param[in] publicKeyLen - public key len (used for the default group ID - BIT_0)
  694. \param[in] group1KeyLen - group ID1 length
  695. \param[in] group2KeyLen - group ID2 length
  696. \param[in] publicKey - public key (used for the default group ID - BIT_0)
  697. \param[in] group1Key - group ID1 key
  698. \param[in] group2Key - group ID2 key
  699. \param[out] none
  700. \return 0 - if Smart Config started successfully.
  701. \sa sl_WlanSmartConfigStop
  702. \note belongs to \ref ext_api
  703. \warning
  704. \par
  705. \code An example of starting smart Config on group ID's 0 + 1 + 2
  706. sl_WlanSmartConfigStart(7, //group ID's (BIT_0 | BIT_1 | BIT_2)
  707. 1, //decrypt key by AES method
  708. 16, //decryption key length for group ID0
  709. 16, //decryption key length for group ID1
  710. 16, //decryption key length for group ID2
  711. "Key0Key0Key0Key0", //decryption key for group ID0
  712. "Key1Key1Key1Key1", //decryption key for group ID1
  713. "Key2Key2Key2Key2" //decryption key for group ID2
  714. );
  715. \endcode
  716. */
  717. #if _SL_INCLUDE_FUNC(sl_WlanSmartConfigStart)
  718. _i16 sl_WlanSmartConfigStart(const _u32 groupIdBitmask,
  719. const _u8 cipher,
  720. const _u8 publicKeyLen,
  721. const _u8 group1KeyLen,
  722. const _u8 group2KeyLen,
  723. const _u8* publicKey,
  724. const _u8* group1Key,
  725. const _u8* group2Key);
  726. #endif
  727. /*!
  728. \brief Wlan set mode
  729. Setting WLAN mode
  730. \param[in] mode - WLAN mode to start the CC31xx device. Possible options are:
  731. - ROLE_STA - for WLAN station mode
  732. - ROLE_AP - for WLAN AP mode
  733. - ROLE_P2P -for WLAN P2P mode
  734. \return 0 - if mode was set correctly
  735. \sa sl_Start sl_Stop
  736. \note belongs to \ref ext_api
  737. \warning After setting the mode the system must be restarted for activating the new mode
  738. \par Example:
  739. \code
  740. //Switch from any role to STA:
  741. sl_WlanSetMode(ROLE_STA);
  742. sl_Stop(0);
  743. sl_Start(NULL,NULL,NULL);
  744. \endcode
  745. */
  746. #if _SL_INCLUDE_FUNC(sl_WlanSetMode)
  747. _i16 sl_WlanSetMode(const _u8 mode);
  748. #endif
  749. /*!
  750. \brief Internal function for setting WLAN configurations
  751. \return On success, zero is returned. On error one of the following error codes returned:
  752. - CONF_ERROR (-1)
  753. - CONF_NVMEM_ACCESS_FAILED (-2)
  754. - CONF_OLD_FILE_VERSION (-3)
  755. - CONF_ERROR_NO_SUCH_COUNTRY_CODE (-4)
  756. \param[in] ConfigId - configuration id
  757. - <b>SL_WLAN_CFG_AP_ID</b>
  758. - <b>SL_WLAN_CFG_GENERAL_PARAM_ID</b>
  759. - <b>SL_WLAN_CFG_P2P_PARAM_ID</b>
  760. \param[in] ConfigOpt - configurations option
  761. - <b>SL_WLAN_CFG_AP_ID</b>
  762. - <b>WLAN_AP_OPT_SSID</b> \n
  763. Set SSID for AP mode. \n
  764. This options takes <b>_u8</b> buffer as parameter
  765. - <b>WLAN_AP_OPT_CHANNEL</b> \n
  766. Set channel for AP mode. \n
  767. 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
  768. This option takes <b>_u8</b> as a parameter
  769. - <b>WLAN_AP_OPT_HIDDEN_SSID</b> \n
  770. Set Hidden SSID Mode for AP mode.Hidden options: \n
  771. 0: disabled \n
  772. 1: Send empty (length=0) SSID in beacon and ignore probe request for broadcast SSID \n
  773. 2: Clear SSID (ASCII 0), but keep the original length (this may be required with some \n
  774. clients that do not support empty SSID) and ignore probe requests for broadcast SSID \n
  775. This option takes <b>_u8</b> as a parameter
  776. - <b>WLAN_AP_OPT_SECURITY_TYPE</b> \n
  777. Set Security type for AP mode. Security options are:
  778. - Open security: SL_SEC_TYPE_OPEN
  779. - WEP security: SL_SEC_TYPE_WEP
  780. - WPA security: SL_SEC_TYPE_WPA_WPA2 \n
  781. This option takes <b>_u8</b> pointer as a parameter
  782. - <b>WLAN_AP_OPT_PASSWORD</b> \n
  783. Set Password for for AP mode (for WEP or for WPA): \n
  784. Password - for WPA: 8 - 63 characters \n
  785. for WEP: 5 / 13 characters (ascii) \n
  786. This options takes <b>_u8</b> buffer as parameter
  787. - <b>SL_WLAN_CFG_GENERAL_PARAM_ID</b>
  788. - <b> WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS </b> \n
  789. Set scan parameters.
  790. This option uses slWlanScanParamCommand_t as parameter
  791. - <b>WLAN_GENERAL_PARAM_OPT_COUNTRY_CODE</b> \n
  792. Set Country Code for AP mode \n
  793. This options takes <b>_u8</b> 2 bytes buffer as parameter
  794. - <b>WLAN_GENERAL_PARAM_OPT_STA_TX_POWER</b> \n
  795. Set STA mode Tx power level \n
  796. Number between 0-15, as dB offset from max power (0 will set MAX power) \n
  797. This options takes <b>_u8</b> as parameter
  798. - <b>WLAN_GENERAL_PARAM_OPT_AP_TX_POWER</b>
  799. Set AP mode Tx power level \n
  800. Number between 0-15, as dB offset from max power (0 will set MAX power) \n
  801. This options takes <b>_u8</b> as parameter
  802. - <b>WLAN_GENERAL_PARAM_OPT_INFO_ELEMENT</b>
  803. Set Info Element for AP mode. \n
  804. The Application can set up to MAX_PRIVATE_INFO_ELEMENTS_SUPPROTED info elements per Role (AP / P2P GO). \n
  805. To delete an info element use the relevant index and length = 0. \n
  806. The Application can set up to MAX_PRIVATE_INFO_ELEMENTS_SUPPROTED to the same role. \n
  807. However, for AP - no more than INFO_ELEMENT_MAX_TOTAL_LENGTH_AP bytes can be stored for all info elements. \n
  808. For P2P GO - no more than INFO_ELEMENT_MAX_TOTAL_LENGTH_P2P_GO bytes can be stored for all info elements. \n
  809. This option takes sl_protocol_WlanSetInfoElement_t as parameter
  810. - <b>SL_WLAN_CFG_P2P_PARAM_ID</b>
  811. - <b>WLAN_P2P_OPT_DEV_TYPE</b> \n
  812. Set P2P Device type.Maximum length of 17 characters. Device type is published under P2P I.E, \n
  813. allows to make devices easier to recognize. \n
  814. In case no device type is set, the default type is "1-0050F204-1" \n
  815. This options takes <b>_u8</b> buffer as parameter
  816. - <b>WLAN_P2P_OPT_CHANNEL_N_REGS</b> \n
  817. Set P2P Channels. \n
  818. listen channel (either 1/6/11 for 2.4GHz) \n
  819. listen regulatory class (81 for 2.4GHz) \n
  820. oper channel (either 1/6/11 for 2.4GHz) \n
  821. oper regulatory class (81 for 2.4GHz) \n
  822. listen channel and regulatory class will determine the device listen channel during p2p find listen phase \n
  823. 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
  824. 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.
  825. This option takes pointer to <b>_u8[4]</b> as parameter
  826. \param[in] ConfigLen - configurations len
  827. \param[in] pValues - configurations values
  828. \sa
  829. \note
  830. \warning
  831. \par Examples:
  832. \par
  833. <b> WLAN_AP_OPT_SSID: </b>
  834. \code
  835. _u8 str[33];
  836. memset(str, 0, 33);
  837. memcpy(str, ssid, len); // ssid string of 32 characters
  838. sl_WlanSet(SL_WLAN_CFG_AP_ID, WLAN_AP_OPT_SSID, strlen(ssid), str);
  839. \endcode
  840. \par
  841. <b> WLAN_AP_OPT_CHANNEL: </b>
  842. \code
  843. _u8 val = channel;
  844. sl_WlanSet(SL_WLAN_CFG_AP_ID, WLAN_AP_OPT_CHANNEL, 1, (_u8 *)&val);
  845. \endcode
  846. \par
  847. <b> WLAN_AP_OPT_HIDDEN_SSID: </b>
  848. \code
  849. _u8 val = hidden;
  850. sl_WlanSet(SL_WLAN_CFG_AP_ID, WLAN_AP_OPT_HIDDEN_SSID, 1, (_u8 *)&val);
  851. \endcode
  852. \par
  853. <b> WLAN_AP_OPT_SECURITY_TYPE: </b>
  854. \code
  855. _u8 val = SL_SEC_TYPE_WPA_WPA2;
  856. sl_WlanSet(SL_WLAN_CFG_AP_ID, WLAN_AP_OPT_SECURITY_TYPE, 1, (_u8 *)&val);
  857. \endcode
  858. \par
  859. <b> WLAN_AP_OPT_PASSWORD: </b>
  860. \code
  861. _u8 str[65];
  862. _u16 len = strlen(password);
  863. memset(str, 0, 65);
  864. memcpy(str, password, len);
  865. sl_WlanSet(SL_WLAN_CFG_AP_ID, WLAN_AP_OPT_PASSWORD, len, (_u8 *)str);
  866. \endcode
  867. \par
  868. <b> WLAN_GENERAL_PARAM_OPT_STA_TX_POWER: </b>
  869. \code
  870. _u8 stapower=(_u8)power;
  871. sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID, WLAN_GENERAL_PARAM_OPT_STA_TX_POWER,1,(_u8 *)&stapower);
  872. \endcode
  873. \par
  874. <b> WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS: </b>
  875. \code
  876. slWlanScanParamCommand_t ScanParamConfig;
  877. ScanParamConfig.G_Channels_mask = 0x01; // bit mask for channels:1 means channel 1 is enabled, 3 means channels 1 + 2 are enabled
  878. ScanParamConfig.rssiThershold = -70; // only for RSSI level which is higher than -70
  879. sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID ,WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS,sizeof(slWlanScanParamCommand_t),(_u8*)&ScanParamConfig);
  880. \endcode
  881. \par
  882. <b> WLAN_GENERAL_PARAM_OPT_COUNTRY_CODE: </b>
  883. \code
  884. _u8* str = (_u8 *) country; // string of 2 characters. i.e. - "US"
  885. sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID, WLAN_GENERAL_PARAM_OPT_COUNTRY_CODE, 2, str);
  886. \endcode
  887. \par
  888. <b> WLAN_GENERAL_PARAM_OPT_AP_TX_POWER: </b>
  889. \code
  890. _u8 appower=(_u8)power;
  891. sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID, WLAN_GENERAL_PARAM_OPT_AP_TX_POWER,1,(_u8 *)&appower);
  892. \endcode
  893. \par
  894. <b> WLAN_P2P_OPT_DEV_TYPE: </b>
  895. \code
  896. _u8 str[17];
  897. _u16 len = strlen(device_type);
  898. memset(str, 0, 17);
  899. memcpy(str, device_type, len);
  900. sl_WlanSet(SL_WLAN_CFG_P2P_PARAM_ID, WLAN_P2P_OPT_DEV_TYPE, len, str);
  901. \endcode
  902. \par
  903. <b> WLAN_P2P_OPT_CHANNEL_N_REGS: </b>
  904. \code
  905. _u8 str[4];
  906. str[0] = (_u8)11; // listen channel
  907. str[1] = (_u8)81; // listen regulatory class
  908. str[2] = (_u8)6; // oper channel
  909. str[3] = (_u8)81; // oper regulatory class
  910. sl_WlanSet(SL_WLAN_CFG_P2P_PARAM_ID, WLAN_P2P_OPT_CHANNEL_N_REGS, 4, str);
  911. \endcode
  912. \par
  913. <b> WLAN_GENERAL_PARAM_OPT_INFO_ELEMENT: </b>
  914. \code
  915. sl_protocol_WlanSetInfoElement_t infoele;
  916. infoele.index = Index; // Index of the info element. range: 0 - MAX_PRIVATE_INFO_ELEMENTS_SUPPROTED
  917. infoele.role = Role; // INFO_ELEMENT_AP_ROLE (0) or INFO_ELEMENT_P2P_GO_ROLE (1)
  918. infoele.ie.id = Id; // Info element ID. if INFO_ELEMENT_DEFAULT_ID (0) is set, ID will be set to 221.
  919. // Organization unique ID. If all 3 bytes are zero - it will be replaced with 08,00,28.
  920. infoele.ie.oui[0] = Oui0; // Organization unique ID first Byte
  921. infoele.ie.oui[1] = Oui1; // Organization unique ID second Byte
  922. infoele.ie.oui[2] = Oui2; // Organization unique ID third Byte
  923. infoele.ie.length = Len; // Length of the info element. must be smaller than 253 bytes
  924. memset(infoele.ie.data, 0, INFO_ELEMENT_MAX_SIZE);
  925. if ( Len <= INFO_ELEMENT_MAX_SIZE )
  926. {
  927. memcpy(infoele.ie.data, IE, Len); // Info element. length of the info element is [0-252]
  928. sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID,WLAN_GENERAL_PARAM_OPT_INFO_ELEMENT,sizeof(sl_protocol_WlanSetInfoElement_t),(_u8* ) &infoele);
  929. }
  930. sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID,WLAN_GENERAL_PARAM_OPT_INFO_ELEMENT,sizeof(sl_protocol_WlanSetInfoElement_t),(_u8* ) &infoele);
  931. \endcode
  932. */
  933. #if _SL_INCLUDE_FUNC(sl_WlanSet)
  934. _i16 sl_WlanSet(const _u16 ConfigId ,const _u16 ConfigOpt,const _u16 ConfigLen,const _u8 *pValues);
  935. #endif
  936. /*!
  937. \brief Internal function for getting WLAN configurations
  938. \return On success, zero is returned. On error, -1 is
  939. returned
  940. \param[in] ConfigId - configuration id
  941. - <b>SL_WLAN_CFG_AP_ID</b>
  942. - <b>SL_WLAN_CFG_GENERAL_PARAM_ID</b>
  943. - <b>SL_WLAN_CFG_P2P_PARAM_ID</b>
  944. \param[out] pConfigOpt - get configurations option
  945. - <b>SL_WLAN_CFG_AP_ID</b>
  946. - <b>WLAN_AP_OPT_SSID</b> \n
  947. Get SSID for AP mode. \n
  948. Get up to 32 characters of SSID \n
  949. This options takes <b>_u8</b> as parameter
  950. - <b>WLAN_AP_OPT_CHANNEL</b> \n
  951. Get channel for AP mode. \n
  952. This option takes <b>_u8</b> as a parameter
  953. - <b>WLAN_AP_OPT_HIDDEN_SSID</b> \n
  954. Get Hidden SSID Mode for AP mode.Hidden options: \n
  955. 0: disabled \n
  956. 1: Send empty (length=0) SSID in beacon and ignore probe request for broadcast SSID \n
  957. 2: Clear SSID (ASCII 0), but keep the original length (this may be required with some \n
  958. clients that do not support empty SSID) and ignore probe requests for broadcast SSID \n
  959. This option takes <b>_u8</b> as a parameter
  960. - <b>WLAN_AP_OPT_SECURITY_TYPE</b> \n
  961. Get Security type for AP mode. Security options are:
  962. - Open security: SL_SEC_TYPE_OPEN
  963. - WEP security: SL_SEC_TYPE_WEP
  964. - WPA security: SL_SEC_TYPE_WPA_WPA2 \n
  965. This option takes <b>_u8</b> as a parameter
  966. - <b>WLAN_AP_OPT_PASSWORD</b> \n
  967. Get Password for for AP mode (for WEP or for WPA): \n
  968. Returns password - string, fills up to 64 characters. \n
  969. This options takes <b>_u8</b> buffer as parameter
  970. - <b>SL_WLAN_CFG_GENERAL_PARAM_ID</b>
  971. - <b> WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS </b> \n
  972. Get scan parameters.
  973. This option uses slWlanScanParamCommand_t as parameter
  974. - <b>WLAN_GENERAL_PARAM_OPT_COUNTRY_CODE</b> \n
  975. Get Country Code for AP mode \n
  976. This options takes <b>_u8</b> buffer as parameter
  977. - <b>WLAN_GENERAL_PARAM_OPT_STA_TX_POWER</b> \n
  978. Get STA mode Tx power level \n
  979. Number between 0-15, as dB offset from max power (0 indicates MAX power) \n
  980. This options takes <b>_u8</b> as parameter
  981. - <b>WLAN_GENERAL_PARAM_OPT_AP_TX_POWER</b>
  982. Get AP mode Tx power level \n
  983. Number between 0-15, as dB offset from max power (0 indicates MAX power) \n
  984. This options takes <b>_u8</b> as parameter
  985. - <b>SL_WLAN_CFG_P2P_PARAM_ID</b>
  986. - <b>WLAN_P2P_OPT_CHANNEL_N_REGS</b> \n
  987. Get P2P Channels. \n
  988. listen channel (either 1/6/11 for 2.4GHz) \n
  989. listen regulatory class (81 for 2.4GHz) \n
  990. oper channel (either 1/6/11 for 2.4GHz) \n
  991. oper regulatory class (81 for 2.4GHz) \n
  992. listen channel and regulatory class will determine the device listen channel during p2p find listen phase \n
  993. 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
  994. 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
  995. This option takes pointer to <b>_u8[4]</b> as parameter
  996. \param[out] pConfigLen - The length of the allocated memory as input, when the
  997. function complete, the value of this parameter would be
  998. the len that actually read from the device.
  999. If the device return length that is longer from the input
  1000. value, the function will cut the end of the returned structure
  1001. and will return SL_ESMALLBUF.
  1002. \param[out] pValues - get configurations values
  1003. \sa sl_WlanSet
  1004. \note
  1005. \warning
  1006. \par Examples:
  1007. \par
  1008. <b> WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS: </b>
  1009. \code
  1010. slWlanScanParamCommand_t ScanParamConfig;
  1011. _u16 Option = WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS;
  1012. _u16 OptionLen = sizeof(slWlanScanParamCommand_t);
  1013. sl_WlanGet(SL_WLAN_CFG_GENERAL_PARAM_ID ,&Option,&OptionLen,(_u8 *)&ScanParamConfig);
  1014. \endcode
  1015. \par
  1016. <b> WLAN_GENERAL_PARAM_OPT_AP_TX_POWER: </b>
  1017. \code
  1018. _i8 TXPower = 0;
  1019. _u16 Option = WLAN_GENERAL_PARAM_OPT_AP_TX_POWER;
  1020. _u16 OptionLen = sizeof(_i8);
  1021. sl_WlanGet(SL_WLAN_CFG_GENERAL_PARAM_ID ,&Option,&OptionLen,(_u8 *)&TXPower);
  1022. \endcode
  1023. \par
  1024. <b> WLAN_GENERAL_PARAM_OPT_STA_TX_POWER: </b>
  1025. \code
  1026. _i8 TXPower = 0;
  1027. _u16 Option = WLAN_GENERAL_PARAM_OPT_STA_TX_POWER;
  1028. _u16 OptionLen = sizeof(_i8);
  1029. sl_WlanGet(SL_WLAN_CFG_GENERAL_PARAM_ID ,&Option,&OptionLen,(_u8 *)&TXPower);
  1030. \endcode
  1031. \par
  1032. <b> WLAN_P2P_OPT_DEV_TYPE: </b>
  1033. \code
  1034. _i8 device_type[18];
  1035. _u16 len = 18;
  1036. _u16 config_opt = WLAN_P2P_OPT_DEV_TYPE;
  1037. sl_WlanGet(SL_WLAN_CFG_P2P_PARAM_ID, &config_opt , &len, (_u8* )device_type);
  1038. \endcode
  1039. \par
  1040. <b> WLAN_AP_OPT_SSID: </b>
  1041. \code
  1042. _i8 ssid[32];
  1043. _u16 len = 32;
  1044. _u16 config_opt = WLAN_AP_OPT_SSID;
  1045. sl_WlanGet(SL_WLAN_CFG_AP_ID, &config_opt , &len, (_u8* )ssid);
  1046. \endcode
  1047. \par
  1048. <b> WLAN_GENERAL_PARAM_OPT_COUNTRY_CODE: </b>
  1049. \code
  1050. _i8 country[3];
  1051. _u16 len = 3;
  1052. _u16 config_opt = WLAN_GENERAL_PARAM_OPT_COUNTRY_CODE;
  1053. sl_WlanGet(SL_WLAN_CFG_GENERAL_PARAM_ID, &config_opt, &len, (_u8* )country);
  1054. \endcode
  1055. \par
  1056. <b> WLAN_AP_OPT_CHANNEL: </b>
  1057. \code
  1058. _i8 channel;
  1059. _u16 len = 1;
  1060. _u16 config_opt = WLAN_AP_OPT_CHANNEL;
  1061. sl_WlanGet(SL_WLAN_CFG_AP_ID, &config_opt, &len, (_u8* )&channel);
  1062. \endcode
  1063. \par
  1064. <b> WLAN_AP_OPT_HIDDEN_SSID: </b>
  1065. \code
  1066. _u8 hidden;
  1067. _u16 len = 1;
  1068. _u16 config_opt = WLAN_AP_OPT_HIDDEN_SSID;
  1069. sl_WlanGet(SL_WLAN_CFG_AP_ID, &config_opt, &len, (_u8* )&hidden);
  1070. \endcode
  1071. \par
  1072. <b> WLAN_AP_OPT_SECURITY_TYPE: </b>
  1073. \code
  1074. _u8 sec_type;
  1075. _u16 len = 1;
  1076. _u16 config_opt = WLAN_AP_OPT_SECURITY_TYPE;
  1077. sl_WlanGet(SL_WLAN_CFG_AP_ID, &config_opt, &len, (_u8* )&sec_type);
  1078. \endcode
  1079. \par
  1080. <b> WLAN_AP_OPT_PASSWORD: </b>
  1081. \code
  1082. _u8 password[64];
  1083. _u16 len = 64;
  1084. memset(password,0,64);
  1085. _u16 config_opt = WLAN_AP_OPT_PASSWORD;
  1086. sl_WlanGet(SL_WLAN_CFG_AP_ID, &config_opt, &len, (_u8* )password);
  1087. \endcode
  1088. \par
  1089. <b> WLAN_P2P_OPT_CHANNEL_N_REGS: </b>
  1090. \code
  1091. _u16 listen_channel,listen_reg,oper_channel,oper_reg;
  1092. _u16 len = 4;
  1093. _u16 config_opt = WLAN_P2P_OPT_CHANNEL_N_REGS;
  1094. _u8 channel_n_regs[4];
  1095. sl_WlanGet(SL_WLAN_CFG_P2P_PARAM_ID, &config_opt, &len, (_u8* )channel_n_regs);
  1096. listen_channel = channel_n_regs[0];
  1097. listen_reg = channel_n_regs[1];
  1098. oper_channel = channel_n_regs[2];
  1099. oper_reg = channel_n_regs[3];
  1100. \endcode
  1101. */
  1102. #if _SL_INCLUDE_FUNC(sl_WlanGet)
  1103. _i16 sl_WlanGet(const _u16 ConfigId, _u16 *pConfigOpt,_u16 *pConfigLen, _u8 *pValues);
  1104. #endif
  1105. /*!
  1106. Close the Doxygen group.
  1107. @}
  1108. */
  1109. #ifdef __cplusplus
  1110. }
  1111. #endif /* __cplusplus */
  1112. #endif /* __WLAN_H__ */