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

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

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

195 {
196  /* verify that this api is allowed. if not allowed then
197  ignore the API execution and return immediately with an error */
198  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
199 
200  return _SlDrvBasicCmd(SL_OPCODE_WLAN_WLANDISCONNECTCOMMAND);
201 }

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

932 {
933  _SlWlanCfgMsgGet_u Msg;
934  _SlCmdExt_t CmdExt;
935 
936  /* verify that this api is allowed. if not allowed then
937  ignore the API execution and return immediately with an error */
938  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
939 
940  if (*pConfigLen == 0)
941  {
942  return SL_EZEROLEN;
943  }
944 
945  _SlDrvResetCmdExt(&CmdExt);
946  CmdExt.RxPayloadLen = (_i16)*pConfigLen;
947  CmdExt.pRxPayload = (_u8 *)pValues;
948  Msg.Cmd.ConfigLen = *pConfigLen;
949  Msg.Cmd.ConfigId = ConfigId;
950  if( pConfigOpt )
951  {
952  Msg.Cmd.ConfigOpt = (_u16)*pConfigOpt;
953  }
954  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlWlanCfgGetCmdCtrl, &Msg, &CmdExt));
955 
956  if( pConfigOpt )
957  {
958  *pConfigOpt = (_u8)Msg.Rsp.ConfigOpt;
959  }
960  if (CmdExt.RxPayloadLen < CmdExt.ActualRxPayloadLen)
961  {
962  *pConfigLen = (_u8)CmdExt.RxPayloadLen;
963  return SL_ESMALLBUF;
964  }
965  else
966  {
967  *pConfigLen = (_u8)CmdExt.ActualRxPayloadLen;
968  }
969 
970 
971  return (_i16)Msg.Rsp.Status;
972 }

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

619 {
620  _i16 retVal = 0;
621  _SlWlanGetNetworkListMsg_u Msg;
622  _SlCmdExt_t CmdExt;
623 
624  /* verify that this api is allowed. if not allowed then
625  ignore the API execution and return immediately with an error */
626  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
627 
628  if (Count == 0)
629  {
630  return SL_EZEROLEN;
631  }
632 
633  _SlDrvResetCmdExt(&CmdExt);
634  CmdExt.RxPayloadLen = (_i16)(sizeof(SlWlanNetworkEntry_t)*(Count));
635  CmdExt.pRxPayload = (_u8 *)pEntries;
636 
637  Msg.Cmd.Index = Index;
638  Msg.Cmd.Count = Count;
639 
640  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlWlanGetNetworkListCtrl, &Msg, &CmdExt));
641  retVal = Msg.Rsp.status;
642 
643  return (_i16)retVal;
644 }
Definition: wlan.h:630

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

267 {
268  _SlPolicyGetMsg_u Msg;
269  _SlCmdExt_t CmdExt;
270 
271  /* verify that this api is allowed. if not allowed then
272  ignore the API execution and return immediately with an error */
273  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
274 
275  if (*pValLen == 0)
276  {
277  return SL_EZEROLEN;
278  }
279 
280  _SlDrvResetCmdExt(&CmdExt);
281  CmdExt.RxPayloadLen = (_i16)(*pValLen);
282  CmdExt.pRxPayload = pVal;
283 
284  Msg.Cmd.PolicyType = Type;
285 
286  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlPolicyGetCmdCtrl, &Msg, &CmdExt));
287 
288 
289  if (CmdExt.RxPayloadLen < CmdExt.ActualRxPayloadLen)
290  {
291  *pValLen = Msg.Rsp.PolicyOptionLen;
292  return SL_ESMALLBUF;
293  }
294  else
295  {
296  /* no pointer valus, fill the results into _i8 */
297  *pValLen = (_u8)CmdExt.ActualRxPayloadLen;
298  *pPolicy = Msg.Rsp.PolicyOption;
299 
300  if( 0 == CmdExt.ActualRxPayloadLen )
301  {
302  *pValLen = 1;
303  }
304 
305  }
306  return (_i16)SL_OS_RET_CODE_OK;
307 }

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

223 {
224  _SlPolicyMsg_u Msg;
225  _SlCmdExt_t CmdExt;
226 
227  /* verify that this api is allowed. if not allowed then
228  ignore the API execution and return immediately with an error */
229  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
230 
231  _SlDrvResetCmdExt(&CmdExt);
232  CmdExt.TxPayload1Len = ValLen;
233  CmdExt.pTxPayload1 = (_u8 *)pVal;
234 
235 
236  Msg.Cmd.PolicyType = Type;
237  Msg.Cmd.PolicyOption = Policy;
238  Msg.Cmd.PolicyOptionLen = ValLen;
239 
240  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlPolicySetCmdCtrl, &Msg, &CmdExt));
241 
242  return (_i16)Msg.Rsp.status;
243 }

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

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

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

583 {
584  _SlProfileDelMsg_u Msg;
585 
586  /* verify that this api is allowed. if not allowed then
587  ignore the API execution and return immediately with an error */
588  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
589 
590  Msg.Cmd.Index = (_u8)Index;
591 
592  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlProfileDelCmdCtrl, &Msg, NULL));
593 
594  return (_i16)Msg.Rsp.status;
595 }

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

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

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

785 {
786  _SlProvisioningStartMsg_u Msg;
787 
788 
789  /* Verify if we can send this command to the NWP
790  We can send only prov. stop command if command is not allowed */
791  if ((!SL_IS_COMMAND_ALLOWED) && (!SL_IS_PROVISIONING_ACTIVE) && (InactivityTimeoutSec != 0))
792  {
793  /* return with the correct error code */
794  return _SlDrvDriverIsApiAllowed(SL_OPCODE_SILO_WLAN);
795  }
796 
797  /* If there is an API in progress and the timeout is not zero (it means the
798  command is not prov. stop) then abort and return an error code */
799  if (_SlDrvIsApiInProgress() && (InactivityTimeoutSec !=0))
800  {
801  return SL_RET_CODE_API_COMMAND_IN_PROGRESS;
802  }
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(SMART_CONFIG_START_PUBLIC_KEY_STRING(&Msg.Cmd.SmartConfigParams.Args), 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 676 of file wlan.c.

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

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

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

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

712 {
713  /* verify that this api is allowed. if not allowed then
714  ignore the API execution and return immediately with an error */
715  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
716 
717  return _SlDrvBasicCmd(SL_OPCODE_WLAN_STARTRXSTATCOMMAND);
718 }

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

723 {
724  /* verify that this api is allowed. if not allowed then
725  ignore the API execution and return immediately with an error */
726  VERIFY_API_ALLOWED(SL_OPCODE_SILO_WLAN);
727 
728  return _SlDrvBasicCmd(SL_OPCODE_WLAN_STOPRXSTATCOMMAND);
729 }

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

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

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

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

Data Structure Documentation

§ SlWlanSmartConfigStartAsyncResponse_t

struct SlWlanSmartConfigStartAsyncResponse_t

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

Data Fields
_u16 Padding
_u16 Status

§ SlWlanConnFailureAsyncResponse_t

struct SlWlanConnFailureAsyncResponse_t

Definition at line 451 of file wlan.h.

Data Fields
_u16 Padding
_u16 Status

§ SlWlanProvisioningStatusAsyncResponse_t

struct SlWlanProvisioningStatusAsyncResponse_t

Definition at line 457 of file wlan.h.

Data Fields
_u16 Padding
_u16 Status

§ SlWlanEventRxFilterInfo_t

struct SlWlanEventRxFilterInfo_t

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

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

§ SlWlanEventDisconnect_t

struct SlWlanEventDisconnect_t

Definition at line 500 of file wlan.h.

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

§ SlWlanEventSTAAdded_t

struct SlWlanEventSTAAdded_t

Definition at line 508 of file wlan.h.

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

§ SlWlanEventP2PConnect_t

struct SlWlanEventP2PConnect_t

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

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

§ SlWlanEventP2PConnectFail_t

struct SlWlanEventP2PConnectFail_t

Definition at line 560 of file wlan.h.

Data Fields
_u16 Padding
_u16 Status

§ SlWlanEventProvisioningStatus_t

struct SlWlanEventProvisioningStatus_t

Definition at line 567 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 577 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 587 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 607 of file wlan.h.

Data Fields
SlWlanEventData_u Data
_u32 Id

§ SlWlanGetRxStatResponse_t

struct SlWlanGetRxStatResponse_t

Definition at line 614 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 630 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 641 of file wlan.h.

Data Fields
_i8 * Key
_u8 KeyLen
_u8 Type

§ SlWlanSecParamsExt_t

struct SlWlanSecParamsExt_t

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

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

§ SlWlanConnectionInfo_u

union SlWlanConnectionInfo_u

Definition at line 672 of file wlan.h.

Data Fields
SlWlanEventP2PConnect_t P2PConnect
SlWlanEventConnect_t StaConnect

§ SlWlanConnStatusParam_t

struct SlWlanConnStatusParam_t

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

Data Fields
_u32 ChannelsMask
_i32 RssiThershold

§ SlWlanInfoElement_t

struct SlWlanInfoElement_t

Definition at line 703 of file wlan.h.

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

§ SlWlanSetInfoElement_t

struct SlWlanSetInfoElement_t

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

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

§ SlWlanRxFilterHeaderArg_u

union SlWlanRxFilterHeaderArg_u

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

Data Fields
_u8 Mask[16]
SlWlanRxFilterHeaderArg_u Value

§ SlWlanRxFilterRuleHeader_t

struct SlWlanRxFilterRuleHeader_t

Definition at line 879 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 899 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 908 of file wlan.h.

Data Fields
SlWlanRxFilterRuleCombination_t Combination
SlWlanRxFilterRuleHeader_t Header

§ SlWlanRxFilterTrigger_t

struct SlWlanRxFilterTrigger_t

Definition at line 957 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 985 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 996 of file wlan.h.

Data Fields
SlWlanRxFilterIdMask_t FilterBitmap
_u8 Padding[4]

§ SlWlanRxFilterUpdateArgsCommandBuff_t

struct SlWlanRxFilterUpdateArgsCommandBuff_t

Definition at line 1004 of file wlan.h.

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

§ SlWlanRxFilterRetrieveStateBuff_t

struct SlWlanRxFilterRetrieveStateBuff_t

Definition at line 1016 of file wlan.h.

Data Fields
SlWlanRxFilterIdMask_t FilterIdMask

§ SlWlanRxFilterSysFiltersSetStateBuff_t

struct SlWlanRxFilterSysFiltersSetStateBuff_t

Definition at line 1023 of file wlan.h.

Data Fields
SlWlanRxFilterSysFiltersMask_t FilterBitmap

§ SlWlanRxFilterSysFiltersRetrieveStateBuff_t

struct SlWlanRxFilterSysFiltersRetrieveStateBuff_t

Definition at line 1030 of file wlan.h.

Data Fields
SlWlanRxFilterSysFiltersMask_t FilterBitmap