@@ -83,10 +83,12 @@ extern "C" {
83
83
#define cbWLAN_RSNIE_SIZE 44
84
84
#define cbWLAN_MDIE_SIZE 5
85
85
86
+ #define cbWLAN_DEFAULT_HANDLE ((cbWLAN_Handle)1)
87
+ #define cbWLAN_INVALID_HANDLE (cb_UINT32_MAX)
86
88
/*===========================================================================
87
89
* TYPES
88
90
*=========================================================================*/
89
-
91
+ typedef cb_uint32 cbWLAN_Handle ;
90
92
/**
91
93
* Start parameters passed to WLAN driver.
92
94
*
@@ -282,12 +284,13 @@ typedef enum {
282
284
* @ingroup wlan
283
285
*/
284
286
typedef enum {
285
- cbWLAN_STATUS_DISCONNECTED_UNKNOWN ,
287
+ cbWLAN_STATUS_DISCONNECTED_UNKNOWN = 0x00 ,
286
288
cbWLAN_STATUS_DISCONNECTED_NO_BSSID_FOUND ,
287
- cbWLAN_STATUS_DISCONNECTED_AUTH_TIMEOUT ,
288
- cbWLAN_STATUS_DISCONNECTED_MIC_FAILURE ,
289
+ cbWLAN_STATUS_DISCONNECTED_ASSOC_FAILURE ,
290
+ cbWLAN_STATUS_DISCONNECTED_AUTH_FAILURE ,
291
+ cbWLAN_STATUS_DISCONNECTED_MIC_FAILURE ,
289
292
cbWLAN_STATUS_DISCONNECTED_ROAMING ,
290
- } cbWLAN_StatusDisconnectedInfo ;
293
+ } cbWLAN_StatusDisconnectedReason ;
291
294
292
295
/**
293
296
* IOCTL parameters @ref cbWLAN_ioctl
@@ -312,14 +315,26 @@ typedef struct cbWLAN_StatusStartedInfo {
312
315
} cbWLAN_StatusStartedInfo ;
313
316
314
317
/**
315
- * Connected parameters indicated from WLAN driver for status indication
318
+ * Disconnected parameters indicated from WLAN driver for status indication
319
+ * @ref cbWLAN_STATUS_DISCONNECTED.
320
+ *
321
+ * @ingroup wlan
322
+ */
323
+ typedef struct cbWLAN_StatusDisconnectedInfo {
324
+ cbWLAN_Handle handle ; /**< Handle returned by cbWLAN_connectXXX */
325
+ cbWLAN_StatusDisconnectedReason reason ;
326
+ } cbWLAN_StatusDisconnectedInfo ;
327
+
328
+ /**
329
+ * Connected parameters indicated from WLAN driver for status indication
316
330
* @ref cbWLAN_STATUS_CONNECTED.
317
331
*
318
332
* @ingroup wlan
319
333
*/
320
334
typedef struct cbWLAN_StatusConnectedInfo {
321
- cbWLAN_MACAddress bssid ; /**< BSSID of the BSS connected to. */
322
- cbWLAN_Channel channel ; /**< Operating channels of the BSS connected to. */
335
+ cbWLAN_Handle handle ; /**< Handle returned by cbWLAN_connectXXX */
336
+ cbWLAN_MACAddress bssid ; /**< BSSID of the BSS connected to. */
337
+ cbWLAN_Channel channel ; /**< Operating channels of the BSS connected to. */
323
338
cb_uint16 mobilityDomainId ;
324
339
} cbWLAN_StatusConnectedInfo ;
325
340
@@ -385,51 +400,51 @@ cbRTSL_Status cbWLAN_init();
385
400
cbRTSL_Status cbWLAN_stop (void );
386
401
387
402
/**
388
- * Connect to access point in open mode (no encryption).
389
- * Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
390
- *
391
- * @param commonParams Connection parameters.
392
- * @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
393
- */
394
- cbRTSL_Status cbWLAN_connectOpen (cbWLAN_CommonConnectParameters * commonParams );
403
+ * Connect to access point in open mode (no encryption).
404
+ * Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
405
+ *
406
+ * @param commonParams Connection parameters.
407
+ * @return @ref cbWLAN_Handle if call successful, otherwise -1.
408
+ */
409
+ cbWLAN_Handle cbWLAN_connectOpen (cbWLAN_CommonConnectParameters * commonParams );
395
410
396
411
/**
397
- * Connect to access point in open mode with WEP encryption.
398
- * Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
399
- *
400
- * @param commonParams Connection parameters.
401
- * @param wepParams WEP specific connection parameters.
402
- * @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
403
- */
404
- cbRTSL_Status cbWLAN_connectWEP (cbWLAN_CommonConnectParameters * commonParams , cbWLAN_WEPConnectParameters * wepParams );
412
+ * Connect to access point in open mode with WEP encryption.
413
+ * Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
414
+ *
415
+ * @param commonParams Connection parameters.
416
+ * @param wepParams WEP specific connection parameters.
417
+ * @return @ref cbWLAN_Handle if call successful, otherwise -1.
418
+ */
419
+ cbWLAN_Handle cbWLAN_connectWEP (cbWLAN_CommonConnectParameters * commonParams , cbWLAN_WEPConnectParameters * wepParams );
405
420
406
421
/**
407
- * Connect to access point with WPA PSK authentication.
408
- * Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
409
- *
410
- * @param commonParams Connection parameters.
411
- * @param wpaParams WPA PSK specific connection parameters.
412
- * @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
413
- */
414
- cbRTSL_Status cbWLAN_connectWPAPSK (cbWLAN_CommonConnectParameters * commonParams , cbWLAN_WPAPSKConnectParameters * wpaParams );
422
+ * Connect to access point with WPA PSK authentication.
423
+ * Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
424
+ *
425
+ * @param commonParams Connection parameters.
426
+ * @param wpaParams WPA PSK specific connection parameters.
427
+ * @return @ref cbWLAN_Handle if call successful, otherwise -1.
428
+ */
429
+ cbWLAN_Handle cbWLAN_connectWPAPSK (cbWLAN_CommonConnectParameters * commonParams , cbWLAN_WPAPSKConnectParameters * wpaParams );
415
430
416
431
/**
417
- * Connect to access point with WPA Enterprise authentication.
418
- * Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
419
- *
420
- * @param commonParams Connection parameters.
421
- * @param enterpriseParams WPA Enterprise specific connection parameters.
422
- * @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
423
- */
424
- cbRTSL_Status cbWLAN_connectEnterprise (cbWLAN_CommonConnectParameters * commonParams , cbWLAN_EnterpriseConnectParameters * enterpriseParams );
432
+ * Connect to access point with WPA Enterprise authentication.
433
+ * Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
434
+ *
435
+ * @param commonParams Connection parameters.
436
+ * @param enterpriseParams WPA Enterprise specific connection parameters.
437
+ * @return @ref cbWLAN_Handle if call successful, otherwise -1.
438
+ */
439
+ cbWLAN_Handle cbWLAN_connectEnterprise (cbWLAN_CommonConnectParameters * commonParams , cbWLAN_EnterpriseConnectParameters * enterpriseParams );
425
440
426
441
/**
427
442
* Disconnect from access point or stop ongoing connection attempt.
428
443
* Disconnection progress is reported as @ref cbWLAN_statusIndication callback.
429
444
*
430
445
* @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
431
446
*/
432
- cbRTSL_Status cbWLAN_disconnect (void );
447
+ cbRTSL_Status cbWLAN_disconnect (cbWLAN_Handle handle );
433
448
434
449
/**
435
450
* Initiate BSS scan.
@@ -459,38 +474,38 @@ cbRTSL_Status cbWLAN_scan(cbWLAN_ScanParameters *params, cbWLAN_scanIndication s
459
474
cb_int16 cbWLAN_STA_getRSSI ();
460
475
461
476
/**
462
- * Start access point in open mode (no encryption).
463
- * Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
464
- *
465
- * @param commonParams Common Accesspoint parameters.
466
- * @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
467
- */
468
- cbRTSL_Status cbWLAN_apStartOpen (cbWLAN_CommonApParameters * commonParams );
477
+ * Start access point in open mode (no encryption).
478
+ * Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
479
+ *
480
+ * @param commonParams Common Accesspoint parameters.
481
+ * @return @ref cbWLAN_Handle if call successful, otherwise -1.
482
+ */
483
+ cbWLAN_Handle cbWLAN_apStartOpen (cbWLAN_CommonApParameters * commonParams );
469
484
470
485
/**
471
486
* Start access point with WPA PSK authentication.
472
487
* Connection progress is reported as @ref cbWLAN_statusIndication callbacks.
473
488
*
474
489
* @param commonParams Common Accesspoint parameters.
475
490
* @param wpaParams WPA PSK specific parameters.
476
- * @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR .
491
+ * @return @ref cbWLAN_Handle if call successful, otherwise -1 .
477
492
*/
478
- cbRTSL_Status cbWLAN_apStartWPAPSK (cbWLAN_CommonApParameters * commonParams , cbWLAN_WPAPSKApParameters * wpaParams );
493
+ cbWLAN_Handle cbWLAN_apStartWPAPSK (cbWLAN_CommonApParameters * commonParams , cbWLAN_WPAPSKApParameters * wpaParams );
479
494
480
495
/**
481
496
* Stop access point.
482
497
*
483
498
* @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
484
499
*/
485
- cbRTSL_Status cbWLAN_apStop (void );
500
+ cbRTSL_Status cbWLAN_apStop (cbWLAN_Handle handle );
486
501
487
502
/**
488
503
* Send an Ethernet data packet.
489
504
* @note Data send when not in connected state is just dropped.
490
505
*
491
506
* @param txData Pointer to the port specific Ethernet data type containing transmit data
492
507
*/
493
- void cbWLAN_sendPacket (void * txData );
508
+ void cbWLAN_sendPacket (cbWLAN_Handle handle , void * txData );
494
509
495
510
/**
496
511
* Register a status indication callback.
@@ -510,7 +525,7 @@ cbRTSL_Status cbWLAN_registerStatusCallback(cbWLAN_statusIndication statusIndica
510
525
* @param callbackContext Context pointer, will be sent back in callback.
511
526
* @return @ref cbSTATUS_OK if call successful, otherwise cbSTATUS_ERROR.
512
527
*/
513
- cbRTSL_Status cbWLAN_registerPacketIndicationCallback (cbWLAN_packetIndication packetIndication , void * callbackContext );
528
+ cbRTSL_Status cbWLAN_registerPacketIndicationCallback (cbWLAN_Handle handle , cbWLAN_packetIndication packetIndication , void * callbackContext );
514
529
515
530
/**
516
531
* Deregister the specified status indication callback.
0 commit comments