SimpleLink CC31xx/CC32xx Host Driver  Version 3.0.1.71
Simplifies the implementation of Internet connectivity
Wlan

Controls the use of the WiFi WLAN module. More...

Functions

_i16 sl_WlanConnect (const _i8 *pName, const _i16 NameLen, const _u8 *pMacAddr, const SlWlanSecParams_t *pSecParams, const SlWlanSecParamsExt_t *pSecExtParams)
 Connect to wlan network as a station. More...
 
_i16 sl_WlanDisconnect (void)
 Wlan disconnect. More...
 
_i16 sl_WlanProfileAdd (const _i8 *pName, const _i16 NameLen, const _u8 *pMacAddr, const SlWlanSecParams_t *pSecParams, const SlWlanSecParamsExt_t *pSecExtParams, const _u32 Priority, const _u32 Options)
 Add profile. More...
 
_i16 sl_WlanProfileUpdate (const _u32 Index, const _i8 *pName, const _i16 NameLen, const _u8 *pMacAddr, const SlWlanSecParams_t *pSecParams, const SlWlanSecParamsExt_t *pSecExtParams, const _u32 Priority)
 Profile Update. More...
 
_i16 sl_WlanProfileGet (const _i16 Index, _i8 *pName, _i16 *pNameLen, _u8 *pMacAddr, SlWlanSecParams_t *pSecParams, SlWlanGetSecParamsExt_t *pSecExtParams, _u32 *pPriority)
 Get profile. More...
 
_i16 sl_WlanProfileDel (const _i16 Index)
 Delete WLAN profile. More...
 
_i16 sl_WlanPolicySet (const _u8 Type, const _u8 Policy, _u8 *pVal, const _u8 ValLen)
 Set policy values. More...
 
_i16 sl_WlanPolicyGet (const _u8 Type, _u8 *pPolicy, _u8 *pVal, _u8 *pValLen)
 Get policy values. More...
 
_i16 sl_WlanGetNetworkList (const _u8 Index, const _u8 Count, SlWlanNetworkEntry_t *pEntries)
 Gets the WLAN scan operation results. More...
 
_i16 sl_WlanGetExtNetworkList (const _u8 Index, const _u8 Count, SlWlanExtNetworkEntry_t *pEntries)
 Gets the WLAN scan operation results. More...
 
_i16 sl_WlanRxStatStart (void)
 Start collecting wlan RX statistics, for unlimited time. More...
 
_i16 sl_WlanRxStatGet (SlWlanGetRxStatResponse_t *pRxStat, const _u32 Flags)
 Get wlan RX statistics. Upon calling this command, the statistics counters will be cleared. More...
 
_i16 sl_WlanRxStatStop (void)
 Stop collecting wlan RX statistic, (if previous called sl_WlanRxStatStart) More...
 
_i16 sl_WlanProvisioning (_u8 ProvisioningCmd, _u8 RequestedRoleAfterSuccess, _u16 InactivityTimeoutSec, char *pSmartConfigKey, _u32 Flags)
 The simpleLink will switch to the appropriate role according to the provisioning mode requested and will start the provisioning process. More...
 
_i16 sl_WlanSetMode (const _u8 Mode)
 Wlan set mode. More...
 
_i16 sl_WlanSet (const _u16 ConfigId, const _u16 ConfigOpt, const _u16 ConfigLen, const _u8 *pValues)
 Setting WLAN configurations. More...
 
_i16 sl_WlanGet (const _u16 ConfigId, _u16 *pConfigOpt, _u16 *pConfigLen, _u8 *pValues)
 Getting WLAN configurations. More...
 
_i16 sl_WlanRxFilterAdd (SlWlanRxFilterRuleType_t RuleType, SlWlanRxFilterFlags_u Flags, const SlWlanRxFilterRule_u *const pRule, const SlWlanRxFilterTrigger_t *const pTrigger, const SlWlanRxFilterAction_t *const pAction, SlWlanRxFilterID_t *pFilterId)
 Adds new filter rule to the system. More...
 

Typedefs

typedef struct SlWlanEventSTAAdded_t SlWlanEventSTARemoved_t
 
typedef struct SlWlanEventP2PClientAdded_t SlWlanEventP2PClientRemoved_t
 
typedef struct SlWlanEventP2PDevFound_t SlWlanEventP2PRequest_t
 
typedef struct SetAntennaCmd SetAntennaIndex_t
 
typedef _i8 SlWlanRxFilterID_t
 
typedef _u8 SlWlanRxFilterIdMask_t[128/8]
 
typedef _u8 SlWlanRxFilterSysFilters_t
 
typedef _u8 SlWlanRxFilterSysFiltersMask_t[SL_WLAN_RX_FILTER_MAX_SYS_FILTERS_SETS/8]
 
typedef _u8 SlWlanRxFilterRuleType_t
 
typedef _u8 SlWlanRxFilterFlags_u
 
typedef _u8 SlWlanRxFilterRuleHeaderCompareFunction_t
 
typedef _u8 SlWlanRxFilterTriggerCompareFunction_t
 
typedef _u8 SlWlanRxFilterRuleHeaderField_t
 
typedef _u8 SlWlanRxFilterRuleCombinationOperator_t
 
typedef _u8 SlWlanRxFilterTriggerRoles_t
 
typedef _u8 SlWlanRxFilterTriggerConnectionStates_t
 
typedef _u8 SlWlanRxFilterCounterId_t
 
typedef _u8 SlWlanRxFilterActionType_t
 

Enumerations

enum  SlWlanP2PWpsMethod_e {
  SL_WLAN_P2P_WPS_METHOD_DEFAULT,
  SL_WLAN_P2P_WPS_METHOD_PIN_USER,
  SL_WLAN_P2P_WPS_METHOD_PIN_MACHINE,
  SL_WLAN_P2P_WPS_METHOD_REKEY,
  SL_WLAN_P2P_WPS_METHOD_PBC,
  SL_WLAN_P2P_WPS_METHOD_REGISTRAR
}
 
enum  SlWlanEventId_e {
  SL_WLAN_EVENT_CONNECT = 1,
  SL_WLAN_EVENT_DISCONNECT,
  SL_WLAN_EVENT_STA_ADDED,
  SL_WLAN_EVENT_STA_REMOVED,
  SL_WLAN_EVENT_P2P_CONNECT,
  SL_WLAN_EVENT_P2P_DISCONNECT,
  SL_WLAN_EVENT_P2P_CLIENT_ADDED,
  SL_WLAN_EVENT_P2P_CLIENT_REMOVED,
  SL_WLAN_EVENT_P2P_DEVFOUND,
  SL_WLAN_EVENT_P2P_REQUEST,
  SL_WLAN_EVENT_P2P_CONNECTFAIL,
  SL_WLAN_EVENT_RXFILTER,
  SL_WLAN_EVENT_PROVISIONING_STATUS,
  SL_WLAN_EVENT_PROVISIONING_PROFILE_ADDED,
  SL_WLAN_EVENT_LINK_QUALITY_TRIGGER,
  SL_WLAN_EVENT_MAX
}
 
enum  SlWlanRateIndex_e {
  SL_WLAN_RATE_1M = 1,
  SL_WLAN_RATE_2M = 2,
  SL_WLAN_RATE_5_5M = 3,
  SL_WLAN_RATE_11M = 4,
  SL_WLAN_RATE_6M = 6,
  SL_WLAN_RATE_9M = 7,
  SL_WLAN_RATE_12M = 8,
  SL_WLAN_RATE_18M = 9,
  SL_WLAN_RATE_24M = 10,
  SL_WLAN_RATE_36M = 11,
  SL_WLAN_RATE_48M = 12,
  SL_WLAN_RATE_54M = 13,
  SL_WLAN_RATE_MCS_0 = 14,
  SL_WLAN_RATE_MCS_1 = 15,
  SL_WLAN_RATE_MCS_2 = 16,
  SL_WLAN_RATE_MCS_3 = 17,
  SL_WLAN_RATE_MCS_4 = 18,
  SL_WLAN_RATE_MCS_5 = 19,
  SL_WLAN_RATE_MCS_6 = 20,
  SL_WLAN_RATE_MCS_7 = 21,
  SL_WLAN_MAX_NUM_RATES = 0xFF
}
 
enum  SlWlanP2pDevPwdMethod_e {
  SL_WLAN_DEV_PW_DEFAULT = 0,
  SL_WLAN_DEV_PW_PIN_KEYPAD = 1,
  SL_WLAN_DEV_PW_PUSH_BUTTON = 4,
  SL_WLAN_DEV_PW_PIN_DISPLAY = 5
}
 
enum  SlWlanMode_e {
  ROLE_STA = 0,
  ROLE_RESERVED = 1,
  ROLE_AP = 2,
  ROLE_P2P = 3,
  ROLE_TAG = 4
}
 
enum  SlWlanConnStatusFlags_e {
  SL_WLAN_DISCONNECTED = 0,
  SL_WLAN_CONNECTED_STA,
  SL_WLAN_CONNECTED_P2PCL,
  SL_WLAN_CONNECTED_P2PGO,
  SL_WLAN_AP_CONNECTED_STATIONS
}
 
enum  Region_e {
  REGION_FCC = 0,
  REGION_ETSI,
  REGION_JP,
  REGION_WW,
  REGION_NO_LIMIT
}
 
enum  SlWlanMetricEvent_e {
  SL_WLAN_METRIC_EVENT_RSSI_BEACON = 0,
  SL_WLAN_METRIC_EVENT_RSSI_DATA = 1
}
 
enum  SlWlanRxQualityEventType_e {
  SL_WLAN_RX_QUALITY_EVENT_LEVEL = 0,
  SL_WLAN_RX_QUALITY_EVENT_EDGE = 1
}
 
enum  SlWlanRssiEventDir_e {
  SL_WLAN_RSSI_EVENT_DIR_LOW = 0,
  SL_WLAN_RSSI_EVENT_DIR_HIGH = 1,
  SL_WLAN_RSSI_EVENT_DIR_BIDIR = 2,
  SL_WLAN_RSSI_EVENT_SHIFT = 3
}
 
enum  SlWlanCoexMode_e {
  SL_WLAN_COEX_MODE_DISABLED,
  SL_WLAN_COEX_BASIC_SINGLE_ANTENNA
}
 
enum  SlWlanAntSelectionMode_e {
  SL_WLAN_ANT_SELECTION_DISABLED,
  SL_WLAN_ANT_SELECTION_ANT1,
  SL_WLAN_ANT_SELECTION_ANT2,
  SL_WLAN_ANT_SELECTION_AUTO,
  SL_WLAN_ANT_SELECTION_MANUAL
}
 
enum  SlWlanAntIndex_e {
  SL_WLAN_ANT_IDX_1 = 1,
  SL_WLAN_ANT_IDX_2,
  SL_WLAN_ANT_TOGGLE,
  SL_WLAN_ANT_NUM_OF_IDXS
}
 

Detailed Description

Controls the use of the WiFi WLAN module.

Function Documentation

§ sl_WlanConnect()

_i16 sl_WlanConnect ( const _i8 *  pName,
const _i16  NameLen,
const _u8 *  pMacAddr,
const SlWlanSecParams_t pSecParams,
const SlWlanSecParamsExt_t pSecExtParams 
)

Connect to wlan network as a station.

Parameters
[in]pNameUp to 32 bytes in case of STA the name is the SSID of the Access Point
[in]NameLenName length
[in]pMacAddr6 bytes for MAC address
[in]pSecParamsSecurity parameters (use NULL key for SL_WLAN_SEC_TYPE_OPEN)
security types options:
  • SL_WLAN_SEC_TYPE_OPEN
  • SL_WLAN_SEC_TYPE_WEP
  • SL_WLAN_SEC_TYPE_WEP_SHARED
  • SL_WLAN_SEC_TYPE_WPA_WPA2
  • SL_WLAN_SEC_TYPE_WPA2_PLUS
  • SL_WLAN_SEC_TYPE_WPA3
  • SL_WLAN_SEC_TYPE_WPA_ENT
  • SL_WLAN_SEC_TYPE_WPS_PBC
  • SL_WLAN_SEC_TYPE_WPS_PIN
  • SL_WLAN_SEC_TYPE_WPA_PMK - insert preprocessed PMK as key
[in]pSecExtParamsEnterprise parameters (set NULL in case Enterprise parameters is not in use)
Returns
Zero on success, or negative error code on failure
See also
sl_WlanDisconnect
Note
Belongs to ext_api
Warning
-In this version only single enterprise mode could be used
-SL_WLAN_SEC_TYPE_WPA is a deprecated definition, the new definition is SL_WLAN_SEC_TYPE_WPA_WPA2 -SL_WLAN_SEC_TYPE_WPA2_PLUS enable to connect to WPA2, WPA2+PMF and WPA3 only networks
Example
  • Connect without security:
    secParams.Key = "";
    secParams.KeyLen = 0;
    secParams.Type = SL_WLAN_SEC_TYPE_OPEN;
    sl_WlanConnect("ssid_name", strlen("ssid_name"),0,&secParams,0);

Definition at line 72 of file wlan.c.

73 {
74  _SlWlanConnectMsg_u Msg;
75  _SlCmdCtrl_t CmdCtrl = {0,0,0};
76 
77  _SlDrvMemZero(&Msg, (_u16)sizeof(_SlWlanConnectMsg_u));
78 
79  /* verify that this api is allowed. if not allowed then
80  ignore the API execution and return immediately with an error */
81  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
82  CmdCtrl.TxDescLen = 0;/* init */
83  CmdCtrl.RxDescLen = (_SlArgSize_t)sizeof(_BasicResponse_t);
84 
85  /* verify SSID length */
86  VERIFY_PROTOCOL(NameLen >= 0 && NameLen <= SL_WLAN_SSID_MAX_LENGTH);
87  /* verify SSID is not NULL */
88  if( NULL == pName )
89  {
90  return SL_INVALPARAM;
91  }
92  /* update SSID length */
93  Msg.Cmd.Args.Common.SsidLen = (_u8)NameLen;
94 
95  /* Profile with no security */
96  /* Enterprise security profile */
97  if (NULL != pSecExtParams)
98  {
99  /* Update command opcode */
100  CmdCtrl.Opcode = SL_OPCODE_WLAN_WLANCONNECTEAPCOMMAND;
101  CmdCtrl.TxDescLen += sizeof(SlWlanConnectEapCommand_t);
102  /* copy SSID */
103  sl_Memcpy(EAP_SSID_STRING(&Msg), pName, NameLen);
104  CmdCtrl.TxDescLen += NameLen;
105  /* Copy password if supplied */
106  if ((NULL != pSecParams) && (pSecParams->KeyLen > 0))
107  {
108  /* update security type */
109  Msg.Cmd.Args.Common.SecType = pSecParams->Type;
110  /* verify key length */
111  if (pSecParams->KeyLen > MAX_KEY_LEN)
112  {
113  return SL_INVALPARAM;
114  }
115  /* update key length */
116  Msg.Cmd.Args.Common.PasswordLen = pSecParams->KeyLen;
117  ARG_CHECK_PTR(pSecParams->Key);
118  /* copy key */
119  sl_Memcpy(EAP_PASSWORD_STRING(&Msg), pSecParams->Key, pSecParams->KeyLen);
120  CmdCtrl.TxDescLen += pSecParams->KeyLen;
121  }
122  else
123  {
124  Msg.Cmd.Args.Common.PasswordLen = 0;
125  }
126 
127  ARG_CHECK_PTR(pSecExtParams);
128  /* Update Eap bitmask */
129  Msg.Cmd.Args.EapBitmask = pSecExtParams->EapMethod;
130  /* Update Certificate file ID index - currently not supported */
131  Msg.Cmd.Args.CertIndex = pSecExtParams->CertIndex;
132  /* verify user length */
133  if (pSecExtParams->UserLen > MAX_USER_LEN)
134  {
135  return SL_INVALPARAM;
136  }
137  Msg.Cmd.Args.UserLen = pSecExtParams->UserLen;
138  /* copy user name (identity) */
139  if(pSecExtParams->UserLen > 0)
140  {
141  sl_Memcpy(EAP_USER_STRING(&Msg), pSecExtParams->User, pSecExtParams->UserLen);
142  CmdCtrl.TxDescLen += pSecExtParams->UserLen;
143  }
144  /* verify Anonymous user length */
145  if (pSecExtParams->AnonUserLen > MAX_ANON_USER_LEN)
146  {
147  return SL_INVALPARAM;
148  }
149  Msg.Cmd.Args.AnonUserLen = pSecExtParams->AnonUserLen;
150  /* copy Anonymous user */
151  if(pSecExtParams->AnonUserLen > 0)
152  {
153  sl_Memcpy(EAP_ANON_USER_STRING(&Msg), pSecExtParams->AnonUser, pSecExtParams->AnonUserLen);
154  CmdCtrl.TxDescLen += pSecExtParams->AnonUserLen;
155  }
156 
157  }
158 
159  /* Regular or open security profile */
160  else
161  {
162  /* Update command opcode */
163  CmdCtrl.Opcode = SL_OPCODE_WLAN_WLANCONNECTCOMMAND;
164  CmdCtrl.TxDescLen += sizeof(SlWlanConnectCommon_t);
165  /* copy SSID */
166  sl_Memcpy(SSID_STRING(&Msg), pName, NameLen);
167  CmdCtrl.TxDescLen += NameLen;
168  /* Copy password if supplied */
169  if( NULL != pSecParams )
170  {
171  /* update security type */
172  Msg.Cmd.Args.Common.SecType = pSecParams->Type;
173  /* verify key length is valid */
174  if (pSecParams->KeyLen > MAX_KEY_LEN)
175  {
176  return SL_INVALPARAM;
177  }
178  /* update key length */
179  Msg.Cmd.Args.Common.PasswordLen = pSecParams->KeyLen;
180  CmdCtrl.TxDescLen += pSecParams->KeyLen;
181  /* copy key (could be no key in case of WPS pin) */
182  if( NULL != pSecParams->Key )
183  {
184  sl_Memcpy(PASSWORD_STRING(&Msg), pSecParams->Key, pSecParams->KeyLen);
185  }
186  }
187  /* Profile with no security */
188  else
189  {
190  Msg.Cmd.Args.Common.PasswordLen = 0;
191  Msg.Cmd.Args.Common.SecType = SL_WLAN_SEC_TYPE_OPEN;
192  }
193  }
194  /* If BSSID is not null, copy to buffer, otherwise set to 0 */
195  if(NULL != pMacAddr)
196  {
197  sl_Memcpy(Msg.Cmd.Args.Common.Bssid, pMacAddr, sizeof(Msg.Cmd.Args.Common.Bssid));
198  }
199  else
200  {
201  _SlDrvMemZero(Msg.Cmd.Args.Common.Bssid, (_u16)sizeof(Msg.Cmd.Args.Common.Bssid));
202  }
203 
204  VERIFY_RET_OK ( _SlDrvCmdOp(&CmdCtrl, &Msg, NULL));
205 
206  return (_i16)Msg.Rsp.status;
207 }

§ sl_WlanDisconnect()

_i16 sl_WlanDisconnect ( void  )

Wlan disconnect.

Disconnect connection

Returns
Zero disconnected done successfully, other already disconnected
See also
sl_WlanConnect
Note
belongs to ext_api
Warning

Definition at line 214 of file wlan.c.

215 {
216  /* verify that this api is allowed. if not allowed then
217  ignore the API execution and return immediately with an error */
218  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
219 
220  return _SlDrvBasicCmd(SL_OPCODE_WLAN_WLANDISCONNECTCOMMAND);
221 }

§ sl_WlanGet()

_i16 sl_WlanGet ( const _u16  ConfigId,
_u16 *  pConfigOpt,
_u16 *  pConfigLen,
_u8 *  pValues 
)

Getting WLAN configurations.

Parameters
[in]ConfigId- configuration id
  • SL_WLAN_CFG_AP_ID
  • SL_WLAN_CFG_GENERAL_PARAM_ID
  • SL_WLAN_CFG_P2P_PARAM_ID
  • SL_WLAN_CFG_AP_ACCESS_LIST_ID
  • SL_WLAN_RX_FILTERS_ID
[out]pConfigOpt- get configurations option
  • SL_WLAN_CFG_AP_ID
    • SL_WLAN_AP_OPT_SSID
      Get SSID for AP mode.
      Get up to 32 characters of SSID
      This options takes _u8 as parameter
    • SL_WLAN_AP_OPT_CHANNEL
      Get channel for AP mode.
      This option takes _u8 as a parameter
    • SL_WLAN_AP_OPT_HIDDEN_SSID
      Get Hidden SSID Mode for AP mode.Hidden options:
      0: disabled
      1: Send empty (length=0) SSID in beacon and ignore probe request for broadcast SSID
      2: Clear SSID (ASCII 0), but keep the original length (this may be required with some
      clients that do not support empty SSID) and ignore probe requests for broadcast SSID
      This option takes _u8 as a parameter
    • SL_WLAN_AP_OPT_SECURITY_TYPE
      Get Security type for AP mode. Security options are:
      • Open security: SL_WLAN_SEC_TYPE_OPEN
      • WEP security: SL_WLAN_SEC_TYPE_WEP
      • WPA security: SL_WLAN_SEC_TYPE_WPA_WPA2
        This option takes _u8 as a parameter
    • SL_WLAN_AP_OPT_PASSWORD
      Get Password for for AP mode (for WEP or for WPA):
      Returns password - string, fills up to 64 characters.
      This options takes _u8 buffer as parameter
    • SL_WLAN_AP_OPT_MAX_STATIONS
      Get Max AP allowed stations:
      This options takes _u8 buffer as parameter
    • SL_WLAN_AP_OPT_MAX_STA_AGING
      Get AP aging time in seconds:
      This options takes _u16 buffer as parameter
    • SL_WLAN_AP_ACCESS_LIST_NUM_ENTRIES
      Get AP access list number of entries:
      This options takes _u8 buffer as parameter
    • SL_WLAN_CFG_AP_ACCESS_LIST_ID
      • The option is the start index in the access list
        Get the AP access list from start index, the number of entries in the list is extracted from the request length.
  • SL_WLAN_CFG_GENERAL_PARAM_ID
    • SL_WLAN_GENERAL_PARAM_ANT_SELECTION_GET
      Getting the desired antenna when antenna selection is set to manual mode. Applicable to CC3x20 devices only.
    • SL_WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS
      Get scan parameters. This option uses SlWlanScanParamCommand_t as parameter
    • SL_WLAN_GENERAL_PARAM_OPT_COUNTRY_CODE
      Get Country Code for AP mode
      This options takes _u8 buffer as parameter
    • SL_WLAN_GENERAL_PARAM_OPT_STA_TX_POWER
      Get STA mode Tx power level
      Number between 0-15, as dB offset from max power (0 indicates MAX power)
      This options takes _u8 as parameter
    • SL_WLAN_GENERAL_PARAM_OPT_AP_TX_POWER Get AP mode Tx power level
      Number between 0-15, as dB offset from max power (0 indicates MAX power)
      This options takes _u8 as parameter
    • SL_WLAN_GENERAL_PARAM_OPT_ENABLE_5G Get current state of 5G mode
    • SL_WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS_5G Get 5G user scan parameters
    • SL_WLAN_GENERAL_PARAM_OPT_USER_COUNTRY_ATTRIB Get user user country attributes
    • SL_WLAN_GENERAL_PARAM_OPT_COUNTRY_ATTRIB Get current country attributes (No way to set country attributes, See also country list in Appendix C)
    • SL_WLAN_GENERAL_PARAM_EXT_CONNECTION_INFO Get Beacon Interval and DTIM Period.
    • SL_WLAN_GENERAL_PARAM_OPT_NO_PS_POLL_MODE Get the mode of polling frames from the AP in power save 0 (default) - Using PS_Poll frames 1 - Not using PS_Poll frames For more information read the sl_WlanSet for this option
  • SL_WLAN_CFG_P2P_PARAM_ID
    • SL_WLAN_P2P_OPT_CHANNEL_N_REGS
      Get P2P Channels.
      listen channel (either 1/6/11 for 2.4GHz)
      listen regulatory class (81 for 2.4GHz)
      oper channel (either 1/6/11 for 2.4GHz)
      oper regulatory class (81 for 2.4GHz)
      listen channel and regulatory class will determine the device listen channel during p2p find listen phase
      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)
      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 _u8[4] as parameter
  • SL_WLAN_RX_FILTERS_ID
[out]pConfigLen- The length of the allocated memory as input, when the function complete, the value of this parameter would be the len that actually read from the device. If the device return length that is longer from the input value, the function will cut the end of the returned structure and will return SL_ESMALLBUF.
[out]pValues- get configurations values
Returns
Zero on success, or negative error code on failure
See also
sl_WlanSet
Note
In case the device was started as AP mode, but no SSID was set, the Get SSID will return "mysimplelink" and not "mysimplelink-xxyyzz"
Warning
Examples
- SL_WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS:
SlWlanScanParamCommand_t ScanParamConfig;
_u16 Option = SL_WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS;
_u16 OptionLen = sizeof(SlWlanScanParamCommand_t);
sl_WlanGet(SL_WLAN_CFG_GENERAL_PARAM_ID ,&Option,&OptionLen,(_u8 *)&ScanParamConfig);

- SL_WLAN_GENERAL_PARAM_OPT_ENABLE_5G
_u8 Enabled5GStatus;
_u16 Option = SL_WLAN_GENERAL_PARAM_OPT_ENABLE_5G;
_u16 OptionLen = sizeof(_u8);
ret = sl_WlanGet(SL_WLAN_CFG_GENERAL_PARAM_ID, &Option, &OptionLen, (_u8 *)&Enabled5GStatus);

- WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS_5G:
SlWlanScanParamCommand_t ScanParamConfig;
_u16 Option = SL_WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS;
_u16 OptionLen = sizeof(SlWlanScanParamCommand_t);
sl_WlanGet(SL_WLAN_CFG_GENERAL_PARAM_ID ,&Option,&OptionLen,(_u8 *)&ScanParamConfig);

- SL_WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS:
SlWlanScanParamCommand_t ScanParamConfig;
_u16 Option = SL_WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS;
_u16 OptionLen = sizeof(SlWlanScanParamCommand_t);
sl_WlanGet(SL_WLAN_CFG_GENERAL_PARAM_ID ,&Option,&OptionLen,(_u8 *)&ScanParamConfig);

  • SL_WLAN_GENERAL_PARAM_OPT_AP_TX_POWER:
    _i32 TXPower = 0;
    _u16 Option = SL_WLAN_GENERAL_PARAM_OPT_AP_TX_POWER;
    _u16 OptionLen = sizeof(TXPower);
    sl_WlanGet(SL_WLAN_CFG_GENERAL_PARAM_ID ,&Option,&OptionLen,(_u8 *)&TXPower);

  • SL_WLAN_GENERAL_PARAM_OPTSTA_TX_POWER:
    _i32 TXPower = 0;
    _u16 Option = SL_WLAN_GENERAL_PARAM_OPT_STA_TX_POWER;
    _u16 OptionLen = sizeof(TXPower);
    sl_WlanGet(SL_WLAN_CFG_GENERAL_PARAM_ID ,&Option,&OptionLen,(_u8 *)&TXPower);

  • SL_WLAN_P2P_OPT_DEV_TYPE:
    _i8 device_type[18];
    _u16 len = 18;
    _u16 config_opt = SL_WLAN_P2P_OPT_DEV_TYPE;
    sl_WlanGet(SL_WLAN_CFG_P2P_PARAM_ID, &config_opt , &len, (_u8* )device_type);

  • SL_WLAN_AP_OPT_SSID:
    _i8 ssid[33];
    _u16 len = 33;
    sl_Memset(ssid,0,33);
    _u16 config_opt = SL_WLAN_AP_OPT_SSID;
    sl_WlanGet(SL_WLAN_CFG_AP_ID, &config_opt , &len, (_u8* )ssid);

  • SL_WLAN_GENERAL_PARAM_OPT_COUNTRY_CODE:
    _i8 country[3];
    _u16 len = 3;
    _u16 config_opt = SL_WLAN_GENERAL_PARAM_OPT_COUNTRY_CODE;
    sl_WlanGet(SL_WLAN_CFG_GENERAL_PARAM_ID, &config_opt, &len, (_u8* )country);

  • SL_WLAN_AP_OPT_CHANNEL:
    _i8 channel;
    _u16 len = 1;
    _u16 config_opt = SL_WLAN_AP_OPT_CHANNEL;
    sl_WlanGet(SL_WLAN_CFG_AP_ID, &config_opt, &len, (_u8* )&channel);

  • SL_WLAN_AP_OPT_HIDDEN_SSID:
    _u8 hidden;
    _u16 len = 1;
    _u16 config_opt = SL_WLAN_AP_OPT_HIDDEN_SSID;
    sl_WlanGet(SL_WLAN_CFG_AP_ID, &config_opt, &len, (_u8* )&hidden);

  • SL_WLAN_AP_OPT_SECURITY_TYPE:
    _u8 sec_type;
    _u16 len = 1;
    _u16 config_opt = SL_WLAN_AP_OPT_SECURITY_TYPE;
    sl_WlanGet(SL_WLAN_CFG_AP_ID, &config_opt, &len, (_u8* )&sec_type);

  • SL_WLAN_AP_OPT_PASSWORD:
    _u8 password[64];
    _u16 len = 64;
    sl_Memset(password,0,64);
    _u16 config_opt = SL_WLAN_AP_OPT_PASSWORD;
    sl_WlanGet(SL_WLAN_CFG_AP_ID, &config_opt, &len, (_u8* )password);

  • SL_WLAN_AP_OPT_MAX_STATIONS:
    _u8 max_ap_stations
    _u16 len = 1;
    _u16 config_opt = SL_WLAN_AP_OPT_MAX_STATIONS;
    sl_WlanGet(SL_WLAN_CFG_AP_ID, &config_opt, &len, (_u8 *)&max_ap_stations);

  • SL_WLAN_AP_OPT_MAX_STA_AGING:
    _u16 ap_sta_aging;
    _u16 len = 2;
    _u16 config_opt = SL_WLAN_AP_OPT_MAX_STA_AGING;
    sl_WlanGet(SL_WLAN_CFG_AP_ID, &config_opt, &len, (_u8 *)&ap_sta_aging);

  • SL_WLAN_AP_ACCESS_LIST_NUM_ENTRIES:
    _u8 aclist_num_entries;
    _u16 config_opt = SL_WLAN_AP_ACCESS_LIST_NUM_ENTRIES;
    _u16 len = sizeof(aclist_num_entries);
    sl_WlanGet(SL_WLAN_CFG_AP_ID, &config_opt, &len, (_u8 *)&aclist_num_entries);

  • SL_WLAN_CFG_AP_ACCESS_LIST_ID:
    _u8 aclist_mac[SL_WLAN_MAX_ACCESS_LIST_STATIONS][MAC_LEN];
    unsigned char aclist_num_entries;
    unsigned short config_opt;
    unsigned short len;
    int actual_aclist_num_entries;
    unsigned short start_aclist_index;
    unsigned short aclist_info_len;
    int i;
    start_aclist_index = 0;
    aclist_info_len = 2*MAC_LEN;
    sl_WlanGet(SL_WLAN_CFG_AP_ACCESS_LIST_ID, &start_aclist_index, &aclist_info_len, (_u8 *)&aclist_mac[start_aclist_index]);
    actual_aclist_num_entries = aclist_info_len / MAC_LEN;
    printf("-Print AP Deny list, num stations = %d\n", actual_aclist_num_entries);
    for (i=0; i<actual_aclist_num_entries; i++)
    {
    _u8 *pMac = aclist_mac[i+start_aclist_index];
    printf(" MAC %d: %02x:%02x:%02x:%02x:%02x:%02x\n", i, pMac[0], pMac[1], pMac[2], pMac[3], pMac[4], pMac[5]);
    }

  • SL_WLAN_P2P_OPT_CHANNEL_N_REGS:
    _u16 listen_channel,listen_reg,oper_channel,oper_reg;
    _u16 len = 4;
    _u16 config_opt = SL_WLAN_P2P_OPT_CHANNEL_N_REGS;
    _u8 channel_n_regs[4];
    sl_WlanGet(SL_WLAN_CFG_P2P_PARAM_ID, &config_opt, &len, (_u8* )channel_n_regs);
    listen_channel = channel_n_regs[0];
    listen_reg = channel_n_regs[1];
    oper_channel = channel_n_regs[2];
    oper_reg = channel_n_regs[3];

  • SL_WLAN_RX_FILTER_STATE:
    int ret = 0;
    SlWlanRxFilterIdMask_t FilterIdMask;
    _u16 len = sizeof(SlWlanRxFilterIdMask_t);;
    _u16 config_opt = SL_WLAN_RX_FILTER_STATE;
    memset(FilterIdMask,0,sizeof(FilterIdMask));
    ret = sl_WlanGet(SL_WLAN_RX_FILTERS_ID, &config_opt , &len, (_u8* )FilterIdMask);

  • SL_WLAN_RX_FILTER_SYS_STATE:
    int ret = 0;
    SlWlanRxFilterSysFiltersMask_t FilterSysIdMask;
    _u16 len = sizeof(SlWlanRxFilterSysFiltersMask_t);;
    _u16 config_opt = SL_WLAN_RX_FILTER_SYS_STATE;
    memset(FilterSysIdMask,0,sizeof(FilterSysIdMask));
    ret = sl_WlanGet(SL_WLAN_RX_FILTERS_ID, &config_opt , &len, (_u8* )FilterSysIdMask);

  • SL_WLAN_CONNECTION_INFO:
    _i16 RetVal = 0 ;
    _u16 Len = sizeof(SlWlanConnStatusParam_t) ;
    SlWlanConnStatusParam_t WlanConnectInfo ;
    RetVal = sl_WlanGet(SL_WLAN_CONNECTION_INFO, NULL, &Len, (_u8* )&WlanConnectInfo);

  • SL_WLAN_GENERAL_PARAM_ANT_SELECTION_GET:
    _i16 RetVal = 0 ;
    _u16 config_opt = SL_WLAN_GENERAL_PARAM_ANT_SELECTION_GET;
    _u16 len = sizeof(SetAntennaIndex_t);
    SetAntennaIndex_t SetAntennaParams;
    RetVal = sl_WlanGet(SL_WLAN_CFG_GENERAL_PARAM_ID, &config_opt, &len, (_u8* )&SetAntennaParams);

  • SL_WLAN_GENERAL_PARAM_EXT_CONNECTION_INFO:
    int8_t ret = 0;
    SlWlanExtConnectionInfo_t ExtConnectionInfo;
    _u16 config_opt = SL_WLAN_GENERAL_PARAM_EXT_CONNECTION_INFO;
    _u16 Len = sizeof(SlWlanExtConnectionInfo_t);
    ret = sl_WlanGet(SL_WLAN_CFG_GENERAL_PARAM_ID, &config_opt, &Len, (_u8* )&ExtConnectionInfo);

  • SL_WLAN_GENERAL_PARAM_OPT_NO_PS_POLL_MODE
    int8_t ret = 0;
    SlWlanNoPSPollMode_t NoPsPollMode;
    _u16 config_opt = SL_WLAN_GENERAL_PARAM_OPT_NO_PS_POLL_MODE;
    _u16 Len = sizeof(SlWlanNoPSPollMode_t);
    ret = sl_WlanGet(SL_WLAN_CFG_GENERAL_PARAM_ID, &config_opt, &Len, (_u8* )&NoPsPollMode);

Definition at line 1201 of file wlan.c.

1202 {
1203  _SlWlanCfgMsgGet_u Msg;
1204  _SlCmdExt_t CmdExt;
1205 
1206  /* verify that this api is allowed. if not allowed then
1207  ignore the API execution and return immediately with an error */
1208  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
1209 
1210  if (*pConfigLen == 0)
1211  {
1212  return SL_EZEROLEN;
1213  }
1214 
1215  _SlDrvResetCmdExt(&CmdExt);
1216  CmdExt.RxPayloadLen = (_i16)*pConfigLen;
1217  CmdExt.pRxPayload = (_u8 *)pValues;
1218  Msg.Cmd.ConfigLen = *pConfigLen;
1219  Msg.Cmd.ConfigId = ConfigId;
1220  if( pConfigOpt )
1221  {
1222  Msg.Cmd.ConfigOpt = (_u16)*pConfigOpt;
1223  }
1224  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlWlanCfgGetCmdCtrl, &Msg, &CmdExt));
1225 
1226  if( pConfigOpt )
1227  {
1228  *pConfigOpt = (_u8)Msg.Rsp.ConfigOpt;
1229  }
1230  if (CmdExt.RxPayloadLen < CmdExt.ActualRxPayloadLen)
1231  {
1232  *pConfigLen = (_u8)CmdExt.RxPayloadLen;
1233  return SL_ESMALLBUF;
1234  }
1235  else
1236  {
1237  *pConfigLen = (_u8)CmdExt.ActualRxPayloadLen;
1238  }
1239 
1240  return (_i16)Msg.Rsp.Status;
1241 }

§ sl_WlanGetExtNetworkList()

_i16 sl_WlanGetExtNetworkList ( const _u8  Index,
const _u8  Count,
SlWlanExtNetworkEntry_t pEntries 
)

Gets the WLAN scan operation results.

Gets scan results with extended information (Country info), gets entry from scan result table

Parameters
[in]IndexStarting index identifier (range 0-29) for getting scan results
[in]CountHow many entries to fetch. Max is (30-"Index").
[out]pEntriesPointer to an allocated SlWlanExtNetworkEntry_t. The number of array items should match "Count"
sec_type:
  • SL_WLAN_SCAN_SEC_TYPE_OPEN
  • SL_WLAN_SCAN_SEC_TYPE_WEP
  • SL_WLAN_SCAN_SEC_TYPE_WPA
  • SL_WLAN_SCAN_SEC_TYPE_WPA2
Returns
Number of valid networks list items
See also
Note
belongs to ext_api
Warning
This command do not initiate any active scanning action
Example
  • Fetching max 10 results:
    SlWlanExtNetworkEntry_t netEntries[10];
    _u8 i;
    _i16 resultsCount = sl_WlanGetExtNetworkList(0,10,&netEntries[0]);
    for(i=0; i< resultsCount; i++)
    {
    printf("%d. ",i+1);
    printf("SSID: %.32s ",netEntries[i].Ssid);
    printf("BSSID: %x:%x:%x:%x:%x:%x ",netEntries[i].Bssid[0],netEntries[i].Bssid[1],netEntries[i].Bssid[2],netEntries[i].Bssid[3],netEntries[i].Bssid[4],netEntries[i].Bssid[5]);
    printf("Channel: %d ",netEntries[i].Channel);
    printf("RSSI: %d ",netEntries[i].Rssi);
    printf("Security type: %d ",SL_WLAN_SCAN_RESULT_SEC_TYPE_BITMAP(netEntries[i].SecurityInfo));
    printf("Group Cipher: %d ",SL_WLAN_SCAN_RESULT_GROUP_CIPHER(netEntries[i].SecurityInfo));
    printf("Unicast Cipher bitmap: %d ",SL_WLAN_SCAN_RESULT_UNICAST_CIPHER_BITMAP(netEntries[i].SecurityInfo));
    printf("Key Mgmt suites bitmap: %d ",SL_WLAN_SCAN_RESULT_KEY_MGMT_SUITES_BITMAP(netEntries[i].SecurityInfo));
    printf("Hidden SSID: %d\r\n",SL_WLAN_SCAN_RESULT_HIDDEN_SSID(netEntries[i].SecurityInfo));
    // extended area
    printf("CountryStr=%c%c\r\n", netEntries[i].CountryStr[0], netEntries[i].CountryStr[1]);
    printf("0x%04x \r\n", netEntries[i].Supported_2_4G_Channels);
    printf("0x%08x \r\n", netEntries[i].Supported_5_0G_Channels);
    }

Definition at line 868 of file wlan.c.

869 {
870  _i16 retVal = 0;
871  _SlWlanGetExtNetworkListMsg_u Msg;
872  _SlCmdExt_t CmdExt;
873 
874  /* verify that this api is allowed. if not allowed then
875  ignore the API execution and return immediately with an error */
876  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
877 
878  if (Count == 0)
879  {
880  return SL_EZEROLEN;
881  }
882 
883  _SlDrvResetCmdExt(&CmdExt);
884  CmdExt.RxPayloadLen = (_i16)(sizeof(SlWlanExtNetworkEntry_t)*(Count));
885  CmdExt.pRxPayload = (_u8 *)pEntries;
886 
887  Msg.Cmd.Index = Index;
888  Msg.Cmd.Count = Count;
889 
890  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlWlanGetExtNetworkListCtrl, &Msg, &CmdExt));
891  retVal = Msg.Rsp.status;
892 
893  return (_i16)retVal;
894 }
Definition: wlan.h:727

§ sl_WlanGetNetworkList()

_i16 sl_WlanGetNetworkList ( const _u8  Index,
const _u8  Count,
SlWlanNetworkEntry_t pEntries 
)

Gets the WLAN scan operation results.

Gets scan results , gets entry from scan result table

Parameters
[in]IndexStarting index identifier (range 0-29) for getting scan results
[in]CountHow many entries to fetch. Max is (30-"Index").
[out]pEntriesPointer to an allocated SlWlanNetworkEntry_t. The number of array items should match "Count"
sec_type:
  • SL_WLAN_SCAN_SEC_TYPE_OPEN
  • SL_WLAN_SCAN_SEC_TYPE_WEP
  • SL_WLAN_SCAN_SEC_TYPE_WPA
  • SL_WLAN_SCAN_SEC_TYPE_WPA2
Returns
Number of valid networks list items
See also
Note
belongs to ext_api
Warning
Triggers a one-shot scan if there are no scan results in the system, or if the scan results which exist are old (aging is defined as 20 seconds if the scan policy is disabled, or twice the scan interval if the policy is enabled). Will otherwise return results from last periodic scan.
Example
  • Fetching max 10 results:
    SlWlanNetworkEntry_t netEntries[10];
    _u8 i;
    _i16 resultsCount = sl_WlanGetNetworkList(0,10,&netEntries[0]);
    for(i=0; i< resultsCount; i++)
    {
    printf("%d. ", i + 1);
    printf("SSID: %.32s ", Entries[i].Ssid);
    printf("BSSID: %x:%x:%x:%x:%x:%x ", Entries[i].Bssid[0], Entries[i].Bssid[1], Entries[i].Bssid[2], Entries[i].Bssid[3], Entries[i].Bssid[4], Entries[i].Bssid[5]);
    printf("Channel: %d ", Entries[i].Channel);
    printf("RSSI: %d ", Entries[i].Rssi);
    printf("Security type: %d ", SL_WLAN_SCAN_RESULT_SEC_TYPE_BITMAP(Entries[i].SecurityInfo));
    printf("Group Cipher: %d ", SL_WLAN_SCAN_RESULT_GROUP_CIPHER(Entries[i].SecurityInfo));
    printf("Unicast Cipher bitmap: %d ", SL_WLAN_SCAN_RESULT_UNICAST_CIPHER_BITMAP(Entries[i].SecurityInfo));
    printf("Key Mgmt suites bitmap: %d ", SL_WLAN_SCAN_RESULT_KEY_MGMT_SUITES_BITMAP(Entries[i].SecurityInfo));
    printf("Hidden SSID: %d ", SL_WLAN_SCAN_RESULT_HIDDEN_SSID(Entries[i].SecurityInfo));
    printf("PMF Enable: %d ", SL_WLAN_SCAN_RESULT_PMF_ENABLE(Entries[i].SecurityInfo));
    printf("PMF Required: %d\r\n", SL_WLAN_SCAN_RESULT_PMF_REQUIRED(Entries[i].SecurityInfo));
    }

Definition at line 820 of file wlan.c.

821 {
822  _i16 retVal = 0;
823  _SlWlanGetNetworkListMsg_u Msg;
824  _SlCmdExt_t CmdExt;
825 
826  /* verify that this api is allowed. if not allowed then
827  ignore the API execution and return immediately with an error */
828  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
829 
830  if (Count == 0)
831  {
832  return SL_EZEROLEN;
833  }
834 
835  _SlDrvResetCmdExt(&CmdExt);
836  CmdExt.RxPayloadLen = (_i16)(sizeof(SlWlanNetworkEntry_t)*(Count));
837  CmdExt.pRxPayload = (_u8 *)pEntries;
838 
839  Msg.Cmd.Index = Index;
840  Msg.Cmd.Count = Count;
841 
842  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlWlanGetNetworkListCtrl, &Msg, &CmdExt));
843  retVal = Msg.Rsp.status;
844 
845  return (_i16)retVal;
846 }
Definition: wlan.h:716

§ sl_WlanPolicyGet()

_i16 sl_WlanPolicyGet ( const _u8  Type,
_u8 *  pPolicy,
_u8 *  pVal,
_u8 *  pValLen 
)

Get policy values.

Parameters
[in]Type
  • SL_WLAN_POLICY_CONNECTION
  • SL_WLAN_POLICY_SCAN
  • SL_WLAN_POLICY_PM, SL_WLAN_POLICY_P2P
[out]pPolicyargument may be set to any value
[out]pValThe 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
[out]pValLenactual value length
Returns
Zero on success, or negative error code on failure
See also
sl_WlanPolicySet
Note
belongs to 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.
Example
  • SL_WLAN_POLICY_CONNECTION - Get connection policy:
    _u8 Policy = 0;
    int length = sizeof(PolicyOption);
    int ret;
    ret = sl_WlanPolicyGet(SL_WLAN_POLICY_CONNECTION ,&Policy,0,(_u8*)&length);
    if (Policy & SL_WLAN_CONNECTION_POLICY(1, 1 , 0 , 0 ))
    {
    printf("Connection Policy is set to Auto + Fast");
    }

  • SL_WLAN_POLICY_SCAN - Get scan policy:
    int ScanInterval = 0; //default value is 600 seconds
    _u8 Policy = 0; //default value is 0 (disabled)
    int ret;
    length = sizeof(ScanInterval);
    ret = sl_WlanPolicyGet(SL_WLAN_POLICY_SCAN ,&Policy,(_u8*)&ScanInterval,(_u8*)&length);
    if (Policy & SL_WLAN_SCAN_POLICY(0 ,1))
    {
    printf("Scan Policy is set to Scan visible ssid ");
    }
    if (Policy & SL_WLAN_SCAN_POLICY(1, 0))
    {
    printf("Scan Policy is set to Scan hidden ssid ");
    }

  • SL_WLAN_POLICY_PM - Get power management policy:
    _u8 Policy = 0;
    int ret;
    SlWlanPmPolicyParams_t PmPolicyParams;
    length = sizeof(PmPolicyParams);
    ret = sl_WlanPolicyGet(SL_POLICY_PM ,&Policy,&PmPolicyParams,(_u8*)&length);
    if (Policy == SL_WLAN_LONG_SLEEP_INTERVAL_POLICY )
    {
    printf("Connection Policy is set to LONG SLEEP INTERVAL POLICY with interval = %d ",PmPolicyParams.MaxSleepTimeMs);
    }

  • SL_WLAN_POLICY_P2P - Get P2P policy:
    _u8 Policy = 0;
    int ret;
    length = sizeof(Policy);
    ret = sl_WlanPolicyGet(SL_WLAN_POLICY_P2P ,&Policy,0,(_u8*)&length);
    //SL_WLAN_P2P_POLICY(p2pNegType, p2pNegInitiator)
    if (Policy & SL_WLAN_P2P_POLICY(0,SL_WLAN_P2P_NEG_INITIATOR_RAND_BACKOFF))
    {
    printf("P2P Policy is set to Rand backoff");
    }
    if (Policy & SL_WLAN_P2P_POLICY(SL_WLAN_P2P_ROLE_NEGOTIATE,0))
    {
    printf("P2P Policy is set to Role Negotiate");
    }

Definition at line 284 of file wlan.c.

285 {
286  _SlPolicyGetMsg_u Msg;
287  _SlCmdExt_t CmdExt;
288 
289  /* verify that this api is allowed. if not allowed then
290  ignore the API execution and return immediately with an error */
291  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
292 
293  if (*pValLen == 0)
294  {
295  return SL_EZEROLEN;
296  }
297 
298  _SlDrvResetCmdExt(&CmdExt);
299  CmdExt.RxPayloadLen = (_i16)(*pValLen);
300  CmdExt.pRxPayload = pVal;
301 
302  Msg.Cmd.PolicyType = Type;
303 
304  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlPolicyGetCmdCtrl, &Msg, &CmdExt));
305 
306 
307  if (CmdExt.RxPayloadLen < CmdExt.ActualRxPayloadLen)
308  {
309  *pValLen = Msg.Rsp.PolicyOptionLen;
310  return SL_ESMALLBUF;
311  }
312  else
313  {
314  /* no pointer valus, fill the results into _i8 */
315  *pValLen = (_u8)CmdExt.ActualRxPayloadLen;
316  *pPolicy = Msg.Rsp.PolicyOption;
317 
318  if( 0 == CmdExt.ActualRxPayloadLen )
319  {
320  *pValLen = 1;
321  }
322 
323  }
324  return (_i16)SL_OS_RET_CODE_OK;
325 }

§ sl_WlanPolicySet()

_i16 sl_WlanPolicySet ( const _u8  Type,
const _u8  Policy,
_u8 *  pVal,
const _u8  ValLen 
)

Set policy values.

Parameters
[in]TypeType of policy to be modified. The Options are:
  • SL_WLAN_POLICY_CONNECTION
  • SL_WLAN_POLICY_SCAN
  • SL_WLAN_POLICY_PM
  • SL_WLAN_POLICY_P2P
[in]PolicyThe option value which depends on action type
[in]pValAn optional value pointer
[in]ValLenAn optional value length, in bytes
Returns
Zero on success or negative error code on failure.
Persistent
All parameters are System Persistent
Note that for SL_WLAN_POLICY_SCAN - Interval and Policy will be System persistent, but the hidden SSID option will not be persistent
See also
sl_WlanPolicyGet
Note
belongs to ext_api
Warning
Example

SL_WLAN_POLICY_CONNECTION:
defines options available to connect the CC31xx device to the AP: The options below could be combined to a single action, if more than one action is required. This API is persistent by default.

If used with uint32_t flags as value, the following flags are supported for the sl_WlanPolicySet command

  • SL_WLAN_CONN_POLICY_NON_PERSISTENT_FLAG - settings are not saved on the FS Flags usage example:
    uint32_t flags = 0;
    flags |= SL_WLAN_CONN_POLICY_NON_PERSISTENT_FLAG;
    sl_WlanPolicySet(SL_WLAN_POLICY_CONNECTION,SL_WLAN_CONNECTION_POLICY(1,0,0,0),&flags,sizeof(flags));
  • Auto Connect: If 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. To set this option, use:
    sl_WlanPolicySet(SL_WLAN_POLICY_CONNECTION,SL_WLAN_CONNECTION_POLICY(1,0,0,0),NULL,0);

  • Fast Connect: If is set, the CC31xx device tries to establish a fast connection to AP. To set this option, use:
    sl_WlanPolicySet(SL_WLAN_POLICY_CONNECTION,SL_WLAN_CONNECTION_POLICY(0,1,0,0),NULL,0)

  • P2P: If is set (relevant for P2P mode only), CC31xx/CC32xx device tries to automatically connect to the first P2P device available, supporting push button only. To set this option, use:
    sl_WlanPolicySet(SL_WLAN_POLICY_CONNECTION,SL_WLAN_CONNECTION_POLICY(0,0,1,0),NULL,0)

  • Auto Provisioning - If is set, the CC31xx device will automatically start the provisioning process after a long period of disconnection when profiles exist to set this option, use:
    sl_WlanPolicySet(SL_WLAN_POLICY_CONNECTION,SL_WLAN_CONNECTION_POLICY(0,0,0,1),NULL,0)

SL_WLAN_POLICY_SCAN:
defines system scan time interval. interval is 10 minutes. After settings scan interval, an immediate scan is activated.
The next scan will be based on the interval settings. For AP scan, minimum interval is 10 seconds.

  • With hidden SSID: For example, setting scan interval to 1 minute interval use including hidden ssid:
    _u32 intervalInSeconds = 60;
    sl_WlanPolicySet(SL_WLAN_POLICY_SCAN,SL_WLAN_SCAN_POLICY(1,1), (_u8 *)&intervalInSeconds,sizeof(intervalInSeconds));

  • No hidden SSID: setting scan interval to 1 minute interval use, not including hidden ssid:
    _u32 intervalInSeconds = 60;
    sl_WlanPolicySet(SL_WLAN_POLICY_SCAN,SL_WLAN_SCAN_POLICY(1,0), (_u8 *)&intervalInSeconds,sizeof(intervalInSeconds));

  • Disable scan:
    #define SL_WLAN_DISABLE_SCAN 0
    _u32 intervalInSeconds = 0;
    sl_WlanPolicySet(SL_WLAN_POLICY_SCAN,SL_WLAN_DISABLE_SCAN,(_u8 *)&intervalInSeconds,sizeof(intervalInSeconds));

SL_WLAN_POLICY_PM:
defines a power management policy for Station mode only:

  • Normal power management (default) policy use:
    sl_WlanPolicySet(SL_WLAN_POLICY_PM , SL_WLAN_NORMAL_POLICY, NULL,0)

  • Low latency power management policy use:
    sl_WlanPolicySet(SL_WLAN_POLICY_PM , SL_WLAN_LOW_LATENCY_POLICY, NULL,0)

  • Low power management policy use:
    sl_WlanPolicySet(SL_WLAN_POLICY_PM , SL_WLAN_LOW_POWER_POLICY, NULL,0)

  • Always on power management policy use:
    sl_WlanPolicySet(SL_WLAN_POLICY_PM , SL_WLAN_ALWAYS_ON_POLICY, NULL,0)

  • Long Sleep Interval policy use:
    SlWlanPmPolicyParams_t PmPolicyParams;
    memset(&PmPolicyParams,0,sizeof(SlWlanPmPolicyParams_t));
    PmPolicyParams.MaxSleepTimeMs = 800; //max sleep time in mSec
    sl_WlanPolicySet(SL_WLAN_POLICY_PM , SL_WLAN_LONG_SLEEP_INTERVAL_POLICY, (_u8*)&PmPolicyParams,sizeof(PmPolicyParams));

  • IOT low power policy use:
    SlWlanPmPolicyParams_t PmPolicyParams;
    memset(&PmPolicyParams,0,sizeof(SlWlanPmPolicyParams_t));
    PmPolicyParams.MaxSleepTimeMs = IOTLP_MIN_DURATION_IN_MSEC; //min sleep duration in mSec
    sl_WlanPolicySet(SL_WLAN_POLICY_PM , SL_WLAN_IOT_LOW_POWER_POLICY, (uint8_t *)&PmPolicyParams, sizeof(PmPolicyParams));

SL_WLAN_POLICY_P2P:
defines p2p negotiation policy parameters for P2P role:

  • To set intent negotiation value, set on of the following:
    SL_WLAN_P2P_ROLE_NEGOTIATE - intent 3
    SL_WLAN_P2P_ROLE_GROUP_OWNER - intent 15
    SL_WLAN_P2P_ROLE_CLIENT - intent 0

  • To set negotiation initiator value (initiator policy of first negotiation action frame), set on of the following:
    SL_WLAN_P2P_NEG_INITIATOR_ACTIVE
    SL_WLAN_P2P_NEG_INITIATOR_PASSIVE
    SL_WLAN_P2P_NEG_INITIATOR_RAND_BACKOFF
    sl_WlanPolicySet(SL_WLAN_POLICY_P2P, SL_WLAN_P2P_POLICY(SL_WLAN_P2P_ROLE_NEGOTIATE,SL_WLAN_P2P_NEG_INITIATOR_RAND_BACKOFF),NULL,0);

Definition at line 242 of file wlan.c.

243 {
244  _SlPolicyMsg_u Msg;
245  _SlCmdExt_t CmdExt;
246 
247  /* verify that this api is allowed. if not allowed then
248  ignore the API execution and return immediately with an error */
249  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
250 
251  _SlDrvResetCmdExt(&CmdExt);
252  CmdExt.TxPayload1Len = ValLen;
253  CmdExt.pTxPayload1 = (_u8 *)pVal;
254 
255  Msg.Cmd.PolicyType = Type;
256  Msg.Cmd.PolicyOption = Policy;
257  Msg.Cmd.PolicyOptionLen = ValLen;
258 
259  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlPolicySetCmdCtrl, &Msg, &CmdExt));
260 
261  return (_i16)Msg.Rsp.status;
262 }

§ sl_WlanProfileAdd()

_i16 sl_WlanProfileAdd ( const _i8 *  pName,
const _i16  NameLen,
const _u8 *  pMacAddr,
const SlWlanSecParams_t pSecParams,
const SlWlanSecParamsExt_t pSecExtParams,
const _u32  Priority,
const _u32  Options 
)

Add profile.

When auto start is enabled, the device connects to a station from the profiles table. Up to 7 profiles (SL_WLAN_MAX_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.

Parameters
[in]pNameUp 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.
[in]NameLenName length
[in]pMacAddr6 bytes for MAC address
[in]pSecParamsSecurity parameters (use NULL key for SL_WLAN_SEC_TYPE_OPEN)
Security types options:
  • SL_WLAN_SEC_TYPE_OPEN
  • SL_WLAN_SEC_TYPE_WEP
  • SL_WLAN_SEC_TYPE_WEP_SHARED
  • SL_WLAN_SEC_TYPE_WPA_WPA2
  • SL_WLAN_SEC_TYPE_WPA2_PLUS
  • SL_WLAN_SEC_TYPE_WPA3
  • SL_WLAN_SEC_TYPE_WPA_ENT
  • SL_WLAN_SEC_TYPE_WPS_PBC
  • SL_WLAN_SEC_TYPE_WPS_PIN
  • SL_WLAN_SEC_TYPE_WPA_PMK - insert preprocessed PMK as key
[in]pSecExtParamsEnterprise 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
[in]PriorityProfile priority. Lowest priority: 0, Highest priority: 15.
[in]OptionsNot supported
Returns
Profile stored index on success, or negative error code on failure.
Persistent
Profiles are Persistent
See also
sl_WlanProfileGet , sl_WlanProfileDel
Note
belongs to 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_WLAN_SEC_TYPE_WPA is a deprecated definition, the new definition is SL_WLAN_SEC_TYPE_WPA_WPA2 -SL_WLAN_SEC_TYPE_WPA2_PLUS enable to connect to WPA2, WPA2+PMF and WPA3 only networks

Definition at line 346 of file wlan.c.

347 {
348  _SlProfileAddMsg_u Msg;
349  _SlCmdCtrl_t CmdCtrl = {0,0,0};
350  CmdCtrl.TxDescLen = 0;/* init */
351  CmdCtrl.RxDescLen = (_SlArgSize_t)(sizeof(_BasicResponse_t));
352 
353 
354  /* Options parameter is currently not in use */
355  (void)Options;
356 
357  /* verify that this api is allowed. if not allowed then
358  ignore the API execution and return immediately with an error */
359  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
360 
361  _SlDrvMemZero(&Msg,sizeof(_SlProfileAddMsg_u));
362 
363  /* update priority */
364  Msg.Cmd.Args.Common.Priority = (_u8)Priority;
365  /* verify SSID is not NULL */
366  if( NULL == pName )
367  {
368  return SL_INVALPARAM;
369  }
370  /* verify SSID length */
371  VERIFY_PROTOCOL(NameLen >= 0 && NameLen <= SL_WLAN_SSID_MAX_LENGTH);
372  /* update SSID length */
373  Msg.Cmd.Args.Common.SsidLen = (_u8)NameLen;
374 
375  /* Enterprise security profile */
376  if (NULL != pSecExtParams)
377  {
378  /* Update command opcode */
379  CmdCtrl.Opcode = SL_OPCODE_WLAN_EAP_PROFILEADDCOMMAND;
380  CmdCtrl.TxDescLen += sizeof(SlWlanAddGetEapProfile_t);
381 
382  /* copy SSID */
383  sl_Memcpy(EAP_PROFILE_SSID_STRING(&Msg), pName, NameLen);
384  CmdCtrl.TxDescLen += NameLen;
385 
386  /* Copy password if supplied */
387  if ((NULL != pSecParams) && (pSecParams->KeyLen > 0))
388  {
389  /* update security type */
390  Msg.Cmd.Args.Common.SecType = (_i8)(pSecParams->Type);
391 
392  if( SL_WLAN_SEC_TYPE_WEP == Msg.Cmd.Args.Common.SecType )
393  {
394  Msg.Cmd.Args.Common.WepKeyId = 0;
395  }
396 
397  /* verify key length */
398  if (pSecParams->KeyLen > MAX_KEY_LEN)
399  {
400  return SL_INVALPARAM;
401  }
402  VERIFY_PROTOCOL(pSecParams->KeyLen <= MAX_KEY_LEN);
403  /* update key length */
404  Msg.Cmd.Args.Common.PasswordLen = pSecParams->KeyLen;
405  CmdCtrl.TxDescLen += pSecParams->KeyLen;
406  ARG_CHECK_PTR(pSecParams->Key);
407  /* copy key */
408  sl_Memcpy(EAP_PROFILE_PASSWORD_STRING(&Msg), pSecParams->Key, pSecParams->KeyLen);
409  }
410  else
411  {
412  Msg.Cmd.Args.Common.PasswordLen = 0;
413  }
414 
415  ARG_CHECK_PTR(pSecExtParams);
416  /* Update Eap bitmask */
417  Msg.Cmd.Args.EapBitmask = pSecExtParams->EapMethod;
418  /* Update Certificate file ID index - currently not supported */
419  Msg.Cmd.Args.CertIndex = pSecExtParams->CertIndex;
420  /* verify user length */
421  if (pSecExtParams->UserLen > MAX_USER_LEN)
422  {
423  return SL_INVALPARAM;
424  }
425  Msg.Cmd.Args.UserLen = pSecExtParams->UserLen;
426  /* copy user name (identity) */
427  if(pSecExtParams->UserLen > 0)
428  {
429  sl_Memcpy(EAP_PROFILE_USER_STRING(&Msg), pSecExtParams->User, pSecExtParams->UserLen);
430  CmdCtrl.TxDescLen += pSecExtParams->UserLen;
431  }
432 
433  /* verify Anonymous user length (for tunneled) */
434  if (pSecExtParams->AnonUserLen > MAX_ANON_USER_LEN)
435  {
436  return SL_INVALPARAM;
437  }
438  Msg.Cmd.Args.AnonUserLen = pSecExtParams->AnonUserLen;
439 
440  /* copy Anonymous user */
441  if(pSecExtParams->AnonUserLen > 0)
442  {
443  sl_Memcpy(EAP_PROFILE_ANON_USER_STRING(&Msg), pSecExtParams->AnonUser, pSecExtParams->AnonUserLen);
444  CmdCtrl.TxDescLen += pSecExtParams->AnonUserLen;
445  }
446 
447  }
448  /* Regular or open security profile */
449  else
450  {
451  /* Update command opcode */
452  CmdCtrl.Opcode = SL_OPCODE_WLAN_PROFILEADDCOMMAND;
453  /* update commnad length */
454  CmdCtrl.TxDescLen += sizeof(SlWlanAddGetProfile_t);
455 
456  if (NULL != pName)
457  {
458  /* copy SSID */
459  sl_Memcpy(PROFILE_SSID_STRING(&Msg), pName, NameLen);
460  CmdCtrl.TxDescLen += NameLen;
461  }
462 
463  /* Copy password if supplied */
464  if( NULL != pSecParams )
465  {
466  /* update security type */
467  Msg.Cmd.Args.Common.SecType = (_i8)(pSecParams->Type);
468 
469  if( SL_WLAN_SEC_TYPE_WEP == Msg.Cmd.Args.Common.SecType )
470  {
471  Msg.Cmd.Args.Common.WepKeyId = 0;
472  }
473 
474  /* verify key length */
475  if (pSecParams->KeyLen > MAX_KEY_LEN)
476  {
477  return SL_INVALPARAM;
478  }
479  /* update key length */
480  Msg.Cmd.Args.Common.PasswordLen = pSecParams->KeyLen;
481  CmdCtrl.TxDescLen += pSecParams->KeyLen;
482  /* copy key (could be no key in case of WPS pin) */
483  if( NULL != pSecParams->Key )
484  {
485  sl_Memcpy(PROFILE_PASSWORD_STRING(&Msg), pSecParams->Key, pSecParams->KeyLen);
486  }
487  }
488  else
489  {
490  Msg.Cmd.Args.Common.SecType = SL_WLAN_SEC_TYPE_OPEN;
491  Msg.Cmd.Args.Common.PasswordLen = 0;
492  }
493  }
494 
495  /* If BSSID is not null, copy to buffer, otherwise set to 0 */
496  if(NULL != pMacAddr)
497  {
498  sl_Memcpy(Msg.Cmd.Args.Common.Bssid, pMacAddr, sizeof(Msg.Cmd.Args.Common.Bssid));
499  }
500  else
501  {
502  _SlDrvMemZero(Msg.Cmd.Args.Common.Bssid, (_u16)sizeof(Msg.Cmd.Args.Common.Bssid));
503  }
504 
505  VERIFY_RET_OK(_SlDrvCmdOp(&CmdCtrl, &Msg, NULL));
506 
507  return (_i16)Msg.Rsp.status;
508 }

§ sl_WlanProfileDel()

_i16 sl_WlanProfileDel ( const _i16  Index)

Delete WLAN profile.

Delete WLAN profile

Parameters
[in]Indexnumber of profile to delete. Possible values are 0 to 6.
Index value SL_WLAN_DEL_ALL_PROFILES will delete all saved profiles
Returns
Zero on success or a negative error code on failure
Persistent
Profile deletion is Persistent
See also
sl_WlanProfileAdd , sl_WlanProfileGet
Note
belongs to ext_api
Warning

Definition at line 784 of file wlan.c.

785 {
786  _SlProfileDelMsg_u Msg;
787 
788  /* verify that this api is allowed. if not allowed then
789  ignore the API execution and return immediately with an error */
790  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
791 
792  Msg.Cmd.Index = (_u8)Index;
793 
794  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlProfileDelCmdCtrl, &Msg, NULL));
795 
796  return (_i16)Msg.Rsp.status;
797 }

§ sl_WlanProfileGet()

_i16 sl_WlanProfileGet ( const _i16  Index,
_i8 *  pName,
_i16 *  pNameLen,
_u8 *  pMacAddr,
SlWlanSecParams_t pSecParams,
SlWlanGetSecParamsExt_t pSecExtParams,
_u32 *  pPriority 
)

Get profile.

Read profile from the device

Parameters
[in]IndexProfile stored index, if index does not exists error is return
[out]pNameUp 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
[out]pNameLenName length
[out]pMacAddr6 bytes for MAC address
[out]pSecParamsSecurity parameters. Security types options:
  • SL_WLAN_SEC_TYPE_OPEN
  • SL_WLAN_SEC_TYPE_WEP
  • SL_WLAN_SEC_TYPE_WEP_SHARED
  • SL_WLAN_SEC_TYPE_WPA_WPA2
  • SL_WLAN_SEC_TYPE_WPA2_PLUS
  • SL_WLAN_SEC_TYPE_WPA3
  • SL_WLAN_SEC_TYPE_WPA_ENT
  • SL_WLAN_SEC_TYPE_WPS_PBC
  • SL_WLAN_SEC_TYPE_WPS_PIN Key and key length are not return. In case of p2p security type pin the key refers to pin code return due to security reasons.
[out]pSecExtParamsEnterprise parameters - identity, identity length, Anonymous, Anonymous length CertIndex (not supported), EapMethod.
[out]pPriorityProfile priority
Returns
Profile security type is returned (0 or positive number) on success, or negative error code on failure SL_ERROR_WLAN_GET_PROFILE_INVALID_INDEX is return is profile index does not exist
See also
sl_WlanProfileAdd , sl_WlanProfileDel
Note
belongs to ext_api
Warning

Definition at line 720 of file wlan.c.

721 {
722  _SlProfileGetMsg_u Msg;
723  Msg.Cmd.Index = (_u8)Index;
724 
725  /* verify that this api is allowed. if not allowed then
726  ignore the API execution and return immediately with an error */
727  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
728 
729  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlProfileGetCmdCtrl, &Msg, NULL));
730 
731  pSecParams->Type = (_u8)(Msg.Rsp.Args.Common.SecType);
732  if (Msg.Rsp.Args.Common.SecType >= 0)
733  {
734  /* since password is not transferred in getprofile, password length should always be zero */
735  pSecParams->KeyLen = Msg.Rsp.Args.Common.PasswordLen;
736  if (NULL != pEntParams)
737  {
738  pEntParams->EapMethod = Msg.Rsp.Args.EapBitmask;
739  pEntParams->UserLen = Msg.Rsp.Args.UserLen;
740  /* copy user name */
741  if (pEntParams->UserLen > 0)
742  {
743  sl_Memcpy(pEntParams->User, EAP_PROFILE_USER_STRING(&Msg), pEntParams->UserLen);
744  }
745  pEntParams->AnonUserLen = Msg.Rsp.Args.AnonUserLen;
746  /* copy anonymous user name */
747  if (pEntParams->AnonUserLen > 0)
748  {
749  sl_Memcpy(pEntParams->AnonUser, EAP_PROFILE_ANON_USER_STRING(&Msg), pEntParams->AnonUserLen);
750  }
751  }
752 
753  *pNameLen = (_i16)(Msg.Rsp.Args.Common.SsidLen);
754  *pPriority = Msg.Rsp.Args.Common.Priority;
755  if (NULL != pMacAddr)
756  {
757  sl_Memcpy(pMacAddr, Msg.Rsp.Args.Common.Bssid, sizeof(Msg.Rsp.Args.Common.Bssid));
758  }
759  sl_Memset(pName, 0, SL_WLAN_SSID_MAX_LENGTH);
760  sl_Memcpy(pName, EAP_PROFILE_SSID_STRING(&Msg), *pNameLen);
761  }
762  return (_i16)Msg.Rsp.Args.Common.SecType;
763 }

§ sl_WlanProfileUpdate()

_i16 sl_WlanProfileUpdate ( const _u32  Index,
const _i8 *  pName,
const _i16  NameLen,
const _u8 *  pMacAddr,
const SlWlanSecParams_t pSecParams,
const SlWlanSecParamsExt_t pSecExtParams,
const _u32  Priority 
)

Profile Update.

Update one or more of the existing profile parameters: SSID, BSSID, priority, security parameters

Parameters
[in]IndexProfile index to update
[in]pNameUp 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. NULL in case update is not needed
[in]NameLenName length. zero in case update is not needed
[in]pMacAddr6 bytes for MAC address, NULL in case update is not needed If a profile was previously added with bssid, and the bssid must be removed (to connect to a different AP with the same ssid and better rssi), it is possible to remove the bssid from the profile using profile update api with the bssid set to: FF:FF:FF:FF:FF:FF.
[in]pSecParamsSecurity parameters (use NULL key for SL_WLAN_SEC_TYPE_OPEN)
Security types options:
  • SL_WLAN_SEC_TYPE_OPEN
  • SL_WLAN_SEC_TYPE_WEP
  • SL_WLAN_SEC_TYPE_WEP_SHARED
  • SL_WLAN_SEC_TYPE_WPA_WPA2
  • SL_WLAN_SEC_TYPE_WPA2_PLUS
  • SL_WLAN_SEC_TYPE_WPA3
  • SL_WLAN_SEC_TYPE_WPA_ENT
  • SL_WLAN_SEC_TYPE_WPS_PBC
  • SL_WLAN_SEC_TYPE_WPS_PIN
    In case update is not needed, set to SL_WLAN_DONT_UPDATE
[in]pSecExtParamsEnterprise 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 or does not need to be updated
[in]PriorityProfile priority. Lowest priority: 0, Highest priority: 15. In case update is not needed, set to SL_WLAN_DONT_UPDATE
Returns
Zero on success or a negative error code on failure
Persistent
Profiles are Persistent
See also
sl_WlanProfileGet , sl_WlanProfileDel, sl_WlanProfileAdd
Note
belongs to ext_api
Warning
In order to keep original security or priority values, set value to SL_WLAN_DONT_UPDATE Note: If WPA profile SSID is being updated, security parameters including the password must be supplied as well.
Example
Update priority in profile index 0:
_u32 Priority;
_u32 index;
SecParams.Key = "";
SecParams.KeyLen = 0;
SecParams.Type = SL_WLAN_DONT_UPDATE;
Priority = 4;
index = 0;
RetVal = sl_WlanProfileUpdate(index, NULL,0,NULL,&SecParams ,NULL,Priority);

Definition at line 529 of file wlan.c.

530 {
531  _SlProfileUpdateMsg_u Msg;
532  _SlCmdCtrl_t CmdCtrl = {0,0,0};
533  CmdCtrl.TxDescLen = 0;/* init */
534  CmdCtrl.RxDescLen = (_SlArgSize_t)(sizeof(_BasicResponse_t));
535 
536 
537  /* verify that this api is allowed. if not allowed then
538  ignore the API execution and return immediately with an error */
539  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
540 
541  _SlDrvMemZero(&Msg,sizeof(_SlProfileUpdateParams_t));
542 
543  Msg.Cmd.Args.Index = Index;
544  /* update priority */
545  Msg.Cmd.Args.Priority = (_u8)Priority;
546 
547  /* verify SSID length */
548  VERIFY_PROTOCOL(NameLen >= 0 && NameLen <= MAX_SSID_LEN);
549  /* update SSID length */
550  Msg.Cmd.Args.SsidLen = (_u8)NameLen;
551 
552 
553  /* Enterprise security profile */
554  if (NULL != pSecExtParams)
555  {
556  /* Update command opcode */
557  CmdCtrl.Opcode = SL_OPCODE_WLAN_PROFILEEAPUPDATECOMMAND;
558  CmdCtrl.TxDescLen += sizeof(SlWlanUpdateProfile_t);
559 
560  /* If SSID is supplied, copy it */
561  if (NULL != pName)
562  {
563  sl_Memcpy(UPDATE_PROFILE_SSID_STRING(&Msg), pName, NameLen);
564  CmdCtrl.TxDescLen += NameLen;
565  }
566  else
567  {
568  Msg.Cmd.Args.SsidLen = 0;
569  }
570 
571 
572  /* Copy password if supplied */
573  if ((NULL != pSecParams) && (pSecParams->KeyLen > 0))
574  {
575  /* update security type */
576  Msg.Cmd.Args.SecType = (_i8)(pSecParams->Type);
577 
578  if( SL_WLAN_SEC_TYPE_WEP == Msg.Cmd.Args.SecType )
579  {
580  Msg.Cmd.Args.WepKeyId = 0;
581  }
582 
583  /* verify key length */
584  if (pSecParams->KeyLen > MAX_KEY_LEN)
585  {
586  return SL_INVALPARAM;
587  }
588  VERIFY_PROTOCOL(pSecParams->KeyLen <= MAX_KEY_LEN);
589  /* update key length */
590  Msg.Cmd.Args.PasswordLen = pSecParams->KeyLen;
591  CmdCtrl.TxDescLen += pSecParams->KeyLen;
592  ARG_CHECK_PTR(pSecParams->Key);
593  /* copy key */
594  sl_Memcpy(UPDATE_PROFILE_PASSWORD_STRING(&Msg), pSecParams->Key, pSecParams->KeyLen);
595  }
596  else
597  {
598  Msg.Cmd.Args.PasswordLen = 0;
599  }
600 
601  ARG_CHECK_PTR(pSecExtParams);
602  /* Update Eap bitmask */
603  Msg.Cmd.Args.EapBitmask = pSecExtParams->EapMethod;
604  /* Update Certificate file ID index - currently not supported */
605  Msg.Cmd.Args.CertIndex = pSecExtParams->CertIndex;
606  /* verify user length */
607  if (pSecExtParams->UserLen > MAX_USER_LEN)
608  {
609  return SL_INVALPARAM;
610  }
611  Msg.Cmd.Args.UserLen = pSecExtParams->UserLen;
612  /* copy user name (identity) */
613  if(pSecExtParams->UserLen > 0)
614  {
615  sl_Memcpy(UPDATE_PROFILE_USER_STRING(&Msg), pSecExtParams->User, pSecExtParams->UserLen);
616  CmdCtrl.TxDescLen += pSecExtParams->UserLen;
617  }
618 
619  /* verify Anonymous user length (for tunneled) */
620  if (pSecExtParams->AnonUserLen > MAX_ANON_USER_LEN)
621  {
622  return SL_INVALPARAM;
623  }
624  Msg.Cmd.Args.AnonUserLen = pSecExtParams->AnonUserLen;
625 
626  /* copy Anonymous user */
627  if(pSecExtParams->AnonUserLen > 0)
628  {
629  sl_Memcpy(UPDATE_PROFILE_ANON_USER_STRING(&Msg), pSecExtParams->AnonUser, pSecExtParams->AnonUserLen);
630  CmdCtrl.TxDescLen += pSecExtParams->AnonUserLen;
631  }
632 
633  }
634  /* Regular or open security profile */
635  else
636  {
637  /* Update command opcode */
638  CmdCtrl.Opcode = SL_OPCODE_WLAN_PROFILEUPDATECOMMAND;
639  /* update commnad length */
640  CmdCtrl.TxDescLen += sizeof(SlWlanUpdateProfile_t);
641 
642  if (NULL != pName)
643  {
644  /* copy SSID */
645  sl_Memcpy(UPDATE_PROFILE_SSID_STRING(&Msg), pName, NameLen);
646  CmdCtrl.TxDescLen += NameLen;
647  }
648  else
649  {
650  Msg.Cmd.Args.SsidLen = 0;
651  }
652 
653  /* Copy password if supplied */
654  if( NULL != pSecParams )
655  {
656  /* update security type */
657  Msg.Cmd.Args.SecType = (_i8)(pSecParams->Type);
658 
659  if( SL_WLAN_SEC_TYPE_WEP == Msg.Cmd.Args.SecType )
660  {
661  Msg.Cmd.Args.WepKeyId = 0;
662  }
663 
664  /* verify key length */
665  if (pSecParams->KeyLen > MAX_KEY_LEN)
666  {
667  return SL_INVALPARAM;
668  }
669  /* update key length */
670  Msg.Cmd.Args.PasswordLen = pSecParams->KeyLen;
671  CmdCtrl.TxDescLen += pSecParams->KeyLen;
672  /* copy key (could be no key in case of WPS pin) */
673  if( NULL != pSecParams->Key )
674  {
675  sl_Memcpy(UPDATE_PROFILE_PASSWORD_STRING(&Msg), pSecParams->Key, pSecParams->KeyLen);
676  }
677  }
678  else
679  {
680  Msg.Cmd.Args.SecType = SL_WLAN_SEC_TYPE_OPEN;
681  Msg.Cmd.Args.PasswordLen = 0;
682  }
683 
684  }
685 
686 
687  /* If BSSID is not null, copy to buffer, otherwise set to 0 */
688  if(NULL != pMacAddr)
689  {
690  sl_Memcpy(Msg.Cmd.Args.Bssid, pMacAddr, sizeof(Msg.Cmd.Args.Bssid));
691  }
692  else
693  {
694  _SlDrvMemZero(Msg.Cmd.Args.Bssid, (_u16)sizeof(Msg.Cmd.Args.Bssid));
695  }
696 
697  VERIFY_RET_OK(_SlDrvCmdOp(&CmdCtrl, &Msg, NULL));
698 
699  return (_i16)Msg.Rsp.status;
700 }

§ sl_WlanProvisioning()

_i16 sl_WlanProvisioning ( _u8  ProvisioningCmd,
_u8  RequestedRoleAfterSuccess,
_u16  InactivityTimeoutSec,
char *  pSmartConfigKey,
_u32  Flags 
)

The simpleLink will switch to the appropriate role according to the provisioning mode requested and will start the provisioning process.

Parameters
[in]ProvisioningCmd
  • SL_WLAN_PROVISIONING_CMD_START_MODE_AP 0: Start AP provisioning (AP role)
  • SL_WLAN_PROVISIONING_CMD_START_MODE_SC 1: Start Smart Config provisioning (STA role)
  • SL_WLAN_PROVISIONING_CMD_START_MODE_APSC 2: Start AP+Smart Config provisioning (AP role)
  • SL_WLAN_PROVISIONING_CMD_START_MODE_APSC_EXTERNAL_CONFIGURATION 3: Start AP + Smart Config + external provisioning (AP role)
  • SL_WLAN_PROVISIONING_CMD_STOP 4: Stop provisioning
  • SL_WLAN_PROVISIONING_CMD_ABORT_EXTERNAL_CONFIGURATIONC 5:
[in]RequestedRoleAfterSuccessThe role that the SimpleLink will switch to in case of a successful provisioning. 0: STA 2: AP 0xFF: stay in current role (relevant only in provisioning_stop)
[in]InactivityTimeoutSec- The period of time (in seconds) the system waits before it automatically stops the provisioning process when no activity is detected. set to 0 in order to stop provisioning. Minimum InactivityTimeoutSec is 30 seconds.
[in]pSmartConfigKeySmart Config key: public key for smart config process - must be 16 chars (relevant for smart config only)
[in]FlagsCan have the following values:
  • SL_WLAN_PROVISIONING_CMD_FLAG_EXTERNAL_CONFIRMATION - Confirmation phase will be completed externally by host (e.g. via cloud assist)
Returns
Zero on success, or negative error code on failure
See also
Warning
Example
  • Start Provisioning - start as STA after success with inactivity timeout of 10 minutes:
    sl_WlanProvisioning(SL_WLAN_PROVISIONING_CMD_START_MODE_APSC, ROLE_STA, 600, "Key0Key0Key0Key0", 0x0);

  • Stop Provisioning:
    sl_WlanProvisioning(SL_WLAN_PROVISIONING_CMD_STOP,0xFF,0,NULL, 0x0);

  • Start AP Provisioning with inactivity timeout of 10 minutes
    sl_WlanProvisioning(SL_WLAN_PROVISIONING_CMD_START_MODE_APSC,ROLE_AP,600,NULL, 0x0);

  • Start AP Provisioning with inactivity timeout of 10 minutes and complete confirmation via user cloud assist
    sl_WlanProvisioning(SL_WLAN_PROVISIONING_CMD_START_MODE_APSC, ROLE_AP, 600, NULL, SL_WLAN_PROVISIONING_CMD_FLAG_EXTERNAL_CONFIRMATION);

Definition at line 1060 of file wlan.c.

1061 {
1062  _SlProvisioningStartMsg_u Msg;
1063 
1064  /* Verify if we can send this command to the NWP
1065  We can send only prov. stop command if command is not allowed */
1066  if ((!SL_IS_COMMAND_ALLOWED) && (!SL_IS_PROVISIONING_ACTIVE) && (InactivityTimeoutSec != 0))
1067  {
1068  /* return with the correct error code */
1069  return _SlDrvDriverIsApiAllowed(SL_OPCODE_SILO_WLAN);
1070  }
1071 
1072  /* If there is an API in progress and the timeout is not zero (it means the
1073  command is not prov. stop) then abort and return an error code */
1074  if (_SlDrvIsApiInProgress() && (InactivityTimeoutSec !=0))
1075  {
1076  return SL_RET_CODE_API_COMMAND_IN_PROGRESS;
1077  }
1078 
1079  _SlDrvMemZero(&Msg, (_u16)sizeof (_SlProvisioningStartMsg_u));
1080 
1081  Msg.Cmd.ProvParams.ProvisioningCmd = (_u8)ProvisioningCmd;
1082  Msg.Cmd.ProvParams.RequestedRoleAfterSuccess = (_u8)RequestedRoleAfterSuccess;
1083  Msg.Cmd.ProvParams.InactivityTimeoutSec = (_u16)InactivityTimeoutSec;
1084  Msg.Cmd.ProvParams.Flags = Flags;
1085 
1086  /* Smart Config parameters */
1087  if (NULL != pSmartConfigKey)
1088  {
1089  Msg.Cmd.SmartConfigParams.Args.GroupIdBitmask = SL_WLAN_SMART_CONFIG_DEFAULT_GROUP;
1090  Msg.Cmd.SmartConfigParams.Args.Cipher = SL_WLAN_SMART_CONFIG_DEFAULT_CIPHER;
1091  Msg.Cmd.SmartConfigParams.Args.PublicKeyLen = SL_WLAN_SMART_CONFIG_KEY_LENGTH;
1092 
1093  /* copy keys (if exist) after command (one after another) */
1094  sl_Memcpy(Msg.Cmd.SmartConfigParams.Key, pSmartConfigKey, SL_WLAN_SMART_CONFIG_KEY_LENGTH);
1095  }
1096  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlProvisioningCmdCtrl , &Msg, NULL));
1097 
1098  return (_i16)Msg.Rsp.status;
1099 }

§ sl_WlanRxFilterAdd()

_i16 sl_WlanRxFilterAdd ( SlWlanRxFilterRuleType_t  RuleType,
SlWlanRxFilterFlags_u  Flags,
const SlWlanRxFilterRule_u *const  pRule,
const SlWlanRxFilterTrigger_t *const  pTrigger,
const SlWlanRxFilterAction_t *const  pAction,
SlWlanRxFilterID_t *  pFilterId 
)

Adds new filter rule to the system.

Parameters
[in]RuleTypeThe rule type
  • SL_WLAN_RX_FILTER_HEADER
  • SL_WLAN_RX_FILTER_COMBINATION
[in]FlagsFlags which set the type of header rule Args and sets the persistent flag
  • SL_WLAN_RX_FILTER_BINARY
  • SL_WLAN_RX_FILTER_PERSISTENT
  • SL_WLAN_RX_FILTER_ENABLE
[in]pRuleDetermine the filter rule logic
[in]pTriggerDetermine when the rule is triggered also sets rule parent.
[in]pActionSets the action to be executed in case the match functions pass
[out]pFilterIdThe filterId which was created
Persistent Save the filters for persistent can be done by calling with SL_WLAN_RX_FILTER_STORE
Returns
Zero on success, or negative error code on failure
See also
Note
Warning

Definition at line 923 of file wlan.c.

929 {
930  _SlWlanRxFilterAddMsg_u Msg;
931 
932  /* verify that this api is allowed. if not allowed then
933  ignore the API execution and return immediately with an error */
934  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
935 
936  Msg.Cmd.RuleType = RuleType;
937  /* filterId is zero */
938  Msg.Cmd.FilterId = 0;
939  Msg.Cmd.Flags = Flags;
940  sl_Memcpy( &(Msg.Cmd.Rule), pRule, sizeof(SlWlanRxFilterRule_u) );
941  sl_Memcpy( &(Msg.Cmd.Trigger), pTrigger, sizeof(SlWlanRxFilterTrigger_t) );
942  sl_Memcpy( &(Msg.Cmd.Action), pAction, sizeof(SlWlanRxFilterAction_t) );
943  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlWlanRxFilterAddtCmdCtrl, &Msg, NULL) );
944  *pFilterId = Msg.Rsp.FilterId;
945  return (_i16)Msg.Rsp.Status;
946 }

§ sl_WlanRxStatGet()

_i16 sl_WlanRxStatGet ( SlWlanGetRxStatResponse_t pRxStat,
const _u32  Flags 
)

Get wlan RX statistics. Upon calling this command, the statistics counters will be cleared.

Parameters
[in]pRxStatPointer to SlWlanGetRxStatResponse_t filled with Rx statistics results
[in]FlagsShould be 0 ( not applicable right now, will be added the future )
Returns
Zero on success, or negative error code on failure
See also
sl_WlanRxStatStart sl_WlanRxStatStop
Note
Belongs to ext_api
Warning

Definition at line 981 of file wlan.c.

982 {
983  SL_DRV_PROTECTION_OBJ_LOCK_FOREVER();
984  if(SL_IS_DEVICE_STAT_IN_PROGRESS)
985  {
986  SL_DRV_PROTECTION_OBJ_UNLOCK();
987  return SL_RET_CODE_DEVICE_STAT_IN_PROGRESS;
988  }
989  SL_DRV_PROTECTION_OBJ_UNLOCK();
990 
991  _SlCmdCtrl_t CmdCtrl = {SL_OPCODE_WLAN_GETRXSTATCOMMAND, 0, (_SlArgSize_t)sizeof(SlWlanGetRxStatResponse_t)};
992  /* Flags parameter is currently not in use */
993  (void)Flags;
994 
995  /* verify that this api is allowed. if not allowed then
996  ignore the API execution and return immediately with an error */
997  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
998 
999  _SlDrvMemZero(pRxStat, (_u16)sizeof(SlWlanGetRxStatResponse_t));
1000  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&CmdCtrl, pRxStat, NULL));
1001  return 0;
1002 }

§ sl_WlanRxStatStart()

_i16 sl_WlanRxStatStart ( void  )

Start collecting wlan RX statistics, for unlimited time.

Parameters
None
Returns
Zero on success, or negative error code on failure
See also
sl_WlanRxStatStop sl_WlanRxStatGet
Note
Belongs to ext_api
Warning
Example
  • Getting wlan RX statistics:
    void RxStatCollectTwice()
    {
    _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(1); // sleep for 1 sec
    sl_WlanRxStatGet(&rxStat,0); // statistics has been cleared upon read
    sleep(1); // sleep for 1 sec
    sl_WlanRxStatGet(&rxStat,0);
    }

Definition at line 954 of file wlan.c.

955 {
956  SL_DRV_PROTECTION_OBJ_LOCK_FOREVER();
957  if(SL_IS_DEVICE_STAT_IN_PROGRESS)
958  {
959  SL_DRV_PROTECTION_OBJ_UNLOCK();
960  return SL_RET_CODE_DEVICE_STAT_IN_PROGRESS;
961  }
962  else
963  {
964  /* turn on flag indication for RX statistics is in progress
965  * to avoid parallel "starts" between
966  * Device statistics API and RX statistics API */
967  SL_SET_WLAN_RX_STAT_IN_PROGRESS;
968  SL_DRV_PROTECTION_OBJ_UNLOCK();
969  /* verify that this api is allowed. if not allowed then
970  ignore the API execution and return immediately with an error */
971  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
972 
973  }
974  return _SlDrvBasicCmd(SL_OPCODE_WLAN_STARTRXSTATCOMMAND);
975 }

§ sl_WlanRxStatStop()

_i16 sl_WlanRxStatStop ( void  )

Stop collecting wlan RX statistic, (if previous called sl_WlanRxStatStart)

Parameters
None
Returns
Zero on success, or negative error code on failure
See also
sl_WlanRxStatStart sl_WlanRxStatGet
Note
Belongs to ext_api
Warning

Definition at line 1007 of file wlan.c.

1008 {
1009  SL_DRV_PROTECTION_OBJ_LOCK_FOREVER();
1010  if(SL_IS_DEVICE_STAT_IN_PROGRESS)
1011  {
1012  SL_DRV_PROTECTION_OBJ_UNLOCK();
1013  return SL_RET_CODE_DEVICE_STAT_IN_PROGRESS;
1014  }
1015 
1016  else
1017  {
1018  SL_UNSET_WLAN_RX_STAT_IN_PROGRESS;
1019  SL_DRV_PROTECTION_OBJ_UNLOCK();
1020  /* verify that this api is allowed. if not allowed then
1021  ignore the API execution and return immediately with an error */
1022  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
1023  return _SlDrvBasicCmd(SL_OPCODE_WLAN_STOPRXSTATCOMMAND);
1024 
1025  }
1026 }

§ sl_WlanSet()

_i16 sl_WlanSet ( const _u16  ConfigId,
const _u16  ConfigOpt,
const _u16  ConfigLen,
const _u8 *  pValues 
)

Setting WLAN configurations.

Parameters
[in]ConfigId- configuration id
  • SL_WLAN_CFG_AP_ID
  • SL_WLAN_CFG_GENERAL_PARAM_ID
  • SL_WLAN_CFG_P2P_PARAM_ID
  • SL_WLAN_RX_FILTERS_ID
  • SL_WLAN_STA_NETWORK_ASSISTED_ROAMING
[in]ConfigOpt- configurations option
  • SL_WLAN_CFG_AP_ID
    • SL_WLAN_AP_OPT_SSID
      Set SSID for AP mode.
      This options takes _u8 buffer as parameter
    • SL_WLAN_AP_OPT_CHANNEL
      Set channel for AP mode.
      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]
      This option takes _u8 as a parameter
    • SL_WLAN_AP_OPT_HIDDEN_SSID
      Set Hidden SSID Mode for AP mode.Hidden options:
      0: disabled
      1: Send empty (length=0) SSID in beacon and ignore probe request for broadcast SSID
      2: Clear SSID (ASCII 0), but keep the original length (this may be required with some
      clients that do not support empty SSID) and ignore probe requests for broadcast SSID
      This option takes _u8 as a parameter
    • SL_WLAN_AP_OPT_SECURITY_TYPE
      Set Security type for AP mode. Security options are:
      • Open security: SL_WLAN_SEC_TYPE_OPEN
      • WEP security: SL_WLAN_SEC_TYPE_WEP
      • WPA security: SL_WLAN_SEC_TYPE_WPA_WPA2
        This option takes _u8 pointer as a parameter
    • SL_WLAN_AP_OPT_PASSWORD
      Set Password for for AP mode (for WEP or for WPA):
      Password - for WPA: 8 - 63 characters
      for WEP: 5 / 13 characters (ascii)
      This options takes _u8 buffer as parameter
    • SL_WLAN_AP_OPT_MAX_STATIONS
      Set Max AP stations - 1..4 - Note: can be less than the number of currently connected stations
      max_stations - 1 characters
      This options takes _u8 buffer as parameter
    • SL_WLAN_AP_OPT_MAX_STA_AGING
      Set Max station ageing time - default is 60 seconds
      max_stations - 2 characters
      This options takes _u16 buffer as parameter
    • SL_WLAN_AP_ACCESS_LIST_MODE
      Set AP access list mode - DISABLE, DENY_LIST
      mode - 1 characters
      This options takes _u8 buffer as parameter
    • SL_WLAN_AP_ACCESS_LIST_ADD_MAC
      Add MAC address to the AP access list:
      mac_addr - 6 characters
      This options takes _u8 buffer as parameter
    • SL_WLAN_AP_ACCESS_LIST_DEL_MAC
      Del MAC address from the AP access list:
      mac_addr - 6 characters
      This options takes _u8 buffer as parameter
    • SL_WLAN_AP_ACCESS_LIST_DEL_IDX
      Delete MAC address from index in the AP access list:
      index - 1 character
      This options takes _u8 buffer as parameter
  • SL_WLAN_CFG_GENERAL_PARAM_ID
    • SL_WLAN_GENERAL_PARAM_OPT_COUNTRY_CODE
      Set Country Code for AP mode
      This options takes _u8 2 bytes buffer as parameter
    • SL_WLAN_GENERAL_PARAM_OPT_STA_TX_POWER
      Set STA mode Tx power level
      Number between 0-15, as dB offset from max power (0 will set MAX power)
      This options takes _u8 as parameter
    • SL_WLAN_GENERAL_PARAM_OPT_AP_TX_POWER Set AP mode Tx power level for 2.4GHz channels only
      Number between 0-15, as dB offset from max power (0 will set MAX power)
      This options takes _u8 as parameter
    • SL_WLAN_GENERAL_PARAM_OPT_INFO_ELEMENT Set Info Element for AP mode.
      The Application can set up to SL_WLAN_MAX_PRIVATE_INFO_ELEMENTS_SUPPROTED info elements per Role (AP / P2P GO).
      To delete an info element use the relevant index and length = 0.
      For AP - no more than SL_WLAN_INFO_ELEMENT_MAX_TOTAL_LENGTH_AP bytes can be stored for all info elements.
      For P2P GO - no more than SL_WLAN_INFO_ELEMENT_MAX_TOTAL_LENGTH_P2P_GO bytes can be stored for all info elements.
      This option takes SlWlanSetInfoElement_t as parameter
    • SL_WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS Set scan parameters: RSSI threshold and channel mask.
    • SL_WLAN_GENERAL_PARAM_OPT_SUSPEND_PROFILES Set suspended profiles mask (set bits 2 and 4 to suspend profiles 2 and 4).
    • SL_WLAN_GENERAL_PARAM_REGISTER_LINK_QUALITY_EVENT Register to receive events regarding the link quality
    • SL_WLAN_GENERAL_PARAM_COEX_CONFIG Configure co-existing to work with both WIFI and BLE Enables the feature and define the GPIO to work with.
    • SL_WLAN_GENERAL_PARAM_ANT_SELECTION_CONFIG Enable using 2 Antennas ,configure which pad to use for each antenna and the configuration mode.
    • SL_WLAN_GENERAL_PARAM_ANT_SELECTION_SET Setting the desired antenna when antenna selection is set to manual mode. Applicable to CC3x20 devices only.
    • SL_WLAN_GENERAL_PARAM_DISABLE_ENT_SERVER_AUTH This option enables to skip server authentication and is valid for one use, when manually connection to an enterprise network
    • SL_WLAN_GENERAL_PARAM_OPT_ENABLE_5G This option allowes to enable or disable the 5Ghz functionallity
    • SL_WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS_5G Configure 5G scan parameters
    • SL_WLAN_GENERAL_PARAM_OPT_USER_COUNTRY_ATTRIB Set user country region attributes
    • SL_WLAN_GENERAL_PARAM_OPT_NO_PS_POLL_MODE Disable no PS_Poll mode (default) - station sends PS-Poll ctrl frame to receive buffered frames from the AP when unicast traffic is indicated in the beacon Enable no PS_Poll mode - Stating transition from PS to Active whenever unicast traffic is indicated in the beacon (this mode is for inter operability issues with access points that doesn't fully support PS-Poll)
  • SL_WLAN_CFG_P2P_PARAM_ID
    • SL_WLAN_P2P_OPT_DEV_TYPE
      Set P2P Device type.Maximum length of 17 characters. Device type is published under P2P I.E,
      allows to make devices easier to recognize.
      In case no device type is set, the default type is "1-0050F204-1"
      This options takes _u8 buffer as parameter
    • SL_WLAN_P2P_OPT_CHANNEL_N_REGS
      Set P2P Channels.
      listen channel (either 1/6/11 for 2.4GHz)
      listen regulatory class (81 for 2.4GHz)
      oper channel (either 1/6/11 for 2.4GHz)
      oper regulatory class (81 for 2.4GHz)
      listen channel and regulatory class will determine the device listen channel during p2p find listen phase
      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)
      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 _u8[4] as parameter
  • SL_WLAN_RX_FILTERS_ID
  • SL_WLAN_STA_NETWORK_ASSISTED_ROAMING
    • SL_WLAN_ROAMING_TRIGGERING_ENABLE
      Configure roaming triggering mode for STA mode. First parameter:.
      0: Disabled
      1: Enabled, Enabling this mode enables monitoring of the network
      Second parameter: rssiThreshold (-85..00 dbm, default -63dbm)
      This options takes SlWlanNetworkAssistedRoaming_t buffer as parameter
    • SL_WLAN_AP_TRANSITION_ENABLE
      Set roaming AP transition mode for STA mode. Options:.
      0: Disabled
      1: Enabled, Enabling this mode allows the serving AP to send a request for transition to another AP
      This options takes SlWlanNetworkAssistedRoaming_t buffer as parameter
[in]ConfigLen- configurations len
[in]pValues- configurations values
Returns
Zero on success, or negative error code on failure
Persistent
System Persistent:
  • SL_WLAN_CFG_GENERAL_PARAM_ID
  • SL_WLAN_CFG_P2P_PARAM_ID

Reset:

  • SL_WLAN_CFG_AP_ID

Non- Persistent:

  • SL_WLAN_GENERAL_PARAM_DISABLE_ENT_SERVER_AUTH
    See also
    Note
    Warning
    Examples

SL_WLAN_AP_OPT_SSID:

_u8 str[33];
memset(str, 0, 33);
memcpy(str, ssid, len); // ssid string of 32 characters
sl_WlanSet(SL_WLAN_CFG_AP_ID, SL_WLAN_AP_OPT_SSID, strlen(ssid), str);


  • SL_WLAN_AP_OPT_CHANNEL:
    _u8 val = channel;
    sl_WlanSet(SL_WLAN_CFG_AP_ID, SL_WLAN_AP_OPT_CHANNEL, 1, (_u8 *)&val);

  • SL_WLAN_AP_OPT_HIDDEN_SSID:
    _u8 val = hidden;
    sl_WlanSet(SL_WLAN_CFG_AP_ID, SL_WLAN_AP_OPT_HIDDEN_SSID, 1, (_u8 *)&val);

  • SL_WLAN_AP_OPT_SECURITY_TYPE:
    _u8 val = SL_WLAN_SEC_TYPE_WPA_WPA2;
    sl_WlanSet(SL_WLAN_CFG_AP_ID, SL_WLAN_AP_OPT_SECURITY_TYPE, 1, (_u8 *)&val);

  • SL_WLAN_AP_OPT_PASSWORD:
    _u8 str[65];
    _u16 len = strlen(password);
    memset(str, 0, 65);
    memcpy(str, password, len);
    sl_WlanSet(SL_WLAN_CFG_AP_ID, SL_WLAN_AP_OPT_PASSWORD, len, (_u8 *)str);

  • SL_WLAN_AP_OPT_MAX_STATIONS:
    _u8 max_ap_stations = 3;
    sl_WlanSet(SL_WLAN_CFG_AP_ID, SL_WLAN_AP_OPT_MAX_STATIONS, sizeof(max_ap_stations), (_u8 *)&max_ap_stations);

  • SL_WLAN_AP_OPT_MAX_STA_AGING:
    _u16 max_ap_sta_aging = 60;
    sl_WlanSet(SL_WLAN_CFG_AP_ID, SL_WLAN_AP_OPT_MAX_STA_AGING, sizeof(max_ap_sta_aging), (_u8 *)&max_ap_sta_aging);

  • SL_WLAN_AP_ACCESS_LIST_MODE:
    _u8 access list_mode = SL_WLAN_AP_ACCESS_LIST_MODE_DENY_LIST;
    sl_WlanSet(SL_WLAN_CFG_AP_ID, SL_WLAN_AP_ACCESS_LIST_MODE, sizeof(access list_mode), (_u8 *)&access list_mode);

  • SL_WLAN_AP_ACCESS_LIST_ADD_MAC:
    _u8 sta_mac[6] = { 0x00, 0x22, 0x33, 0x44, 0x55, 0x66 };
    sl_WlanSet(SL_WLAN_CFG_AP_ID, SL_WLAN_AP_ACCESS_LIST_ADD_MAC, sizeof(sta_mac), (_u8 *)&sta_mac);

  • SL_WLAN_AP_ACCESS_LIST_DEL_MAC:
    _u8 sta_mac[6] = { 0x00, 0x22, 0x33, 0x44, 0x55, 0x66 };
    sl_WlanSet(SL_WLAN_CFG_AP_ID, SL_WLAN_AP_ACCESS_LIST_DEL_MAC, sizeof(sta_mac), (_u8 *)&sta_mac);

  • SL_WLAN_AP_ACCESS_LIST_DEL_IDX:
    _u8 sta_index = 0;
    sl_WlanSet(SL_WLAN_CFG_AP_ID, SL_WLAN_AP_ACCESS_LIST_DEL_IDX, sizeof(sta_index), (_u8 *)&sta_index);

  • SL_WLAN_GENERAL_PARAM_OPT_STA_TX_POWER:
    _u8 stapower=(_u8)power;
    sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID, SL_WLAN_GENERAL_PARAM_OPT_STA_TX_POWER,1,(_u8 *)&stapower);

  • SL_WLAN_GENERAL_PARAM_OPT_COUNTRY_CODE:
    _u8* str = (_u8 *) country; // string of 2 characters. i.e. - "US"
    sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID, SL_WLAN_GENERAL_PARAM_OPT_COUNTRY_CODE, 2, str);

  • SL_WLAN_GENERAL_PARAM_OPT_AP_TX_POWER:
    _u8 appower=(_u8)power;
    sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID, SL_WLAN_GENERAL_PARAM_OPT_AP_TX_POWER,1,(_u8 *)&appower);

  • WLAN_GENERAL_PARAM_REGISTER_LINK_QUALITY_EVENT:
    sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID, WLAN_GENERAL_PARAM_REGISTER_LINK_QUALITY_EVENT,sizeof(SlWlanRegisterLinkQualityEvents_t),(_u8 *)&RegisterLinkQuality);

  • SL_WLAN_GENERAL_PARAM_OPT_SUSPEND_PROFILES
    _u32 suspendedProfilesMask=(_u32)mask;
    sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID, SL_WLAN_GENERAL_PARAM_OPT_SUSPEND_PROFILES,sizeof(suspendedProfilesMask),(_u32 *)&suspendedProfilesMask);

  • SL_WLAN_P2P_OPT_DEV_TYPE:
    _u8 str[17];
    _u16 len = strlen(device_type);
    memset(str, 0, 17);
    memcpy(str, device_type, len);
    sl_WlanSet(SL_WLAN_CFG_P2P_PARAM_ID, SL_WLAN_P2P_OPT_DEV_TYPE, len, str);

  • SL_WLAN_P2P_OPT_CHANNEL_N_REGS
    _u8 str[4];
    str[0] = (_u8)11; // listen channel
    str[1] = (_u8)81; // listen regulatory class
    str[2] = (_u8)6; // oper channel
    str[3] = (_u8)81; // oper regulatory class
    sl_WlanSet(SL_WLAN_CFG_P2P_PARAM_ID, SL_WLAN_P2P_OPT_CHANNEL_N_REGS, 4, str);

  • SL_WLAN_GENERAL_PARAM_OPT_INFO_ELEMENT:
    infoele.Index = Index; // Index of the info element. range: 0 - SL_WLAN_MAX_PRIVATE_INFO_ELEMENTS_SUPPROTED
    infoele.Role = Role; // SL_WLAN_INFO_ELEMENT_AP_ROLE (0) or SL_WLAN_INFO_ELEMENT_P2P_GO_ROLE (1)
    infoele.IE.Id = Id; // Info element ID. if SL_WLAN_INFO_ELEMENT_DEFAULT_ID (0) is set, ID will be set to 221.
    // Organization unique ID. If all 3 bytes are zero - it will be replaced with 08,00,28.
    infoele.IE.Oui[0] = Oui0; // Organization unique ID first Byte
    infoele.IE.Oui[1] = Oui1; // Organization unique ID second Byte
    infoele.IE.Oui[2] = Oui2; // Organization unique ID third Byte
    infoele.IE.Length = Len; // Length of the info element. must be smaller than 253 bytes
    memset(infoele.IE.Data, 0, SL_WLAN_INFO_ELEMENT_MAX_SIZE);
    if ( Len <= SL_WLAN_INFO_ELEMENT_MAX_SIZE )
    {
    memcpy(infoele.IE.Data, IE, Len); // Info element. length of the info element is [0-252]
    sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID,SL_WLAN_GENERAL_PARAM_OPT_INFO_ELEMENT,sizeof(SlWlanSetInfoElement_t),(_u8* ) &infoele);
    }

  • SL_WLAN_GENERAL_PARAM_OPT_ENABLE_5G
    _u8 Enabled5GStatus = 1;
    _u16 Option = SL_WLAN_GENERAL_PARAM_OPT_ENABLE_5G;
    _u16 OptionLen = sizeof(_u8);
    ret = sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID, Option, OptionLen, (_u8 *)&Enabled5GStatus);

  • SL_WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS:
    SlWlanScanParamCommand_t ScanParamConfig;
    _u16 Option = SL_WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS;
    _u16 OptionLen = sizeof(ScanParamConfig);
    // 2.4G channels bits order: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
    ScanParamConfig.RssiThreshold = -70;
    ScanParamConfig.ChannelsMask = 0x1FFF;
    sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID, &Option, &OptionLen, (_u8 *)&ScanParamConfig);

    - SL_WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS_5G:
    
    SlWlanScanParam5GCommand_t ScanParamConfig5G;
    _u16 Option = SL_WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS_5G;
    _u16 OptionLen = sizeof(SlWlanScanParam5GCommand_t);
    // 5.0G channels bits order: 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132,
    // 136, 140, 144, 149, 153, 157, 161, 165, 169, 184, 188, 192, 196
    ScanParamConfig5G.ChannelsMask = 0x0000000F; // Select ChannelsMask for channels 36, 40, 44, 48
    ScanParamConfig5G.RssiThreshold = -70;
    sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID, Option, OptionLen, (_u8 *)&ScanParamConfig5G);

  • SL_WLAN_GENERAL_PARAM_DISABLE_ENT_SERVER_AUTH:
    _u8 param = 1; // 1 means disable the server authentication
    sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID,SL_WLAN_GENERAL_PARAM_DISABLE_ENT_SERVER_AUTH,1,&param);

  • SL_WLAN_RX_FILTER_STORE:
    sl_WlanSet(SL_WLAN_RX_FILTERS_ID, SL_WLAN_RX_FILTER_STORE, 0, NULL);
  • SL_WLAN_GENERAL_PARAM_COEX_CONFIG:
    //The configuration will take place after soft reset of the networking subsystem( sl_stop(),sl_star())
    sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID,SL_WLAN_GENERAL_PARAM_COEX_CONFIG,sizeof(SlWlanCoexConfig_t),&param);

  • SL_WLAN_GENERAL_PARAM_OPT_NO_PS_POLL_MODE:
    //Disable no PS_Poll mode (default) - station sends PS-Poll ctrl frame to receive buffered frames from the AP when
    unicast traffic is indicated in the beacon
    //Enable no PS_Poll mode - Stating transition from PS to Active whenever unicast traffic is indicated in the beacon
    (this mode is for inter operability issues with access points that doesn't fully support
    PS-Poll)
    SlWlanNoPSPollMode_t NoPsPollMode;
    NoPsPollMode.Enable = 1; // enable no PS-Poll mode (work without PS-Poll frames)
    sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID, SL_WLAN_GENERAL_PARAM_OPT_NO_PS_POLL_MODE,sizeof(SlWlanNoPSPollMode_t),(_u8 *)& NoPsPollMode);

  • SL_WLAN_ROAMING_TRIGGERING_ENABLE:
    SlWlanNetworkAssistedRoaming_t roamingTriggeringEnable;
    roamingTriggeringEnable.Enable = 1;
    roamingTriggeringEnable.rssiThreshold = -63;
    sl_WlanSet(SL_WLAN_STA_NETWORK_ASSISTED_ROAMING, SL_WLAN_ROAMING_TRIGGERING_ENABLE, sizeof(SlWlanNetworkAssistedRoaming_t ), roamingTriggeringEnable );

  • SL_WLAN_AP_TRANSITION_ENABLE:
    SlWlanNetworkAssistedRoaming_t roamingTransitionEnable;
    roamingTransitionEnable.Enable = 1;
    sl_WlanSet(SL_WLAN_STA_NETWORK_ASSISTED_ROAMING, SL_WLAN_AP_TRANSITION_ENABLE, sizeof(SlWlanNetworkAssistedRoaming_t ), apTransitionEnable );

Definition at line 1159 of file wlan.c.

1160 {
1161  _SlWlanCfgSetMsg_u Msg;
1162  _SlCmdExt_t CmdExt;
1163 
1164  /* verify that this api is allowed. if not allowed then
1165  ignore the API execution and return immediately with an error */
1166  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
1167 
1168  _SlDrvResetCmdExt(&CmdExt);
1169  CmdExt.TxPayload1Len = (_u16)((ConfigLen+3) & (~3));
1170  CmdExt.pTxPayload1 = (_u8 *)pValues;
1171 
1172  Msg.Cmd.ConfigId = ConfigId;
1173  Msg.Cmd.ConfigLen = ConfigLen;
1174  Msg.Cmd.ConfigOpt = ConfigOpt;
1175 
1176  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlWlanCfgSetCmdCtrl, &Msg, &CmdExt));
1177 
1178  return (_i16)Msg.Rsp.status;
1179 }

§ sl_WlanSetMode()

_i16 sl_WlanSetMode ( const _u8  Mode)

Wlan set mode.

Setting WLAN mode

Parameters
[in]ModeWLAN 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
  • ROLE_TAG -for TAG mode - WLAN STA not connected
Returns
Zero on success, or negative error code on failure
Persistent
Mode is Persistent
See also
sl_Start sl_Stop
Note
Belongs to ext_api
Warning
After setting the mode the system must be restarted for activating the new mode
Example

Definition at line 1124 of file wlan.c.

1125 {
1126  _SlwlanSetModeMsg_u Msg;
1127 
1128  /* verify that this api is allowed. if not allowed then
1129  ignore the API execution and return immediately with an error */
1130  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
1131 
1132  Msg.Cmd.Mode = Mode;
1133 
1134  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlWlanSetModeCmdCtrl , &Msg, NULL));
1135 
1136  return (_i16)Msg.Rsp.status;
1137 }

Data Structure Documentation

§ SlWlanSmartConfigStartAsyncResponse_t

struct SlWlanSmartConfigStartAsyncResponse_t

Definition at line 528 of file wlan.h.

Data Fields
_u8 PrivateToken[32]
_u32 PrivateTokenLen
_u8 Ssid[32]
_u32 SsidLen
_u32 Status

§ SlWlanSmartConfigStopAsyncResponse_t

struct SlWlanSmartConfigStopAsyncResponse_t

Definition at line 537 of file wlan.h.

Data Fields
_u16 Padding
_u16 Status

§ SlWlanConnFailureAsyncResponse_t

struct SlWlanConnFailureAsyncResponse_t

Definition at line 543 of file wlan.h.

Data Fields
_u16 Padding
_u16 Status

§ SlWlanProvisioningStatusAsyncResponse_t

struct SlWlanProvisioningStatusAsyncResponse_t

Definition at line 549 of file wlan.h.

Data Fields
_u16 Padding
_u16 Status

§ SlWlanEventRxFilterInfo_t

struct SlWlanEventRxFilterInfo_t

Definition at line 568 of file wlan.h.

Data Fields
_u8 Type
_u8 UserActionIdBitmap[SL_WLAN_RX_FILTER_NUM_USER_EVENT_ID/8]

§ SlWlanEventConnect_t

struct SlWlanEventConnect_t

Definition at line 583 of file wlan.h.

Data Fields
_u8 Bssid[6]
_u8 Channel
_u8 SsidLen
_u8 SsidName[32]

§ SlWlanEventDisconnect_t

struct SlWlanEventDisconnect_t

Definition at line 591 of file wlan.h.

Data Fields
_u8 Bssid[6]
_u8 ReasonCode
_u8 SsidLen
_u8 SsidName[32]

§ SlWlanEventSTAAdded_t

struct SlWlanEventSTAAdded_t

Definition at line 599 of file wlan.h.

Data Fields
_u8 Mac[6]
_u8 Padding[2]

§ SlWlanEventP2PConnect_t

struct SlWlanEventP2PConnect_t

Definition at line 606 of file wlan.h.

Data Fields
_u8 Bssid[6]
_u8 GoDeviceName[32]
_u8 GoDeviceNameLen
_u8 Padding[3]
_u8 Reserved
_u8 SsidLen
_u8 SsidName[32]

§ SlWlanEventP2PDisconnect_t

struct SlWlanEventP2PDisconnect_t

Definition at line 617 of file wlan.h.

Data Fields
_u8 Bssid[6]
_u8 GoDeviceName[32]
_u8 GoDeviceNameLen
_u8 Padding[3]
_u8 ReasonCode
_u8 SsidLen
_u8 SsidName[32]

§ SlWlanEventP2PClientAdded_t

struct SlWlanEventP2PClientAdded_t

Definition at line 628 of file wlan.h.

Data Fields
_u8 ClDeviceName[32]
_u8 ClDeviceNameLen
_u8 Mac[6]
_u8 OwnSsid[32]
_u8 OwnSsidLen

§ SlWlanEventP2PDevFound_t

struct SlWlanEventP2PDevFound_t

Definition at line 637 of file wlan.h.

Data Fields
_u8 GoDeviceName[32]
_u8 GoDeviceNameLen
_u8 Mac[6]
_u8 WpsMethod

§ SlWlanEventP2PConnectFail_t

struct SlWlanEventP2PConnectFail_t

Definition at line 646 of file wlan.h.

Data Fields
_u16 Padding
_u16 Status

§ SlWlanEventProvisioningStatus_t

struct SlWlanEventProvisioningStatus_t

Definition at line 652 of file wlan.h.

Data Fields
_u8 ProvisioningStatus
_u32 Reserved
_u8 Role
_u8 Ssid[32]
_u8 Ssidlen
_u8 WlanStatus

§ SlWlanEventProvisioningProfileAdded_t

struct SlWlanEventProvisioningProfileAdded_t

Definition at line 662 of file wlan.h.

Data Fields
_u8 Reserved[32]
_u32 ReservedLen
_u8 Ssid[32]
_u32 SsidLen
_u32 Status

§ SlWlanLinkQualityAsyncEvent_t

struct SlWlanLinkQualityAsyncEvent_t

Definition at line 671 of file wlan.h.

Data Fields
_u8 Data
_u8 Padding[2]
_u8 TriggerId

§ SlWlanEventData_u

union SlWlanEventData_u

Definition at line 678 of file wlan.h.

Data Fields
SlWlanEventConnect_t Connect
SlWlanEventDisconnect_t Disconnect
SlWlanLinkQualityAsyncEvent_t LinkQualityTrigger
SlWlanEventP2PClientAdded_t P2PClientAdded
SlWlanEventP2PClientRemoved_t P2PClientRemoved
SlWlanEventP2PConnect_t P2PConnect
SlWlanEventP2PConnectFail_t P2PConnectFail
SlWlanEventP2PDevFound_t P2PDevFound
SlWlanEventP2PDisconnect_t P2PDisconnect
SlWlanEventP2PRequest_t P2PRequest
SlWlanEventProvisioningProfileAdded_t ProvisioningProfileAdded
SlWlanEventProvisioningStatus_t ProvisioningStatus
SlWlanEventRxFilterInfo_t RxFilterInfo
SlWlanEventSTAAdded_t STAAdded
SlWlanEventSTARemoved_t STARemoved

§ SlWlanEvent_t

struct SlWlanEvent_t

Definition at line 697 of file wlan.h.

Data Fields
SlWlanEventData_u Data
_u32 Id

§ SlWlanGetRxStatResponse_t

struct SlWlanGetRxStatResponse_t

Definition at line 703 of file wlan.h.

Data Fields
_i16 AvarageDataCtrlRssi
_i16 AvarageMgMntRssi
_u32 GetTimeStamp
_u16 RateHistogram[SL_WLAN_NUM_OF_RATE_INDEXES]
_u32 ReceivedAddressMismatchPacketsNumber
_u32 ReceivedFcsErrorPacketsNumber
_u32 ReceivedValidPacketsNumber
_u16 RssiHistogram[SL_WLAN_SIZE_OF_RSSI_HISTOGRAM]
_u32 StartTimeStamp

§ SlWlanNetworkEntry_t

struct SlWlanNetworkEntry_t

Definition at line 716 of file wlan.h.

Data Fields
_u8 Bssid[SL_WLAN_BSSID_LENGTH]
_u8 Channel
_i8 Reserved[1]
_i8 Rssi
_i16 SecurityInfo
_u8 Ssid[SL_WLAN_SSID_MAX_LENGTH]
_u8 SsidLen

§ SlWlanExtNetworkEntry_t

struct SlWlanExtNetworkEntry_t

Definition at line 727 of file wlan.h.

Data Fields
_u8 Bssid[SL_WLAN_BSSID_LENGTH]
_u8 Channel
_u8 CountryStr[2]
_i8 Reserved[1]
_i8 Rssi
_i16 SecurityInfo
_u8 Ssid[SL_WLAN_SSID_MAX_LENGTH]
_u8 SsidLen
_u16 Supported_2_4G_Channels
_u32 Supported_5_0G_Channels

§ SlWlanSecParams_t

struct SlWlanSecParams_t

Definition at line 742 of file wlan.h.

Data Fields
_i8 * Key
_u8 KeyLen
_u8 Type

§ SlWlanSecParamsExt_t

struct SlWlanSecParamsExt_t

Definition at line 749 of file wlan.h.

Data Fields
_i8 * AnonUser
_u8 AnonUserLen
_u8 CertIndex
_u32 EapMethod
_i8 * User
_u8 UserLen

§ SlWlanGetSecParamsExt_t

struct SlWlanGetSecParamsExt_t

Definition at line 759 of file wlan.h.

Data Fields
_i8 AnonUser[64]
_u8 AnonUserLen
_u8 CertIndex
_u32 EapMethod
_i8 User[64]
_u8 UserLen

§ SlWlanConnectionInfo_u

union SlWlanConnectionInfo_u

Definition at line 772 of file wlan.h.

Data Fields
SlWlanEventP2PConnect_t P2PConnect
SlWlanEventConnect_t StaConnect

§ SlWlanConnStatusParam_t

struct SlWlanConnStatusParam_t

Definition at line 787 of file wlan.h.

Data Fields
SlWlanConnectionInfo_u ConnectionInfo
_u8 ConnStatus
_u8 Mode
_u8 Reserved
_u8 SecType

§ SlWlanScanParamCommand_t

struct SlWlanScanParamCommand_t

Definition at line 796 of file wlan.h.

Data Fields
_u32 ChannelsMask
_i32 RssiThreshold

§ SlWlanScanParam2GCommand_t

struct SlWlanScanParam2GCommand_t

Definition at line 802 of file wlan.h.

Data Fields
_u32 ChannelsMask
_i32 RssiThreshold

§ SlWlanScanParam5GCommand_t

struct SlWlanScanParam5GCommand_t

Definition at line 808 of file wlan.h.

Data Fields
_u32 ChannelsMask
_i32 RssiThreshold

§ SlWlanUserCountryAttrib_t

struct SlWlanUserCountryAttrib_t

Definition at line 822 of file wlan.h.

Data Fields
_u32 Active_2_4G_Channels
_u32 Active_5_0G_Channels
_u32 Dfs_5_0G_Channels
_u8 Padding[3]
_u8 Region

§ SlWlanInfoElement_t

struct SlWlanInfoElement_t

Definition at line 830 of file wlan.h.

Data Fields
_u8 Data[252]
_u8 Id
_u16 Length
_u8 Oui[3]

§ SlWlanSetInfoElement_t

struct SlWlanSetInfoElement_t

Definition at line 838 of file wlan.h.

Data Fields
SlWlanInfoElement_t IE
_u8 Index
_u8 Role

§ SlWlanPmPolicyParams_t

struct SlWlanPmPolicyParams_t

Definition at line 845 of file wlan.h.

Data Fields
_u16 MaxSleepTimeMs
_u8 PowerMgtBitMask
_u8 Reserved
_u16 Reserved2
_u16 Reserved3

§ SlWlanRegisterLinkQualityEvents_t

struct SlWlanRegisterLinkQualityEvents_t

Definition at line 879 of file wlan.h.

Data Fields
_u8 Direction
_u8 Enable
_u8 Hysteresis
_u8 Metric
_u16 Pacing
_u8 Padding[2]
_i16 Threshold
_u8 TriggerId
_u8 Type

§ SlWlanCoexConfig_t

struct SlWlanCoexConfig_t

Definition at line 898 of file wlan.h.

Data Fields
_u8 InputPad
_u8 Mode
_u32 Options
_u8 OutputPad
_u8 Reserved

§ SlWlanNoPSPollMode_t

struct SlWlanNoPSPollMode_t

Definition at line 907 of file wlan.h.

Data Fields
_u8 Enable
_u8 Padding[2]
_u8 Reserved

§ SlWlanAntSelectionConfig_t

struct SlWlanAntSelectionConfig_t

Definition at line 923 of file wlan.h.

Data Fields
_u8 Ant1Pad
_u8 Ant2Pad
_u8 Mode
_u32 Options
_u8 Reserved

§ SetAntennaCmd

struct SetAntennaCmd

Definition at line 940 of file wlan.h.

Data Fields
SlWlanAntIndex_e AntIndex

§ SlWlanExtConnectionInfo_t

struct SlWlanExtConnectionInfo_t

Definition at line 945 of file wlan.h.

Data Fields
_u16 BeaconInterval
_u8 DTIMPeriod
_u8 reserved[17]

§ SlWlanRxFilterPatternArg_t

struct SlWlanRxFilterPatternArg_t

Definition at line 973 of file wlan.h.

Data Fields
_u8 Length
_u16 Offset
_u8 Reserved
_u8 Value[16]

§ SlWlanRxFilterHeaderArg_u

union SlWlanRxFilterHeaderArg_u

Definition at line 1030 of file wlan.h.

Data Fields
_u8 Bssid[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][6]
_u32 EtherType[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS]
_u32 FrameLength[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS]
_u8 FrameSubtype[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS]
_u8 Frametype[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS]
_u8 FrametypeAscii[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][4]
_u8 IpProtocol[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS]
_u8 IpProtocolAscii[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][5]
_u8 Ipv4[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][4]
_u8 Ipv4Ascii[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][16]
_u8 Ipv6[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][16]
_u8 IpVersion
_u8 IpVersionAscii[4]
_u8 Mac[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][6]
_u8 MacAscii[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][18]
SlWlanRxFilterPatternArg_t Pattern
_u32 Port[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS]

§ SlWlanRxFilterRuleHeaderArgs_t

struct SlWlanRxFilterRuleHeaderArgs_t

Definition at line 1087 of file wlan.h.

Data Fields
_u8 Mask[16]
SlWlanRxFilterHeaderArg_u Value

§ SlWlanRxFilterRuleHeader_t

struct SlWlanRxFilterRuleHeader_t

Definition at line 1096 of file wlan.h.

Data Fields
SlWlanRxFilterRuleHeaderArgs_t Args
SlWlanRxFilterRuleHeaderCompareFunction_t CompareFunc
SlWlanRxFilterRuleHeaderField_t Field
_u8 Padding[2]

§ SlWlanRxFilterRuleCombination_t

struct SlWlanRxFilterRuleCombination_t

Definition at line 1114 of file wlan.h.

Data Fields
SlWlanRxFilterID_t CombinationFilterId[SL_WLAN_RX_FILTER_RANGE_ARGS]
SlWlanRxFilterRuleCombinationOperator_t Operator
_u8 Padding

§ SlWlanRxFilterRule_u

union SlWlanRxFilterRule_u

Definition at line 1122 of file wlan.h.

Data Fields
SlWlanRxFilterRuleCombination_t Combination
SlWlanRxFilterRuleHeader_t Header

§ SlWlanRxFilterTrigger_t

struct SlWlanRxFilterTrigger_t

Definition at line 1167 of file wlan.h.

Data Fields
SlWlanRxFilterTriggerCompareFunction_t CompareFunction
SlWlanRxFilterTriggerConnectionStates_t ConnectionState
SlWlanRxFilterCounterId_t Counter
_u32 CounterVal
_u8 Padding[3]
SlWlanRxFilterID_t ParentFilterID
SlWlanRxFilterTriggerRoles_t Role

§ SlWlanRxFilterAction_t

struct SlWlanRxFilterAction_t

Definition at line 1192 of file wlan.h.

Data Fields
_u8 Counter
_u8 Padding[3]
_u16 Reserved
SlWlanRxFilterActionType_t Type
_u8 UserId

§ SlWlanRxFilterOperationCommandBuff_t

struct SlWlanRxFilterOperationCommandBuff_t

Definition at line 1203 of file wlan.h.

Data Fields
SlWlanRxFilterIdMask_t FilterBitmap
_u8 Padding[4]

§ SlWlanNetworkAssistedRoaming_t

struct SlWlanNetworkAssistedRoaming_t

Definition at line 1211 of file wlan.h.

Data Fields
_u8 Enable
_u8 Reserved
_i16 rssiThreshold

§ SlWlanRxFilterUpdateArgsCommandBuff_t

struct SlWlanRxFilterUpdateArgsCommandBuff_t

Definition at line 1219 of file wlan.h.

Data Fields
SlWlanRxFilterRuleHeaderArgs_t Args
_u8 BinaryOrAscii
_u8 FilterId
_u8 Padding[2]

§ SlWlanRxFilterRetrieveStateBuff_t

struct SlWlanRxFilterRetrieveStateBuff_t

Definition at line 1230 of file wlan.h.

Data Fields
SlWlanRxFilterIdMask_t FilterIdMask

§ SlWlanRxFilterSysFiltersSetStateBuff_t

struct SlWlanRxFilterSysFiltersSetStateBuff_t

Definition at line 1237 of file wlan.h.

Data Fields
SlWlanRxFilterSysFiltersMask_t FilterBitmap

§ SlWlanRxFilterSysFiltersRetrieveStateBuff_t

struct SlWlanRxFilterSysFiltersRetrieveStateBuff_t

Definition at line 1244 of file wlan.h.

Data Fields
SlWlanRxFilterSysFiltersMask_t FilterBitmap