SimpleLink CC3120/CC3220 Host Driver  Version 2.0.1.27
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_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_WlanRxStatStart (void)
 Start collecting wlan RX statistics, for unlimited time. More...
 
_i16 sl_WlanRxStatStop (void)
 Stop collecting wlan RX statistic, (if previous called sl_WlanRxStatStart) 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_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 _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_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
}
 
enum  SlWlanConnStatusFlags_e {
  SL_WLAN_DISCONNECTED = 0,
  SL_WLAN_CONNECTED_STA,
  SL_WLAN_CONNECTED_P2PCL,
  SL_WLAN_CONNECTED_P2PGO,
  SL_WLAN_AP_CONNECTED_STATIONS
}
 

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_WPA_ENT
  • SL_WLAN_SEC_TYPE_WPS_PBC
  • SL_WLAN_SEC_TYPE_WPS_PIN
[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
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 <= 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_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_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_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);

Definition at line 927 of file wlan.c.

928 {
929  _SlWlanCfgMsgGet_u Msg;
930  _SlCmdExt_t CmdExt;
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  if (*pConfigLen == 0)
937  {
938  return SL_EZEROLEN;
939  }
940 
941  _SlDrvResetCmdExt(&CmdExt);
942  CmdExt.RxPayloadLen = (_i16)*pConfigLen;
943  CmdExt.pRxPayload = (_u8 *)pValues;
944  Msg.Cmd.ConfigLen = *pConfigLen;
945  Msg.Cmd.ConfigId = ConfigId;
946  if( pConfigOpt )
947  {
948  Msg.Cmd.ConfigOpt = (_u16)*pConfigOpt;
949  }
950  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlWlanCfgGetCmdCtrl, &Msg, &CmdExt));
951 
952  if( pConfigOpt )
953  {
954  *pConfigOpt = (_u8)Msg.Rsp.ConfigOpt;
955  }
956  if (CmdExt.RxPayloadLen < CmdExt.ActualRxPayloadLen)
957  {
958  *pConfigLen = (_u8)CmdExt.RxPayloadLen;
959  return SL_ESMALLBUF;
960  }
961  else
962  {
963  *pConfigLen = (_u8)CmdExt.ActualRxPayloadLen;
964  }
965 
966  return (_i16)Msg.Rsp.Status;
967 }

§ 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
This command do not initiate any active scanning action
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 ",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));
    }

Definition at line 630 of file wlan.c.

631 {
632  _i16 retVal = 0;
633  _SlWlanGetNetworkListMsg_u Msg;
634  _SlCmdExt_t CmdExt;
635 
636  /* verify that this api is allowed. if not allowed then
637  ignore the API execution and return immediately with an error */
638  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
639 
640  if (Count == 0)
641  {
642  return SL_EZEROLEN;
643  }
644 
645  _SlDrvResetCmdExt(&CmdExt);
646  CmdExt.RxPayloadLen = (_i16)(sizeof(SlWlanNetworkEntry_t)*(Count));
647  CmdExt.pRxPayload = (_u8 *)pEntries;
648 
649  Msg.Cmd.Index = Index;
650  Msg.Cmd.Count = Count;
651 
652  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlWlanGetNetworkListCtrl, &Msg, &CmdExt));
653  retVal = Msg.Rsp.status;
654 
655  return (_i16)retVal;
656 }
Definition: wlan.h:633

§ 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 - only the interval will be saved.
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.

  • 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));

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_WPA_ENT
  • SL_WLAN_SEC_TYPE_WPS_PBC
  • SL_WLAN_SEC_TYPE_WPS_PIN
[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

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 <= 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 594 of file wlan.c.

595 {
596  _SlProfileDelMsg_u Msg;
597 
598  /* verify that this api is allowed. if not allowed then
599  ignore the API execution and return immediately with an error */
600  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
601 
602  Msg.Cmd.Index = (_u8)Index;
603 
604  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlProfileDelCmdCtrl, &Msg, NULL));
605 
606  return (_i16)Msg.Rsp.status;
607 }

§ 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_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
See also
sl_WlanProfileAdd , sl_WlanProfileDel
Note
belongs to ext_api
Warning

Definition at line 528 of file wlan.c.

529 {
530  _SlProfileGetMsg_u Msg;
531  Msg.Cmd.Index = (_u8)Index;
532 
533  /* verify that this api is allowed. if not allowed then
534  ignore the API execution and return immediately with an error */
535  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
536 
537  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlProfileGetCmdCtrl, &Msg, NULL));
538 
539  pSecParams->Type = (_u8)(Msg.Rsp.Args.Common.SecType);
540  if (Msg.Rsp.Args.Common.SecType >= 0)
541  {
542  /* since password is not transferred in getprofile, password length should always be zero */
543  pSecParams->KeyLen = Msg.Rsp.Args.Common.PasswordLen;
544  if (NULL != pEntParams)
545  {
546  pEntParams->EapMethod = Msg.Rsp.Args.EapBitmask;
547  pEntParams->UserLen = Msg.Rsp.Args.UserLen;
548  /* copy user name */
549  if (pEntParams->UserLen > 0)
550  {
551  sl_Memcpy(pEntParams->User, EAP_PROFILE_USER_STRING(&Msg), pEntParams->UserLen);
552  }
553  pEntParams->AnonUserLen = Msg.Rsp.Args.AnonUserLen;
554  /* copy anonymous user name */
555  if (pEntParams->AnonUserLen > 0)
556  {
557  sl_Memcpy(pEntParams->AnonUser, EAP_PROFILE_ANON_USER_STRING(&Msg), pEntParams->AnonUserLen);
558  }
559  }
560 
561  *pNameLen = (_i16)(Msg.Rsp.Args.Common.SsidLen);
562  *pPriority = Msg.Rsp.Args.Common.Priority;
563 
564  if (NULL != Msg.Rsp.Args.Common.Bssid)
565  {
566  sl_Memcpy(pMacAddr, Msg.Rsp.Args.Common.Bssid, sizeof(Msg.Rsp.Args.Common.Bssid));
567  }
568 
569  sl_Memset(pName, 0, SL_WLAN_SSID_MAX_LENGTH);
570  sl_Memcpy(pName, EAP_PROFILE_SSID_STRING(&Msg), *pNameLen);
571  }
572  return (_i16)Msg.Rsp.Args.Common.SecType;
573 }

§ 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 + WAC 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 (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 786 of file wlan.c.

787 {
788  _SlProvisioningStartMsg_u Msg;
789 
790  /* Verify if we can send this command to the NWP
791  We can send only prov. stop command if command is not allowed */
792  if ((!SL_IS_COMMAND_ALLOWED) && (!SL_IS_PROVISIONING_ACTIVE) && (InactivityTimeoutSec != 0))
793  {
794  /* return with the correct error code */
795  return _SlDrvDriverIsApiAllowed(SL_OPCODE_SILO_WLAN);
796  }
797 
798  /* If there is an API in progress and the timeout is not zero (it means the
799  command is not prov. stop) then abort and return an error code */
800  if (_SlDrvIsApiInProgress() && (InactivityTimeoutSec !=0))
801  {
802  return SL_RET_CODE_API_COMMAND_IN_PROGRESS;
803  }
804 
805  _SlDrvMemZero(&Msg, (_u16)sizeof (_SlProvisioningStartMsg_u));
806 
807  Msg.Cmd.ProvParams.ProvisioningCmd = (_u8)ProvisioningCmd;
808  Msg.Cmd.ProvParams.RequestedRoleAfterSuccess = (_u8)RequestedRoleAfterSuccess;
809  Msg.Cmd.ProvParams.InactivityTimeoutSec = (_u16)InactivityTimeoutSec;
810  Msg.Cmd.ProvParams.Flags = Flags;
811 
812  /* Smart Config parameters */
813  if (NULL != pSmartConfigKey)
814  {
815  Msg.Cmd.SmartConfigParams.Args.GroupIdBitmask = SL_WLAN_SMART_CONFIG_DEFAULT_GROUP;
816  Msg.Cmd.SmartConfigParams.Args.Cipher = SL_WLAN_SMART_CONFIG_DEFAULT_CIPHER;
817  Msg.Cmd.SmartConfigParams.Args.PublicKeyLen = SL_WLAN_SMART_CONFIG_KEY_LENGTH;
818 
819  /* copy keys (if exist) after command (one after another) */
820  sl_Memcpy(Msg.Cmd.SmartConfigParams.Key, pSmartConfigKey, SL_WLAN_SMART_CONFIG_KEY_LENGTH);
821  }
822  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlProvisioningCmdCtrl , &Msg, NULL));
823 
824  return (_i16)Msg.Rsp.status;
825 }

§ 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 685 of file wlan.c.

691 {
692  _SlWlanRxFilterAddMsg_u Msg;
693 
694  /* verify that this api is allowed. if not allowed then
695  ignore the API execution and return immediately with an error */
696  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
697 
698  Msg.Cmd.RuleType = RuleType;
699  /* filterId is zero */
700  Msg.Cmd.FilterId = 0;
701  Msg.Cmd.Flags = Flags;
702  sl_Memcpy( &(Msg.Cmd.Rule), pRule, sizeof(SlWlanRxFilterRule_u) );
703  sl_Memcpy( &(Msg.Cmd.Trigger), pTrigger, sizeof(SlWlanRxFilterTrigger_t) );
704  sl_Memcpy( &(Msg.Cmd.Action), pAction, sizeof(SlWlanRxFilterAction_t) );
705  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlWlanRxFilterAddtCmdCtrl, &Msg, NULL) );
706  *pFilterId = Msg.Rsp.FilterId;
707  return (_i16)Msg.Rsp.Status;
708 }

§ 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 738 of file wlan.c.

739 {
740  _SlCmdCtrl_t CmdCtrl = {SL_OPCODE_WLAN_GETRXSTATCOMMAND, 0, (_SlArgSize_t)sizeof(SlWlanGetRxStatResponse_t)};
741  /* Flags paramater is currently not in use */
742  (void)Flags;
743 
744  /* verify that this api is allowed. if not allowed then
745  ignore the API execution and return immediately with an error */
746  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
747 
748  _SlDrvMemZero(pRxStat, (_u16)sizeof(SlWlanGetRxStatResponse_t));
749  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&CmdCtrl, pRxStat, NULL));
750 
751  return 0;
752 }

§ 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
This API is deprecated and should be removed for next release
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(1000); // sleep for 1 sec
    sl_WlanRxStatGet(&rxStat,0); // statistics has been cleared upon read
    Sleep(1000); // sleep for 1 sec
    sl_WlanRxStatGet(&rxStat,0);
    }

Definition at line 716 of file wlan.c.

717 {
718  /* verify that this api is allowed. if not allowed then
719  ignore the API execution and return immediately with an error */
720  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
721 
722  return _SlDrvBasicCmd(SL_OPCODE_WLAN_STARTRXSTATCOMMAND);
723 }

§ 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
This API is deprecated and should be removed for next release

Definition at line 727 of file wlan.c.

728 {
729  /* verify that this api is allowed. if not allowed then
730  ignore the API execution and return immediately with an error */
731  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
732 
733  return _SlDrvBasicCmd(SL_OPCODE_WLAN_STOPRXSTATCOMMAND);
734 }

§ 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
[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
      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_DISABLE_ENT_SERVER_AUTH This option enables to skip server authentication and is valid for one use, when manually connection to an enterprise network
                  - <b>SL_WLAN_CFG_P2P_PARAM_ID</b>
                      - <b>SL_WLAN_P2P_OPT_DEV_TYPE</b> \n
                              Set P2P Device type.Maximum length of 17 characters. Device type is published under P2P I.E, \n
                              allows to make devices easier to recognize. \n
                              In case no device type is set, the default type is "1-0050F204-1"  \n
                              This options takes <b>_u8</b> buffer as parameter
                      - <b>SL_WLAN_P2P_OPT_CHANNEL_N_REGS</b> \n
                             Set P2P Channels. \n
                             listen channel (either 1/6/11 for 2.4GHz) \n
                             listen regulatory class (81 for 2.4GHz)   \n
                             oper channel (either 1/6/11 for 2.4GHz)   \n
                             oper regulatory class (81 for 2.4GHz)     \n
                             listen channel and regulatory class will determine the device listen channel during p2p find listen phase \n
                             oper channel and regulatory class will determine the operating channel preferred by this device (in case it is group owner this will be the operating channel) \n
                             channels should be one of the social channels (1/6/11). In case no listen/oper channel selected, a random 1/6/11 will be selected.
                             This option takes pointer to <b>_u8[4]</b> as parameter

                  - <b>SL_WLAN_RX_FILTERS_ID</b>
                      - <b>SL_WLAN_RX_FILTER_STATE</b> \n
                              Enable or disable filters. The buffer input is SlWlanRxFilterOperationCommandBuff_t\n
                      - <b>SL_WLAN_RX_FILTER_SYS_STATE</b> \n
                              Enable or disable system filters. The buffer input is SlWlanRxFilterSysFiltersSetStateBuff_t\n
                      - <b>SL_WLAN_RX_FILTER_REMOVE</b> \n
                              Remove filters. The buffer input is SlWlanRxFilterOperationCommandBuff_t\n
                      - <b>SL_WLAN_RX_FILTER_STORE</b> \n
                              Save the filters as persistent. \n
                      - <b>SL_WLAN_RX_FILTER_UPDATE_ARGS</b> \n
                              Update filter arguments. The buffer input is SlWlanRxFilterUpdateArgsCommandBuff_t\n
Parameters
[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);

  • 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_SCAN_PARAMS:
    SlWlanScanParamCommand_t ScanParamConfig;
    ScanParamConfig.RssiThreshold = -70;
    ScanParamConfig.ChannelsMask = 0x1FFF;
    sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID,SL_WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS,sizeof(ScanParamConfig),(_u8* ) &ScanParamConfig);

  • 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);

Definition at line 885 of file wlan.c.

886 {
887  _SlWlanCfgSetMsg_u Msg;
888  _SlCmdExt_t CmdExt;
889 
890  /* verify that this api is allowed. if not allowed then
891  ignore the API execution and return immediately with an error */
892  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
893 
894  _SlDrvResetCmdExt(&CmdExt);
895  CmdExt.TxPayload1Len = (_u16)((ConfigLen+3) & (~3));
896  CmdExt.pTxPayload1 = (_u8 *)pValues;
897 
898  Msg.Cmd.ConfigId = ConfigId;
899  Msg.Cmd.ConfigLen = ConfigLen;
900  Msg.Cmd.ConfigOpt = ConfigOpt;
901 
902  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlWlanCfgSetCmdCtrl, &Msg, &CmdExt));
903 
904  return (_i16)Msg.Rsp.status;
905 }

§ 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
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 850 of file wlan.c.

851 {
852  _SlwlanSetModeMsg_u Msg;
853 
854  /* verify that this api is allowed. if not allowed then
855  ignore the API execution and return immediately with an error */
856  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
857 
858  Msg.Cmd.Mode = Mode;
859 
860  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlWlanSetModeCmdCtrl , &Msg, NULL));
861 
862  return (_i16)Msg.Rsp.status;
863 }

Data Structure Documentation

§ SlWlanSmartConfigStartAsyncResponse_t

struct SlWlanSmartConfigStartAsyncResponse_t

Definition at line 453 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 462 of file wlan.h.

Data Fields
_u16 Padding
_u16 Status

§ SlWlanConnFailureAsyncResponse_t

struct SlWlanConnFailureAsyncResponse_t

Definition at line 468 of file wlan.h.

Data Fields
_u16 Padding
_u16 Status

§ SlWlanProvisioningStatusAsyncResponse_t

struct SlWlanProvisioningStatusAsyncResponse_t

Definition at line 474 of file wlan.h.

Data Fields
_u16 Padding
_u16 Status

§ SlWlanEventRxFilterInfo_t

struct SlWlanEventRxFilterInfo_t

Definition at line 493 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 507 of file wlan.h.

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

§ SlWlanEventDisconnect_t

struct SlWlanEventDisconnect_t

Definition at line 515 of file wlan.h.

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

§ SlWlanEventSTAAdded_t

struct SlWlanEventSTAAdded_t

Definition at line 523 of file wlan.h.

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

§ SlWlanEventP2PConnect_t

struct SlWlanEventP2PConnect_t

Definition at line 530 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 541 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 552 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 561 of file wlan.h.

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

§ SlWlanEventP2PConnectFail_t

struct SlWlanEventP2PConnectFail_t

Definition at line 570 of file wlan.h.

Data Fields
_u16 Padding
_u16 Status

§ SlWlanEventProvisioningStatus_t

struct SlWlanEventProvisioningStatus_t

Definition at line 576 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 586 of file wlan.h.

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

§ SlWlanEventData_u

union SlWlanEventData_u

Definition at line 595 of file wlan.h.

Data Fields
SlWlanEventConnect_t Connect
SlWlanEventDisconnect_t Disconnect
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 614 of file wlan.h.

Data Fields
SlWlanEventData_u Data
_u32 Id

§ SlWlanGetRxStatResponse_t

struct SlWlanGetRxStatResponse_t

Definition at line 620 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 633 of file wlan.h.

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

§ SlWlanSecParams_t

struct SlWlanSecParams_t

Definition at line 644 of file wlan.h.

Data Fields
_i8 * Key
_u8 KeyLen
_u8 Type

§ SlWlanSecParamsExt_t

struct SlWlanSecParamsExt_t

Definition at line 651 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 661 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 674 of file wlan.h.

Data Fields
SlWlanEventP2PConnect_t P2PConnect
SlWlanEventConnect_t StaConnect

§ SlWlanConnStatusParam_t

struct SlWlanConnStatusParam_t

Definition at line 689 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 698 of file wlan.h.

Data Fields
_u32 ChannelsMask
_i32 RssiThreshold

§ SlWlanInfoElement_t

struct SlWlanInfoElement_t

Definition at line 704 of file wlan.h.

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

§ SlWlanSetInfoElement_t

struct SlWlanSetInfoElement_t

Definition at line 712 of file wlan.h.

Data Fields
SlWlanInfoElement_t IE
_u8 Index
_u8 Role

§ SlWlanPmPolicyParams_t

struct SlWlanPmPolicyParams_t

Definition at line 719 of file wlan.h.

Data Fields
_u16 MaxSleepTimeMs
_u16 Reserved
_u16 Reserved2
_u16 Reserved3

§ SlWlanRxFilterPatternArg_t

struct SlWlanRxFilterPatternArg_t

Definition at line 747 of file wlan.h.

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

§ SlWlanRxFilterHeaderArg_u

union SlWlanRxFilterHeaderArg_u

Definition at line 804 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 861 of file wlan.h.

Data Fields
_u8 Mask[16]
SlWlanRxFilterHeaderArg_u Value

§ SlWlanRxFilterRuleHeader_t

struct SlWlanRxFilterRuleHeader_t

Definition at line 870 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 888 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 896 of file wlan.h.

Data Fields
SlWlanRxFilterRuleCombination_t Combination
SlWlanRxFilterRuleHeader_t Header

§ SlWlanRxFilterTrigger_t

struct SlWlanRxFilterTrigger_t

Definition at line 941 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 966 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 977 of file wlan.h.

Data Fields
SlWlanRxFilterIdMask_t FilterBitmap
_u8 Padding[4]

§ SlWlanRxFilterUpdateArgsCommandBuff_t

struct SlWlanRxFilterUpdateArgsCommandBuff_t

Definition at line 985 of file wlan.h.

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

§ SlWlanRxFilterRetrieveStateBuff_t

struct SlWlanRxFilterRetrieveStateBuff_t

Definition at line 996 of file wlan.h.

Data Fields
SlWlanRxFilterIdMask_t FilterIdMask

§ SlWlanRxFilterSysFiltersSetStateBuff_t

struct SlWlanRxFilterSysFiltersSetStateBuff_t

Definition at line 1003 of file wlan.h.

Data Fields
SlWlanRxFilterSysFiltersMask_t FilterBitmap

§ SlWlanRxFilterSysFiltersRetrieveStateBuff_t

struct SlWlanRxFilterSysFiltersRetrieveStateBuff_t

Definition at line 1010 of file wlan.h.

Data Fields
SlWlanRxFilterSysFiltersMask_t FilterBitmap