SimpleLink CC3120/CC3220 Host Driver  Version 2.0.1.22
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 73 of file wlan.c.

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

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

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

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

954 {
955  _SlWlanCfgMsgGet_u Msg;
956  _SlCmdExt_t CmdExt;
957 
958  /* verify that this api is allowed. if not allowed then
959  ignore the API execution and return immediately with an error */
960  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
961 
962  if (*pConfigLen == 0)
963  {
964  return SL_EZEROLEN;
965  }
966 
967  _SlDrvResetCmdExt(&CmdExt);
968  CmdExt.RxPayloadLen = (_i16)*pConfigLen;
969  CmdExt.pRxPayload = (_u8 *)pValues;
970  Msg.Cmd.ConfigLen = *pConfigLen;
971  Msg.Cmd.ConfigId = ConfigId;
972  if( pConfigOpt )
973  {
974  Msg.Cmd.ConfigOpt = (_u16)*pConfigOpt;
975  }
976  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlWlanCfgGetCmdCtrl, &Msg, &CmdExt));
977 
978  if( pConfigOpt )
979  {
980  *pConfigOpt = (_u8)Msg.Rsp.ConfigOpt;
981  }
982  if (CmdExt.RxPayloadLen < CmdExt.ActualRxPayloadLen)
983  {
984  *pConfigLen = (_u8)CmdExt.RxPayloadLen;
985  return SL_ESMALLBUF;
986  }
987  else
988  {
989  *pConfigLen = (_u8)CmdExt.ActualRxPayloadLen;
990  }
991 
992 
993  return (_i16)Msg.Rsp.Status;
994 }

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

641 {
642  _i16 retVal = 0;
643  _SlWlanGetNetworkListMsg_u Msg;
644  _SlCmdExt_t CmdExt;
645 
646  /* verify that this api is allowed. if not allowed then
647  ignore the API execution and return immediately with an error */
648  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
649 
650  if (Count == 0)
651  {
652  return SL_EZEROLEN;
653  }
654 
655  _SlDrvResetCmdExt(&CmdExt);
656  CmdExt.RxPayloadLen = (_i16)(sizeof(SlWlanNetworkEntry_t)*(Count));
657  CmdExt.pRxPayload = (_u8 *)pEntries;
658 
659  Msg.Cmd.Index = Index;
660  Msg.Cmd.Count = Count;
661 
662  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlWlanGetNetworkListCtrl, &Msg, &CmdExt));
663  retVal = Msg.Rsp.status;
664 
665  return (_i16)retVal;
666 }
Definition: wlan.h:653

§ 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 lenght
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 inteval = %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 288 of file wlan.c.

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

§ 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, minimun 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 244 of file wlan.c.

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

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

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

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

605 {
606  _SlProfileDelMsg_u Msg;
607 
608  /* verify that this api is allowed. if not allowed then
609  ignore the API execution and return immediately with an error */
610  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
611 
612  Msg.Cmd.Index = (_u8)Index;
613 
614  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlProfileDelCmdCtrl, &Msg, NULL));
615 
616  return (_i16)Msg.Rsp.status;
617 }

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

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

§ 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 (relevent for smart config only)
[in]FlagsCan have the following values:
  • SL_WLAN_PROVISIONING_CMD_FLAG_EXTERNAL_CONFIRMATION - Confirmation phase will be completed externaly 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 806 of file wlan.c.

807 {
808  _SlProvisioningStartMsg_u Msg;
809 
810 
811  /* Verify if we can send this command to the NWP
812  We can send only prov. stop command if command is not allowed */
813  if ((!SL_IS_COMMAND_ALLOWED) && (!SL_IS_PROVISIONING_ACTIVE) && (InactivityTimeoutSec != 0))
814  {
815  /* return with the correct error code */
816  return _SlDrvDriverIsApiAllowed(SL_OPCODE_SILO_WLAN);
817  }
818 
819  /* If there is an API in progress and the timeout is not zero (it means the
820  command is not prov. stop) then abort and return an error code */
821  if (_SlDrvIsApiInProgress() && (InactivityTimeoutSec !=0))
822  {
823  return SL_RET_CODE_API_COMMAND_IN_PROGRESS;
824  }
825 
826 
827  _SlDrvMemZero(&Msg, (_u16)sizeof (_SlProvisioningStartMsg_u));
828 
829  Msg.Cmd.ProvParams.ProvisioningCmd = (_u8)ProvisioningCmd;
830  Msg.Cmd.ProvParams.RequestedRoleAfterSuccess = (_u8)RequestedRoleAfterSuccess;
831  Msg.Cmd.ProvParams.InactivityTimeoutSec = (_u16)InactivityTimeoutSec;
832  Msg.Cmd.ProvParams.Flags = Flags;
833 
834  /* Smart Config parameters */
835  if (NULL != pSmartConfigKey)
836  {
837  Msg.Cmd.SmartConfigParams.Args.GroupIdBitmask = SL_WLAN_SMART_CONFIG_DEFAULT_GROUP;
838  Msg.Cmd.SmartConfigParams.Args.Cipher = SL_WLAN_SMART_CONFIG_DEFAULT_CIPHER;
839  Msg.Cmd.SmartConfigParams.Args.PublicKeyLen = SL_WLAN_SMART_CONFIG_KEY_LENGTH;
840 
841  /* copy keys (if exist) after command (one after another) */
842  sl_Memcpy(SMART_CONFIG_START_PUBLIC_KEY_STRING(&Msg.Cmd.SmartConfigParams.Args), pSmartConfigKey, SL_WLAN_SMART_CONFIG_KEY_LENGTH);
843  }
844  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlProvisioningCmdCtrl , &Msg, NULL));
845 
846  return (_i16)Msg.Rsp.status;
847 }

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

704 {
705 
706 
707  _SlWlanRxFilterAddMsg_u Msg;
708 
709  /* verify that this api is allowed. if not allowed then
710  ignore the API execution and return immediately with an error */
711  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
712 
713  Msg.Cmd.RuleType = RuleType;
714  /* filterId is zero */
715  Msg.Cmd.FilterId = 0;
716  Msg.Cmd.Flags = Flags;
717  sl_Memcpy( &(Msg.Cmd.Rule), pRule, sizeof(SlWlanRxFilterRule_u) );
718  sl_Memcpy( &(Msg.Cmd.Trigger), pTrigger, sizeof(SlWlanRxFilterTrigger_t) );
719  sl_Memcpy( &(Msg.Cmd.Action), pAction, sizeof(SlWlanRxFilterAction_t) );
720  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlWlanRxFilterAddtCmdCtrl, &Msg, NULL) );
721  *pFilterId = Msg.Rsp.FilterId;
722  return (_i16)Msg.Rsp.Status;
723 
724 }

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

756 {
757  _SlCmdCtrl_t CmdCtrl = {SL_OPCODE_WLAN_GETRXSTATCOMMAND, 0, (_SlArgSize_t)sizeof(SlWlanGetRxStatResponse_t)};
758  /* Flags paramater is currently not in use */
759  (void)Flags;
760 
761  /* verify that this api is allowed. if not allowed then
762  ignore the API execution and return immediately with an error */
763  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
764 
765  _SlDrvMemZero(pRxStat, (_u16)sizeof(SlWlanGetRxStatResponse_t));
766  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&CmdCtrl, pRxStat, NULL));
767 
768  return 0;
769 }

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

734 {
735  /* verify that this api is allowed. if not allowed then
736  ignore the API execution and return immediately with an error */
737  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
738 
739  return _SlDrvBasicCmd(SL_OPCODE_WLAN_STARTRXSTATCOMMAND);
740 }

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

745 {
746  /* verify that this api is allowed. if not allowed then
747  ignore the API execution and return immediately with an error */
748  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
749 
750  return _SlDrvBasicCmd(SL_OPCODE_WLAN_STOPRXSTATCOMMAND);
751 }

§ 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 aging 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.RssiThershold = -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 911 of file wlan.c.

912 {
913  _SlWlanCfgSetMsg_u Msg;
914  _SlCmdExt_t CmdExt;
915 
916  /* verify that this api is allowed. if not allowed then
917  ignore the API execution and return immediately with an error */
918  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
919 
920  _SlDrvResetCmdExt(&CmdExt);
921  CmdExt.TxPayload1Len = (_u16)((ConfigLen+3) & (~3));
922  CmdExt.pTxPayload1 = (_u8 *)pValues;
923 
924  Msg.Cmd.ConfigId = ConfigId;
925  Msg.Cmd.ConfigLen = ConfigLen;
926  Msg.Cmd.ConfigOpt = ConfigOpt;
927 
928  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlWlanCfgSetCmdCtrl, &Msg, &CmdExt));
929 
930  return (_i16)Msg.Rsp.status;
931 }

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

874 {
875  _SlwlanSetModeMsg_u Msg;
876 
877  /* verify that this api is allowed. if not allowed then
878  ignore the API execution and return immediately with an error */
879  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
880 
881  Msg.Cmd.Mode = Mode;
882 
883  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlWlanSetModeCmdCtrl , &Msg, NULL));
884 
885  return (_i16)Msg.Rsp.status;
886 }

Data Structure Documentation

§ SlWlanSmartConfigStartAsyncResponse_t

struct SlWlanSmartConfigStartAsyncResponse_t

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

Data Fields
_u16 Padding
_u16 Status

§ SlWlanConnFailureAsyncResponse_t

struct SlWlanConnFailureAsyncResponse_t

Definition at line 474 of file wlan.h.

Data Fields
_u16 Padding
_u16 Status

§ SlWlanProvisioningStatusAsyncResponse_t

struct SlWlanProvisioningStatusAsyncResponse_t

Definition at line 480 of file wlan.h.

Data Fields
_u16 Padding
_u16 Status

§ SlWlanEventRxFilterInfo_t

struct SlWlanEventRxFilterInfo_t

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

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

§ SlWlanEventDisconnect_t

struct SlWlanEventDisconnect_t

Definition at line 523 of file wlan.h.

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

§ SlWlanEventSTAAdded_t

struct SlWlanEventSTAAdded_t

Definition at line 531 of file wlan.h.

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

§ SlWlanEventP2PConnect_t

struct SlWlanEventP2PConnect_t

Definition at line 538 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 549 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 563 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 573 of file wlan.h.

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

§ SlWlanEventP2PConnectFail_t

struct SlWlanEventP2PConnectFail_t

Definition at line 583 of file wlan.h.

Data Fields
_u16 Padding
_u16 Status

§ SlWlanEventProvisioningStatus_t

struct SlWlanEventProvisioningStatus_t

Definition at line 590 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 600 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 610 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 630 of file wlan.h.

Data Fields
SlWlanEventData_u Data
_u32 Id

§ SlWlanGetRxStatResponse_t

struct SlWlanGetRxStatResponse_t

Definition at line 637 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 653 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 664 of file wlan.h.

Data Fields
_i8 * Key
_u8 KeyLen
_u8 Type

§ SlWlanSecParamsExt_t

struct SlWlanSecParamsExt_t

Definition at line 671 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 681 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 695 of file wlan.h.

Data Fields
SlWlanEventP2PConnect_t P2PConnect
SlWlanEventConnect_t StaConnect

§ SlWlanConnStatusParam_t

struct SlWlanConnStatusParam_t

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

Data Fields
_u32 ChannelsMask
_i32 RssiThershold

§ SlWlanInfoElement_t

struct SlWlanInfoElement_t

Definition at line 726 of file wlan.h.

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

§ SlWlanSetInfoElement_t

struct SlWlanSetInfoElement_t

Definition at line 734 of file wlan.h.

Data Fields
SlWlanInfoElement_t IE
_u8 Index
_u8 Role

§ SlWlanPmPolicyParams_t

struct SlWlanPmPolicyParams_t

Definition at line 742 of file wlan.h.

Data Fields
_u16 MaxSleepTimeMs
_u16 Reserved
_u16 Reserved2
_u16 Reserved3

§ SlWlanRxFilterPatternArg_t

struct SlWlanRxFilterPatternArg_t

Definition at line 774 of file wlan.h.

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

§ SlWlanRxFilterHeaderArg_u

union SlWlanRxFilterHeaderArg_u

Definition at line 835 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
_u16 Port[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS]

§ SlWlanRxFilterRuleHeaderArgs_t

struct SlWlanRxFilterRuleHeaderArgs_t

Definition at line 893 of file wlan.h.

Data Fields
_u8 Mask[16]
SlWlanRxFilterHeaderArg_u Value

§ SlWlanRxFilterRuleHeader_t

struct SlWlanRxFilterRuleHeader_t

Definition at line 902 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 922 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 931 of file wlan.h.

Data Fields
SlWlanRxFilterRuleCombination_t Combination
SlWlanRxFilterRuleHeader_t Header

§ SlWlanRxFilterTrigger_t

struct SlWlanRxFilterTrigger_t

Definition at line 980 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 1008 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 1019 of file wlan.h.

Data Fields
SlWlanRxFilterIdMask_t FilterBitmap
_u8 Padding[4]

§ SlWlanRxFilterUpdateArgsCommandBuff_t

struct SlWlanRxFilterUpdateArgsCommandBuff_t

Definition at line 1027 of file wlan.h.

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

§ SlWlanRxFilterRetrieveStateBuff_t

struct SlWlanRxFilterRetrieveStateBuff_t

Definition at line 1039 of file wlan.h.

Data Fields
SlWlanRxFilterIdMask_t FilterIdMask

§ SlWlanRxFilterSysFiltersSetStateBuff_t

struct SlWlanRxFilterSysFiltersSetStateBuff_t

Definition at line 1046 of file wlan.h.

Data Fields
SlWlanRxFilterSysFiltersMask_t FilterBitmap

§ SlWlanRxFilterSysFiltersRetrieveStateBuff_t

struct SlWlanRxFilterSysFiltersRetrieveStateBuff_t

Definition at line 1053 of file wlan.h.

Data Fields
SlWlanRxFilterSysFiltersMask_t FilterBitmap