XDK API  3.6.0
Documentation
Data Structures | Macros | Typedefs | Enumerations | Functions

Device Interface. More...

+ Collaboration diagram for Device:

Data Structures

struct  _SlPartialVersion
 
struct  sl_DeviceDriverErrorReport
 
struct  sl_DeviceReport
 
struct  sl_DeviceReportAbort
 
struct  SlDateTime_t
 
struct  SlDeviceEvent_t
 
union  SlDeviceEventData_u
 
struct  SlVersionFull
 

Macros

#define EVENT_DROPPED_DEVICE_ASYNC_GENERAL_ERROR   (0x00000001L)
 
#define EVENT_DROPPED_NETAPP_IP_LEASED   (0x00000004L)
 
#define EVENT_DROPPED_NETAPP_IP_RELEASED   (0x00000008L)
 
#define EVENT_DROPPED_NETAPP_IPACQUIRED   (0x00000001L)
 
#define EVENT_DROPPED_NETAPP_IPACQUIRED_V6   (0x00000002L)
 
#define EVENT_DROPPED_SOCKET_TXFAILEDASYNCRESPONSE   (0x00000001L)
 
#define EVENT_DROPPED_WLAN_STA_CONNECTED   (0x00000004L)
 
#define EVENT_DROPPED_WLAN_STA_DISCONNECTED   (0x00000008L)
 
#define EVENT_DROPPED_WLAN_WLANASYNCDISCONNECTEDRESPONSE   (0x00000002L)
 
#define EVENT_DROPPED_WLAN_WLANASYNCONNECTEDRESPONSE   (0x00000001L)
 
#define SL_API_ABORTED   (-100)
 
#define SL_BAD_INTERFACE   (-2004)
 
#define SL_DEVICE_FATAL_ERROR_EVENT   SL_DEVICE_GENERAL_ERROR_EVENT
 
#define SL_DEVICE_GENERAL_CONFIGURATION   (1)
 
#define SL_DEVICE_GENERAL_CONFIGURATION_DATE_TIME   (11)
 
#define SL_DEVICE_GENERAL_VERSION   (12)
 
#define SL_DEVICE_STATUS   (2)
 
#define SL_ERROR_CON_MGMT_STATUS_AP_DEAUTHENTICATE   SL_GENERAL_ERROR_CON_MGMT_STATUS_AP_DEAUTHENTICATE
 
#define SL_ERROR_CON_MGMT_STATUS_AP_DISASSOCIATE   SL_GENERAL_ERROR_CON_MGMT_STATUS_AP_DISASSOCIATE
 
#define SL_ERROR_CON_MGMT_STATUS_ASSOC_REJECT   SL_GENERAL_ERROR_CON_MGMT_STATUS_ASSOC_REJECT
 
#define SL_ERROR_CON_MGMT_STATUS_AUTH_REJECT   SL_GENERAL_ERROR_CON_MGMT_STATUS_AUTH_REJECT
 
#define SL_ERROR_CON_MGMT_STATUS_DISCONNECT_DURING_CONNECT   SL_GENERAL_ERROR_CON_MGMT_STATUS_DISCONNECT_DURING_CONNECT
 
#define SL_ERROR_CON_MGMT_STATUS_MIC_FAILURE   SL_GENERAL_ERROR_CON_MGMT_STATUS_MIC_FAILURE
 
#define SL_ERROR_CON_MGMT_STATUS_ROAMING_TRIGGER   SL_GENERAL_ERROR_CON_MGMT_STATUS_ROAMING_TRIGGER
 
#define SL_ERROR_CON_MGMT_STATUS_ROC_FAILURE   SL_GENERAL_ERROR_CON_MGMT_STATUS_ROC_FAILURE
 
#define SL_ERROR_CON_MGMT_STATUS_SECURITY_FAILURE   SL_GENERAL_ERROR_CON_MGMT_STATUS_SECURITY_FAILURE
 
#define SL_ERROR_CON_MGMT_STATUS_SG_RESELECT   SL_GENERAL_ERROR_CON_MGMT_STATUS_SG_RESELECT
 
#define SL_ERROR_CON_MGMT_STATUS_UNSPECIFIED   SL_GENERAL_ERROR_CON_MGMT_STATUS_UNSPECIFIED
 
#define SL_ERROR_DHCP_CLIENT_RENEW_FAILED   (-100) /* DHCP client error */
 
#define SL_ERROR_DHCP_SERVER_ENABLE_FAILED   (-83) /* DHCP server enable failed */
 
#define SL_ERROR_FS_FILE_TABLE_LOAD_FAILED   (-77) /* init file system failed */
 
#define SL_ERROR_GENERAL_ERROR   (-127)
 
#define SL_ERROR_HOSTAPD_BSSID_VALIDATION_ERROR   (-79) /* Ap configurations BSSID error */
 
#define SL_ERROR_HOSTAPD_FAILED_TO_SETUP_INTERFACE   (-80) /* Ap configurations interface error */
 
#define SL_ERROR_HOSTAPD_INIT_FAIL   (-73) /* init error code */
 
#define SL_ERROR_HOSTAPD_INIT_IF_FAIL   (-74) /* init error code */
 
#define SL_ERROR_HTTP_SERVER_ENABLE_FAILED   (-82) /* HTTP server enable failed */
 
#define SL_ERROR_ILLEGAL_CHANNEL   (-61) /* supplicant error */
 
#define SL_ERROR_LENGTH_ERROR_PREFIX   (-116) /* Uart header length error */
 
#define SL_ERROR_MDNS_CREATE_FAIL   (-121) /* mDNS create failed */
 
#define SL_ERROR_MDNS_ENABLE_FAIL   (-81) /* mDNS enable failed */
 
#define SL_ERROR_PREFERRED_NETWORK_LIST_FULL   (-93) /* supplicant error */
 
#define SL_ERROR_PREFERRED_NETWORKS_FILE_LOAD_FAILED   (-78) /* init file system failed */
 
#define SL_ERROR_PREFERRED_NETWORKS_FILE_WRITE_FAILED   (-94) /* supplicant error */
 
#define SL_ERROR_STATIC_ADDR_SUBNET_ERROR   (-60) /* network stack error*/
 
#define SL_ERROR_SUPPLICANT_ERROR   (-72) /* init error code */
 
#define SL_ERROR_WAKELOCK_ERROR_PREFIX   (-115) /* Wake lock expired */
 
#define SL_ERROR_WLAN_DRV_INIT_FAIL   (-75) /* init error code */
 
#define SL_ERROR_WLAN_DRV_START_FAIL   (-76) /* wlan start error */
 
#define SL_ESMALLBUF   (-2001)
 
#define SL_EVENT_CLASS_BSD   (3)
 
#define SL_EVENT_CLASS_DEVICE   (1)
 
#define SL_EVENT_CLASS_FS   (6)
 
#define SL_EVENT_CLASS_GLOBAL   (0)
 
#define SL_EVENT_CLASS_NETAPP   (4)
 
#define SL_EVENT_CLASS_NETCFG   (5)
 
#define SL_EVENT_CLASS_WLAN   (2)
 
#define SL_EZEROLEN   (-2002)
 
#define SL_GENERAL_ERROR_CON_MGMT_STATUS_AP_DEAUTHENTICATE   (-106)
 
#define SL_GENERAL_ERROR_CON_MGMT_STATUS_AP_DISASSOCIATE   (-107)
 
#define SL_GENERAL_ERROR_CON_MGMT_STATUS_ASSOC_REJECT   (-104)
 
#define SL_GENERAL_ERROR_CON_MGMT_STATUS_AUTH_REJECT   (-103)
 
#define SL_GENERAL_ERROR_CON_MGMT_STATUS_DISCONNECT_DURING_CONNECT   (-109)
 
#define SL_GENERAL_ERROR_CON_MGMT_STATUS_MIC_FAILURE   (-112)
 
#define SL_GENERAL_ERROR_CON_MGMT_STATUS_ROAMING_TRIGGER   (-108)
 
#define SL_GENERAL_ERROR_CON_MGMT_STATUS_ROC_FAILURE   (-111)
 
#define SL_GENERAL_ERROR_CON_MGMT_STATUS_SECURITY_FAILURE   (-105)
 
#define SL_GENERAL_ERROR_CON_MGMT_STATUS_SG_RESELECT   (-110)
 
#define SL_GENERAL_ERROR_CON_MGMT_STATUS_UNSPECIFIED   (-102)
 
#define SL_INVALPARAM   (-2003)
 
#define SL_NETAPP_HTTPGETTOKENVALUE_EVENT   (1)
 
#define SL_NETAPP_HTTPPOSTTOKENVALUE_EVENT   (2)
 
#define SL_NETAPP_IP_LEASED_EVENT   (3)
 
#define SL_NETAPP_IP_RELEASED_EVENT   (4)
 
#define SL_NETAPP_IPV4_IPACQUIRED_EVENT   (1)
 
#define SL_NETAPP_IPV6_IPACQUIRED_EVENT   (2)
 
#define SL_POOL_IS_EMPTY   (-2000)
 
#define SL_SOCKET_ASYNC_EVENT   (2)
 
#define SL_SOCKET_TX_FAILED_EVENT   (1)
 
#define SL_WLAN_CONNECT_EVENT   (1)
 
#define SL_WLAN_CONNECTION_FAILED_EVENT   (9)
 
#define SL_WLAN_DISCONNECT_EVENT   (2)
 
#define SL_WLAN_P2P_DEV_FOUND_EVENT   (7)
 
#define SL_WLAN_P2P_NEG_REQ_RECEIVED_EVENT   (8)
 
#define SL_WLAN_SMART_CONFIG_COMPLETE_EVENT   (3)
 
#define SL_WLAN_SMART_CONFIG_STOP_EVENT   (4)
 
#define SL_WLAN_STA_CONNECTED_EVENT   (5)
 
#define SL_WLAN_STA_DISCONNECTED_EVENT   (6)
 
#define STATUS_DEVICE_SMART_CONFIG_ACTIVE   (0x80000000L)
 
#define STATUS_WLAN_STA_CONNECTED   (0x80000000L)
 

Typedefs

typedef void(* P_INIT_CALLBACK )(_u32 Status)
 

Enumerations

enum  SlDeviceDriverError_e
 
enum  SlDriverAPIWithTimeout_e
 
enum  SlErrorSender_e
 

Functions

_i16 sl_Start (const void *pIfHdl, _i8 *pDevName, const P_INIT_CALLBACK pInitCallBack)
 Start the SimpleLink device. More...
 
_i16 sl_Stop (const _u16 timeout)
 Stop the SimpleLink device. More...
 
void sl_Task (void)
 Internal function for setting device configurations. More...
 

Detailed Description


Data Structure Documentation

struct _SlPartialVersion

Data Fields

_u32 ChipId
 
_u32 FwVersion [4]
 
_u8 PhyVersion [4]
 

Field Documentation

_u32 ChipId
_u32 FwVersion[4]
_u8 PhyVersion[4]
struct sl_DeviceDriverErrorReport

Data Fields

_u32 info
 

Field Documentation

_u32 info
struct sl_DeviceReport

Data Fields

SlErrorSender_e sender
 
_i8 status
 

Field Documentation

_i8 status
struct sl_DeviceReportAbort

Data Fields

_u32 AbortData
 
_u32 AbortType
 

Field Documentation

_u32 AbortData
_u32 AbortType
struct SlDateTime_t

Data Fields

_u32 reserved [3]
 
_u32 sl_tm_day
 
_u32 sl_tm_hour
 
_u32 sl_tm_min
 
_u32 sl_tm_mon
 
_u32 sl_tm_sec
 
_u32 sl_tm_week_day
 
_u32 sl_tm_year
 
_u32 sl_tm_year_day
 

Field Documentation

_u32 reserved[3]
_u32 sl_tm_day
_u32 sl_tm_hour
_u32 sl_tm_min
_u32 sl_tm_mon
_u32 sl_tm_sec
_u32 sl_tm_week_day
_u32 sl_tm_year
_u32 sl_tm_year_day
struct SlDeviceEvent_t
+ Collaboration diagram for SlDeviceEvent_t:

Data Fields

SlDeviceDriverError_e Event
 
SlDeviceEventData_u EventData
 

Field Documentation

union SlDeviceEventData_u
+ Collaboration diagram for SlDeviceEventData_u:

Data Fields

sl_DeviceDriverErrorReport deviceDriverReport
 
sl_DeviceReport deviceEvent
 
sl_DeviceReportAbort deviceReport
 

Field Documentation

sl_DeviceDriverErrorReport deviceDriverReport
sl_DeviceReport deviceEvent
sl_DeviceReportAbort deviceReport
struct SlVersionFull
+ Collaboration diagram for SlVersionFull:

Data Fields

_SlPartialVersion ChipFwAndPhyVersion
 
_u32 NwpVersion [4]
 
_u16 Padding
 
_u16 RomVersion
 

Field Documentation

_SlPartialVersion ChipFwAndPhyVersion
_u32 NwpVersion[4]
_u16 Padding
_u16 RomVersion

Macro Definition Documentation

#define EVENT_DROPPED_DEVICE_ASYNC_GENERAL_ERROR   (0x00000001L)
#define EVENT_DROPPED_NETAPP_IP_LEASED   (0x00000004L)
#define EVENT_DROPPED_NETAPP_IP_RELEASED   (0x00000008L)
#define EVENT_DROPPED_NETAPP_IPACQUIRED   (0x00000001L)
#define EVENT_DROPPED_NETAPP_IPACQUIRED_V6   (0x00000002L)
#define EVENT_DROPPED_SOCKET_TXFAILEDASYNCRESPONSE   (0x00000001L)
#define EVENT_DROPPED_WLAN_STA_CONNECTED   (0x00000004L)
#define EVENT_DROPPED_WLAN_STA_DISCONNECTED   (0x00000008L)
#define EVENT_DROPPED_WLAN_WLANASYNCDISCONNECTEDRESPONSE   (0x00000002L)
#define EVENT_DROPPED_WLAN_WLANASYNCONNECTEDRESPONSE   (0x00000001L)
#define SL_API_ABORTED   (-100)
#define SL_BAD_INTERFACE   (-2004)
#define SL_DEVICE_FATAL_ERROR_EVENT   SL_DEVICE_GENERAL_ERROR_EVENT
#define SL_DEVICE_GENERAL_CONFIGURATION   (1)
#define SL_DEVICE_GENERAL_CONFIGURATION_DATE_TIME   (11)
#define SL_DEVICE_GENERAL_VERSION   (12)
#define SL_DEVICE_STATUS   (2)
#define SL_ERROR_CON_MGMT_STATUS_AP_DEAUTHENTICATE   SL_GENERAL_ERROR_CON_MGMT_STATUS_AP_DEAUTHENTICATE
#define SL_ERROR_CON_MGMT_STATUS_AP_DISASSOCIATE   SL_GENERAL_ERROR_CON_MGMT_STATUS_AP_DISASSOCIATE
#define SL_ERROR_CON_MGMT_STATUS_ASSOC_REJECT   SL_GENERAL_ERROR_CON_MGMT_STATUS_ASSOC_REJECT
#define SL_ERROR_CON_MGMT_STATUS_AUTH_REJECT   SL_GENERAL_ERROR_CON_MGMT_STATUS_AUTH_REJECT
#define SL_ERROR_CON_MGMT_STATUS_DISCONNECT_DURING_CONNECT   SL_GENERAL_ERROR_CON_MGMT_STATUS_DISCONNECT_DURING_CONNECT
#define SL_ERROR_CON_MGMT_STATUS_MIC_FAILURE   SL_GENERAL_ERROR_CON_MGMT_STATUS_MIC_FAILURE
#define SL_ERROR_CON_MGMT_STATUS_ROAMING_TRIGGER   SL_GENERAL_ERROR_CON_MGMT_STATUS_ROAMING_TRIGGER
#define SL_ERROR_CON_MGMT_STATUS_ROC_FAILURE   SL_GENERAL_ERROR_CON_MGMT_STATUS_ROC_FAILURE
#define SL_ERROR_CON_MGMT_STATUS_SECURITY_FAILURE   SL_GENERAL_ERROR_CON_MGMT_STATUS_SECURITY_FAILURE
#define SL_ERROR_CON_MGMT_STATUS_SG_RESELECT   SL_GENERAL_ERROR_CON_MGMT_STATUS_SG_RESELECT
#define SL_ERROR_CON_MGMT_STATUS_UNSPECIFIED   SL_GENERAL_ERROR_CON_MGMT_STATUS_UNSPECIFIED
#define SL_ERROR_DHCP_CLIENT_RENEW_FAILED   (-100) /* DHCP client error */
#define SL_ERROR_DHCP_SERVER_ENABLE_FAILED   (-83) /* DHCP server enable failed */
#define SL_ERROR_FS_FILE_TABLE_LOAD_FAILED   (-77) /* init file system failed */
#define SL_ERROR_GENERAL_ERROR   (-127)
#define SL_ERROR_HOSTAPD_BSSID_VALIDATION_ERROR   (-79) /* Ap configurations BSSID error */
#define SL_ERROR_HOSTAPD_FAILED_TO_SETUP_INTERFACE   (-80) /* Ap configurations interface error */
#define SL_ERROR_HOSTAPD_INIT_FAIL   (-73) /* init error code */
#define SL_ERROR_HOSTAPD_INIT_IF_FAIL   (-74) /* init error code */
#define SL_ERROR_HTTP_SERVER_ENABLE_FAILED   (-82) /* HTTP server enable failed */
#define SL_ERROR_ILLEGAL_CHANNEL   (-61) /* supplicant error */
#define SL_ERROR_LENGTH_ERROR_PREFIX   (-116) /* Uart header length error */
#define SL_ERROR_MDNS_CREATE_FAIL   (-121) /* mDNS create failed */
#define SL_ERROR_MDNS_ENABLE_FAIL   (-81) /* mDNS enable failed */
#define SL_ERROR_PREFERRED_NETWORK_LIST_FULL   (-93) /* supplicant error */
#define SL_ERROR_PREFERRED_NETWORKS_FILE_LOAD_FAILED   (-78) /* init file system failed */
#define SL_ERROR_PREFERRED_NETWORKS_FILE_WRITE_FAILED   (-94) /* supplicant error */
#define SL_ERROR_STATIC_ADDR_SUBNET_ERROR   (-60) /* network stack error*/
#define SL_ERROR_SUPPLICANT_ERROR   (-72) /* init error code */
#define SL_ERROR_WAKELOCK_ERROR_PREFIX   (-115) /* Wake lock expired */
#define SL_ERROR_WLAN_DRV_INIT_FAIL   (-75) /* init error code */
#define SL_ERROR_WLAN_DRV_START_FAIL   (-76) /* wlan start error */
#define SL_ESMALLBUF   (-2001)
#define SL_EVENT_CLASS_BSD   (3)
#define SL_EVENT_CLASS_DEVICE   (1)
#define SL_EVENT_CLASS_FS   (6)
#define SL_EVENT_CLASS_GLOBAL   (0)
#define SL_EVENT_CLASS_NETAPP   (4)
#define SL_EVENT_CLASS_NETCFG   (5)
#define SL_EVENT_CLASS_WLAN   (2)
#define SL_EZEROLEN   (-2002)
#define SL_GENERAL_ERROR_CON_MGMT_STATUS_AP_DEAUTHENTICATE   (-106)
#define SL_GENERAL_ERROR_CON_MGMT_STATUS_AP_DISASSOCIATE   (-107)
#define SL_GENERAL_ERROR_CON_MGMT_STATUS_ASSOC_REJECT   (-104)
#define SL_GENERAL_ERROR_CON_MGMT_STATUS_AUTH_REJECT   (-103)
#define SL_GENERAL_ERROR_CON_MGMT_STATUS_DISCONNECT_DURING_CONNECT   (-109)
#define SL_GENERAL_ERROR_CON_MGMT_STATUS_MIC_FAILURE   (-112)
#define SL_GENERAL_ERROR_CON_MGMT_STATUS_ROAMING_TRIGGER   (-108)
#define SL_GENERAL_ERROR_CON_MGMT_STATUS_ROC_FAILURE   (-111)
#define SL_GENERAL_ERROR_CON_MGMT_STATUS_SECURITY_FAILURE   (-105)
#define SL_GENERAL_ERROR_CON_MGMT_STATUS_SG_RESELECT   (-110)
#define SL_GENERAL_ERROR_CON_MGMT_STATUS_UNSPECIFIED   (-102)
#define SL_INVALPARAM   (-2003)
#define SL_NETAPP_HTTPGETTOKENVALUE_EVENT   (1)
#define SL_NETAPP_HTTPPOSTTOKENVALUE_EVENT   (2)
#define SL_NETAPP_IP_LEASED_EVENT   (3)
#define SL_NETAPP_IP_RELEASED_EVENT   (4)
#define SL_NETAPP_IPV4_IPACQUIRED_EVENT   (1)
#define SL_NETAPP_IPV6_IPACQUIRED_EVENT   (2)
#define SL_POOL_IS_EMPTY   (-2000)
#define SL_SOCKET_ASYNC_EVENT   (2)
#define SL_SOCKET_TX_FAILED_EVENT   (1)
#define SL_WLAN_CONNECT_EVENT   (1)
#define SL_WLAN_CONNECTION_FAILED_EVENT   (9)
#define SL_WLAN_DISCONNECT_EVENT   (2)
#define SL_WLAN_P2P_DEV_FOUND_EVENT   (7)
#define SL_WLAN_P2P_NEG_REQ_RECEIVED_EVENT   (8)
#define SL_WLAN_SMART_CONFIG_COMPLETE_EVENT   (3)
#define SL_WLAN_SMART_CONFIG_STOP_EVENT   (4)
#define SL_WLAN_STA_CONNECTED_EVENT   (5)
#define SL_WLAN_STA_DISCONNECTED_EVENT   (6)
#define STATUS_DEVICE_SMART_CONFIG_ACTIVE   (0x80000000L)
#define STATUS_WLAN_STA_CONNECTED   (0x80000000L)

Typedef Documentation

typedef void(* P_INIT_CALLBACK)(_u32 Status)

Enumeration Type Documentation

Enumerator
SL_DEVICE_GENERAL_ERROR_EVENT 
SL_DEVICE_ABORT_ERROR_EVENT 
SL_DEVICE_DRIVER_ASSERT_ERROR_EVENT 
SL_DEVICE_DRIVER_TIMEOUT_CMD_COMPLETE 
SL_DEVICE_DRIVER_TIMEOUT_SYNC_PATTERN 
SL_DEVICE_DRIVER_TIMEOUT_ASYNC_EVENT 
SL_DEVICE_ERROR_MAX 
Enumerator
SL_DRIVER_API_DEVICE_SL_START 
SL_DRIVER_API_DEVICE_SL_STOP 
SL_DRIVER_API_NETAPP_PING_START 
SL_DRIVER_API_SOCKET_CONNECT 
SL_DRIVER_API_SOCKET_ACCEPT 
SL_DRIVER_API_SOCKET_SELECT 
SL_DRIVER_API_SOCKET_RECV 
SL_DRIVER_API_SOCKET_RECVFROM 
Enumerator
SL_ERR_SENDER_HEALTH_MON 
SL_ERR_SENDER_CLI_UART 
SL_ERR_SENDER_SUPPLICANT 
SL_ERR_SENDER_NETWORK_STACK 
SL_ERR_SENDER_WLAN_DRV_IF 
SL_ERR_SENDER_WILINK 
SL_ERR_SENDER_INIT_APP 
SL_ERR_SENDER_NETX 
SL_ERR_SENDER_HOST_APD 
SL_ERR_SENDER_MDNS 
SL_ERR_SENDER_HTTP_SERVER 
SL_ERR_SENDER_DHCP_SERVER 
SL_ERR_SENDER_DHCP_CLIENT 
SL_ERR_DISPATCHER 
SL_ERR_NUM_SENDER_LAST 

Function Documentation

_i16 sl_Start ( const void *  pIfHdl,
_i8 pDevName,
const P_INIT_CALLBACK  pInitCallBack 
)

This function initialize the communication interface, set the enable pin of the device, and call to the init complete callback.

Parameters
[in]pIfHdlOpened Interface Object. In case the interface must be opened outside the SimpleLink Driver, the user might give the handler to be used in
any access of the communication interface with the device (UART/SPI).
The SimpleLink driver will open an interface port only if this parameter is null!
[in]pDevNameThe name of the device to open. Could be used when the pIfHdl is null, to transfer information to the open interface function
This pointer could be used to pass additional information to sl_IfOpen in case it is required (e.g. UART com port name)
[in]pInitCallBackPointer to function that would be called on completion of the initialization process.
If this parameter is NULL the function is blocked until the device initialization is completed, otherwise the function returns immediately.
Returns
Returns the current active role (STA/AP/P2P) or an error code:
  • ROLE_STA, ROLE_AP, ROLE_P2P in case of success, otherwise in failure one of the following is return:
  • ROLE_STA_ERR (Failure to load MAC/PHY in STA role)
  • ROLE_AP_ERR (Failure to load MAC/PHY in AP role)
  • ROLE_P2P_ERR (Failure to load MAC/PHY in P2P role)
See also
sl_Stop
Note
belongs to basic_api
Warning
This function must be called before any other SimpleLink API is used, or after sl_Stop is called for reinit the device
Example:
1 An example for open interface without callback routine. The interface name and handler are
2 handled by the sl_IfOpen routine:
3 
4  if( sl_Start(NULL, NULL, NULL) < 0 )
5 {
6  LOG("Error opening interface to device\n");
7 }

+ Here is the caller graph for this function:

_i16 sl_Stop ( const _u16  timeout)

This function clears the enable pin of the device, closes the communication
interface and invokes the stop complete callback

Parameters
[in]timeoutStop timeout in msec. Should be used to give the device time to finish
any transmission/reception that is not completed when the function was called.
Additional options:
  • 0 Enter to hibernate immediately
  • 0xFFFF Host waits for device's response before
    hibernating, without timeout protection
  • 0 < Timeout[msec] < 0xFFFF Host waits for device's response before
    hibernating, with a defined timeout protection
    This timeout defines the max time to wait. The NWP
    response can be sent earlier than this timeout.
Returns
On success, zero is returned. On error, -1 is returned
See also
sl_Start
Note
This API will shutdown the device and invoke the "i/f close" function regardless
if it was opened implicitly or explicitly.
It is up to the platform interface library to properly handle interface close
routine
belongs to basic_api
Warning

+ Here is the caller graph for this function:

void sl_Task ( void  )
Returns
On success, zero is returned. On error, -1 is returned
Parameters
[in]DeviceSetIdconfiguration id
[in]Optionconfigurations option
[in]ConfigLenconfigurations len
[in]pValuesconfigurations values
See also
Note
Warning
Examples:
1 Setting device time and date example:
2 
3 SlDateTime_t dateTime= {0};
4 dateTime.sl_tm_day = (_u32)23; // Day of month (DD format) range 1-31
5 dateTime.sl_tm_mon = (_u32)6; // Month (MM format) in the range of 1-12
6 dateTime.sl_tm_year = (_u32)2014; // Year (YYYY format)
7 dateTime.sl_tm_hour = (_u32)17; // Hours in the range of 0-23
8 dateTime.sl_tm_min = (_u32)55; // Minutes in the range of 0-59
9 dateTime.sl_tm_sec = (_u32)22; // Seconds in the range of 0-59
10 sl_DevSet(SL_DEVICE_GENERAL_CONFIGURATION,
11  SL_DEVICE_GENERAL_CONFIGURATION_DATE_TIME,
12  sizeof(SlDateTime_t),
13  (_u8 *)(&dateTime));

Internal function for getting device configurations

Returns
On success, zero is returned. On error, -1 is returned
Parameters
[in]DeviceGetIdconfiguration id - example SL_DEVICE_STATUS
[out]pOptionGet configurations option, example for get status options
  • SL_EVENT_CLASS_GLOBAL
  • SL_EVENT_CLASS_DEVICE
  • SL_EVENT_CLASS_WLAN
  • SL_EVENT_CLASS_BSD
  • SL_EVENT_CLASS_NETAPP
  • SL_EVENT_CLASS_NETCFG
  • SL_EVENT_CLASS_FS
[out]pConfigLenThe 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]pValuesGet configurations values
See also
Note
Warning
Examples:
1 Example for getting WLAN class status:
2 _u32 statusWlan;
3 _u8 pConfigOpt;
4 _u8 pConfigLen;
5 pConfigOpt = SL_EVENT_CLASS_WLAN;
6 pConfigLen = sizeof(_u32);
7 sl_DevGet(SL_DEVICE_STATUS,&pConfigOpt,&pConfigLen,(_u8 *)(&statusWlan));
8 Example for getting version:
9 SlVersionFull ver;
10 pConfigLen = sizeof(ver);
11 pConfigOpt = SL_DEVICE_GENERAL_VERSION;
12 sl_DevGet(SL_DEVICE_GENERAL_CONFIGURATION,&pConfigOpt,&pConfigLen,(_u8 *)(&ver));
13 printf("CHIP %d\nMAC 31.%d.%d.%d.%d\nPHY %d.%d.%d.%d\nNWP %d.%d.%d.%d\nROM %d\nHOST %d.%d.%d.%d\n",
14  ver.ChipFwAndPhyVersion.ChipId,
15  ver.ChipFwAndPhyVersion.FwVersion[0],ver.ChipFwAndPhyVersion.FwVersion[1],
16  ver.ChipFwAndPhyVersion.FwVersion[2],ver.ChipFwAndPhyVersion.FwVersion[3],
17  ver.ChipFwAndPhyVersion.PhyVersion[0],ver.ChipFwAndPhyVersion.PhyVersion[1],
18  ver.ChipFwAndPhyVersion.PhyVersion[2],ver.ChipFwAndPhyVersion.PhyVersion[3],
19  ver.NwpVersion[0],ver.NwpVersion[1],ver.NwpVersion[2],ver.NwpVersion[3],
20  ver.RomVersion,
21  SL_MAJOR_VERSION_NUM,SL_MINOR_VERSION_NUM,SL_VERSION_NUM,SL_SUB_VERSION_NUM);
1 Getting Device time and date example:
2 
3 SlDateTime_t dateTime = {0};
4 _i8 configLen = sizeof(SlDateTime_t);
5 _i8 configOpt = SL_DEVICE_GENERAL_CONFIGURATION_DATE_TIME;
6 sl_DevGet(SL_DEVICE_GENERAL_CONFIGURATION,&configOpt, &configLen,(_u8 *)(&dateTime));
7 
8 printf("Day %d,Mon %d,Year %d,Hour %d,Min %d,Sec %d\n",dateTime.sl_tm_day,dateTime.sl_tm_mon,dateTime.sl_tm_year,
9  dateTime.sl_tm_hour,dateTime.sl_tm_min,dateTime.sl_tm_sec);

Set asynchronous event mask

Mask asynchronous events from the device. Masked events do not generate asynchronous messages from the device. By default - all events are active

Parameters
[in]EventClassThe classification groups that the mask is referred to. Need to be one of the following:
  • SL_EVENT_CLASS_GLOBAL
  • SL_EVENT_CLASS_DEVICE
  • SL_EVENT_CLASS_WLAN
  • SL_EVENT_CLASS_BSD
  • SL_EVENT_CLASS_NETAPP
  • SL_EVENT_CLASS_NETCFG
  • SL_EVENT_CLASS_FS
[in]MaskEvent Mask bitmap. Valid mask are (per group):
  • SL_EVENT_CLASS_WLAN user events
    • SL_WLAN_CONNECT_EVENT
    • SL_WLAN_DISCONNECT_EVENT
  • SL_EVENT_CLASS_DEVICE user events
    • SL_DEVICE_GENERAL_ERROR_EVENT
  • SL_EVENT_CLASS_BSD user events
    • SL_SOCKET_TX_FAILED_EVENT
    • SL_SOCKET_ASYNC_EVENT
  • SL_EVENT_CLASS_NETAPP user events
    • SL_NETAPP_IPV4_IPACQUIRED_EVENT
    • SL_NETAPP_IPV6_IPACQUIRED_EVENT
Returns
On success, zero is returned. On error, -1 is returned
See also
sl_EventMaskGet
Note
belongs to ext_api
Warning
Example:
1 An example of masking connection/disconnection async events from WLAN class:
2  sl_EventMaskSet(SL_EVENT_CLASS_WLAN, (SL_WLAN_CONNECT_EVENT | SL_WLAN_DISCONNECT_EVENT) );

Get current event mask of the device

return the events bit mask from the device. In case that event is masked, the device is not sending this event.

Parameters
[in]EventClassThe classification groups that the mask is referred to. Need to be one of the following:
  • SL_EVENT_CLASS_GLOBAL
  • SL_EVENT_CLASS_DEVICE
  • SL_EVENT_CLASS_WLAN
  • SL_EVENT_CLASS_BSD
  • SL_EVENT_CLASS_NETAPP
  • SL_EVENT_CLASS_NETCFG
  • SL_EVENT_CLASS_FS
[out]pMaskPointer to Mask bitmap where the value should be stored. Bitmasks are the same as in sl_EventMaskSet
Returns
On success, zero is returned. On error, -1 is returned
See also
sl_EventMaskSet
Note
belongs to ext_api
Warning
Example:
1 An example of getting an event mask for WLAN class
2 _u32 maskWlan;
3  sl_StatusGet(SL_EVENT_CLASS_WLAN,&maskWlan);

the simple link task entry

This function must be called from the main loop or from dedicated thread in the following cases:

  • Non-Os Platform - should be called from the mail loop
  • Multi Threaded Platform when the user does not implement the external spawn functions - should be called from dedicated thread allocated to the simplelink driver. In this mode the function never return.
Returns
None
See also
sl_Stop
Note
belongs to basic_api
Warning
This function must be called from a thread that is start running before any call to other simple link API

All rights reserved. The use is subject to the XDK SDK EULA by Bosch Connected Devices and Solutions GmbH.
This documentation file has been automatically generated on Thu Mar 14 2019 19:12:50 by doxygen 1.8.8