mbed official / mbed-dev

Dependents:   Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more

Committer:
AnnaBridge
Date:
Fri May 26 12:39:01 2017 +0100
Revision:
165:e614a9f1c9e2
Parent:
149:156823d33999
This updates the lib to the mbed lib v 143

Who changed what in which revision?

UserRevisionLine numberNew contents of line
<> 149:156823d33999 1 /*---------------------------------------------------------------------------
<> 149:156823d33999 2 * Copyright (c) 2016, u-blox Malmö, All Rights Reserved
<> 149:156823d33999 3 * SPDX-License-Identifier: LicenseRef-PBL
<> 149:156823d33999 4 *
<> 149:156823d33999 5 * This file and the related binary are licensed under the
<> 149:156823d33999 6 * Permissive Binary License, Version 1.0 (the "License");
<> 149:156823d33999 7 * you may not use these files except in compliance with the License.
<> 149:156823d33999 8 *
<> 149:156823d33999 9 * You may obtain a copy of the License here:
<> 149:156823d33999 10 * LICENSE-permissive-binary-license-1.0.txt and at
<> 149:156823d33999 11 * https://www.mbed.com/licenses/PBL-1.0
<> 149:156823d33999 12 *
<> 149:156823d33999 13 * See the License for the specific language governing permissions and
<> 149:156823d33999 14 * limitations under the License.
<> 149:156823d33999 15 *
<> 149:156823d33999 16 * Component : WLAN
<> 149:156823d33999 17 * File : cb_wlan.h
<> 149:156823d33999 18 *
<> 149:156823d33999 19 * Description : Main WLAN component, ties together WM, SUPPLICANT and
<> 149:156823d33999 20 * TARGET to one streamlined API.
<> 149:156823d33999 21 *-------------------------------------------------------------------------*/
<> 149:156823d33999 22
<> 149:156823d33999 23 /**
<> 149:156823d33999 24 * @file cb_wlan.h The main WLAN component interface.
<> 149:156823d33999 25 * All functions declared extern needs to be provided by another/upper layer.
<> 149:156823d33999 26 * @ingroup wlan
<> 149:156823d33999 27 */
<> 149:156823d33999 28
<> 149:156823d33999 29 #ifndef _CB_WLAN_H_
<> 149:156823d33999 30 #define _CB_WLAN_H_
<> 149:156823d33999 31
<> 149:156823d33999 32 #include "cb_types.h"
<> 149:156823d33999 33 #include "cb_wlan_types.h"
AnnaBridge 165:e614a9f1c9e2 34 #include "cb_cert_utils.h"
<> 149:156823d33999 35 #include "cb_status.h"
<> 149:156823d33999 36
<> 149:156823d33999 37 #ifdef __cplusplus
<> 149:156823d33999 38 extern "C" {
<> 149:156823d33999 39 #endif
<> 149:156823d33999 40
<> 149:156823d33999 41
<> 149:156823d33999 42 /*===========================================================================
<> 149:156823d33999 43 * DEFINES
<> 149:156823d33999 44 *=========================================================================*/
<> 149:156823d33999 45
<> 149:156823d33999 46 /**
<> 149:156823d33999 47 * Max username length in @ref cbWLAN_EnterpriseConnectParameters
<> 149:156823d33999 48 *
<> 149:156823d33999 49 * @ingroup wlan
<> 149:156823d33999 50 */
<> 149:156823d33999 51 #define cbWLAN_MAX_USERNAME_LENGTH 64
<> 149:156823d33999 52
<> 149:156823d33999 53 /**
<> 149:156823d33999 54 * Max password length in @ref cbWLAN_Util_PSKFromPWD and @ref cbWLAN_EnterpriseConnectParameters
<> 149:156823d33999 55 *
<> 149:156823d33999 56 * @ingroup wlan
<> 149:156823d33999 57 */
<> 149:156823d33999 58 #define cbWLAN_MAX_PASSPHRASE_LENGTH 64
<> 149:156823d33999 59
<> 149:156823d33999 60 /**
<> 149:156823d33999 61 * PSK length in @ref cbWLAN_WPAPSKConnectParameters
<> 149:156823d33999 62 *
<> 149:156823d33999 63 * @ingroup wlan
<> 149:156823d33999 64 */
<> 149:156823d33999 65 #define cbWLAN_PSK_LENGTH 32
<> 149:156823d33999 66
<> 149:156823d33999 67
<> 149:156823d33999 68 /**
<> 149:156823d33999 69 * Max domain name length in @ref cbWLAN_EnterpriseConnectParameters
<> 149:156823d33999 70 *
<> 149:156823d33999 71 * @ingroup wlan
<> 149:156823d33999 72 */
<> 149:156823d33999 73 #define cbWLAN_MAX_DOMAIN_LENGTH 64
<> 149:156823d33999 74
<> 149:156823d33999 75
<> 149:156823d33999 76 /*===========================================================================
<> 149:156823d33999 77 * TYPES
<> 149:156823d33999 78 *=========================================================================*/
<> 149:156823d33999 79 /**
<> 149:156823d33999 80 * Start parameters passed to WLAN driver.
<> 149:156823d33999 81 *
<> 149:156823d33999 82 * @ingroup wlan
<> 149:156823d33999 83 */
<> 149:156823d33999 84 typedef struct cbWLAN_StartParameters {
<> 149:156823d33999 85 cbWLAN_MACAddress mac; /**< MAC of WLAN interface, set to all zeros if hardware programmed address should be used. */
<> 149:156823d33999 86 cb_boolean disable80211d;
<> 149:156823d33999 87 cbWM_ModuleType deviceType; /**< Specify current device type. */
<> 149:156823d33999 88 union {
<> 149:156823d33999 89 struct {
<> 149:156823d33999 90 cbWM_TxPowerSettings txPowerSettings; /**< Transmission power settings. */
<> 149:156823d33999 91 } ODIN_W26X;
<> 149:156823d33999 92 } deviceSpecific;
<> 149:156823d33999 93 } cbWLAN_StartParameters;
<> 149:156823d33999 94
<> 149:156823d33999 95 /**
<> 149:156823d33999 96 * Common connect parameters.
<> 149:156823d33999 97 *
<> 149:156823d33999 98 * @ingroup wlan
<> 149:156823d33999 99 */
<> 149:156823d33999 100 typedef struct cbWLAN_CommonConnectParameters {
<> 149:156823d33999 101 cbWLAN_MACAddress bssid; /**< BSSID to connect to, set to all zero for any BSSID. */
<> 149:156823d33999 102 cbWLAN_Ssid ssid; /**< SSID to connect to. */
<> 149:156823d33999 103 } cbWLAN_CommonConnectParameters;
<> 149:156823d33999 104
<> 149:156823d33999 105
<> 149:156823d33999 106 /**
<> 149:156823d33999 107 * WEP specific connect parameters.
<> 149:156823d33999 108 *
<> 149:156823d33999 109 * @ingroup wlan
<> 149:156823d33999 110 */
<> 149:156823d33999 111 typedef struct cbWLAN_WEPConnectParameters {
<> 149:156823d33999 112 cbWLAN_WEPKey keys[4]; /**< WEP keys. */
<> 149:156823d33999 113 cb_uint32 txKey; /**< Active WEP transmission key index (0-3). */
<> 149:156823d33999 114 } cbWLAN_WEPConnectParameters;
<> 149:156823d33999 115
<> 149:156823d33999 116 /**
<> 149:156823d33999 117 * WPA PSK parameters.
<> 149:156823d33999 118 *
<> 149:156823d33999 119 * @ingroup wlan
<> 149:156823d33999 120 */
<> 149:156823d33999 121 typedef struct cbWLAN_WPAPSK {
<> 149:156823d33999 122 cb_uint8 key[cbWLAN_PSK_LENGTH]; /**< WPA pre-shared key in binary form. */
<> 149:156823d33999 123 } cbWLAN_WPAPSK;
<> 149:156823d33999 124
<> 149:156823d33999 125 /**
<> 149:156823d33999 126 * WPA PSK specific connect parameters.
<> 149:156823d33999 127 *
<> 149:156823d33999 128 * @ingroup wlan
<> 149:156823d33999 129 */
<> 149:156823d33999 130 typedef struct cbWLAN_WPAPSKConnectParameters {
<> 149:156823d33999 131 cbWLAN_WPAPSK psk; /**< WPA pre-shared key*/
<> 149:156823d33999 132 } cbWLAN_WPAPSKConnectParameters;
<> 149:156823d33999 133
<> 149:156823d33999 134
<> 149:156823d33999 135 typedef enum cbWLAN_CipherSuite {
<> 149:156823d33999 136 cbWLAN_CIPHER_SUITE_NONE = 0x00,
<> 149:156823d33999 137 cbWLAN_CIPHER_SUITE_WEP64 = 0x01,
<> 149:156823d33999 138 cbWLAN_CIPHER_SUITE_WEP128 = 0x02,
<> 149:156823d33999 139 cbWLAN_CIPHER_SUITE_TKIP = 0x04,
<> 149:156823d33999 140 cbWLAN_CIPHER_SUITE_AES_CCMP = 0x08,
<> 149:156823d33999 141 } cbWLAN_CipherSuite;
<> 149:156823d33999 142
<> 149:156823d33999 143 typedef enum cbWLAN_AuthenticationSuite {
<> 149:156823d33999 144 cbWLAN_AUTHENTICATION_SUITE_NONE = 0x00,
<> 149:156823d33999 145 cbWLAN_AUTHENTICATION_SUITE_SHARED_SECRET = 0x01,
<> 149:156823d33999 146 cbWLAN_AUTHENTICATION_SUITE_PSK = 0x02,
<> 149:156823d33999 147 cbWLAN_AUTHENTICATION_SUITE_8021X = 0x04,
<> 149:156823d33999 148 cbWLAN_AUTHENTICATION_SUITE_USE_WPA = 0x08,
<> 149:156823d33999 149 cbWLAN_AUTHENTICATION_SUITE_USE_WPA2 = 0x10,
<> 149:156823d33999 150 } cbWLAN_AuthenticationSuite;
<> 149:156823d33999 151
<> 149:156823d33999 152
<> 149:156823d33999 153 /**
<> 149:156823d33999 154 * WPA Enterprise specific connect parameters.
<> 149:156823d33999 155 *
<> 149:156823d33999 156 * @ingroup wlan
<> 149:156823d33999 157 */
<> 149:156823d33999 158 typedef struct cbWLAN_EnterpriseConnectParameters {
<> 149:156823d33999 159 cbWLAN_EnterpriseMode authMode; /**< Enterprise authentication mode. */
<> 149:156823d33999 160 cb_uint8 username[cbWLAN_MAX_USERNAME_LENGTH]; /**< Username string. */
<> 149:156823d33999 161 cb_uint8 passphrase[cbWLAN_MAX_PASSPHRASE_LENGTH]; /**< Passphrase string. */
<> 149:156823d33999 162 cb_uint8 domain[cbWLAN_MAX_DOMAIN_LENGTH]; /**< Domain string. */
AnnaBridge 165:e614a9f1c9e2 163 cbCERT_Stream *clientCertificate; /**< Stream handle to provide SSL certificate for authentication. */
AnnaBridge 165:e614a9f1c9e2 164 cbCERT_Stream *clientPrivateKey; /**< STream handle to provide SSL private key for authentication. */
<> 149:156823d33999 165 } cbWLAN_EnterpriseConnectParameters;
<> 149:156823d33999 166
<> 149:156823d33999 167 /**
<> 149:156823d33999 168 * Common access point parameters.
<> 149:156823d33999 169 *
<> 149:156823d33999 170 * @ingroup wlan
<> 149:156823d33999 171 */
<> 149:156823d33999 172 typedef struct cbWLAN_CommonApParameters {
<> 149:156823d33999 173 cbWLAN_Ssid ssid; /**< SSID to connect to. */
<> 149:156823d33999 174 cbWLAN_Channel channel; /**< Active channel. */
<> 149:156823d33999 175 cbWLAN_RateMask basicRates; /**< Basic rates. */
<> 149:156823d33999 176 }cbWLAN_CommonApParameters;
<> 149:156823d33999 177
<> 149:156823d33999 178
<> 149:156823d33999 179 /**
<> 149:156823d33999 180 * WPA PSK specific AP parameters.
<> 149:156823d33999 181 *
<> 149:156823d33999 182 * @ingroup wlan
<> 149:156823d33999 183 */
<> 149:156823d33999 184 typedef struct cbWLAN_WPAPSKApParameters {
AnnaBridge 165:e614a9f1c9e2 185 cbWLAN_CipherSuite rsnCiphers; /**< Bit field indicating which ciphers that shall be displayed in RSN information elements. If 0 no RSN information elements is added to beacons and probe responses. */
AnnaBridge 165:e614a9f1c9e2 186 cbWLAN_CipherSuite wpaCiphers; /**< Bit field indicating which ciphers that shall be displayed in WPA information elements. If 0 no WPA information elements is added to beacons and probe responses. */
AnnaBridge 165:e614a9f1c9e2 187 cbWLAN_WPAPSK psk; /**< WPA pre-shared key*/
AnnaBridge 165:e614a9f1c9e2 188 cb_uint32 gtkRekeyInterval; /**< Group rekey interval in seconds */
<> 149:156823d33999 189 } cbWLAN_WPAPSKApParameters;
<> 149:156823d33999 190
<> 149:156823d33999 191
<> 149:156823d33999 192 /**
<> 149:156823d33999 193 * Scan parameters
<> 149:156823d33999 194 *
<> 149:156823d33999 195 * @ingroup wlan
<> 149:156823d33999 196 */
<> 149:156823d33999 197 typedef struct cbWLAN_ScanParameters {
<> 149:156823d33999 198 cbWLAN_Ssid ssid; /**< SSID to scan for, set to zero length for broadcast scan. */
<> 149:156823d33999 199 } cbWLAN_ScanParameters;
<> 149:156823d33999 200
<> 149:156823d33999 201 /**
<> 149:156823d33999 202 * Scan result information reported from WLAN component. Contains info for
<> 149:156823d33999 203 * one specific BSS.
<> 149:156823d33999 204 *
<> 149:156823d33999 205 * @ingroup wlan
<> 149:156823d33999 206 */
<> 149:156823d33999 207 typedef struct cbWLAN_ScanIndicationInfo {
<> 149:156823d33999 208 cbWLAN_MACAddress bssid; /**< BSS BSSID */
<> 149:156823d33999 209 cbWLAN_Ssid ssid; /**< BSS SSID */
<> 149:156823d33999 210 cbWLAN_Channel channel; /**< BSS channel */
<> 149:156823d33999 211 cbWLAN_OperationalMode operationalMode; /**< BSS type */
<> 149:156823d33999 212 cb_int32 rssi; /**< RSSI for scan result packet. */
<> 149:156823d33999 213
<> 149:156823d33999 214 cbWLAN_AuthenticationSuite authenticationSuites; /**< Supported authentication suites */
<> 149:156823d33999 215 cbWLAN_CipherSuite unicastCiphers; /**< Supported unicast cipher suites */
<> 149:156823d33999 216 cbWLAN_CipherSuite groupCipher; /**< Supported group cipher suites */
<> 149:156823d33999 217
<> 149:156823d33999 218 cbWLAN_RateMask basicRateSet; /**< Basic rate set, i.e. required rates. */
<> 149:156823d33999 219 cbWLAN_RateMask supportedRateSet; /**< Supported rate set, super set of basic rate set. */
<> 149:156823d33999 220 cb_uint32 beaconPeriod; /**< Beacon period in ms. */
<> 149:156823d33999 221 cb_uint32 DTIMPeriod; /**< DTIM period in beacon intervals */
<> 149:156823d33999 222 cb_uint8 countryCode[3]; /**< Three letter country code */
<> 149:156823d33999 223 cb_uint32 flags; // QoS, short preamble, DFS, privacy,
<> 149:156823d33999 224 } cbWLAN_ScanIndicationInfo;
<> 149:156823d33999 225
<> 149:156823d33999 226 /**
<> 149:156823d33999 227 * Status indications indicated by @ref cbWLAN_statusIndication.
<> 149:156823d33999 228 *
<> 149:156823d33999 229 * @ingroup wlan
<> 149:156823d33999 230 */
<> 149:156823d33999 231 typedef enum {
<> 149:156823d33999 232 cbWLAN_STATUS_STOPPED,
<> 149:156823d33999 233 cbWLAN_STATUS_STARTED,
<> 149:156823d33999 234 cbWLAN_STATUS_ERROR,
<> 149:156823d33999 235 cbWLAN_STATUS_DISCONNECTED,
<> 149:156823d33999 236 cbWLAN_STATUS_CONNECTING,
<> 149:156823d33999 237 cbWLAN_STATUS_CONNECTED,
<> 149:156823d33999 238 cbWLAN_STATUS_CONNECTION_FAILURE,
<> 149:156823d33999 239 cbWLAN_STATUS_AP_UP,
<> 149:156823d33999 240 cbWLAN_STATUS_AP_DOWN,
<> 149:156823d33999 241 cbWLAN_STATUS_AP_STA_ADDED,
<> 149:156823d33999 242 cbWLAN_STATUS_AP_STA_REMOVED,
<> 149:156823d33999 243 } cbWLAN_StatusIndicationInfo;
<> 149:156823d33999 244
<> 149:156823d33999 245 /**
<> 149:156823d33999 246 * Disconnection reasons for @ref cbWLAN_STATUS_DISCONNECTED.
<> 149:156823d33999 247 *
<> 149:156823d33999 248 * @ingroup wlan
<> 149:156823d33999 249 */
<> 149:156823d33999 250 typedef enum {
<> 149:156823d33999 251 cbWLAN_STATUS_DISCONNECTED_UNKNOWN,
<> 149:156823d33999 252 cbWLAN_STATUS_DISCONNECTED_NO_BSSID_FOUND,
<> 149:156823d33999 253 cbWLAN_STATUS_DISCONNECTED_AUTH_TIMEOUT,
<> 149:156823d33999 254 cbWLAN_STATUS_DISCONNECTED_MIC_FAILURE,
<> 149:156823d33999 255 } cbWLAN_StatusDisconnectedInfo;
<> 149:156823d33999 256
<> 149:156823d33999 257 /**
<> 149:156823d33999 258 * IOCTL parameters @ref cbWLAN_ioctl
<> 149:156823d33999 259 *
<> 149:156823d33999 260 * @ingroup wlan
<> 149:156823d33999 261 */
<> 149:156823d33999 262 typedef enum {
<> 149:156823d33999 263 cbWLAN_IOCTL_FIRST,
<> 149:156823d33999 264 cbWLAN_IOCTL_SET_POWER_SAVE_MODE = cbWLAN_IOCTL_FIRST, //!< Set power mode @ref cbWLAN_IoctlPowerSaveMode
<> 149:156823d33999 265 cbWLAN_IOCTL_GET_POWER_SAVE_MODE, //!< Get power mode @ref cbWLAN_IoctlPowerSaveMode
<> 149:156823d33999 266 cbWLAN_IOCTL_SET_LISTEN_INTERVAL, //!< Set listen interval, integer value 0 - 16
<> 149:156823d33999 267 cbWLAN_IOCTL_GET_LISTEN_INTERVAL, //!< Get listen interval, integer value 0 - 16
<> 149:156823d33999 268 cbWLAN_IOCTL_SET_DTIM_ENABLE, //!< Set DTIM enable 0, disable 1 enable
<> 149:156823d33999 269 cbWLAN_IOCTL_GET_DTIM_ENABLE, //!< Get DTIM enable 0, disable 1 enable
<> 149:156823d33999 270 cbWLAN_IOCTL_SET_SLEEP_TIMEOUT, //!< Set enter power save entry delay (in ms). Power save mode will be entered only if there no activity during this delay
<> 149:156823d33999 271 cbWLAN_IOCTL_GET_SLEEP_TIMEOUT, //!< Get enter power save entry delay (in ms). Power save mode will be entered only if there no activity during this delay
<> 149:156823d33999 272 cbWLAN_IOCTL_LAST,
AnnaBridge 165:e614a9f1c9e2 273 cbWLAN_IOCTL_SET_GSETTING = 1000, //!< Pipe to @ref cbWM_gSet.
AnnaBridge 165:e614a9f1c9e2 274 cbWLAN_IOCTL_SET_TSETTING = 2000, //!< Pipe to @ref cbWM_tSet.
AnnaBridge 165:e614a9f1c9e2 275 cbWLAN_IOCTL_GET_GSETTING = 3000, //!< Pipe to @ref cbWM_gGet.
AnnaBridge 165:e614a9f1c9e2 276 cbWLAN_IOCTL_GET_TSETTING = 4000, //!< Pipe to @ref cbWM_tGet.
<> 149:156823d33999 277 } cbWLAN_Ioctl;
<> 149:156823d33999 278
<> 149:156823d33999 279 /**
<> 149:156823d33999 280 * Power save modes set using @ref cbWLAN_ioctl
<> 149:156823d33999 281 *
<> 149:156823d33999 282 * @ingroup wlan
<> 149:156823d33999 283 */
<> 149:156823d33999 284 typedef enum {
<> 149:156823d33999 285 cbWLAN_IOCTL_POWER_SAVE_MODE_OFF,
<> 149:156823d33999 286 cbWLAN_IOCTL_POWER_SAVE_MODE_SLEEP,
<> 149:156823d33999 287 cbWLAN_IOCTL_POWER_SAVE_MODE_DEEP_SLEEP
<> 149:156823d33999 288 } cbWLAN_IoctlPowerSaveMode;
<> 149:156823d33999 289
<> 149:156823d33999 290 /**
<> 149:156823d33999 291 * Start parameters indicated from WLAN driver for status indication
<> 149:156823d33999 292 * @ref cbWLAN_STATUS_STARTED.
<> 149:156823d33999 293 *
<> 149:156823d33999 294 * @ingroup wlan
<> 149:156823d33999 295 */
<> 149:156823d33999 296 typedef struct cbWLAN_StatusStartedInfo {
<> 149:156823d33999 297 cbWLAN_MACAddress macAddress; /**< MAC address of WLAN driver. */
<> 149:156823d33999 298 } cbWLAN_StatusStartedInfo;
<> 149:156823d33999 299
<> 149:156823d33999 300 /**
<> 149:156823d33999 301 * Connected parameters indicated from WLAN driver for status indication
<> 149:156823d33999 302 * @ref cbWLAN_STATUS_CONNECTED.
<> 149:156823d33999 303 *
<> 149:156823d33999 304 * @ingroup wlan
<> 149:156823d33999 305 */
<> 149:156823d33999 306 typedef struct cbWLAN_StatusConnectedInfo {
<> 149:156823d33999 307 cbWLAN_MACAddress bssid; /**< BSSID of the BSS connected to. */
<> 149:156823d33999 308 cbWLAN_Channel channel; /**< Operating channels of the BSS connected to. */
<> 149:156823d33999 309 } cbWLAN_StatusConnectedInfo;
<> 149:156823d33999 310
<> 149:156823d33999 311 /**
<> 149:156823d33999 312 * Received Ethernet data packet information and properties.
<> 149:156823d33999 313 *
<> 149:156823d33999 314 * @ingroup wlan
<> 149:156823d33999 315 */
<> 149:156823d33999 316 typedef struct cbWLAN_PacketIndicationInfo {
<> 149:156823d33999 317 void *rxData; /**< Pointer to the port specific data type. */
<> 149:156823d33999 318 cb_uint32 size; /**< Length of the data payload in the port specific packet data type. */
<> 149:156823d33999 319 cb_boolean isChecksumVerified; /**< True if the TCP/UDP checksum is verified and correct. */
<> 149:156823d33999 320 } cbWLAN_PacketIndicationInfo;
<> 149:156823d33999 321
<> 149:156823d33999 322 /**
<> 149:156823d33999 323 * Status updates from WLAN component.
<> 149:156823d33999 324 * @note The callback must not make any call back to WLAN.
<> 149:156823d33999 325 *
<> 149:156823d33999 326 * @param callbackContext Context pointer provided in @ref cbWLAN_registerStatusCallback.
<> 149:156823d33999 327 * @param status Status indication type.
<> 149:156823d33999 328 * @param data Additional status indication data, depends on indication type.
<> 149:156823d33999 329 *
<> 149:156823d33999 330 * @sa cbWLAN_registerStatusCallback
<> 149:156823d33999 331 */
<> 149:156823d33999 332 typedef void (*cbWLAN_statusIndication)(void *callbackContext, cbWLAN_StatusIndicationInfo status, void *data);
<> 149:156823d33999 333
<> 149:156823d33999 334
<> 149:156823d33999 335 /**
<> 149:156823d33999 336 * Indication of received Ethernet data packet.
<> 149:156823d33999 337 *
<> 149:156823d33999 338 * @param callbackContext Context pointer provided in @ref cbWLAN_init.
<> 149:156823d33999 339 * @param packetInfo Pointer to struct containing packet information and data pointers.
<> 149:156823d33999 340 */
<> 149:156823d33999 341 typedef void (*cbWLAN_packetIndication)(void *callbackContext, cbWLAN_PacketIndicationInfo *packetInfo);
<> 149:156823d33999 342
<> 149:156823d33999 343 /**
<> 149:156823d33999 344 * Scan result indication from WLAN component.
<> 149:156823d33999 345 *
<> 149:156823d33999 346 * @param callbackContext Context pointer provided in @ref cbWLAN_init.
<> 149:156823d33999 347 * @param bssDescriptor Pointer to struct containing scan result information.
<> 149:156823d33999 348 * @param isLastResult @ref TRUE if scan scan is finished.
<> 149:156823d33999 349 */
<> 149:156823d33999 350 typedef void (*cbWLAN_scanIndication)(void *callbackContext, cbWLAN_ScanIndicationInfo *bssDescriptor, cb_boolean isLastResult);
<> 149:156823d33999 351
<> 149:156823d33999 352 /*===========================================================================
<> 149:156823d33999 353 * WLAN API
<> 149:156823d33999 354 *=========================================================================*/
<> 149:156823d33999 355
<> 149:156823d33999 356 /**
<> 149:156823d33999 357 * Initialize WLAN component.
<> 149:156823d33999 358 *
<> 149:156823d33999 359 * @param callbackContext Context handle used in indication callbacks.
<> 149:156823d33999 360 * @return @ref cbSTATUS_OK if successful, otherwise cbSTATUS_ERROR.
<> 149:156823d33999 361 */
<> 149:156823d33999 362 cbRTSL_Status cbWLAN_init(void *callbackContext);
<> 149:156823d33999 363
<> 149:156823d33999 364
<> 149:156823d33999 365 /**
<> 149:156823d33999 366 * Stop WLAN component.
<> 149:156823d33999 367 * Stop and destroy WLAN driver instance.
<> 149:156823d33999 368 *
<> 149:156823d33999 369 * @return @ref cbSTATUS_OK if successful, otherwise cbSTATUS_ERROR.
<> 149:156823d33999 370 */
<> 149:156823d33999 371 cbRTSL_Status cbWLAN_stop(void);
<> 149:156823d33999 372
<> 149:156823d33999 373 /**
<> 149:156823d33999 374 * Connect to access point in open mode (no encryption).
<> 149:156823d33999 375 * Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
<> 149:156823d33999 376 *
<> 149:156823d33999 377 * @param commonParams Connection parameters.
<> 149:156823d33999 378 * @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
<> 149:156823d33999 379 */
<> 149:156823d33999 380 cbRTSL_Status cbWLAN_connectOpen(cbWLAN_CommonConnectParameters *commonParams);
<> 149:156823d33999 381
<> 149:156823d33999 382 /**
<> 149:156823d33999 383 * Connect to access point in open mode with WEP encryption.
<> 149:156823d33999 384 * Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
<> 149:156823d33999 385 *
<> 149:156823d33999 386 * @param commonParams Connection parameters.
<> 149:156823d33999 387 * @param wepParams WEP specific connection parameters.
<> 149:156823d33999 388 * @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
<> 149:156823d33999 389 */
<> 149:156823d33999 390 cbRTSL_Status cbWLAN_connectWEP(cbWLAN_CommonConnectParameters *commonParams, cbWLAN_WEPConnectParameters *wepParams);
<> 149:156823d33999 391
<> 149:156823d33999 392 /**
<> 149:156823d33999 393 * Connect to access point with WPA PSK authentication.
<> 149:156823d33999 394 * Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
<> 149:156823d33999 395 *
<> 149:156823d33999 396 * @param commonParams Connection parameters.
<> 149:156823d33999 397 * @param wpaParams WPA PSK specific connection parameters.
<> 149:156823d33999 398 * @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
<> 149:156823d33999 399 */
<> 149:156823d33999 400 cbRTSL_Status cbWLAN_connectWPAPSK(cbWLAN_CommonConnectParameters *commonParams, cbWLAN_WPAPSKConnectParameters *wpaParams);
<> 149:156823d33999 401
<> 149:156823d33999 402 /**
<> 149:156823d33999 403 * Disconnect from access point or stop ongoing connection attempt.
<> 149:156823d33999 404 * Disconnection progress is reported as @ref cbWLAN_statusIndication callback.
<> 149:156823d33999 405 *
<> 149:156823d33999 406 * @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
<> 149:156823d33999 407 */
<> 149:156823d33999 408 cbRTSL_Status cbWLAN_disconnect(void);
<> 149:156823d33999 409
<> 149:156823d33999 410 /**
<> 149:156823d33999 411 * Initiate BSS scan.
<> 149:156823d33999 412 * If specific channel is set in scan parameters, only that channel is
<> 149:156823d33999 413 * scanned. If SSID is specified, a directed probe request against that SSID
<> 149:156823d33999 414 * will be used. Scan results are reported in @ref cbWLAN_scanIndication
<> 149:156823d33999 415 * callbacks.
<> 149:156823d33999 416 * @note Depending on channel using DFS or not, passive scans may be used
<> 149:156823d33999 417 * instead of active probe requests.
<> 149:156823d33999 418 *
<> 149:156823d33999 419 * @param params Scan parameters
<> 149:156823d33999 420 * @param scanIndication Callback function for scan results.
<> 149:156823d33999 421 * @param callbackContext Context pointer, will be sent back in callback.
<> 149:156823d33999 422 * @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
<> 149:156823d33999 423 */
<> 149:156823d33999 424 cbRTSL_Status cbWLAN_scan(cbWLAN_ScanParameters *params, cbWLAN_scanIndication scanIndication, void *callbackContext);
<> 149:156823d33999 425
<> 149:156823d33999 426
<> 149:156823d33999 427 /**
<> 149:156823d33999 428 * Retrieve an RSSI value for station mode.
<> 149:156823d33999 429 *
<> 149:156823d33999 430 * @note Depending on connection state and data transfer interval
<> 149:156823d33999 431 * the value may be incorrect.
<> 149:156823d33999 432 *
<> 149:156823d33999 433 * @return RSSI value in dBm
<> 149:156823d33999 434 */
<> 149:156823d33999 435 cb_int16 cbWLAN_STA_getRSSI();
<> 149:156823d33999 436
<> 149:156823d33999 437 /**
<> 149:156823d33999 438 * Start access point in open mode (no encryption).
<> 149:156823d33999 439 * Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
<> 149:156823d33999 440 *
<> 149:156823d33999 441 * @param commonParams Common Accesspoint parameters.
<> 149:156823d33999 442 * @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
<> 149:156823d33999 443 */
<> 149:156823d33999 444 cbRTSL_Status cbWLAN_apStartOpen(cbWLAN_CommonApParameters *commonParams);
<> 149:156823d33999 445
<> 149:156823d33999 446 /**
<> 149:156823d33999 447 * Start access point with WPA PSK authentication.
<> 149:156823d33999 448 * Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
<> 149:156823d33999 449 *
<> 149:156823d33999 450 * @param commonParams Common Accesspoint parameters.
<> 149:156823d33999 451 * @param wpaParams WPA PSK specific parameters.
<> 149:156823d33999 452 * @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
<> 149:156823d33999 453 */
<> 149:156823d33999 454 cbRTSL_Status cbWLAN_apStartWPAPSK(cbWLAN_CommonApParameters *commonParams, cbWLAN_WPAPSKApParameters *wpaParams);
<> 149:156823d33999 455
<> 149:156823d33999 456 /**
<> 149:156823d33999 457 * Stop access point.
<> 149:156823d33999 458 *
<> 149:156823d33999 459 * @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
<> 149:156823d33999 460 */
<> 149:156823d33999 461 cbRTSL_Status cbWLAN_apStop(void);
<> 149:156823d33999 462
<> 149:156823d33999 463 /**
<> 149:156823d33999 464 * Send an Ethernet data packet.
<> 149:156823d33999 465 * @note Data send when not in connected state is just dropped.
<> 149:156823d33999 466 *
<> 149:156823d33999 467 * @param txData Pointer to the port specific Ethernet data type containing transmit data
<> 149:156823d33999 468 */
<> 149:156823d33999 469 void cbWLAN_sendPacket(void *txData);
<> 149:156823d33999 470
<> 149:156823d33999 471 /**
<> 149:156823d33999 472 * Register a status indication callback.
<> 149:156823d33999 473 * @note There may be multiple clients connected.
<> 149:156823d33999 474 *
<> 149:156823d33999 475 * @param statusIndication Callback function.
<> 149:156823d33999 476 * @param callbackContext Context pointer, will be sent back in callback.
<> 149:156823d33999 477 * @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
<> 149:156823d33999 478 */
<> 149:156823d33999 479 cbRTSL_Status cbWLAN_registerStatusCallback(cbWLAN_statusIndication statusIndication, void *callbackContext);
<> 149:156823d33999 480
<> 149:156823d33999 481
<> 149:156823d33999 482 /**
<> 149:156823d33999 483 * Register a status indication callback.
<> 149:156823d33999 484 *
<> 149:156823d33999 485 * @param packetIndication Callback function.
<> 149:156823d33999 486 * @param callbackContext Context pointer, will be sent back in callback.
<> 149:156823d33999 487 * @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
<> 149:156823d33999 488 */
<> 149:156823d33999 489 cbRTSL_Status cbWLAN_registerPacketIndicationCallback(cbWLAN_packetIndication packetIndication, void *callbackContext);
<> 149:156823d33999 490
<> 149:156823d33999 491 /**
<> 149:156823d33999 492 * Deregister the specified status indication callback.
<> 149:156823d33999 493 *
<> 149:156823d33999 494 * @param statusIndication Callback function.
<> 149:156823d33999 495 * @param callbackContext Context pointer, will be sent back in callback.
<> 149:156823d33999 496 * @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
<> 149:156823d33999 497 */
<> 149:156823d33999 498 cbRTSL_Status cbWLAN_deregisterStatusCallback(cbWLAN_statusIndication statusIndication, void *callbackContext);
<> 149:156823d33999 499
<> 149:156823d33999 500
<> 149:156823d33999 501 cbRTSL_Status cbWLAN_Util_PSKFromPWD(cb_char passphrase[cbWLAN_MAX_PASSPHRASE_LENGTH], cbWLAN_Ssid ssid, cb_uint8 psk[cbWLAN_PSK_LENGTH]);
<> 149:156823d33999 502
<> 149:156823d33999 503 /**
<> 149:156823d33999 504 * Set the channel list to be used for connection and scanning.
<> 149:156823d33999 505 * The list will be filtered according to the allowed channel list
<> 149:156823d33999 506 * set. The list can include both 2.4GHz and 5GHz channels.
<> 149:156823d33999 507 * If channel list parameter is NULL the default channel list is
<> 149:156823d33999 508 * restored.
<> 149:156823d33999 509 *
<> 149:156823d33999 510 * @param channelList Pointer to channel list for the driver to use.
<> 149:156823d33999 511 *
<> 149:156823d33999 512 * @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
<> 149:156823d33999 513 */
<> 149:156823d33999 514 cbRTSL_Status cbWLAN_setChannelList(const cbWLAN_ChannelList *channelList);
<> 149:156823d33999 515
<> 149:156823d33999 516 /**
<> 149:156823d33999 517 * Returns the wanted channel list.
<> 149:156823d33999 518 *
<> 149:156823d33999 519 * @param channelList Pointer to channel list
<> 149:156823d33999 520 *
<> 149:156823d33999 521 * @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
<> 149:156823d33999 522 */
<> 149:156823d33999 523 cbRTSL_Status cbWLAN_getChannelList(cbWLAN_ChannelList *channelList);
<> 149:156823d33999 524
<> 149:156823d33999 525 /**
<> 149:156823d33999 526 * Returns the channel list currently used. This channel list
<> 149:156823d33999 527 * depend on the channel list specified by the user and the
<> 149:156823d33999 528 * current regulatory domain.
<> 149:156823d33999 529 *
<> 149:156823d33999 530 * @param channelList Pointer to channel list
<> 149:156823d33999 531 *
<> 149:156823d33999 532 * @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
<> 149:156823d33999 533 */
<> 149:156823d33999 534 cbRTSL_Status cbWLAN_getActiveChannelList(cbWLAN_ChannelList *channelList);
<> 149:156823d33999 535
<> 149:156823d33999 536 /**
<> 149:156823d33999 537 * WLAN control settings. Both in and out parameters are supported.
<> 149:156823d33999 538 * If an ioctl request is not supported cbSTATUS_ERROR is returned and
<> 149:156823d33999 539 * the value parameter shall be ignored.
<> 149:156823d33999 540 *
<> 149:156823d33999 541 * @param ioctl Parameter that shall be set. @ref cbWLAN_Ioctl lists all supported parameters.
<> 149:156823d33999 542 * @param value Value. @ref cbWLAN_Ioctl lists the type for all supported parameters.
<> 149:156823d33999 543 *
<> 149:156823d33999 544 * @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
<> 149:156823d33999 545 */
<> 149:156823d33999 546 cbRTSL_Status cbWLAN_ioctl(cbWLAN_Ioctl ioctl, void* value);
<> 149:156823d33999 547
<> 149:156823d33999 548 #ifdef __cplusplus
<> 149:156823d33999 549 }
<> 149:156823d33999 550 #endif
<> 149:156823d33999 551
<> 149:156823d33999 552 #endif /* _CB_WLAN_H_ */
<> 149:156823d33999 553