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