diff --git a/CHANGELOG.md b/CHANGELOG.md
index 32e3ae0..3d434c1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,24 @@
# CHANGES
-### 03/06/2015 - 1.0.0
+### 07/2015 - 1.0.1
+- Updated SDK to original version 1.1.0.
+- Fixed a bug in cc_timer.c (line 690). A memset was used to clear a struct but the size passed was of a pointer.
+- Added BACK_UP_ARM_REGISTERS and RESTORE_ARM_REGISTERS macros to GCC. In cc_pm.c.
+- Changed asm to __asm. In cc_pm.c, lines 318, 319 and 320.
+- Fixed UNUSED macro in cc_types.h to avoid warnings of uninitialized variables.
+- Added braces to initializer in dma_hal.c (lines 184-215).
+- Added CPUipsr function for gcc in interrupt_hal.c
+- Added initial condition to temp variable in cc_uart_isr (uart_hal.c, line 147).
+- Fixed missing HttpString.h and HttpConfig in Http web server.
+- Removed interfaces library (the _if.c files must be linked to project now).
+- Removed netapps library (each netapp have its own library now).
+- Fixed all the examples from the new SDK version (except bootloader and dynamic library).
+- Changed directory structure (libraries source are now unde the folder "src" in the same way that they are within TI SDK).
+- Updated documentation.
+- Updated FreeRTOS to v8.2.1.
+- Every project must include a FreeRTOSConfig.h now.
+
+### 03/2015 - 1.0.0
- Removed FreeRTOS and FatFS source code. This must be placed inside the project
from now on.
- libosi doesn't have FreeRTOS included.
@@ -8,17 +26,17 @@ from now on.
- Fixed variable path CC3200SDK to CC3200-Linux-SDK.
- All examples now contains a .elf and a raw .bin file.
-### 02/03/2015
+### 02/2015
- Fixed FreeRTOSHooks.c and startup.c includes.
-### 01/28/2015-2
+### 01/2015-2
- -O3 is buggy, compiling with -Os now
-### 01/28/2015
+### 01/2015
- All libs are compiled with -O3 and no -g
- Added makefile to root dir
-### 01/27/2015
+### 01/2015
- Added LP_Buttom example.
- Added Assembler help do docs.
diff --git a/Makefile b/Makefile
index 26a8ae4..0038c7f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,31 +1,39 @@
-DRIVERLIB = source/driverlib
-SIMPLELINK = source/simplelink
-OSLIB = source/oslib
-MIDDLEWARE = source/middleware
-INTERFACES = source/interfaces
-NETAPP = source/netapps
-
-ifeq ("${target}", "NONOS")
- SDK_TARGETS = $(SIMPLELINK) $(MIDDLEWARE) $(INTERFACES) $(NETAPP)
-else
- ifeq ("${target}", "TINY")
- SDK_TARGETS = $(SIMPLELINK)
- else
- SDK_TARGETS = $(DRIVERLIB) $(SIMPLELINK) $(OSLIB) $(MIDDLEWARE) $(INTERFACES) $(NETAPP)
- endif
-endif
-
-.PHONY: all $(SDK_TARGETS)
-all: $(SDK_TARGETS)
+DRIVERLIB = src/driverlib
+SIMPLELINK = src/simplelink
+OSLIB = src/oslib
+MIDDLEWARE = src/middleware
+WEBCLIENT = src/netapps/http/client
+WEBSERVER = src/netapps/http/server
+JSON = src/netapps/json
+MQTT = src/netapps/mqtt
+SMTP = src/netapps/smtp/client
+TFTP = src/netapps/tftp/client
+XMPP = src/netapps/xmpp/client
-clean:
- rm -rf lib/*
+SDK_TARGETS = $(DRIVERLIB) $(SIMPLELINK) $(OSLIB) $(MIDDLEWARE) $(WEBCLIENT) $(WEBSERVER) $(JSON) $(MQTT) $(SMTP) $(TFTP) $(XMPP)
+SDK_TARGETS_NONOS = $(SIMPLELINK) $(MIDDLEWARE)
+SDK_TARGETS_TINY = $(SIMPLELINK)
+
+
+.PHONY: all
+all: os nonos tiny
+
+os: $(SDK_TARGETS)
+
+nonos: $(SDK_TARGETS_NONOS)
+
+tiny: $(SDK_TARGETS_TINY)
+
+.PHONY: $(SDK_TARGETS)
$(SDK_TARGETS):
- @$(MAKE) -C $@;
+ @$(MAKE) -C $@
$(SDK_TARGETS_NONOS):
- @$(MAKE) -C $@ target=NONOS;
+ @$(MAKE) -C $@ target=NONOS
$(SDK_TARGETS_TINY):
@$(MAKE) -C $@ target=TINY;
+
+clean:
+ rm -rf lib/*
\ No newline at end of file
diff --git a/README.md b/README.md
index 8ae452d..46f7244 100644
--- a/README.md
+++ b/README.md
@@ -1,13 +1,11 @@
# CC3200-Linux-SDK
-version 1.0.0
-
### Overview
This repo contains a reworked SDK for the CC3200 microcontroller, from Texas
Instruments, to work under linux.
-The intention is to provide a way to develop for this platform while TI doesn't
+The intention is to provide a way to develop in this platform while TI doesn't
release an official SDK for linux.
-Currently, it works with Ubuntu and Slackware (tested with version 14.10).
+Currently, it works with Ubuntu (tested with version 14.10) and Slackware.
The TI SDK version used for this rework is the 1.0.0 and the original can be
found at : http://www.ti.com/tool/cc3200sdk.
@@ -18,7 +16,7 @@ For instructions on how to use it, please see USAGE.md file.
- The directory structure of the SDK.
- Replaced all the makefiles for the libs (some of them just didn't work).
- Fixed small issues with gcc for the libraries.
-- Ported almost all examples to work with eclipse (except the OTA-NONOS and the
+- Ported almost all examples to work with eclipse (except dynamic library and the
application bootloader).
- Added extra documentation (Datasheet and etc).
@@ -30,12 +28,14 @@ The SDK is organized as follow
- ROOT
- doc -> Documentation
- examples -> Contain several examples adapted to work with eclipse and gcc.
- - include -> Directory for the header files (.h).
- lib -> Pre-compiled library files.
- other -> Configuration files and freeRTOS.
- - source -> The source files and make files for all the libraries.
+ - src -> The source files and make files for all the libraries.
### Rebuilding the libs
Open a terminal in the root directory and do a "make". For the nonos versions
-use "make target=NONOS" and for the simplelink tiny "make target=TINY".
+use "make nonos" and for the simplelink tiny "make tiny".
+
+07/2015
+version 1.0.1
diff --git a/docs/CC3200 Simplelink OTA Extlib API User's Guide.chm b/docs/CC3200 Simplelink OTA Extlib API User's Guide.chm
index 217b8c2..46333f7 100644
Binary files a/docs/CC3200 Simplelink OTA Extlib API User's Guide.chm and b/docs/CC3200 Simplelink OTA Extlib API User's Guide.chm differ
diff --git a/docs/CC3200-Peripheral_Driver_Library_User's_Guide.chm b/docs/CC3200-Peripheral_Driver_Library_User's_Guide.chm
index 320ea33..4ebfa65 100644
Binary files a/docs/CC3200-Peripheral_Driver_Library_User's_Guide.chm and b/docs/CC3200-Peripheral_Driver_Library_User's_Guide.chm differ
diff --git a/docs/CC3200-Power_Management_Framework.pdf b/docs/CC3200-Power_Management_Framework.pdf
index 6f0fe57..b9caabb 100644
Binary files a/docs/CC3200-Power_Management_Framework.pdf and b/docs/CC3200-Power_Management_Framework.pdf differ
diff --git a/docs/CC3200-Programmers_Guide.pdf b/docs/CC3200-Programmers_Guide.pdf
index c3bdd69..c2cc240 100644
Binary files a/docs/CC3200-Programmers_Guide.pdf and b/docs/CC3200-Programmers_Guide.pdf differ
diff --git a/docs/CC3200-SDK_Release_Note.pdf b/docs/CC3200-SDK_Release_Note.pdf
new file mode 100644
index 0000000..340221e
Binary files /dev/null and b/docs/CC3200-SDK_Release_Note.pdf differ
diff --git a/docs/hardware/CC3200-LAUNCHXL_ASSY_FAB_Rev3p2.pdf b/docs/hardware/CC3200-LAUNCHXL_ASSY_FAB_Rev3p2.pdf
new file mode 100644
index 0000000..6f68475
Binary files /dev/null and b/docs/hardware/CC3200-LAUNCHXL_ASSY_FAB_Rev3p2.pdf differ
diff --git a/docs/hardware/CC3200-LAUNCHXL_ASSY_FAB_Rev4p1.pdf b/docs/hardware/CC3200-LAUNCHXL_ASSY_FAB_Rev4p1.pdf
new file mode 100644
index 0000000..2195743
Binary files /dev/null and b/docs/hardware/CC3200-LAUNCHXL_ASSY_FAB_Rev4p1.pdf differ
diff --git a/docs/hardware/CC3200-LaunchPad_Hardware_User_Guide.pdf b/docs/hardware/CC3200-LaunchPad_Hardware_User_Guide.pdf
index fa5daeb..63be442 100644
Binary files a/docs/hardware/CC3200-LaunchPad_Hardware_User_Guide.pdf and b/docs/hardware/CC3200-LaunchPad_Hardware_User_Guide.pdf differ
diff --git a/docs/netapps/http/http_client.chm b/docs/netapps/http/http_client.chm
new file mode 100644
index 0000000..0bdf01f
Binary files /dev/null and b/docs/netapps/http/http_client.chm differ
diff --git a/docs/netapps/mqtt/lib/client/MQTT_Client.chm b/docs/netapps/mqtt/lib/client/MQTT_Client.chm
new file mode 100644
index 0000000..a57db9a
Binary files /dev/null and b/docs/netapps/mqtt/lib/client/MQTT_Client.chm differ
diff --git a/docs/netapps/mqtt/lib/server/MQTT_Server.chm b/docs/netapps/mqtt/lib/server/MQTT_Server.chm
new file mode 100644
index 0000000..94396e3
Binary files /dev/null and b/docs/netapps/mqtt/lib/server/MQTT_Server.chm differ
diff --git a/docs/netapps/mqtt/sl/client/sl_mqtt_client.chm b/docs/netapps/mqtt/sl/client/sl_mqtt_client.chm
new file mode 100644
index 0000000..326d737
Binary files /dev/null and b/docs/netapps/mqtt/sl/client/sl_mqtt_client.chm differ
diff --git a/docs/netapps/mqtt/sl/server/sl_mqtt_server.chm b/docs/netapps/mqtt/sl/server/sl_mqtt_server.chm
new file mode 100644
index 0000000..76901e0
Binary files /dev/null and b/docs/netapps/mqtt/sl/server/sl_mqtt_server.chm differ
diff --git a/docs/simplelink_api/html/_include_2user_8h_source.html b/docs/simplelink_api/html/_include_2user_8h_source.html
deleted file mode 100644
index ed392f2..0000000
--- a/docs/simplelink_api/html/_include_2user_8h_source.html
+++ /dev/null
@@ -1,338 +0,0 @@
-
-
-
00001 /******************************************************************************
-00002 *
-00003 * Copyright (C) 2013 Texas Instruments Incorporated
-00004 *
-00005 * All rights reserved. Property of Texas Instruments Incorporated.
-00006 * Restricted rights to use, duplicate or disclose this code are
-00007 * granted through contract.
-00008 *
-00009 * The program may not be used without the written permission of
-00010 * Texas Instruments Incorporated or against the terms and conditions
-00011 * stipulated in the agreement under which this program has been supplied,
-00012 * and under no circumstances can it be used with non-TI connectivity device.
-00013 *
-00014 ******************************************************************************/
-00015
-00016 #ifndef __FLOWCONT_H__
-00017 #define __FLOWCONT_H__
-00018
-00019 /******************************************************************************
-00020
-00021 If building with a C++ compiler, make all of the definitions in this header
-00022 have a C binding.
-00023
-00024 *****************************************************************************/
-00025 #ifdef __cplusplus
-00026 extern"C" {
-00027 #endif
-00028
-00029 #define WLAN_STATUS_CONN 1
-00030 #define WLAN_STATUS_DISCONN 0
-00031 #define EVENT_Q_STATUS_NOT_EMPTY 1
-00032 #define EVENT_Q_STATUS_EMPTY 0
-00033 #define PENDING_RECV_STATUS_PRESENT 1
-00034 #define PENDING_RECV_STATUS_ABSENT 0
-00035 #define FW_BUSY_PKTS_STATUS_PRESENT 1
-00036 #define FW_BUSY_PKTS_STATUS_ABSENT 0
-00037 #define PENDING_CMD_STATUS_PRESENT 1
-00038 #define PENDING_CMD_STATUS_ABSENT 0
-00039
-00040 #define FLOW_CONT_WLAN_STATUS_BIT 0
-00041 #define FLOW_CONT_EVENT_Q_STATUS_BIT 1
-00042 #define FLOW_CONT_PENDING_RECV_STATUS_BIT 2
-00043 #define FLOW_CONT_FW_BUSY_PKTS_STATUS_BIT 3
-00044 #define FLOW_CONT_PENDING_CMD_STATUS_BIT 4
-00045
-00046 #define FLOW_CONT_WLAN_STATUS_DEFAULT (WLAN_STATUS_DISCONN << FLOW_CONT_WLAN_STATUS_BIT )
-00047 #define FLOW_CONT_EVENT_Q_STATUS_DEFAULT (EVENT_Q_STATUS_NOT_EMPTY << FLOW_CONT_EVENT_Q_STATUS_BIT )
-00048 #define FLOW_CONT_PENDING_RECV_STATUS_DEFAULT (PENDING_RECV_STATUS_ABSENT << FLOW_CONT_PENDING_RECV_STATUS_BIT)
-00049 #define FLOW_CONT_FW_BUSY_PKTS_STATUS_DEFAULT (FW_BUSY_PKTS_STATUS_ABSENT << FLOW_CONT_FW_BUSY_PKTS_STATUS_BIT)
-00050 #define FLOW_CONT_PENDING_CMD_STATUS_DEFAULT (PENDING_CMD_STATUS_ABSENT << FLOW_CONT_PENDING_CMD_STATUS_BIT )
-00051
-00052 #define FLOW_CONT_STATUS_DEFAULT (FLOW_CONT_WLAN_STATUS_DEFAULT |\
-00053 FLOW_CONT_EVENT_Q_STATUS_DEFAULT |\
-00054 FLOW_CONT_PENDING_RECV_STATUS_DEFAULT|\
-00055 FLOW_CONT_FW_BUSY_PKTS_STATUS_DEFAULT|\
-00056 FLOW_CONT_PENDING_CMD_STATUS_DEFAULT )
-00057
-00058 /*****************************************************************************
-00059
-00060 Prototypes for the APIs.
-00061
-00062 *****************************************************************************/
-00063
-00064 #define FLOW_CONT_MIN 1
-00065
-00066 externvoid _SlDrvFlowContInit(void);
-00067
-00068 externvoid _SlDrvFlowContDeinit(void);
-00069
-00070 /*****************************************************************************
-00071
-00072 Mark the end of the C bindings section for C++ compilers.
-00073
-00074 *****************************************************************************/
-00075 #ifdef __cplusplus
-00076 }
-00077 #endif /* __cplusplus */
-00078
-00079 #endif /* __FLOWCONT_H__ */
-00080
-
Status = sl_FsGetInfo("FileName.html",0,&FsFileInfo);
-
-
-
-
-
-
-
-
-
-
_i32 sl_FsOpen
-
(
-
_u8 *
-
pFileName,
-
-
-
-
-
_u32
-
AccessModeAndMaxSize,
-
-
-
-
-
_u32 *
-
pToken,
-
-
-
-
-
_i32 *
-
pFileHandle
-
-
-
-
)
-
-
-
-
-
-
open file for read or write from/to storage device
-
Parameters
-
-
[in]
pFileName
File Name buffer pointer
-
[in]
AccessModeAndMaxSize
Options: As described below
-
[in]
pToken
Reserved for future use. Use NULL for this field
-
[out]
pFileHandle
Pointing on the file and used for read and write commands to the file
-
-
-
-
AccessModeAndMaxSize possible input
- FS_MODE_OPEN_READ - Read a file
- FS_MODE_OPEN_WRITE - Open for write for an existing file
- FS_MODE_OPEN_CREATE(maxSizeInBytes,accessModeFlags) - Open for creating a new file. Max file size is defined in bytes.
- For optimal FS size, use max size in 4K-512 bytes steps (e.g. 3584,7680,117760)
- Several access modes bits can be combined together from SlFileOpenFlags_e enum
-
Returns
On success, zero is returned. On error, an error code is returned
Status = sl_FsGetInfo("FileName.html",0,&FsFileInfo);
+
+
+
+
+
+
+
+
+
+
_i32 sl_FsOpen
+
(
+
const _u8 *
+
pFileName,
+
+
+
+
+
const _u32
+
AccessModeAndMaxSize,
+
+
+
+
+
_u32 *
+
pToken,
+
+
+
+
+
_i32 *
+
pFileHandle
+
+
+
+
)
+
+
+
+
+
+
open file for read or write from/to storage device
+
Parameters
+
+
[in]
pFileName
File Name buffer pointer
+
[in]
AccessModeAndMaxSize
Options: As described below
+
[in]
pToken
Reserved for future use. Use NULL for this field
+
[out]
pFileHandle
Pointing on the file and used for read and write commands to the file
+
+
+
+
AccessModeAndMaxSize possible input
+ FS_MODE_OPEN_READ - Read a file
+ FS_MODE_OPEN_WRITE - Open for write for an existing file
+ FS_MODE_OPEN_CREATE(maxSizeInBytes,accessModeFlags) - Open for creating a new file. Max file size is defined in bytes.
+ For optimal FS size, use max size in 4K-512 bytes steps (e.g. 3584,7680,117760)
+ Several access modes bits can be combined together from SlFileOpenFlags_e enum
+
Returns
On success, zero is returned. On error, an error code is returned
Async event activation notes Function prototypes for event callback handlers Event handler function names should be defined in the user.h file e.g. "#define sl_WlanEvtHdlr SLWlanEventHandler" Indicates all WLAN events are handled by User func "SLWlanEventHandler" Important notes:
-
Event handlers cannot activate another SimpleLink API from the event's context
-
Event's data is valid during event's context. Any application data which is required for the user application should be copied or marked into user's variables
-
It is not recommended to delay the execution of the event callback handler
Async event activation notes Function prototypes for event callback handlers Event handler function names should be defined in the user.h file e.g. "#define sl_WlanEvtHdlr SLWlanEventHandler" Indicates all WLAN events are handled by User func "SLWlanEventHandler" Important notes:
+
Event handlers cannot activate another SimpleLink API from the event's context
+
Event's data is valid during event's context. Any application data which is required for the user application should be copied or marked into user's variables
+
It is not recommended to delay the execution of the event callback handler
Defines whether to include socket send APIs in SimpleLink driver or not. More...
+
+
+
Detailed Description
+
This section IS NOT REQUIRED in case one of the following pre defined capabilities set is in use:
+
+
SL_TINY
+
SL_SMALL
+
SL_FULL
+
+
PORTING ACTION:
+
+
Define one of the pre-defined capabilities set or uncomment the relevant definitions below to select the required capabilities
+
+
Macro Definition Documentation
+
+
+
+
+
+
#define SL_INC_ARG_CHECK
+
+
+
+
+
Defines whether the SimpleLink driver perform argument check or not.
+
When defined, the SimpleLink driver perform argument check on
+ function call. Removing this define could reduce some code
+ size and improve slightly the performances but may impact in
+ unpredictable behavior in case of invalid arguments
+
See Also
+
Note
belongs to configuration_sec
+
Warning
Removing argument check may cause unpredictable behavior in case of invalid arguments. In this case the user is responsible to argument validity (for example all handlers must not be NULL)
+
+
+
+
+
+
+
+
+
#define SL_INC_EXT_API
+
+
+
+
+
Defines whether to include extended API in SimpleLink driver or not.
+
When defined, the SimpleLink driver will include also all
+ exteded API of the included packages
+
See Also
ext_api
+
Note
belongs to configuration_sec
+
Warning
+
+
+
+
+
+
+
+
+
#define SL_INC_NET_APP_PKG
+
+
+
+
+
Defines whether to include NET_APP package in SimpleLink driver or not.
+
When defined, the SimpleLink driver will include also the
+ NET_APP package
+
See Also
+
Note
belongs to configuration_sec
+
Warning
+
+
+
+
+
+
+
+
+
#define SL_INC_NET_CFG_PKG
+
+
+
+
+
Defines whether to include NET_CFG package in SimpleLink driver or not.
+
When defined, the SimpleLink driver will include also
+ the NET_CFG package
+
See Also
+
Note
belongs to configuration_sec
+
Warning
+
+
+
+
+
+
+
+
+
#define SL_INC_NVMEM_PKG
+
+
+
+
+
Defines whether to include NVMEM package in SimpleLink driver or not.
+
When defined, the SimpleLink driver will include also the
+ NVMEM package
+
See Also
+
Note
belongs to configuration_sec
+
Warning
+
+
+
+
+
+
+
+
+
#define SL_INC_SOCK_CLIENT_SIDE_API
+
+
+
+
+
Defines whether to include socket client side APIs in SimpleLink driver or not.
+
When defined, the SimpleLink driver will include also socket
+ client side APIs
+
See Also
client_side
+
Note
belongs to configuration_sec
+
Warning
+
+
+
+
+
+
+
+
+
#define SL_INC_SOCK_RECV_API
+
+
+
+
+
Defines whether to include socket receive APIs in SimpleLink driver or not.
+
When defined, the SimpleLink driver will include also socket
+ receive side APIs
+
See Also
recv_api
+
Note
belongs to configuration_sec
+
Warning
+
+
+
+
+
+
+
+
+
#define SL_INC_SOCK_SEND_API
+
+
+
+
+
Defines whether to include socket send APIs in SimpleLink driver or not.
+
When defined, the SimpleLink driver will include also socket
+ send side APIs
+
See Also
send_api
+
Note
belongs to configuration_sec
+
Warning
+
+
+
+
+
+
+
+
+
#define SL_INC_SOCK_SERVER_SIDE_API
+
+
+
+
+
Defines whether to include socket server side APIs in SimpleLink driver or not.
+
When defined, the SimpleLink driver will include also socket
+ server side APIs
+
See Also
server_side
+
Note
+
Warning
+
+
+
+
+
+
+
+
+
#define SL_INC_SOCKET_PKG
+
+
+
+
+
Defines whether to include SOCKET package in SimpleLink driver or not.
+
When defined, the SimpleLink driver will include also
+ the SOCKET package
+
See Also
+
Note
belongs to configuration_sec
+
Warning
+
+
+
+
+
+
+
+
+
#define SL_INC_STD_BSD_API_NAMING
+
+
+
+
+
Defines whether SimpleLink driver should expose standard BSD APIs or not.
+
When defined, the SimpleLink driver in addtion to its alternative
+ BSD APIs expose also standard BSD APIs.
+ Stadrad BSD API includs the following functions:
+ socket , close , accept , bind , listen , connect , select ,
+ setsockopt , getsockopt , recv , recvfrom , write , send , sendto ,
+ gethostbyname
+
See Also
+
Note
belongs to configuration_sec
+
Warning
+
+
+
+
+
+
+
+
+
#define SL_INC_WLAN_PKG
+
+
+
+
+
Defines whether to include WLAN package in SimpleLink driver or not.
+
When defined, the SimpleLink driver will include also
+ the WLAN package
+
The SimpleLink device supports several standard communication protocol among SPI and UART. CC32XX Host Driver implements SPI Communication Interface
-
Note
In CC32XX, SPI implementation uses DMA in order to increase the utilization of the communication channel. If user prefers to user UART, these interfaces need to be redefined
-
porting ACTION:
-
None
-
-
Macro Definition Documentation
-
-
-
-
-
-
#define sl_IfClose spi_Close
-
-
-
-
-
Closes an opened interface communication port.
-
Parameters
-
-
fd
- file descriptor of opened communication channel
-
-
-
-
Returns
upon successful completion, the function shall return 0. Otherwise, -1 shall be returned
Opens an interface communication port to be used for communicating with a SimpleLink device.
-
Given an interface name and option flags, this function opens the communication port and creates a file descriptor. This file descriptor is used afterwards to read and write data from and to this specific communication channel. The speed, clock polarity, clock phase, chip select and all other specific attributes of the channel are all should be set to hardcoded in this function.
-
Parameters
-
-
ifName
- points to the interface name/path. The interface name is an optional attributes that the simple link driver receives on opening the driver (sl_Start). In systems that the spi channel is not implemented as part of the os device drivers, this parameter could be NULL.
-
flags
- optional flags parameters for future use
-
-
-
-
Returns
upon successful completion, the function shall open the channel and return a non-negative integer representing the file descriptor. Otherwise, -1 shall be returned
register an interrupt handler routine for the host IRQ
-
Parameters
-
-
InterruptHdl
- pointer to interrupt handler routine
-
pValue
- pointer to a memory structure that is passed to the interrupt handler.
-
-
-
-
Returns
upon successful registration, the function shall return 0. Otherwise, -1 shall be returned
-
See also
\note If there is already registered interrupt handler, the function
- should overwrite the old handler with the new one
-
-\note If the handler is a null pointer, the function should un-register the
- interrupt handler, and the interrupts can be disabled.
-
\note This function could be implemented as zero copy and return only upon successful completion
- of writing the whole buffer, but in cases that memory allocation is not too tight, the
- function could copy the data to internal buffer, return back and complete the write in
- parallel to other activities as long as the other SPI activities would be blocked until
- the entire buffer write would be completed
-
- The prototype of the function is as follow:
- int xxx_IfWrite(Fd_t Fd , char* pBuff , int Len);
-
The SimpleLink device supports several standard communication protocol among SPI and
+UART. CC32XX Host Driver implements SPI Communication Interface
+
Note
In CC32XX, SPI implementation uses DMA in order to increase the utilization of the communication channel. If user prefers to user UART, these interfaces need to be redefined
+
porting ACTION:
+
+
None
+
+
Macro Definition Documentation
+
+
+
+
+
+
#define sl_IfClose spi_Close
+
+
+
+
+
Closes an opened interface communication port.
+
Parameters
+
+
fd
- file descriptor of opened communication channel
+
+
+
+
Returns
upon successful completion, the function shall return 0. Otherwise, -1 shall be returned
Opens an interface communication port to be used for communicating with a SimpleLink device.
+
Given an interface name and option flags, this function opens
+ the communication port and creates a file descriptor.
+ This file descriptor is used afterwards to read and write
+ data from and to this specific communication channel.
+ The speed, clock polarity, clock phase, chip select and all other
+ specific attributes of the channel are all should be set to hardcoded
+ in this function.
+
Parameters
+
+
ifName
- points to the interface name/path. The interface name is an optional attributes that the simple link driver receives on opening the driver (sl_Start). In systems that the spi channel is not implemented as part of the os device drivers, this parameter could be NULL.
+
flags
- optional flags parameters for future use
+
+
+
+
Returns
upon successful completion, the function shall open the channel and return a non-negative integer representing the file descriptor. Otherwise, -1 shall be returned
This function could be implemented as zero copy and return only upon successful completion of writing the whole buffer, but in cases that memory allocation is not too tight, the function could copy the data to internal buffer, return back and complete the write in parallel to other activities as long as the other SPI activities would be blocked until the entire buffer write would be completed
+
The prototype of the function is as follow: int xxx_IfWrite(Fd_t Fd , char* pBuff , int Len);
type definition for a locking object container More...
-
-
-
Detailed Description
-
The SimpleLink driver could run on two kind of platforms:
-
Non-Os / Single Threaded (default)
-
Multi-Threaded
-
-
CC32XX SimpleLink Host Driver is ported on both Non-Os and Multi Threaded OS enviroment. The Host driver is made OS independent by implementing an OS Abstraction layer. Reference implementation for OS Abstraction is available for FreeRTOS and TI-RTOS.
-
If you choose to work in multi-threaded environment under different operating system you
-will have to provide some basic adaptation routines to allow the driver to protect access to
-resources for different threads (locking object) and to allow synchronization between threads
-(sync objects). In additional the driver support running without dedicated thread allocated solely
-to the simple link driver. If you choose to work in this mode, you should also supply a spawn
-method that will enable to run function on a temporary context.
-
-\note - This Macro is defined in the IDE to generate Driver for both OS and Non-OS
-
- porting ACTION:
- - None
Macro Definition Documentation
-
-
-
-
-
-
#define _SlTime_t OsiTime_t
-
-
-
-
-
type definition for a time value
-
Note
On each configuration or platform the type could be whatever is needed - integer, pointer to structure etc.
-
-belongs to configuration_sec
-
-
-
-
-
-
-
-
-
#define sl_LockObjCreate
-
(
-
-
pLockObj,
-
-
-
-
-
-
pName
-
-
-
-
)
-
osi_LockObjCreate(pLockObj)
-
-
-
-
-
This function creates a locking object.
-
The locking object is used for protecting a shared resources between different threads.
-
Parameters
-
-
pLockObj
- pointer to the locking object control block
-
-
-
-
Returns
upon successful creation the function should return 0 Otherwise, a negative value indicating the error code shall be returned
-
Note
belongs to configuration_sec
-
Warning
-
-
-
-
-
-
-
-
-
#define sl_LockObjDelete
-
(
-
-
pLockObj
)
-
osi_LockObjDelete(pLockObj)
-
-
-
-
-
This function deletes a locking object.
-
Parameters
-
-
pLockObj
- pointer to the locking object control block
-
-
-
-
Returns
upon successful deletion the function should return 0 Otherwise, a negative value indicating the error code shall be returned
-
Note
belongs to configuration_sec
-
Warning
-
-
-
-
-
-
-
-
-
#define sl_LockObjLock
-
(
-
-
pLockObj,
-
-
-
-
-
-
Timeout
-
-
-
-
)
-
osi_LockObjLock(pLockObj,Timeout)
-
-
-
-
-
This function locks a locking object.
-
All other threads that call this function before this thread calls the osi_LockObjUnlock would be suspended
-
Parameters
-
-
pLockObj
- pointer to the locking object control block
-
Timeout
- numeric value specifies the maximum number of mSec to stay suspended while waiting for the locking object Currently, the simple link driver uses only two values:
-
OSI_WAIT_FOREVER
-
OSI_NO_WAIT
-
-
-
-
-
-
\return upon successful reception of the locking object the function should return 0
- Otherwise, a negative value indicating the error code shall be returned
-
Note
belongs to configuration_sec
-
Warning
-
-
-
-
-
-
-
-
-
#define sl_LockObjUnlock
-
(
-
-
pLockObj
)
-
osi_LockObjUnlock(pLockObj)
-
-
-
-
-
This function unlock a locking object.
-
Parameters
-
-
pLockObj
- pointer to the locking object control block
-
-
-
-
Returns
upon successful unlocking the function should return 0 Otherwise, a negative value indicating the error code shall be returned
This function call the pEntry callback from a different context.
-
Parameters
-
-
pEntry
- pointer to the entry callback function
-
pValue
- pointer to any type of memory structure that would be passed to pEntry callback from the execution thread.
-
flags
- execution flags - reserved for future usage
-
-
-
-
Returns
upon successful registration of the spawn the function should return 0 (the function is not blocked till the end of the execution of the function and could be returned before the execution is actually completed) Otherwise, a negative value indicating the error code shall be returned
-
Note
belongs to configuration_sec
-
Warning
-
-
-
-
-
-
-
-
-
#define sl_SyncObjCreate
-
(
-
-
pSyncObj,
-
-
-
-
-
-
pName
-
-
-
-
)
-
osi_SyncObjCreate(pSyncObj)
-
-
-
-
-
This function creates a sync object.
-
The sync object is used for synchronization between diffrent thread or ISR and a thread.
-
Parameters
-
-
pSyncObj
- pointer to the sync object control block
-
-
-
-
Returns
upon successful creation the function should return 0 Otherwise, a negative value indicating the error code shall be returned
-
Note
belongs to configuration_sec
-
Warning
-
-
-
-
-
-
-
-
-
#define sl_SyncObjDelete
-
(
-
-
pSyncObj
)
-
osi_SyncObjDelete(pSyncObj)
-
-
-
-
-
This function deletes a sync object.
-
Parameters
-
-
pSyncObj
- pointer to the sync object control block
-
-
-
-
Returns
upon successful deletion the function should return 0 Otherwise, a negative value indicating the error code shall be returned
-
Note
belongs to configuration_sec
-
Warning
-
-
-
-
-
-
-
-
-
#define sl_SyncObjSignal
-
(
-
-
pSyncObj
)
-
osi_SyncObjSignal(pSyncObj)
-
-
-
-
-
This function generates a sync signal for the object.
-
All suspended threads waiting on this sync object are resumed
-
Parameters
-
-
pSyncObj
- pointer to the sync object control block
-
-
-
-
Returns
upon successful signaling the function should return 0 Otherwise, a negative value indicating the error code shall be returned
-
Note
the function could be called from ISR context
-
Warning
-
-
-
-
-
-
-
-
-
#define sl_SyncObjSignalFromIRQ
-
(
-
-
pSyncObj
)
-
osi_SyncObjSignalFromISR(pSyncObj)
-
-
-
-
-
This function generates a sync signal for the object from Interrupt.
-
This is for RTOS that should signal from IRQ using a dedicated API
-
Parameters
-
-
pSyncObj
- pointer to the sync object control block
-
-
-
-
Returns
upon successful signaling the function should return 0 Otherwise, a negative value indicating the error code shall be returned
-
Note
the function could be called from ISR context
-
Warning
-
-
-
-
-
-
-
-
-
#define sl_SyncObjWait
-
(
-
-
pSyncObj,
-
-
-
-
-
-
Timeout
-
-
-
-
)
-
osi_SyncObjWait(pSyncObj,Timeout)
-
-
-
-
-
This function waits for a sync signal of the specific sync object.
-
Parameters
-
-
pSyncObj
- pointer to the sync object control block
-
Timeout
- numeric value specifies the maximum number of mSec to stay suspended while waiting for the sync signal Currently, the simple link driver uses only two values:
-
OSI_WAIT_FOREVER
-
OSI_NO_WAIT
-
-
-
-
-
-
Returns
upon successful reception of the signal within the timeout window return 0 Otherwise, a negative value indicating the error code shall be returned
Locking object are used to protect a resource from mutual accesses of two or more threads. The locking object should suppurt reentrant locks by a signal thread. This object is generally implemented by mutex semaphore
-
Note
On each configuration or platform the type could be whatever is needed - integer, structure etc.
Sync object is object used to synchronize between two threads or thread and interrupt handler. One thread is waiting on the object and the other thread send a signal, which then release the waiting thread. The signal must be able to be sent from interrupt context. This object is generally implemented by binary semaphore or events.
-
Note
On each configuration or platform the type could be whatever is needed - integer, structure etc.
The SimpleLink driver could run on two kind of platforms:
+ -# Non-Os / Single Threaded (default)
+ -# Multi-Threaded
+
+CC32XX SimpleLink Host Driver is ported on both Non-Os and Multi Threaded OS enviroment.
+The Host driver is made OS independent by implementing an OS Abstraction layer.
+Reference implementation for OS Abstraction is available for FreeRTOS and TI-RTOS.
+
+
+If you choose to work in multi-threaded environment under different operating system you
+will have to provide some basic adaptation routines to allow the driver to protect access to
+resources for different threads (locking object) and to allow synchronization between threads
+(sync objects). In additional the driver support running without dedicated thread allocated solely
+to the simple link driver. If you choose to work in this mode, you should also supply a spawn
+method that will enable to run function on a temporary context.
+
Note
- This Macro is defined in the IDE to generate Driver for both OS and Non-OS
porting ACTION:
+ - None
+
Macro Definition Documentation
+
+
+
+
+
+
#define SL_PLATFORM_EXTERNAL_SPAWN
+
+
+
+
+
This function call the pEntry callback from a different context.
+
Parameters
+
+
pEntry
- pointer to the entry callback function
+
pValue
- pointer to any type of memory structure that would be passed to pEntry callback from the execution thread.
+
flags
- execution flags - reserved for future usage
+
+
+
+
Returns
upon successful registration of the spawn the function should return 0 (the function is not blocked till the end of the execution of the function and could be returned before the execution is actually completed) Otherwise, a negative value indicating the error code shall be returned
Internal function for getting device configurations.
-
Returns
On success, zero is returned. On error, -1 is returned
-
Parameters
-
-
[in]
DeviceGetId
configuration id - example SL_DEVICE_STATUS
-
[out]
pOption
Get 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]
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
This function initialize the communication interface, set the enable pin of the device, and call to the init complete callback.
-
Parameters
-
-
[in]
pIfHdl
Opened 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]
pDevName
The 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]
pInitCallBack
Pointer 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)
This function clears the enable pin of the device, closes the communication
-interface and invokes the stop complete callback
-
Parameters
-
-
[in]
timeout
Stop 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
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
-
Internal function for getting device configurations.
+
Returns
On success, zero is returned. On error, -1 is returned
+
Parameters
+
+
[in]
DeviceGetId
configuration id - example SL_DEVICE_STATUS
+
[out]
pOption
Get 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]
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
This function initialize the communication interface, set the enable pin of the device, and call to the init complete callback.
+
Parameters
+
+
[in]
pIfHdl
Opened 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]
pDevName
The 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]
pInitCallBack
Pointer 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)
This function clears the enable pin of the device, closes the communication
+ interface and invokes the stop complete callback
+
Parameters
+
+
[in]
timeout
Stop 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
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
+
+
+
+
+
+
+
+
+
void sl_Task
+
(
+
void
+
)
+
+
+
+
+
+
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.
Status = sl_FsGetInfo("FileName.html",Token,&FsFileInfo);
-
-
-
-
-
-
-
-
-
-
long sl_FsOpen
-
(
-
unsigned char *
-
pFileName,
-
-
-
-
-
unsigned long
-
AccessModeAndMaxSize,
-
-
-
-
-
unsigned long *
-
pToken,
-
-
-
-
-
long *
-
pFileHandle
-
-
-
-
)
-
-
-
-
-
-
open file for read or write from/to storage device
-
Parameters
-
-
[in]
pFileName
File Name buffer pointer
-
[in]
AccessModeAndMaxSize
Options: As described below
-
[in]
pToken
input Token for read, output Token for write
-
[out]
pFileHandle
Pointing on the file and used for read and write commands to the file
-
-
-
-
AccessModeAndMaxSize possible input
- FS_MODE_OPEN_READ - Read a file
- FS_MODE_OPEN_WRITE - Open for write for an existing file
- FS_MODE_OPEN_CREATE(maxSizeInBytes,accessModeFlags) - Open for creating a new file. Max file size is defined in bytes.
- For optimal FS size, use max size in 4K-512 bytes (e.g. 3584,7680)
- Several access modes can be combined together from SlFileOpenFlags_e
-
Returns
On success, zero is returned. On error, negative is returned
Get service List Insert into out pBuffer a list of peer's services that are the NWP. The list is in a form of service struct. The user should chose the type of the service struct like: More...
Internal function for getting network applications configurations. More...
-
-
-
Detailed Description
-
Function Documentation
-
-
-
-
-
-
_i16 sl_NetAppDnsGetHostByName
-
(
-
_i8 *
-
hostname,
-
-
-
-
-
_u16
-
usNameLen,
-
-
-
-
-
_u32 *
-
out_ip_addr,
-
-
-
-
-
_u8
-
family
-
-
-
-
)
-
-
-
-
-
-
Get host IP by name.
-
Obtain the IP Address of machine on network, by machine name.
-
Parameters
-
-
[in]
hostname
host name
-
[in]
usNameLen
name length
-
[out]
out_ip_addr
This parameter is filled in with host IP address. In case that host name is not resolved, out_ip_addr is zero.
-
[in]
family
protocol family
-
-
-
-
Returns
On success, 0 is returned. On error, negative is returned SL_POOL_IS_EMPTY may be return in case there are no resources in the system In this case try again later or increase MAX_CONCURRENT_ACTIONS Possible DNS error codes:
-
SL_NET_APP_DNS_QUERY_NO_RESPONSE
-
SL_NET_APP_DNS_NO_SERVER
-
SL_NET_APP_DNS_QUERY_FAILED
-
SL_NET_APP_DNS_MALFORMED_PACKET
-
SL_NET_APP_DNS_MISMATCHED_RESPONSE
-
-
-
See also
-
Note
Only one sl_NetAppDnsGetHostByName can be handled at a time. Calling this API while the same command is called from another thread, may result in one of the two scenarios:
-
The command will wait (internal) until the previous command finish, and then be executed.
-
There are not enough resources and POOL_IS_EMPTY error will return. In this case, MAX_CONCURRENT_ACTIONS can be increased (result in memory increase) or try again later to issue the command.
Return service attributes like IP address, port and text according to service name.
-
The user sets a service name Full/Part (see example below), and should get:
-
IP of service
-
The port of service
-
The text of service
-
-
-
Hence it can make a connection to the specific service and use it. It is similar to get host by name method. It is done by a single shot query with PTR type on the service name. The command that is sent is from constant parameters and variables parameters.
-
Parameters
-
-
[in]
pService
Service name can be full or partial.
- Example for full service name:
-
PC1._ipp._tcp.local
-
PC2_server._ftp._tcp.local
-
-
-Example for partial service name:
-
_ipp._tcp.local
-
_ftp._tcp.local
-
-
-
[in]
ServiceLen
The length of the service name (in_pService).
-
[in]
Family
IPv4 or IPv6 (SL_AF_INET , SL_AF_INET6).
-
[out]
pAddr
Contains the IP address of the service.
-
[out]
pPort
Contains the port of the service.
-
[out]
pTextLen
Has 2 options. One as Input field and the other one as output:
-
Input:
- Contains the max length of the text that the user wants to get.
- It means that if the text len of service is bigger that its value than the text is cut to inout_TextLen value.
-
Output:
- Contain the length of the text that is returned. Can be full text or part of the text (see above).
-
-
-
[out]
pOut_pText
Contains the text of the service full or partial
-
-
-
-
Returns
On success, zero is returned SL_POOL_IS_EMPTY may be return in case there are no resources in the system In this case try again later or increase MAX_CONCURRENT_ACTIONS In case No service is found error SL_NET_APP_DNS_NO_ANSWER will be returned
-
Note
The returns attributes belongs to the first service found. There may be other services with the same service name that will response to the query. The results of these responses are saved in the peer cache of the Device and should be read by another API.
-
Only one sl_NetAppDnsGetHostByService can be handled at a time. Calling this API while the same command is called from another thread, may result in one of the two scenarios:
-
The command will wait (internal) until the previous command finish, and then be executed.
-
There are not enough resources and SL_POOL_IS_EMPTY error will return. In this case, MAX_CONCURRENT_ACTIONS can be increased (result in memory increase) or try again later to issue the command.
-
-
Warning
Text length can be 120 bytes only
-
-
-
-
-
-
-
-
-
_i32 sl_NetAppGet
-
(
-
_u8
-
AppId,
-
-
-
-
-
_u8
-
Option,
-
-
-
-
-
_u8 *
-
pOptionLen,
-
-
-
-
-
_u8 *
-
pOptionValue
-
-
-
-
)
-
-
-
-
-
-
Internal function for getting network applications configurations.
-
Returns
On success, zero is returned. On error, -1 is returned
-
Parameters
-
-
[in]
AppId
Application id, could be one of the following:
-
-
SL_NET_APP_HTTP_SERVER_ID
-
SL_NET_APP_DHCP_SERVER_ID
-
-
-
[in]
Options
Get option, could be one of the following:
- NETAPP_SET_BASIC_OPT
-
[in]
OptionLen
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 ESMALLBUF
-
[out]
pValues
pointer to the option structure which will be filled with the response from the device
Get service List Insert into out pBuffer a list of peer's services that are the NWP. The list is in a form of service struct. The user should chose the type of the service struct like:
-
-
Full service parameters with text.
-
Full service parameters.
-
Short service parameters (port and IP only) especially for tiny hosts.
-
-
The different types of struct are made to give the Possibility to save memory in the host
-
The user also chose how many max services to get and start point index NWP peer cache. For example:
-
Get max of 3 full services from index 0.Up to 3 full services from index 0 are inserted into pBuffer (services that are in indexes 0,1,2).
-
Get max of 4 full services from index 3.Up to 4 full services from index 3 are inserted into pBuffer (services that are in indexes 3,4,5,6).
-
Get max of 2 int services from index 6.Up to 2 int services from index 6 are inserted into pBuffer (services that are in indexes 6,7).
-
-
See below - command parameters.
-
Parameters
-
-
[in]
indexOffset
- The start index in the peer cache that from it the first service is returned.
-
[in]
MaxServiceCount
- The Max services that can be returned if existed or if not exceed the max index in the peer cache
-
[in]
Flags
- an ENUM number that means which service struct to use (means which types of service to fill)
if the out pBuffer size is bigger than an RX packet(1480), than an error is returned because there is no place in the RX packet. The size is a multiply of MaxServiceCount and size of service struct(that is set according to flag value).
-
-
-
-
-
-
-
-
-
_i16 sl_NetAppMDNSRegisterService
-
(
-
const _i8 *
-
pServiceName,
-
-
-
-
-
_u8
-
ServiceNameLen,
-
-
-
-
-
const _i8 *
-
pText,
-
-
-
-
-
_u8
-
TextLen,
-
-
-
-
-
_u16
-
Port,
-
-
-
-
-
_u32
-
TTL,
-
-
-
-
-
_u32
-
Options
-
-
-
-
)
-
-
-
-
-
-
Register a new mDNS service.
-
This function registers a new mDNS service to the mDNS package and the DB.
-
This registered service is a service offered by the application. The service name should be full service name according to RFC of the DNS-SD - meaning the value in name field in the SRV answer. Example for service name:
-
PC1._ipp._tcp.local
-
PC2_server._ftp._tcp.local
-
-
If the option is_unique is set, mDNS probes the service name to make sure it is unique before starting to announce the service on the network. Instance is the instance portion of the service name.
-
Parameters
-
-
[in]
ServiceLen
The length of the service.
-
[in]
TextLen
The length of the service should be smaller than 64.
-
[in]
port
The port on this target host port.
-
[in]
TTL
The TTL of the service
-
[in]
Options
bitwise parameters:
-
-
bit 0 - service is unique (means that the service needs to be unique)
-
bit 31 - for internal use if the service should be added or deleted (set means ADD).
-
bit 1-30 for future.
-
-
-
[in]
pServiceName
The service name. Example for service name:
-
-
PC1._ipp._tcp.local
-
PC2_server._ftp._tcp.local
-
-
-
[in]
pText
The description of the service. should be as mentioned in the RFC (according to type of the service IPP,FTP...)
-
-
-
-
Returns
On success, zero is returned Possible error codes:
-
Maximum advertise services are already configured. Delete another existed service that is registered and then register again the new service
-
Trying to register a service that is already exists
-
Trying to delete service that does not existed
-
Illegal service name according to the RFC
-
Retry request
-
Illegal length of one of the mDNS Set functions
-
mDNS is not operational as the device has no IP.Connect the device to an AP to get an IP address.
-
mDNS parameters error
-
mDNS internal cache error
-
mDNS internal error
-
Adding a service is not allowed as it is already exist (duplicate service)
-
mDNS is not running
-
Host name error. Host name format is not allowed according to RFC 1033,1034,1035, 6763
-
List size buffer is bigger than internally allowed in the NWP (API get service list), change the APIs’ parameters to decrease the size of the list
1) Temporary - there is an allocation on stack of internal buffer. Its size is NETAPP_MDNS_MAX_SERVICE_NAME_AND_TEXT_LENGTH.
- It means that the sum of the text length and service name length cannot be bigger than NETAPP_MDNS_MAX_SERVICE_NAME_AND_TEXT_LENGTH.
- If it is - An error is returned.
- 2) According to now from certain constraints the variables parameters are set in the attribute part (contain constant parameters)
-
-
-
-
-
-
-
-
-
_i16 sl_NetAppMDNSUnRegisterService
-
(
-
const _i8 *
-
pServiceName,
-
-
-
-
-
_u8
-
ServiceNameLen
-
-
-
-
)
-
-
-
-
-
-
Unregister mDNS service This function deletes the mDNS service from the mDNS package and the database.
-
The mDNS service that is to be unregistered is a service that the application no longer wishes to provide.
-The service name should be the full service name according to RFC of the DNS-SD - meaning the value in name field in the SRV answer.
Ping uses the ICMP protocol's mandatory ECHO_REQUEST
-
Parameters
-
-
[in]
pPingParams
Pointer to the ping request structure:
-
-
if flags parameter is set to 0, ping will report back once all requested pings are done (as defined by TotalNumberOfAttempts).
-
-
if flags parameter is set to 1, ping will report back after every ping, for TotalNumberOfAttempts.
-
if flags parameter is set to 2, ping will stop after the first successful ping, and report back for the successful ping, as well as any preceding failed ones. For stopping an ongoing ping activity, set parameters IP address to 0
-
-
-
[in]
family
SL_AF_INET or SL_AF_INET6
-
[out]
pReport
Ping pReport
-
[out]
pCallback
Callback function upon completion. If callback is NULL, the API is blocked until data arrives
-
-
-
-
Returns
On success, zero is returned. On error, -1 is returned SL_POOL_IS_EMPTY may be return in case there are no resources in the system In this case try again later or increase MAX_CONCURRENT_ACTIONS
-
See also
sl_NetAppPingReport
-
Note
Only one sl_NetAppPingStart can be handled at a time. Calling this API while the same command is called from another thread, may result in one of the two scenarios:
-
The command will wait (internal) until the previous command finish, and then be executed.
-
There are not enough resources and SL_POOL_IS_EMPTY error will return. In this case, MAX_CONCURRENT_ACTIONS can be increased (result in memory increase) or try again later to issue the command.
-
-
-
Warning
-
Example:
An example of sending 20 ping requests and reporting results to a callback routine when
dhcpParams.lease_time = 4096; // lease time (in seconds) of the IP Address
-
dhcpParams.ipv4_addr_start = SL_IPV4_VAL(192,168,1,10); // first IP Address for allocation. IP Address should be set as Hex number - i.e. 0A0B0C01 for (10.11.12.1)
-
dhcpParams.ipv4_addr_last = SL_IPV4_VAL(192,168,1,16); // last IP Address for allocation. IP Address should be set as Hex number - i.e. 0A0B0C01 for (10.11.12.1)
-
sl_NetAppStop(SL_NET_APP_DHCP_SERVER_ID); // Stop DHCP server before settings
-
sl_NetAppSet(SL_NET_APP_DHCP_SERVER_ID, NETAPP_SET_DHCP_SRV_BASIC_OPT, outLen, (_u8* )&dhcpParams); // set parameters
-
sl_NetAppStart(SL_NET_APP_DHCP_SERVER_ID); // Start DHCP server with new settings
-
Set Device URN name example:
-
-
Device name, maximum length of 33 characters
-
Device name affects URN name, own SSID name in AP mode, and WPS file "device name" in WPS I.E (STA-WPS / P2P)
-
In case no device URN name set, the default name is "mysimplelink"
-
Allowed characters in device name are: 'a - z' , 'A - Z' , '0-9' and '-'
Get service List Insert into out pBuffer a list of peer's services that are the NWP. The list is in a form of service struct. The user should chose the type of the service struct like: More...
Internal function for getting network applications configurations. More...
+
+
+
Detailed Description
+
Function Documentation
+
+
+
+
+
+
_i16 sl_NetAppDnsGetHostByName
+
(
+
_i8 *
+
hostname,
+
+
+
+
+
const _u16
+
usNameLen,
+
+
+
+
+
_u32 *
+
out_ip_addr,
+
+
+
+
+
const _u8
+
family
+
+
+
+
)
+
+
+
+
+
+
Get host IP by name.
+
Obtain the IP Address of machine on network, by machine name.
+
Parameters
+
+
[in]
hostname
host name
+
[in]
usNameLen
name length
+
[out]
out_ip_addr
This parameter is filled in with host IP address. In case that host name is not resolved, out_ip_addr is zero.
+
[in]
family
protocol family
+
+
+
+
Returns
On success, 0 is returned. On error, negative is returned SL_POOL_IS_EMPTY may be return in case there are no resources in the system In this case try again later or increase MAX_CONCURRENT_ACTIONS Possible DNS error codes:
+
SL_NET_APP_DNS_QUERY_NO_RESPONSE
+
SL_NET_APP_DNS_NO_SERVER
+
SL_NET_APP_DNS_QUERY_FAILED
+
SL_NET_APP_DNS_MALFORMED_PACKET
+
SL_NET_APP_DNS_MISMATCHED_RESPONSE
+
+
+
See Also
+
Note
Only one sl_NetAppDnsGetHostByName can be handled at a time. Calling this API while the same command is called from another thread, may result in one of the two scenarios:
+
The command will wait (internal) until the previous command finish, and then be executed.
+
There are not enough resources and POOL_IS_EMPTY error will return. In this case, MAX_CONCURRENT_ACTIONS can be increased (result in memory increase) or try again later to issue the command.
+
+
+
Warning
In case an IP address in a string format is set as input, without any prefix (e.g. "1.2.3.4") the device will not try to access the DNS and it will return the input address on the 'out_ip_addr' field
Return service attributes like IP address, port and text according to service name.
+
The user sets a service name Full/Part (see example below), and should get:
+
IP of service
+
The port of service
+
The text of service
+
+
+
Hence it can make a connection to the specific service and use it. It is similar to get host by name method. It is done by a single shot query with PTR type on the service name. The command that is sent is from constant parameters and variables parameters.
+
Parameters
+
+
[in]
pService
Service name can be full or partial.
+ Example for full service name:
+
PC1._ipp._tcp.local
+
PC2_server._ftp._tcp.local
+
+
+Example for partial service name:
+
_ipp._tcp.local
+
_ftp._tcp.local
+
+
+
[in]
ServiceLen
The length of the service name (in_pService).
+
[in]
Family
IPv4 or IPv6 (SL_AF_INET , SL_AF_INET6).
+
[out]
pAddr
Contains the IP address of the service.
+
[out]
pPort
Contains the port of the service.
+
[out]
pTextLen
Has 2 options. One as Input field and the other one as output:
+
Input:
+ Contains the max length of the text that the user wants to get.
+ It means that if the text len of service is bigger that its value than the text is cut to inout_TextLen value.
+
Output:
+ Contain the length of the text that is returned. Can be full text or part of the text (see above).
+
+
+
[out]
pOut_pText
Contains the text of the service full or partial
+
+
+
+
Returns
On success, zero is returned SL_POOL_IS_EMPTY may be return in case there are no resources in the system In this case try again later or increase MAX_CONCURRENT_ACTIONS In case No service is found error SL_NET_APP_DNS_NO_ANSWER will be returned
+
Note
The returns attributes belongs to the first service found. There may be other services with the same service name that will response to the query. The results of these responses are saved in the peer cache of the Device and should be read by another API.
+
Only one sl_NetAppDnsGetHostByService can be handled at a time. Calling this API while the same command is called from another thread, may result in one of the two scenarios:
+
+
The command will wait (internal) until the previous command finish, and then be executed.
+
There are not enough resources and SL_POOL_IS_EMPTY error will return. In this case, MAX_CONCURRENT_ACTIONS can be increased (result in memory increase) or try again later to issue the command.
+
+
Warning
Text length can be 120 bytes only
+
+
+
+
+
+
+
+
+
_i32 sl_NetAppGet
+
(
+
const _u8
+
AppId,
+
+
+
+
+
const _u8
+
Option,
+
+
+
+
+
_u8 *
+
pOptionLen,
+
+
+
+
+
_u8 *
+
pOptionValue
+
+
+
+
)
+
+
+
+
+
+
Internal function for getting network applications configurations.
+
Returns
On success, zero is returned. On error, -1 is returned
+
Parameters
+
+
[in]
AppId
Application id, could be one of the following:
+
+
SL_NET_APP_HTTP_SERVER_ID
+
SL_NET_APP_DHCP_SERVER_ID
+
SL_NET_APP_MDNS_ID
+
SL_NET_APP_DEVICE_CONFIG_ID
+
+
+
[in]
SetOptions
set option, could be one of the following:
+
+
SL_NET_APP_DHCP_SERVER_ID
+
NETAPP_SET_DHCP_SRV_BASIC_OPT
+
+
+
SL_NET_APP_HTTP_SERVER_ID
+
NETAPP_SET_GET_HTTP_OPT_PORT_NUMBER
+
NETAPP_SET_GET_HTTP_OPT_AUTH_CHECK
+
NETAPP_SET_GET_HTTP_OPT_AUTH_NAME
+
NETAPP_SET_GET_HTTP_OPT_AUTH_PASSWORD
+
NETAPP_SET_GET_HTTP_OPT_AUTH_REALM
+
NETAPP_SET_GET_HTTP_OPT_ROM_PAGES_ACCESS
+
+
+
SL_NET_APP_MDNS_ID
+
NETAPP_SET_GET_MDNS_CONT_QUERY_OPT
+
NETAPP_SET_GET_MDNS_QEVETN_MASK_OPT
+
NETAPP_SET_GET_MDNS_TIMING_PARAMS_OPT
+
+
+
SL_NET_APP_DEVICE_CONFIG_ID
+
NETAPP_SET_GET_DEV_CONF_OPT_DEVICE_URN
+
NETAPP_SET_GET_DEV_CONF_OPT_DOMAIN_NAME
+
+
+
+
+
[in]
OptionLen
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 ESMALLBUF
+
[out]
pValues
pointer to the option structure which will be filled with the response from the device
Get service List Insert into out pBuffer a list of peer's services that are the NWP. The list is in a form of service struct. The user should chose the type of the service struct like:
+
- Full service parameters with text.
+ - Full service parameters.
+ - Short service parameters (port and IP only) especially for tiny hosts.
+
The different types of struct are made to give the Possibility to save memory in the host
+
The user also chose how many max services to get and start point index NWP peer cache. For example:
+
+
Get max of 3 full services from index 0.Up to 3 full services from index 0 are inserted into pBuffer (services that are in indexes 0,1,2).
+
Get max of 4 full services from index 3.Up to 4 full services from index 3 are inserted into pBuffer (services that are in indexes 3,4,5,6).
+
Get max of 2 int services from index 6.Up to 2 int services from index 6 are inserted into pBuffer (services that are in indexes 6,7).
+
+
See below - command parameters.
+
Parameters
+
+
[in]
indexOffset
- The start index in the peer cache that from it the first service is returned.
+
[in]
MaxServiceCount
- The Max services that can be returned if existed or if not exceed the max index in the peer cache
+
[in]
Flags
- an ENUM number that means which service struct to use (means which types of service to fill)
if the out pBuffer size is bigger than an RX packet(1480), than an error is returned because there is no place in the RX packet. The size is a multiply of MaxServiceCount and size of service struct(that is set according to flag value).
+
+
+
+
+
+
+
+
+
_i16 sl_NetAppMDNSRegisterService
+
(
+
const _i8 *
+
pServiceName,
+
+
+
+
+
const _u8
+
ServiceNameLen,
+
+
+
+
+
const _i8 *
+
pText,
+
+
+
+
+
const _u8
+
TextLen,
+
+
+
+
+
const _u16
+
Port,
+
+
+
+
+
const _u32
+
TTL,
+
+
+
+
+
_u32
+
Options
+
+
+
+
)
+
+
+
+
+
+
Register a new mDNS service.
+
This function registers a new mDNS service to the mDNS package and the DB.
+
This registered service is a service offered by the application. The service name should be full service name according to RFC of the DNS-SD - meaning the value in name field in the SRV answer. Example for service name:
+
+
PC1._ipp._tcp.local
+
PC2_server._ftp._tcp.local
+
+
If the option is_unique is set, mDNS probes the service name to make sure it is unique before starting to announce the service on the network. Instance is the instance portion of the service name.
+
Parameters
+
+
[in]
ServiceLen
The length of the service.
+
[in]
TextLen
The length of the service should be smaller than 64.
+
[in]
port
The port on this target host port.
+
[in]
TTL
The TTL of the service
+
[in]
Options
bitwise parameters:
+
+
bit 0 - service is unique (means that the service needs to be unique)
+
bit 31 - for internal use if the service should be added or deleted (set means ADD).
+
bit 1-30 for future.
+
+
+
[in]
pServiceName
The service name. Example for service name:
+
+
PC1._ipp._tcp.local
+
PC2_server._ftp._tcp.local
+
+
+
[in]
pText
The description of the service. should be as mentioned in the RFC (according to type of the service IPP,FTP...)
+
+
+
+
Returns
On success, zero is returned Possible error codes:
+
Maximum advertise services are already configured. Delete another existed service that is registered and then register again the new service
+
Trying to register a service that is already exists
+
Trying to delete service that does not existed
+
Illegal service name according to the RFC
+
Retry request
+
Illegal length of one of the mDNS Set functions
+
mDNS is not operational as the device has no IP.Connect the device to an AP to get an IP address.
+
mDNS parameters error
+
mDNS internal cache error
+
mDNS internal error
+
Adding a service is not allowed as it is already exist (duplicate service)
+
mDNS is not running
+
Host name error. Host name format is not allowed according to RFC 1033,1034,1035, 6763
+
List size buffer is bigger than internally allowed in the NWP (API get service list), change the APIs’ parameters to decrease the size of the list
1) Temporary - there is an allocation on stack of internal buffer. Its size is NETAPP_MDNS_MAX_SERVICE_NAME_AND_TEXT_LENGTH.
+ It means that the sum of the text length and service name length cannot be bigger than NETAPP_MDNS_MAX_SERVICE_NAME_AND_TEXT_LENGTH.
+ If it is - An error is returned.
+ 2) According to now from certain constraints the variables parameters are set in the attribute part (contain constant parameters)
+
+
+
+
+
+
+
+
+
_i16 sl_NetAppMDNSUnRegisterService
+
(
+
const _i8 *
+
pServiceName,
+
+
+
+
+
const _u8
+
ServiceNameLen
+
+
+
+
)
+
+
+
+
+
+
Unregister mDNS service This function deletes the mDNS service from the mDNS package and the database.
+
The mDNS service that is to be unregistered is a service that the application no longer wishes to provide.
+ The service name should be the full service name according to RFC of the DNS-SD - meaning the value in name field in the SRV answer.
Ping uses the ICMP protocol's mandatory ECHO_REQUEST
+
Parameters
+
+
[in]
pPingParams
Pointer to the ping request structure:
+
+
if flags parameter is set to 0, ping will report back once all requested pings are done (as defined by TotalNumberOfAttempts).
+
+
if flags parameter is set to 1, ping will report back after every ping, for TotalNumberOfAttempts.
+
if flags parameter is set to 2, ping will stop after the first successful ping, and report back for the successful ping, as well as any preceding failed ones. For stopping an ongoing ping activity, set parameters IP address to 0
+
+
+
[in]
family
SL_AF_INET or SL_AF_INET6
+
[out]
pReport
Ping pReport
+
[out]
pCallback
Callback function upon completion. If callback is NULL, the API is blocked until data arrives
+
+
+
+
Returns
On success, zero is returned. On error, -1 is returned SL_POOL_IS_EMPTY may be return in case there are no resources in the system In this case try again later or increase MAX_CONCURRENT_ACTIONS
+
See Also
sl_NetAppPingReport
+
Note
Only one sl_NetAppPingStart can be handled at a time. Calling this API while the same command is called from another thread, may result in one of the two scenarios:
+
The command will wait (internal) until the previous command finish, and then be executed.
+
There are not enough resources and SL_POOL_IS_EMPTY error will return. In this case, MAX_CONCURRENT_ACTIONS can be increased (result in memory increase) or try again later to issue the command.
+
+
+
Warning
+
Example:
An example of sending 20 ping requests and reporting results to a callback routine when
dhcpParams.lease_time = 4096; // lease time (in seconds) of the IP Address
+
dhcpParams.ipv4_addr_start = SL_IPV4_VAL(192,168,1,10); // first IP Address for allocation. IP Address should be set as Hex number - i.e. 0A0B0C01 for (10.11.12.1)
+
dhcpParams.ipv4_addr_last = SL_IPV4_VAL(192,168,1,16); // last IP Address for allocation. IP Address should be set as Hex number - i.e. 0A0B0C01 for (10.11.12.1)
+
sl_NetAppStop(SL_NET_APP_DHCP_SERVER_ID); // Stop DHCP server before settings
+
sl_NetAppSet(SL_NET_APP_DHCP_SERVER_ID, NETAPP_SET_DHCP_SRV_BASIC_OPT, outLen, (_u8* )&dhcpParams); // set parameters
+
sl_NetAppStart(SL_NET_APP_DHCP_SERVER_ID); // Start DHCP server with new settings
+
Set Device URN name example:
+
+
Device name, maximum length of 33 characters
+
Device name affects URN name, own SSID name in AP mode, and WPS file "device name" in WPS I.E (STA-WPS / P2P)
+
In case no device URN name set, the default name is "mysimplelink"
+
Allowed characters in device name are: 'a - z' , 'A - Z' , '0-9' and '-'
Internal function for getting network configurations. More...
-
-
-
Detailed Description
-
Function Documentation
-
-
-
-
-
-
_i32 sl_NetCfgGet
-
(
-
_u8
-
ConfigId,
-
-
-
-
-
_u8 *
-
pConfigOpt,
-
-
-
-
-
_u8 *
-
pConfigLen,
-
-
-
-
-
_u8 *
-
pValues
-
-
-
-
)
-
-
-
-
-
-
Internal function for getting network configurations.
-
Returns
On success, zero is returned. On error, -1 is returned
-
Parameters
-
-
[in]
ConfigId
configuration id
-
[out]
pConfigOpt
Get configurations option
-
[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 ESMALLBUF
-
[out]
pValues
- get configurations values
-
-
-
-
See also
-
Note
-
Warning
-
Examples:
SL_MAC_ADDRESS_GET:
-
-
Get the device MAC address.
-
The returned MAC address is taken from FileSystem first. If the MAC address was not set by SL_MAC_ADDRESS_SET, the default MAC address
Internal function for getting network configurations. More...
+
+
+
Detailed Description
+
Function Documentation
+
+
+
+
+
+
_i32 sl_NetCfgGet
+
(
+
const _u8
+
ConfigId,
+
+
+
+
+
_u8 *
+
pConfigOpt,
+
+
+
+
+
_u8 *
+
pConfigLen,
+
+
+
+
+
_u8 *
+
pValues
+
+
+
+
)
+
+
+
+
+
+
Internal function for getting network configurations.
+
Returns
On success, zero is returned. On error, -1 is returned
+
Parameters
+
+
[in]
ConfigId
configuration id
+
[out]
pConfigOpt
Get configurations option
+
[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 ESMALLBUF
+
[out]
pValues
- get configurations values
+
+
+
+
See Also
+
Note
+
Warning
+
Examples:
SL_MAC_ADDRESS_GET:
+
+
Get the device MAC address.
+
The returned MAC address is taken from FileSystem first. If the MAC address was not set by SL_MAC_ADDRESS_SET, the default MAC address
The simple link device can work with different communication channels (e.g. spi/uart). Texas Instruments provides single driver that can work with all these types. This section bind between the physical communication interface channel and the SimpleLink driver
-
Note
Correct and efficient implementation of this driver is critical for the performances of the SimpleLink device on this platform.
-
PORTING ACTION:
-
None
-
-
Macro Definition Documentation
-
-
-
-
-
-
#define sl_IfClose spi_Close
-
-
-
-
-
Closes an opened interface communication port.
-
Parameters
-
-
fd
- file descriptor of opened communication channel
-
-
-
-
Returns
upon successful completion, the function shall return 0. Otherwise, -1 shall be returned
Opens an interface communication port to be used for communicating with a SimpleLink device.
-
Given an interface name and option flags, this function opens the communication port and creates a file descriptor. This file descriptor is used afterwards to read and write data from and to this specific communication channel. The speed, clock polarity, clock phase, chip select and all other specific attributes of the channel are all should be set to hardcoded in this function.
-
Parameters
-
-
ifName
- points to the interface name/path. The interface name is an optional attributes that the simple link driver receives on opening the driver (sl_Start). In systems that the spi channel is not implemented as part of the os device drivers, this parameter could be NULL.
-
flags
- optional flags parameters for future use
-
-
-
-
Returns
upon successful completion, the function shall open the channel and return a non-negative integer representing the file descriptor. Otherwise, -1 shall be returned
register an interrupt handler routine for the host IRQ
-
Parameters
-
-
InterruptHdl
- pointer to interrupt handler routine
-
pValue
- pointer to a memory structure that is passed to the interrupt handler.
-
-
-
-
Returns
upon successful registration, the function shall return 0. Otherwise, -1 shall be returned
-
See also
\note If there is already registered interrupt handler, the function
- should overwrite the old handler with the new one
-
-\note If the handler is a null pointer, the function should un-register the
- interrupt handler, and the interrupts can be disabled.
-
\note This function could be implemented as zero copy and return only upon successful completion
- of writing the whole buffer, but in cases that memory allocation is not too tight, the
- function could copy the data to internal buffer, return back and complete the write in
- parallel to other activities as long as the other SPI activities would be blocked until
- the entire buffer write would be completed
-
- The prototype of the function is as follow:
- int xxx_IfWrite(Fd_t Fd , char* pBuff , int Len);
-
type definition for a locking object container More...
-
-
-
Detailed Description
-
The simple link driver can run on multi-threaded environment as well as non-os environment (mail loop)
-
This section IS NOT REQUIRED in case you are working on non-os environment.
-
If you choose to work in multi-threaded environment under any operating system you will have to provide some basic adaptation routines to allow the driver to protect access to resources from different threads (locking object) and to allow synchronization between threads (sync objects).
-
PORTING ACTION:
-
Uncomment SL_PLATFORM_MULTI_THREADED define
-
Bind locking object routines
-
Bind synchronization object routines
-
Optional - Bind spawn thread routine
-
-
Macro Definition Documentation
-
-
-
-
-
-
#define _SlTime_t OsiTime_t
-
-
-
-
-
type definition for a time value
-
Note
On each porting or platform the type could be whatever is needed - integer, pointer to structure etc.
-
-belongs to ported_sec
-
-
-
-
-
-
-
-
-
#define sl_LockObjCreate
-
(
-
-
pLockObj,
-
-
-
-
-
-
pName
-
-
-
-
)
-
osi_LockObjCreate(pLockObj)
-
-
-
-
-
This function creates a locking object.
-
The locking object is used for protecting a shared resources between different threads.
-
Parameters
-
-
pLockObj
- pointer to the locking object control block
-
-
-
-
Returns
upon successful creation the function should return 0 Otherwise, a negative value indicating the error code shall be returned
-
Note
belongs to ported_sec
-
Warning
-
-
-
-
-
-
-
-
-
#define sl_LockObjDelete
-
(
-
-
pLockObj
)
-
osi_LockObjDelete(pLockObj)
-
-
-
-
-
This function deletes a locking object.
-
Parameters
-
-
pLockObj
- pointer to the locking object control block
-
-
-
-
Returns
upon successful deletion the function should return 0 Otherwise, a negative value indicating the error code shall be returned
-
Note
belongs to ported_sec
-
Warning
-
-
-
-
-
-
-
-
-
#define sl_LockObjLock
-
(
-
-
pLockObj,
-
-
-
-
-
-
Timeout
-
-
-
-
)
-
osi_LockObjLock(pLockObj,Timeout)
-
-
-
-
-
This function locks a locking object.
-
All other threads that call this function before this thread calls the osi_LockObjUnlock would be suspended
-
Parameters
-
-
pLockObj
- pointer to the locking object control block
-
Timeout
- numeric value specifies the maximum number of mSec to stay suspended while waiting for the locking object Currently, the simple link driver uses only two values:
-
OSI_WAIT_FOREVER
-
OSI_NO_WAIT
-
-
-
-
-
-
\return upon successful reception of the locking object the function should return 0
- Otherwise, a negative value indicating the error code shall be returned
-
Note
belongs to ported_sec
-
Warning
-
-
-
-
-
-
-
-
-
#define sl_LockObjUnlock
-
(
-
-
pLockObj
)
-
osi_LockObjUnlock(pLockObj)
-
-
-
-
-
This function unlock a locking object.
-
Parameters
-
-
pLockObj
- pointer to the locking object control block
-
-
-
-
Returns
upon successful unlocking the function should return 0 Otherwise, a negative value indicating the error code shall be returned
This function call the pEntry callback from a different context.
-
Parameters
-
-
pEntry
- pointer to the entry callback function
-
pValue
- pointer to any type of memory structure that would be passed to pEntry callback from the execution thread.
-
flags
- execution flags - reserved for future usage
-
-
-
-
Returns
upon successful registration of the spawn the function should return 0 (the function is not blocked till the end of the execution of the function and could be returned before the execution is actually completed) Otherwise, a negative value indicating the error code shall be returned
-
Note
belongs to ported_sec
-
Warning
-
-
-
-
-
-
-
-
-
#define sl_SyncObjCreate
-
(
-
-
pSyncObj,
-
-
-
-
-
-
pName
-
-
-
-
)
-
osi_SyncObjCreate(pSyncObj)
-
-
-
-
-
This function creates a sync object.
-
The sync object is used for synchronization between diffrent thread or ISR and a thread.
-
Parameters
-
-
pSyncObj
- pointer to the sync object control block
-
-
-
-
Returns
upon successful creation the function should return 0 Otherwise, a negative value indicating the error code shall be returned
-
Note
belongs to ported_sec
-
Warning
-
-
-
-
-
-
-
-
-
#define sl_SyncObjDelete
-
(
-
-
pSyncObj
)
-
osi_SyncObjDelete(pSyncObj)
-
-
-
-
-
This function deletes a sync object.
-
Parameters
-
-
pSyncObj
- pointer to the sync object control block
-
-
-
-
Returns
upon successful deletion the function should return 0 Otherwise, a negative value indicating the error code shall be returned
-
Note
belongs to ported_sec
-
Warning
-
-
-
-
-
-
-
-
-
#define sl_SyncObjSignal
-
(
-
-
pSyncObj
)
-
osi_SyncObjSignal(pSyncObj)
-
-
-
-
-
This function generates a sync signal for the object.
-
All suspended threads waiting on this sync object are resumed
-
Parameters
-
-
pSyncObj
- pointer to the sync object control block
-
-
-
-
Returns
upon successful signaling the function should return 0 Otherwise, a negative value indicating the error code shall be returned
-
Note
the function could be called from ISR context
-
Warning
-
-
-
-
-
-
-
-
-
#define sl_SyncObjSignalFromIRQ
-
(
-
-
pSyncObj
)
-
osi_SyncObjSignalFromISR(pSyncObj)
-
-
-
-
-
This function generates a sync signal for the object from Interrupt.
-
This is for RTOS that should signal from IRQ using a dedicated API
-
Parameters
-
-
pSyncObj
- pointer to the sync object control block
-
-
-
-
Returns
upon successful signaling the function should return 0 Otherwise, a negative value indicating the error code shall be returned
-
Note
the function could be called from ISR context
-
Warning
-
-
-
-
-
-
-
-
-
#define sl_SyncObjWait
-
(
-
-
pSyncObj,
-
-
-
-
-
-
Timeout
-
-
-
-
)
-
osi_SyncObjWait(pSyncObj,Timeout)
-
-
-
-
-
This function waits for a sync signal of the specific sync object.
-
Parameters
-
-
pSyncObj
- pointer to the sync object control block
-
Timeout
- numeric value specifies the maximum number of mSec to stay suspended while waiting for the sync signal Currently, the simple link driver uses only two values:
-
OSI_WAIT_FOREVER
-
OSI_NO_WAIT
-
-
-
-
-
-
Returns
upon successful reception of the signal within the timeout window return 0 Otherwise, a negative value indicating the error code shall be returned
Locking object are used to protect a resource from mutual accesses of two or more threads. The locking object should suppurt reentrant locks by a signal thread. This object is generally implemented by mutex semaphore
-
Note
On each porting or platform the type could be whatever is needed - integer, structure etc.
Sync object is object used to synchronize between two threads or thread and interrupt handler. One thread is waiting on the object and the other thread send a signal, which then release the waiting thread. The signal must be able to be sent from interrupt context. This object is generally implemented by binary semaphore or events.
-
Note
On each porting or platform the type could be whatever is needed - integer, structure etc.
Defines whether to include socket send APIs in SimpleLink driver or not. More...
-
-
-
Detailed Description
-
This section IS NOT REQUIRED in case one of the following pre defined capabilities set is in use:
-
SL_TINY
-
SL_SMALL
-
SL_FULL
-
-
PORTING ACTION:
-
Define one of the pre-defined capabilities set or uncomment the relevant definitions below to select the required capabilities
-
-
Macro Definition Documentation
-
-
-
-
-
-
#define SL_INC_ARG_CHECK
-
-
-
-
-
Defines whether the SimpleLink driver perform argument check or not.
-
When defined, the SimpleLink driver perform argument check on function call. Removing this define could reduce some code size and improve slightly the performances but may impact in unpredictable behavior in case of invalid arguments
-
See also
-
Note
belongs to porting_sec
-
Warning
Removing argument check may cause unpredictable behavior in case of invalid arguments. In this case the user is responsible to argument validity (for example all handlers must not be NULL)
-
-
-
-
-
-
-
-
-
#define SL_INC_EXT_API
-
-
-
-
-
Defines whether to include extended API in SimpleLink driver or not.
-
When defined, the SimpleLink driver will include also all exteded API of the included packages
-
See also
ext_api
-
Note
belongs to porting_sec
-
Warning
-
-
-
-
-
-
-
-
-
#define SL_INC_NET_APP_PKG
-
-
-
-
-
Defines whether to include NET_APP package in SimpleLink driver or not.
-
When defined, the SimpleLink driver will include also the NET_APP package
-
See also
-
Note
belongs to porting_sec
-
Warning
-
-
-
-
-
-
-
-
-
#define SL_INC_NET_CFG_PKG
-
-
-
-
-
Defines whether to include NET_CFG package in SimpleLink driver or not.
-
When defined, the SimpleLink driver will include also the NET_CFG package
-
See also
-
Note
belongs to porting_sec
-
Warning
-
-
-
-
-
-
-
-
-
#define SL_INC_NVMEM_PKG
-
-
-
-
-
Defines whether to include NVMEM package in SimpleLink driver or not.
-
When defined, the SimpleLink driver will include also the NVMEM package
-
See also
-
Note
belongs to porting_sec
-
Warning
-
-
-
-
-
-
-
-
-
#define SL_INC_SOCK_CLIENT_SIDE_API
-
-
-
-
-
Defines whether to include socket client side APIs in SimpleLink driver or not.
-
When defined, the SimpleLink driver will include also socket client side APIs
-
See also
client_side
-
Note
belongs to porting_sec
-
Warning
-
-
-
-
-
-
-
-
-
#define SL_INC_SOCK_RECV_API
-
-
-
-
-
Defines whether to include socket receive APIs in SimpleLink driver or not.
-
When defined, the SimpleLink driver will include also socket receive side APIs
-
See also
recv_api
-
Note
belongs to porting_sec
-
Warning
-
-
-
-
-
-
-
-
-
#define SL_INC_SOCK_SEND_API
-
-
-
-
-
Defines whether to include socket send APIs in SimpleLink driver or not.
-
When defined, the SimpleLink driver will include also socket send side APIs
-
See also
send_api
-
Note
belongs to porting_sec
-
Warning
-
-
-
-
-
-
-
-
-
#define SL_INC_SOCK_SERVER_SIDE_API
-
-
-
-
-
Defines whether to include socket server side APIs in SimpleLink driver or not.
-
When defined, the SimpleLink driver will include also socket server side APIs
-
See also
server_side
-
Note
-
Warning
-
-
-
-
-
-
-
-
-
#define SL_INC_SOCKET_PKG
-
-
-
-
-
Defines whether to include SOCKET package in SimpleLink driver or not.
-
When defined, the SimpleLink driver will include also the SOCKET package
-
See also
-
Note
belongs to porting_sec
-
Warning
-
-
-
-
-
-
-
-
-
#define SL_INC_STD_BSD_API_NAMING
-
-
-
-
-
Defines whether SimpleLink driver should expose standard BSD APIs or not.
-
When defined, the SimpleLink driver in addtion to its alternative BSD APIs expose also standard BSD APIs. Stadrad BSD API includs the following functions: socket , close , accept , bind , listen , connect , select , setsockopt , getsockopt , recv , recvfrom , write , send , sendto , gethostbyname
-
See also
-
Note
belongs to porting_sec
-
Warning
-
-
-
-
-
-
-
-
-
#define SL_INC_WLAN_PKG
-
-
-
-
-
Defines whether to include WLAN package in SimpleLink driver or not.
-
When defined, the SimpleLink driver will include also the WLAN package
Disable the device by setting the appropriate GPIO to Low.
-
-
Detailed Description
-
The enable/disable line (nHib) provide mechanism to enter the device into the least current consumption mode. This mode could be used when no traffic is required (tx/rx). when this hardware line is not connected to any IO of the host this define should be left empty.
-
Note:
Not connecting this line results in ability to start the driver only once.
-
PORTING ACTION:
-
-
Bind the GPIO that is connected to the device to the SimpleLink driver
-
-
Define Documentation
-
-
-
-
-
-
#define sl_DeviceDisable
-
(
-
)
-
NwpPowerOff()
-
-
-
-
-
-
Disable the device by setting the appropriate GPIO to Low.
if nHib/nShutdown pins are not connected to the host this define should be left empty. Not connecting on of these lines may result in higher power consumption and inability to start and stop the driver correctly.
-
-
-
-
-
-
-
-
-
#define sl_DeviceEnable
-
(
-
)
-
NwpPowerOn()
-
-
-
-
-
-
Enable the device by set the appropriate GPIO to high.
if nHib/nShutdown pins are not connected to the host this define should be left empty. Not connecting on of these lines may result in higher power consumption and inability to start and stop the driver correctly.
An event handler for WLAN connection or disconnection indication This event handles async WLAN events. Possible events are: SL_WLAN_CONNECT_EVENT - indicates WLAN is connected SL_WLAN_DISCONNECT_EVENT - indicates WLAN is disconnected. More...
An event handler for IP address asynchronous event. Usually accepted after new WLAN connection. This event handles networking events. Possible events are: SL_NETAPP_IPV4_ACQUIRED - IP address was acquired (DHCP or Static) More...
A callback for HTTP server events. Possible events are: SL_NETAPP_HTTPGETTOKENVALUE - NWP requests to get the value of a specific token SL_NETAPP_HTTPPOSTTOKENVALUE - NWP post to the host a new value for a specific token. More...
-
-
-
Detailed Description
-
This section includes the asynchronous event handlers routines
-
PORTING ACTION: -Uncomment the required handler and define your routine as the value of this handler
A callback for HTTP server events. Possible events are: SL_NETAPP_HTTPGETTOKENVALUE - NWP requests to get the value of a specific token SL_NETAPP_HTTPPOSTTOKENVALUE - NWP post to the host a new value for a specific token.
-
Parameters
-
-
pServerEvent
- Contains the relevant event information (SL_NETAPP_HTTPGETTOKENVALUE or SL_NETAPP_HTTPPOSTTOKENVALUE)
-
pServerResponse
- Should be filled by the user with the relevant response information (i.e SL_NETAPP_HTTPSETTOKENVALUE as a response to SL_NETAPP_HTTPGETTOKENVALUE event)
An event handler for IP address asynchronous event. Usually accepted after new WLAN connection. This event handles networking events. Possible events are: SL_NETAPP_IPV4_ACQUIRED - IP address was acquired (DHCP or Static)
-
See also
-
Note
belongs to porting_sec
-
Warning
-
-
-
-
-
-
-
-
-
#define sl_WlanEvtHdlr SimpleLinkWlanEventHandler
-
-
-
-
-
An event handler for WLAN connection or disconnection indication This event handles async WLAN events. Possible events are: SL_WLAN_CONNECT_EVENT - indicates WLAN is connected SL_WLAN_DISCONNECT_EVENT - indicates WLAN is disconnected.
The simple link device can work with different communication channels (e.g. spi/uart). Texas Instruments provides single driver that can work with all these types. This section bind between the physical communication interface channel and the SimpleLink driver
-
Note:
Correct and efficient implementation of this driver is critical for the performances of the SimpleLink device on this platform.
-
PORTING ACTION:
-
-
Bind the functions of the communication channel interface driver with the simple link driver
-
-
Define Documentation
-
-
-
-
-
-
#define sl_IfClose spi_Close
-
-
-
-
-
-
Closes an opened interface communication port.
-
Parameters:
-
-
fd
- file descriptor of opened communication channel
-
-
-
-
Returns:
upon successful completion, the function shall return 0. Otherwise, -1 shall be returned
Opens an interface communication port to be used for communicating with a SimpleLink device.
-
Given an interface name and option flags, this function opens the communication port and creates a file descriptor. This file descriptor is used afterwards to read and write data from and to this specific communication channel. The speed, clock polarity, clock phase, chip select and all other specific attributes of the channel are all should be set to hardcoded in this function.
-
Parameters:
-
-
ifName
- points to the interface name/path. The interface name is an optional attributes that the simple link driver receives on opening the driver (sl_Start). In systems that the spi channel is not implemented as part of the os device drivers, this parameter could be NULL.
-
flags
- optional flags parameters for future use
-
-
-
-
Returns:
upon successful completion, the function shall open the channel and return a non-negative integer representing the file descriptor. Otherwise, -1 shall be returned
This function could be implemented as zero copy and return only upon successful completion of writing the whole buffer, but in cases that memory allocation is not too tight, the function could copy the data to internal buffer, return back and complete the write in parallel to other activities as long as the other SPI activities would be blocked until the entire buffer write would be completed
-
The prototype of the function is as follow: int xxx_IfWrite(Fd_t Fd , char* pBuff , int Len);
The simple link driver can run on multi-threaded environment as well as non-os environment (mail loop)
-
This section IS NOT REQUIRED in case you are working on non-os environment.
-
If you choose to work in multi-threaded environment under any operating system you will have to provide some basic adaptation routines to allow the driver to protect access to resources from different threads (locking object) and to allow synchronization between threads (sync objects).
-
PORTING ACTION:
-
-
Uncomment SL_PLATFORM_MULTI_THREADED define
-
Bind locking object routines
-
Bind synchronization object routines
-
Optional - Bind spawn thread routine
-
-
Define Documentation
-
-
-
-
-
-
#define SL_PLATFORM_EXTERNAL_SPAWN
-
-
-
-
-
-
This function call the pEntry callback from a different context.
-
Parameters:
-
-
pEntry
- pointer to the entry callback function
-
pValue
- pointer to any type of memory structure that would be passed to pEntry callback from the execution thread.
-
flags
- execution flags - reserved for future usage
-
-
-
-
Returns:
upon successful registration of the spawn the function should return 0 (the function is not blocked till the end of the execution of the function and could be returned before the execution is actually completed) Otherwise, a negative value indicating the error code shall be returned
Defines whether to include socket send APIs in SimpleLink driver or not.
-
-
Detailed Description
-
This section IS NOT REQUIRED in case one of the following pre defined capabilities set is in use:
-
-
SL_TINY
-
SL_SMALL
-
SL_FULL
-
-
PORTING ACTION:
-
-
Define one of the pre-defined capabilities set or uncomment the relevant definitions below to select the required capabilities
-
-
Define Documentation
-
-
-
-
-
-
#define SL_INC_ARG_CHECK
-
-
-
-
-
-
Defines whether the SimpleLink driver perform argument check or not.
-
When defined, the SimpleLink driver perform argument check on function call. Removing this define could reduce some code size and improve slightly the performances but may impact in unpredictable behavior in case of invalid arguments
Removing argument check may cause unpredictable behavior in case of invalid arguments. In this case the user is responsible to argument validity (for example all handlers must not be NULL)
-
-
-
-
-
-
-
-
-
#define SL_INC_EXT_API
-
-
-
-
-
-
Defines whether to include extended API in SimpleLink driver or not.
-
When defined, the SimpleLink driver will include also all exteded API of the included packages
Defines whether SimpleLink driver should expose standard BSD APIs or not.
-
When defined, the SimpleLink driver in addtion to its alternative BSD APIs expose also standard BSD APIs. Stadrad BSD API includs the following functions: socket , close , accept , bind , listen , connect , select , setsockopt , getsockopt , recv , recvfrom , write , send , sendto , gethostbyname
This function is used with connection-based socket types (SOCK_STREAM). It extracts the first connection request on the queue of pending connections, creates a new connected socket, and returns a new file descriptor referring to that socket. The newly created socket is not in the listening state. The original socket sd is unaffected by this call. The argument sd is a socket that has been created with sl_Socket(), bound to a local address with sl_Bind(), and is listening for connections after a sl_Listen(). The argument addr is a pointer to a sockaddr structure. This structure is filled in with the address of the peer socket, as known to the communications layer. The exact format of the address returned addr is determined by the socket's address family. The addrlen argument is a value-result argument: it should initially contain the size of the structure pointed to by addr, on return it will contain the actual length (in bytes) of the address returned.
-
Parameters
-
-
[in]
sd
socket descriptor (handle)
-
[out]
addr
the argument addr is a pointer to a sockaddr structure. This structure is filled in with the address of the peer socket, as known to the communications layer. The exact format of the address returned addr is determined by the socket's address
- sockaddr:
- - code for the address format. On this version only AF_INET is supported.
- - socket address, the length depends on the code format
-
[out]
addrlen
the addrlen argument is a value-result argument: it should initially contain the size of the structure pointed to by addr
-
-
-
-
Returns
On success, a socket handle. On a non-blocking accept a possible negative value is SL_EAGAIN. On failure, negative value. SL_POOL_IS_EMPTY may be return in case there are no resources in the system In this case try again later or increase MAX_CONCURRENT_ACTIONS
This function gives the socket the local address addr. addr is addrlen bytes long. Traditionally, this is called When a socket is created with socket, it exists in a name space (address family) but has no name assigned. It is necessary to assign a local address before a SOCK_STREAM socket may receive connections.
-
Parameters
-
-
[in]
sd
socket descriptor (handle)
-
[in]
addr
specifies the destination addrs
- sockaddr:
- - code for the address format. On this version only AF_INET is supported.
- - socket address, the length depends on the code format
-
[in]
addrlen
contains the size of the structure pointed to by addr
-
-
-
-
Returns
On success, zero is returned. On error, a negative error code is returned.
Function connects the socket referred to by the socket descriptor sd, to the address specified by addr. The addrlen argument specifies the size of addr. The format of the address in addr is determined by the address space of the socket. If it is of type SOCK_DGRAM, this call specifies the peer with which the socket is to be associated; this address is that to which datagrams are to be sent, and the only address from which datagrams are to be received. If the socket is of type SOCK_STREAM, this call attempts to make a connection to another socket. The other socket is specified by address, which is an address in the communications space of the socket.
-
Parameters
-
-
[in]
sd
socket descriptor (handle)
-
[in]
addr
specifies the destination addr
- sockaddr:
- - code for the address format. On this version only AF_INET is supported.
- - socket address, the length depends on the code format
-
[in]
addrlen
contains the size of the structure pointed to by addr
-
-
-
-
Returns
On success, a socket handle. On a non-blocking connect a possible negative value is SL_EALREADY. On failure, negative value. SL_POOL_IS_EMPTY may be return in case there are no resources in the system In this case try again later or increase MAX_CONCURRENT_ACTIONS
This function manipulate the options associated with a socket. Options may exist at multiple protocol levels; they are always present at the uppermost socket level.
-
When manipulating socket options the level at which the option resides and the name of the option must be specified. To manipulate options at the socket level, level is specified as SOL_SOCKET. To manipulate options at any other level the protocol number of the appropriate proto- col controlling the option is supplied. For example, to indicate that an option is to be interpreted by the TCP protocol, level should be set to the protocol number of TCP;
-
The parameters optval and optlen are used to access optval - ues for setsockopt(). For getsockopt() they identify a buffer in which the value for the requested option(s) are to be returned. For getsockopt(), optlen is a value-result parameter, initially containing the size of the buffer pointed to by option_value, and modified on return to indicate the actual size of the value returned. If no option value is to be supplied or returned, option_value may be NULL.
-
Parameters
-
-
[in]
sd
socket handle
-
[in]
level
defines the protocol level for this option
-
[in]
optname
defines the option name to interrogate
-
[out]
optval
specifies a value for the option
-
[out]
optlen
specifies the length of the option value
-
-
-
-
Returns
On success, zero is returned. On error, a negative value is returned.
The willingness to accept incoming connections and a queue limit for incoming connections are specified with listen(), and then the connections are accepted with accept. The listen() call applies only to sockets of type SOCK_STREAM The backlog parameter defines the maximum length the queue of pending connections may grow to.
-
Parameters
-
-
[in]
sd
socket descriptor (handle)
-
[in]
backlog
specifies the listen queue depth.
-
-
-
-
Returns
On success, zero is returned. On error, a negative error code is returned.
function receives a message from a connection-mode socket
-
Parameters
-
-
[in]
sd
socket handle
-
[out]
buf
Points to the buffer where the message should be stored.
-
[in]
Len
Specifies the length in bytes of the buffer pointed to by the buffer argument. Range: 1-16000 bytes
-
[in]
flags
Specifies the type of message reception. On this version, this parameter is not supported.
-
-
-
-
Returns
return the number of bytes received, or a negative value if an error occurred. using a non-blocking recv a possible negative value is SL_EAGAIN. SL_POOL_IS_EMPTY may be return in case there are no resources in the system In this case try again later or increase MAX_CONCURRENT_ACTIONS
function receives a message from a connection-mode or connectionless-mode socket
-
Parameters
-
-
[in]
sd
socket handle
-
[out]
buf
Points to the buffer where the message should be stored.
-
[in]
Len
Specifies the length in bytes of the buffer pointed to by the buffer argument. Range: 1-16000 bytes
-
[in]
flags
Specifies the type of message reception. On this version, this parameter is not supported.
-
[in]
from
pointer to an address structure indicating the source address.
- sockaddr:
- - code for the address format. On this version only AF_INET is supported.
- - socket address, the length depends on the code format
-
[in]
fromlen
source address structure size. This parameter MUST be set to the size of the structure pointed to by addr.
-
-
-
-
Returns
return the number of bytes received, or a negative value if an error occurred. using a non-blocking recv a possible negative value is SL_EAGAIN. SL_RET_CODE_INVALID_INPUT (-2) will be returned if fromlen has incorrect length. SL_POOL_IS_EMPTY may be return in case there are no resources in the system In this case try again later or increase MAX_CONCURRENT_ACTIONS
Select allow a program to monitor multiple file descriptors, waiting until one or more of the file descriptors become "ready" for some class of I/O operation
-
Parameters
-
-
[in]
nfds
the highest-numbered file descriptor in any of the three sets, plus 1.
-
[out]
readsds
socket descriptors list for read monitoring and accept monitoring
-
[out]
writesds
socket descriptors list for connect monitoring only, write monitoring is not supported
-
[out]
exceptsds
socket descriptors list for exception monitoring, not supported.
-
[in]
timeout
is an upper bound on the amount of time elapsed before select() returns. Null or above 0xffff seconds means infinity timeout. The minimum timeout is 10 milliseconds, less than 10 milliseconds will be set automatically to 10 milliseconds. Max microseconds supported is 0xfffc00.
-
-
-
-
Returns
On success, select() returns the number of file descriptors contained in the three returned descriptor sets (that is, the total number of bits that are set in readfds, writefds, exceptfds) which may be zero if the timeout expires before anything interesting happens. On error, a negative value is returned. readsds - return the sockets on which Read request will return without delay with valid data. writesds - return the sockets on which Write request will return without delay. exceptsds - return the sockets closed recently. SL_POOL_IS_EMPTY may be return in case there are no resources in the system In this case try again later or increase MAX_CONCURRENT_ACTIONS
If the timeout value set to less than 5ms it will automatically set to 5ms to prevent overload of the system belongs to basic_api
-
Only one sl_Select can be handled at a time. Calling this API while the same command is called from another thread, may result in one of the two scenarios:
-
The command will wait (internal) until the previous command finish, and then be executed.
-
There are not enough resources and SL_POOL_IS_EMPTY error will return. In this case, MAX_CONCURRENT_ACTIONS can be increased (result in memory increase) or try again later to issue the command.
-
-
Warning
-
-
-
-
-
-
-
-
-
_i16 sl_Send
-
(
-
_i16
-
sd,
-
-
-
-
-
const void *
-
buf,
-
-
-
-
-
_i16
-
Len,
-
-
-
-
-
_i16
-
flags
-
-
-
-
)
-
-
-
-
-
-
write data to TCP socket
-
This function is used to transmit a message to another socket. Returns immediately after sending data to device. In case of TCP failure an async event SL_SOCKET_TX_FAILED_EVENT is going to be received. In case of a RAW socket (transceiver mode), extra 4 bytes should be reserved at the end of the frame data buffer for WLAN FCS
-
Parameters
-
-
[in]
sd
socket handle
-
[in]
buf
Points to a buffer containing the message to be sent
-
[in]
Len
message size in bytes. Range: 1-1460 bytes
-
[in]
flags
Specifies the type of message transmission. On this version, this parameter is not supported for TCP. For transceiver mode, the SL_RAW_RF_TX_PARAMS macro can be used to determine transmission parameters (channel,rate,tx_power,preamble)
-
-
-
-
Returns
Return the number of bytes transmitted, or -1 if an error occurred
This function is used to transmit a message to another socket (connection less socket SOCK_DGRAM, SOCK_RAW). Returns immediately after sending data to device. In case of transmission failure an async event SL_SOCKET_TX_FAILED_EVENT is going to be received.
-
Parameters
-
-
[in]
sd
socket handle
-
[in]
buf
Points to a buffer containing the message to be sent
-
[in]
Len
message size in bytes. Range: 1-1460 bytes
-
[in]
flags
Specifies the type of message transmission. On this version, this parameter is not supported
-
[in]
to
pointer to an address structure indicating the destination address.
- sockaddr:
- - code for the address format. On this version only AF_INET is supported.
- - socket address, the length depends on the code format
-
[in]
tolen
destination address structure size
-
-
-
-
Returns
Return the number of transmitted bytes, or -1 if an error occurred
This function manipulate the options associated with a socket. Options may exist at multiple protocol levels; they are always present at the uppermost socket level.
-
When manipulating socket options the level at which the option resides and the name of the option must be specified. To manipulate options at the socket level, level is specified as SOL_SOCKET. To manipulate options at any other level the protocol number of the appropriate proto- col controlling the option is supplied. For example, to indicate that an option is to be interpreted by the TCP protocol, level should be set to the protocol number of TCP;
-
The parameters optval and optlen are used to access optval - ues for setsockopt(). For getsockopt() they identify a buffer in which the value for the requested option(s) are to be returned. For getsockopt(), optlen is a value-result parameter, initially containing the size of the buffer pointed to by option_value, and modified on return to indicate the actual size of the value returned. If no option value is to be supplied or returned, option_value may be NULL.
-
Parameters
-
-
[in]
sd
socket handle
-
[in]
level
defines the protocol level for this option
-
SL_SOL_SOCKET Socket level configurations (L4, transport layer)
-
SL_IPPROTO_IP IP level configurations (L3, network layer)
-
SL_SOL_PHY_OPT Link level configurations (L2, link layer)
-
-
-
[in]
optname
defines the option name to interrogate
-
SL_SOL_SOCKET
-
SL_SO_KEEPALIVE
- Enable/Disable periodic keep alive. Keeps TCP connections active by enabling the periodic transmission of messages
- Timeout is 5 minutes.
- Default: Enabled
- This options takes SlSockKeepalive_t struct as parameter
-
SL_SO_RCVTIMEO
- Sets the timeout value that specifies the maximum amount of time an input function waits until it completes.
- Default: No timeout
- This options takes SlTimeval_t struct as parameter
-
SL_SO_RCVBUF
- Sets tcp max recv window size.
- This options takes SlSockWinsize_t struct as parameter
-
SL_SO_NONBLOCKING
- Sets socket to non-blocking operation Impacts: connect, accept, send, sendto, recv and recvfrom.
- Default: Blocking. This options takes SlSockNonblocking_t struct as parameter
-
SL_SO_SECMETHOD
- Sets method to tcp secured socket (SL_SEC_SOCKET)
- Default: SL_SO_SEC_METHOD_SSLv3_TLSV1_2
- This options takes SlSockSecureMethod struct as parameter
-
SL_SO_SEC_MASK
- Sets specific cipher to tcp secured socket (SL_SEC_SOCKET)
- Default: "Best" cipher suitable to method
- This options takes SlSockSecureMask struct as parameter
-
SL_SO_SECURE_FILES_CA_FILE_NAME
- Map secured socket to CA file by name
- This options takes _u8 buffer as parameter
-
SL_SO_SECURE_FILES_PRIVATE_KEY_FILE_NAME
- Map secured socket to private key by name
- This options takes _u8 buffer as parameter
-
SL_SO_SECURE_FILES_CERTIFICATE_FILE_NAME
- Map secured socket to certificate file by name
- This options takes _u8 buffer as parameter
-
SL_SO_SECURE_FILES_DH_KEY_FILE_NAME
- Map secured socket to Diffie Hellman file by name
- This options takes _u8 buffer as parameter
-
SL_SO_CHANGE_CHANNEL
- Sets channel in transceiver mode. This options takes _u32 as channel number parameter
-
-
-
SL_IPPROTO_IP
-
SL_IP_MULTICAST_TTL
- Set the time-to-live value of outgoing multicast packets for this socket.
- This options takes _u8 as parameter
-
SL_IP_ADD_MEMBERSHIP
- UDP socket, Join a multicast group.
- This options takes SlSockIpMreq struct as parameter
-
SL_IP_DROP_MEMBERSHIP
- UDP socket, Leave a multicast group
- This options takes SlSockIpMreq struct as parameter
-
SL_IP_RAW_RX_NO_HEADER
- Raw socket remove IP header from received data.
- Default: data includes ip header
- This options takes _u32 as parameter
-
SL_IP_HDRINCL
- RAW socket only, the IPv4 layer generates an IP header when sending a packet unless
- the IP_HDRINCL socket option is enabled on the socket.
- When it is enabled, the packet must contain an IP header.
- Default: disabled, IPv4 header generated by Network Stack
- This options takes _u32 as parameter
-
SL_IP_RAW_IPV6_HDRINCL (inactive)
- RAW socket only, the IPv6 layer generates an IP header when sending a packet unless
- the IP_HDRINCL socket option is enabled on the socket. When it is enabled, the packet must contain an IP header
- Default: disabled, IPv4 header generated by Network Stack
- This options takes _u32 as parameter
-
-
-
SL_SOL_PHY_OPT
-
SL_SO_PHY_RATE
- RAW socket, set WLAN PHY transmit rate
- The values are based on RateIndex_e
- This options takes _u32 as parameter
-
SL_SO_PHY_TX_POWER
- RAW socket, set WLAN PHY TX power
- Valid rage is 1-15
- This options takes _u32 as parameter
-
SL_SO_PHY_NUM_FRAMES_TO_TX
- RAW socket, set number of frames to transmit in transceiver mode. Default: 1 packet This options takes _u32 as parameter
-
SL_SO_PHY_PREAMBLE
- RAW socket, set WLAN PHY preamble for Long/Short
- This options takes _u32 as parameter
-
-
-
-
-
[in]
optval
specifies a value for the option
-
[in]
optlen
specifies the length of the option value
-
-
-
-
Returns
On success, zero is returned. On error, a negative value is returned.
The socket function creates a new socket of a certain socket type, identified by an integer number, and allocates system resources to it. This function is called by the application layer to obtain a socket handle.
-
Parameters
-
-
[in]
domain
specifies the protocol family of the created socket. For example: AF_INET for network protocol IPv4 AF_RF for starting transceiver mode. Notes:
-
sending and receiving any packet overriding 802.11 header
-
for optimized power consumption the socket will be started in TX only mode until receive command is activated AF_INET6 for IPv6
-
-
-
[in]
type
specifies the communication semantic, one of: SOCK_STREAM (reliable stream-oriented service or Stream Sockets) SOCK_DGRAM (datagram service or Datagram Sockets) SOCK_RAW (raw protocols atop the network layer) when used with AF_RF: SOCK_DGRAM - L2 socket SOCK_RAW - L1 socket - bypass WLAN CCA (Clear Channel Assessment)
-
[in]
protocol
specifies a particular transport to be used with the socket. The most common are IPPROTO_TCP, IPPROTO_SCTP, IPPROTO_UDP, IPPROTO_DCCP. The value 0 may be used to select a default protocol from the selected domain and type
-
-
-
-
Returns
On success, socket handle that is used for consequent socket operations. A successful return code should be a positive number (int16) On error, a negative (int16) value will be returned specifying the error code. SL_EAFNOSUPPORT - illegal domain parameter SL_EPROTOTYPE - illegal type parameter SL_EACCES - permission denied SL_ENSOCK - exceeded maximal number of socket SL_ENOMEM - memory allocation error SL_EINVAL - error in socket configuration SL_EPROTONOSUPPORT - illegal protocol parameter SL_EOPNOTSUPP - illegal combination of protocol and type parameters
This function is used with connection-based socket types (SOCK_STREAM). It extracts the first connection request on the queue of pending connections, creates a new connected socket, and returns a new file descriptor referring to that socket. The newly created socket is not in the listening state. The original socket sd is unaffected by this call. The argument sd is a socket that has been created with sl_Socket(), bound to a local address with sl_Bind(), and is listening for connections after a sl_Listen(). The argument addr is a pointer to a sockaddr structure. This structure is filled in with the address of the peer socket, as known to the communications layer. The exact format of the address returned addr is determined by the socket's address family. The addrlen argument is a value-result argument: it should initially contain the size of the structure pointed to by addr, on return it will contain the actual length (in bytes) of the address returned.
+
Parameters
+
+
[in]
sd
socket descriptor (handle)
+
[out]
addr
the argument addr is a pointer to a sockaddr structure. This structure is filled in with the address of the peer socket, as known to the communications layer. The exact format of the address returned addr is determined by the socket's address
+ sockaddr:
+ - code for the address format. On this version only AF_INET is supported.
+ - socket address, the length depends on the code format
+
[out]
addrlen
the addrlen argument is a value-result argument: it should initially contain the size of the structure pointed to by addr
+
+
+
+
Returns
On success, a socket handle. On a non-blocking accept a possible negative value is SL_EAGAIN. On failure, negative value. SL_POOL_IS_EMPTY may be return in case there are no resources in the system In this case try again later or increase MAX_CONCURRENT_ACTIONS
This function gives the socket the local address addr. addr is addrlen bytes long. Traditionally, this is called When a socket is created with socket, it exists in a name space (address family) but has no name assigned. It is necessary to assign a local address before a SOCK_STREAM socket may receive connections.
+
Parameters
+
+
[in]
sd
socket descriptor (handle)
+
[in]
addr
specifies the destination addrs
+ sockaddr:
+ - code for the address format. On this version only AF_INET is supported.
+ - socket address, the length depends on the code format
+
[in]
addrlen
contains the size of the structure pointed to by addr
+
+
+
+
Returns
On success, zero is returned. On error, a negative error code is returned.
Function connects the socket referred to by the socket descriptor sd, to the address specified by addr. The addrlen argument specifies the size of addr. The format of the address in addr is determined by the address space of the socket. If it is of type SOCK_DGRAM, this call specifies the peer with which the socket is to be associated; this address is that to which datagrams are to be sent, and the only address from which datagrams are to be received. If the socket is of type SOCK_STREAM, this call attempts to make a connection to another socket. The other socket is specified by address, which is an address in the communications space of the socket.
+
Parameters
+
+
[in]
sd
socket descriptor (handle)
+
[in]
addr
specifies the destination addr
+ sockaddr:
+ - code for the address format. On this version only AF_INET is supported.
+ - socket address, the length depends on the code format
+
[in]
addrlen
contains the size of the structure pointed to by addr
+
+
+
+
Returns
On success, a socket handle. On a non-blocking connect a possible negative value is SL_EALREADY. On failure, negative value. SL_POOL_IS_EMPTY may be return in case there are no resources in the system In this case try again later or increase MAX_CONCURRENT_ACTIONS
This function manipulate the options associated with a socket. Options may exist at multiple protocol levels; they are always present at the uppermost socket level.
+
When manipulating socket options the level at which the option resides and the name of the option must be specified. To manipulate options at the socket level, level is specified as SOL_SOCKET. To manipulate options at any other level the protocol number of the appropriate proto- col controlling the option is supplied. For example, to indicate that an option is to be interpreted by the TCP protocol, level should be set to the protocol number of TCP;
+
The parameters optval and optlen are used to access optval - ues for setsockopt(). For getsockopt() they identify a buffer in which the value for the requested option(s) are to be returned. For getsockopt(), optlen is a value-result parameter, initially containing the size of the buffer pointed to by option_value, and modified on return to indicate the actual size of the value returned. If no option value is to be supplied or returned, option_value may be NULL.
+
Parameters
+
+
[in]
sd
socket handle
+
[in]
level
defines the protocol level for this option
+
[in]
optname
defines the option name to interrogate
+
[out]
optval
specifies a value for the option
+
[out]
optlen
specifies the length of the option value
+
+
+
+
Returns
On success, zero is returned. On error, a negative value is returned.
The willingness to accept incoming connections and a queue limit for incoming connections are specified with listen(), and then the connections are accepted with accept. The listen() call applies only to sockets of type SOCK_STREAM The backlog parameter defines the maximum length the queue of pending connections may grow to.
+
Parameters
+
+
[in]
sd
socket descriptor (handle)
+
[in]
backlog
specifies the listen queue depth.
+
+
+
+
Returns
On success, zero is returned. On error, a negative error code is returned.
function receives a message from a connection-mode socket
+
Parameters
+
+
[in]
sd
socket handle
+
[out]
buf
Points to the buffer where the message should be stored.
+
[in]
Len
Specifies the length in bytes of the buffer pointed to by the buffer argument. Range: 1-16000 bytes
+
[in]
flags
Specifies the type of message reception. On this version, this parameter is not supported.
+
+
+
+
Returns
return the number of bytes received, or a negative value if an error occurred. using a non-blocking recv a possible negative value is SL_EAGAIN. SL_POOL_IS_EMPTY may be return in case there are no resources in the system In this case try again later or increase MAX_CONCURRENT_ACTIONS
function receives a message from a connection-mode or connectionless-mode socket
+
Parameters
+
+
[in]
sd
socket handle
+
[out]
buf
Points to the buffer where the message should be stored.
+
[in]
Len
Specifies the length in bytes of the buffer pointed to by the buffer argument. Range: 1-16000 bytes
+
[in]
flags
Specifies the type of message reception. On this version, this parameter is not supported.
+
[in]
from
pointer to an address structure indicating the source address.
+ sockaddr:
+ - code for the address format. On this version only AF_INET is supported.
+ - socket address, the length depends on the code format
+
[in]
fromlen
source address structure size. This parameter MUST be set to the size of the structure pointed to by addr.
+
+
+
+
Returns
return the number of bytes received, or a negative value if an error occurred. using a non-blocking recv a possible negative value is SL_EAGAIN. SL_RET_CODE_INVALID_INPUT (-2) will be returned if fromlen has incorrect length. SL_POOL_IS_EMPTY may be return in case there are no resources in the system In this case try again later or increase MAX_CONCURRENT_ACTIONS
Select allow a program to monitor multiple file descriptors, waiting until one or more of the file descriptors become "ready" for some class of I/O operation
+
Parameters
+
+
[in]
nfds
the highest-numbered file descriptor in any of the three sets, plus 1.
+
[out]
readsds
socket descriptors list for read monitoring and accept monitoring
+
[out]
writesds
socket descriptors list for connect monitoring only, write monitoring is not supported, non blocking connect is supported
+
[out]
exceptsds
socket descriptors list for exception monitoring, not supported.
+
[in]
timeout
is an upper bound on the amount of time elapsed before select() returns. Null or above 0xffff seconds means infinity timeout. The minimum timeout is 10 milliseconds, less than 10 milliseconds will be set automatically to 10 milliseconds. Max microseconds supported is 0xfffc00.
+
+
+
+
Returns
On success, select() returns the number of file descriptors contained in the three returned descriptor sets (that is, the total number of bits that are set in readfds, writefds, exceptfds) which may be zero if the timeout expires before anything interesting happens. On error, a negative value is returned. readsds - return the sockets on which Read request will return without delay with valid data. writesds - return the sockets on which Write request will return without delay. exceptsds - return the sockets closed recently. SL_POOL_IS_EMPTY may be return in case there are no resources in the system In this case try again later or increase MAX_CONCURRENT_ACTIONS
If the timeout value set to less than 5ms it will automatically set to 5ms to prevent overload of the system belongs to basic_api
+
Only one sl_Select can be handled at a time. Calling this API while the same command is called from another thread, may result in one of the two scenarios:
+
+
The command will wait (internal) until the previous command finish, and then be executed.
+
There are not enough resources and SL_POOL_IS_EMPTY error will return. In this case, MAX_CONCURRENT_ACTIONS can be increased (result in memory increase) or try again later to issue the command.
+
+
Warning
+
+
+
+
+
+
+
+
+
_i16 sl_Send
+
(
+
_i16
+
sd,
+
+
+
+
+
const void *
+
buf,
+
+
+
+
+
_i16
+
Len,
+
+
+
+
+
_i16
+
flags
+
+
+
+
)
+
+
+
+
+
+
write data to TCP socket
+
This function is used to transmit a message to another socket. Returns immediately after sending data to device. In case of TCP failure an async event SL_SOCKET_TX_FAILED_EVENT is going to be received. In case of a RAW socket (transceiver mode), extra 4 bytes should be reserved at the end of the frame data buffer for WLAN FCS
+
Parameters
+
+
[in]
sd
socket handle
+
[in]
buf
Points to a buffer containing the message to be sent
+
[in]
Len
message size in bytes. Range: 1-1460 bytes
+
[in]
flags
Specifies the type of message transmission. On this version, this parameter is not supported for TCP. For transceiver mode, the SL_RAW_RF_TX_PARAMS macro can be used to determine transmission parameters (channel,rate,tx_power,preamble)
+
+
+
+
Returns
Return the number of bytes transmitted, or -1 if an error occurred
This function is used to transmit a message to another socket (connection less socket SOCK_DGRAM, SOCK_RAW). Returns immediately after sending data to device. In case of transmission failure an async event SL_SOCKET_TX_FAILED_EVENT is going to be received.
+
Parameters
+
+
[in]
sd
socket handle
+
[in]
buf
Points to a buffer containing the message to be sent
+
[in]
Len
message size in bytes. Range: 1-1460 bytes
+
[in]
flags
Specifies the type of message transmission. On this version, this parameter is not supported
+
[in]
to
pointer to an address structure indicating the destination address.
+ sockaddr:
+ - code for the address format. On this version only AF_INET is supported.
+ - socket address, the length depends on the code format
+
[in]
tolen
destination address structure size
+
+
+
+
Returns
Return the number of transmitted bytes, or -1 if an error occurred
This function manipulate the options associated with a socket. Options may exist at multiple protocol levels; they are always present at the uppermost socket level.
+
When manipulating socket options the level at which the option resides and the name of the option must be specified. To manipulate options at the socket level, level is specified as SOL_SOCKET. To manipulate options at any other level the protocol number of the appropriate proto- col controlling the option is supplied. For example, to indicate that an option is to be interpreted by the TCP protocol, level should be set to the protocol number of TCP;
+
The parameters optval and optlen are used to access optval - ues for setsockopt(). For getsockopt() they identify a buffer in which the value for the requested option(s) are to be returned. For getsockopt(), optlen is a value-result parameter, initially containing the size of the buffer pointed to by option_value, and modified on return to indicate the actual size of the value returned. If no option value is to be supplied or returned, option_value may be NULL.
+
Parameters
+
+
[in]
sd
socket handle
+
[in]
level
defines the protocol level for this option
+
SL_SOL_SOCKET Socket level configurations (L4, transport layer)
+
SL_IPPROTO_IP IP level configurations (L3, network layer)
+
SL_SOL_PHY_OPT Link level configurations (L2, link layer)
+
+
+
[in]
optname
defines the option name to interrogate
+
SL_SOL_SOCKET
+
SL_SO_KEEPALIVE
+ Enable/Disable periodic keep alive. Keeps TCP connections active by enabling the periodic transmission of messages
+ Timeout is 5 minutes.
+ Default: Enabled
+ This options takes SlSockKeepalive_t struct as parameter
+
SL_SO_RCVTIMEO
+ Sets the timeout value that specifies the maximum amount of time an input function waits until it completes.
+ Default: No timeout
+ This options takes SlTimeval_t struct as parameter
+
SL_SO_RCVBUF
+ Sets tcp max recv window size.
+ This options takes SlSockWinsize_t struct as parameter
+
SL_SO_NONBLOCKING
+ Sets socket to non-blocking operation Impacts: connect, accept, send, sendto, recv and recvfrom.
+ Default: Blocking. This options takes SlSockNonblocking_t struct as parameter
+
SL_SO_SECMETHOD
+ Sets method to tcp secured socket (SL_SEC_SOCKET)
+ Default: SL_SO_SEC_METHOD_SSLv3_TLSV1_2
+ This options takes SlSockSecureMethod struct as parameter
+
SL_SO_SEC_MASK
+ Sets specific cipher to tcp secured socket (SL_SEC_SOCKET)
+ Default: "Best" cipher suitable to method
+ This options takes SlSockSecureMask struct as parameter
+
SL_SO_SECURE_FILES_CA_FILE_NAME
+ Map secured socket to CA file by name
+ This options takes _u8 buffer as parameter
+
SL_SO_SECURE_FILES_PRIVATE_KEY_FILE_NAME
+ Map secured socket to private key by name
+ This options takes _u8 buffer as parameter
+
SL_SO_SECURE_FILES_CERTIFICATE_FILE_NAME
+ Map secured socket to certificate file by name
+ This options takes _u8 buffer as parameter
+
SL_SO_SECURE_FILES_DH_KEY_FILE_NAME
+ Map secured socket to Diffie Hellman file by name
+ This options takes _u8 buffer as parameter
+
SL_SO_CHANGE_CHANNEL
+ Sets channel in transceiver mode. This options takes _u32 as channel number parameter
+
+
+
SL_IPPROTO_IP
+
SL_IP_MULTICAST_TTL
+ Set the time-to-live value of outgoing multicast packets for this socket.
+ This options takes _u8 as parameter
+
SL_IP_ADD_MEMBERSHIP
+ UDP socket, Join a multicast group.
+ This options takes SlSockIpMreq struct as parameter
+
SL_IP_DROP_MEMBERSHIP
+ UDP socket, Leave a multicast group
+ This options takes SlSockIpMreq struct as parameter
+
SL_IP_RAW_RX_NO_HEADER
+ Raw socket remove IP header from received data.
+ Default: data includes ip header
+ This options takes _u32 as parameter
+
SL_IP_HDRINCL
+ RAW socket only, the IPv4 layer generates an IP header when sending a packet unless
+ the IP_HDRINCL socket option is enabled on the socket.
+ When it is enabled, the packet must contain an IP header.
+ Default: disabled, IPv4 header generated by Network Stack
+ This options takes _u32 as parameter
+
SL_IP_RAW_IPV6_HDRINCL (inactive)
+ RAW socket only, the IPv6 layer generates an IP header when sending a packet unless
+ the IP_HDRINCL socket option is enabled on the socket. When it is enabled, the packet must contain an IP header
+ Default: disabled, IPv4 header generated by Network Stack
+ This options takes _u32 as parameter
+
+
+
SL_SOL_PHY_OPT
+
SL_SO_PHY_RATE
+ RAW socket, set WLAN PHY transmit rate
+ The values are based on RateIndex_e
+ This options takes _u32 as parameter
+
SL_SO_PHY_TX_POWER
+ RAW socket, set WLAN PHY TX power
+ Valid rage is 1-15
+ This options takes _u32 as parameter
+
SL_SO_PHY_NUM_FRAMES_TO_TX
+ RAW socket, set number of frames to transmit in transceiver mode. Default: 1 packet This options takes _u32 as parameter
+
SL_SO_PHY_PREAMBLE
+ RAW socket, set WLAN PHY preamble for Long/Short
+ This options takes _u32 as parameter
+
+
+
+
+
[in]
optval
specifies a value for the option
+
[in]
optlen
specifies the length of the option value
+
+
+
+
Returns
On success, zero is returned. On error, a negative value is returned.
The socket function creates a new socket of a certain socket type, identified by an integer number, and allocates system resources to it. This function is called by the application layer to obtain a socket handle.
+
Parameters
+
+
[in]
domain
specifies the protocol family of the created socket. For example: AF_INET for network protocol IPv4 AF_RF for starting transceiver mode. Notes:
+
sending and receiving any packet overriding 802.11 header
+
for optimized power consumption the socket will be started in TX only mode until receive command is activated AF_INET6 for IPv6
+
+
+
[in]
type
specifies the communication semantic, one of: SOCK_STREAM (reliable stream-oriented service or Stream Sockets) SOCK_DGRAM (datagram service or Datagram Sockets) SOCK_RAW (raw protocols atop the network layer) when used with AF_RF: SOCK_DGRAM - L2 socket SOCK_RAW - L1 socket - bypass WLAN CCA (Clear Channel Assessment)
+
[in]
protocol
specifies a particular transport to be used with the socket. The most common are IPPROTO_TCP, IPPROTO_SCTP, IPPROTO_UDP, IPPROTO_DCCP. The value 0 may be used to select a default protocol from the selected domain and type
+
+
+
+
Returns
On success, socket handle that is used for consequent socket operations. A successful return code should be a positive number (int16) On error, a negative (int16) value will be returned specifying the error code. SL_EAFNOSUPPORT - illegal domain parameter SL_EPROTOTYPE - illegal type parameter SL_EACCES - permission denied SL_ENSOCK - exceeded maximal number of socket SL_ENOMEM - memory allocation error SL_EINVAL - error in socket configuration SL_EPROTONOSUPPORT - illegal protocol parameter SL_EOPNOTSUPP - illegal combination of protocol and type parameters
Stop Smart Config procedure. Once Smart Config will be stopped, Asynchronous event will be received - SL_OPCODE_WLAN_SMART_CONFIG_STOP_ASYNC_RESPONSE. More...
up to 32 bytes in case of STA the name is the SSID of the Access Point
-
[in]
NameLen
name length
-
[in]
pMacAddr
6 bytes for MAC address
-
[in]
pSecParams
Security parameters (use NULL key for SL_SEC_TYPE_OPEN)
-
[in]
pSecExtParams
Enterprise parameters (set NULL in case Enterprise parameters is not in use)
-
-
-
-
Returns
On success, zero is returned. On error, negative is returned In case error number (-71) is returned, it indicates a connection was activated while the device it running in AP role
Internal function for getting WLAN configurations.
-
Returns
On success, zero is returned. On error, -1 is returned
-
Parameters
-
-
[in]
ConfigId
- configuration id
-
SL_WLAN_CFG_AP_ID
-
SL_WLAN_CFG_GENERAL_PARAM_ID
-
SL_WLAN_CFG_P2P_PARAM_ID
-
-
-
[out]
pConfigOpt
- get configurations option
-
SL_WLAN_CFG_AP_ID
-
WLAN_AP_OPT_SSID
- Get SSID for AP mode.
- Get up to 32 characters of SSID
- This options takes _u8 as parameter
-
WLAN_AP_OPT_CHANNEL
- Get channel for AP mode.
- This option takes _u8 as a parameter
-
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
-
WLAN_AP_OPT_SECURITY_TYPE
- Get Security type for AP mode. Security options are:
-
Open security: SL_SEC_TYPE_OPEN
-
WEP security: SL_SEC_TYPE_WEP
-
WPA security: SL_SEC_TYPE_WPA_WPA2
- This option takes _u8 as a parameter
-
-
-
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_CFG_GENERAL_PARAM_ID
-
WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS
- Get scan parameters. This option uses slWlanScanParamCommand_t as parameter
-
WLAN_GENERAL_PARAM_OPT_COUNTRY_CODE
- Get Country Code for AP mode
- This options takes _u8 buffer as parameter
-
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
-
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
-
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
-
-
-
-
-
[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.
Gets scan results , gets entry from scan result table
-
Parameters
-
-
[in]
Index
- Starting index identifier (range 0-19) for getting scan results
-
[in]
Count
- How many entries to fetch. Max is (20-"Index").
-
[out]
pEntries
- pointer to an allocated Sl_WlanNetworkEntry_t. the number of array items should match "Count" sec_type: SL_SCAN_SEC_TYPE_OPEN, SL_SCAN_SEC_TYPE_WEP, SL_SCAN_SEC_TYPE_WPA or SL_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
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
-
-
-
-
Returns
On success, zero is returned. On error, -1 is returned
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.
-
-
-
-
-
-
-
-
-
_i16 sl_WlanPolicySet
-
(
-
_u8
-
Type,
-
-
-
-
-
const _u8
-
Policy,
-
-
-
-
-
_u8 *
-
pVal,
-
-
-
-
-
_u8
-
ValLen
-
-
-
-
)
-
-
-
-
-
-
Set policy values.
-
Parameters
-
-
[in]
Type
Type of policy to be modified. The Options are:
-
-
SL_POLICY_CONNECTION
-
SL_POLICY_SCAN
-
SL_POLICY_PM
-
SL_POLICY_P2P
-
-
-
[in]
Policy
The option value which depends on action type
-
[in]
pVal
An optional value pointer
-
[in]
ValLen
An optional value length, in bytes
-
-
-
-
Returns
On success, zero is returned. On error, -1 is returned
SL_POLICY_CONNECTION type defines three options available to connect the CC31xx device to the AP:
-
-
If Auto Connect 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_POLICY_CONNECTION,SL_CONNECTION_POLICY(1,0,0,0,0),NULL,0)
-
If Fast Connect is set, the CC31xx device tries to establish a fast connection to AP.
- To set this option, use:
- sl_WlanPolicySet(SL_POLICY_CONNECTION,SL_CONNECTION_POLICY(0,1,0,0,0),NULL,0)
-
(relevant for P2P mode only) - If Any P2P is set, 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_POLICY_CONNECTION,SL_CONNECTION_POLICY(0,0,0,1,0),NULL,0)
-
For auto smart config upon restart (any command from Host will end this state) use:
- sl_WlanPolicySet(SL_POLICY_CONNECTION,SL_CONNECTION_POLICY(0,0,0,0,1),NULL,0)
-The options above could be combined to a single action, if more than one action is required.
-
-
-
-
SL_POLICY_SCAN defines system scan time interval in case there is no connection. Default interval is 10 minutes.
-After settings scan interval, an immediate scan is activated. The next scan will be based on the interval settings.
-
-
For example, setting scan interval to 1 minute interval use:
- _u32 intervalInSeconds = 60;
- #define SL_SCAN_ENABLE 1
- sl_WlanPolicySet(SL_POLICY_SCAN,SL_SCAN_ENABLE, (_u8 *)&intervalInSeconds,sizeof(intervalInSeconds));
-
-
For example, disable scan:
- #define SL_SCAN_DISABLE 0
- sl_WlanPolicySet(SL_POLICY_SCAN,SL_SCAN_DISABLE,0,0);
-
-
-
-
SL_POLICY_PM defines a power management policy for Station mode only:
-
For setting normal power management (default) policy use: sl_WlanPolicySet(SL_POLICY_PM , SL_NORMAL_POLICY, NULL,0)
-
For setting low latency power management policy use: sl_WlanPolicySet(SL_POLICY_PM , SL_LOW_LATENCY_POLICY, NULL,0)
-
For setting low power management policy use: sl_WlanPolicySet(SL_POLICY_PM , SL_LOW_POWER_POLICY, NULL,0)
-
For setting always on power management policy use: sl_WlanPolicySet(SL_POLICY_PM , SL_ALWAYS_ON_POLICY, NULL,0)
-
For setting Long Sleep Interval policy use:
- _u16 PolicyBuff[4] = {0,0,800,0}; // PolicyBuff[2] is max sleep time in mSec
- sl_WlanPolicySet(SL_POLICY_PM , SL_LONG_SLEEP_INTERVAL_POLICY, (_u8*)PolicyBuff,sizeof(PolicyBuff));
- SL_POLICY_P2P defines p2p negotiation policy parameters for P2P role:
-
To set intent negotiation value, set on of the following: SL_P2P_ROLE_NEGOTIATE - intent 3 SL_P2P_ROLE_GROUP_OWNER - intent 15 SL_P2P_ROLE_CLIENT - intent 0
-
To set negotiation initiator value (initiator policy of first negotiation action frame), set on of the following: SL_P2P_NEG_INITIATOR_ACTIVE SL_P2P_NEG_INITIATOR_PASSIVE SL_P2P_NEG_INITIATOR_RAND_BACKOFF For example:
- sl_WlanPolicySet(SL_POLICY_P2P, SL_P2P_POLICY(SL_P2P_ROLE_NEGOTIATE,SL_P2P_NEG_INITIATOR_RAND_BACKOFF),NULL,0)
When auto start is enabled, the device connects to a station from the profiles table. Up to 7 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]
pName
up 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]
NameLen
name length
-
[in]
pMacAddr
6 bytes for MAC address
-
[in]
pSecParams
Security parameters - security type (SL_SEC_TYPE_OPEN,SL_SEC_TYPE_WEP,SL_SEC_TYPE_WPA_WPA2, SL_SEC_TYPE_P2P_PBC,SL_SEC_TYPE_P2P_PIN_KEYPAD,SL_SEC_TYPE_P2P_PIN_DISPLAY, SL_SEC_TYPE_WPA_ENT), key, and key length in case of p2p security type pin the key refers to pin code
-
[in]
pSecExtParams
Enterprise 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]
Priority
profile priority. Lowest priority: 0
-
[in]
Options
Not supported
-
-
-
-
Returns
On success, profile stored index is returned. On error, negative value is returned
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_SEC_TYPE_WPA is a deprecated definition, the new definition is SL_SEC_TYPE_WPA_WPA2
-
-
-
-
-
-
-
-
-
_i16 sl_WlanProfileDel
-
(
-
_i16
-
Index
)
-
-
-
-
-
-
Delete WLAN profile.
-
Delete WLAN profile
-
Parameters
-
-
[in]
index
number of profile to delete.Possible values are 0 to 6. Index value 255 will delete all saved profiles
-
-
-
-
Returns
On success, zero is returned. On error, -1 is returned
profile stored index, if index does not exists error is return
-
[out]
pName
up 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]
pNameLen
name length
-
[out]
pMacAddr
6 bytes for MAC address
-
[out]
pSecParams
security parameters - security type (LAN_SEC_UNSEC, WLAN_SEC_WEP, WLAN_SEC_WPA or WLAN_SEC_WPA2, WLAN_SEC_P2P_PBC, WLAN_SEC_P2P_PIN_KEYPAD or WLAN_SEC_P2P_DISPLAY), key and key length are not in case of p2p security type pin the key refers to pin code return due to security reasons.
This API is deprecated and should be removed for next release
-
-
-
-
-
-
-
-
-
_i16 sl_WlanSet
-
(
-
_u16
-
ConfigId,
-
-
-
-
-
_u16
-
ConfigOpt,
-
-
-
-
-
_u16
-
ConfigLen,
-
-
-
-
-
_u8 *
-
pValues
-
-
-
-
)
-
-
-
-
-
-
Internal function for setting WLAN configurations.
-
Returns
On success, zero is returned. On error one of the following error codes returned:
-
CONF_ERROR (-1)
-
CONF_NVMEM_ACCESS_FAILED (-2)
-
CONF_OLD_FILE_VERSION (-3)
-
CONF_ERROR_NO_SUCH_COUNTRY_CODE (-4)
-
-
-
Parameters
-
-
[in]
ConfigId
- configuration id
-
SL_WLAN_CFG_AP_ID
-
SL_WLAN_CFG_GENERAL_PARAM_ID
-
SL_WLAN_CFG_P2P_PARAM_ID
-
-
-
[in]
ConfigOpt
- configurations option
-
SL_WLAN_CFG_AP_ID
-
WLAN_AP_OPT_SSID
- Set SSID for AP mode.
- This options takes _u8 buffer as parameter
-
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
-
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
-
WLAN_AP_OPT_SECURITY_TYPE
- Set Security type for AP mode. Security options are:
-
Open security: SL_SEC_TYPE_OPEN
-
WEP security: SL_SEC_TYPE_WEP
-
WPA security: SL_SEC_TYPE_WPA_WPA2
- This option takes _u8 pointer as a parameter
-
-
-
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_CFG_GENERAL_PARAM_ID
-
WLAN_GENERAL_PARAM_OPT_COUNTRY_CODE
- Set Country Code for AP mode
- This options takes _u8 2 bytes buffer as parameter
-
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
-
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
-
WLAN_GENERAL_PARAM_OPT_INFO_ELEMENT Set Info Element for AP mode.
- The Application can set up to MAX_PRIVATE_INFO_ELEMENTS_SUPPROTED info elements per Role (AP / P2P GO).
- To delete an info element use the relevant index and length = 0.
- The Application can set up to MAX_PRIVATE_INFO_ELEMENTS_SUPPROTED to the same role.
- However, for AP - no more than INFO_ELEMENT_MAX_TOTAL_LENGTH_AP bytes can be stored for all info elements.
- For P2P GO - no more than INFO_ELEMENT_MAX_TOTAL_LENGTH_P2P_GO bytes can be stored for all info elements.
- This option takes sl_protocol_WlanSetInfoElement_t as parameter
-
-
-
SL_WLAN_CFG_P2P_PARAM_ID
-
WLAN_P2P_OPT_DEV_TYPE
- Set P2P Device type.Maximum length of 17 characters. Device type is published under P2P I.E,
- allows to make devices easier to recognize.
- In case no device type is set, the default type is "1-0050F204-1"
- This options takes _u8 buffer as parameter
-
WLAN_P2P_OPT_CHANNEL_N_REGS
- Set P2P Channels.
- listen channel (either 1/6/11 for 2.4GHz)
- listen regulatory class (81 for 2.4GHz)
- oper channel (either 1/6/11 for 2.4GHz)
- oper regulatory class (81 for 2.4GHz)
- listen channel and regulatory class will determine the device listen channel during p2p find listen phase
- oper channel and regulatory class will determine the operating channel preferred by this device (in case it is group owner this will be the operating channel)
- channels should be one of the social channels (1/6/11). In case no listen/oper channel selected, a random 1/6/11 will be selected. This option takes pointer to _u8[4] as parameter
-
-
-
-
-
[in]
ConfigLen
- configurations len
-
[in]
pValues
- configurations values
-
-
-
-
See also
-
Note
-
Warning
-
Examples:
-
WLAN_AP_OPT_SSID:
_u8 str[33];
-
memset(str, 0, 33);
-
memcpy(str, ssid, len); // ssid string of 32 characters
The target of the procedure is to let the
- device to gain the network parameters: SSID and Password (if network is secured)
- and to connect to it once located in the network range.
- An external application should be used on a device connected to any mobile network.
- The external application will transmit over the air the network parameters in secured manner.
- The Password may be decrypted using a Key.
- The decryption method may be decided in the command or embedded in the Flash.
- The procedure can be activated for 1-3 group ID in the range of BIT_0 - BIT_15 where the default group ID id 0 (BIT_0)
- Once Smart Config has ended successfully, Asynchronous event will be received -
- SL_OPCODE_WLAN_SMART_CONFIG_START_ASYNC_RESPONSE.
- The Event will hold the SSID and an extra field that might have been delivered as well (i.e. - device name)
-
Parameters
-
-
[in]
groupIdBitmask
- each bit represent a group ID that should be searched. The Default group ID id BIT_0. 2 more group can be searched in addition. The range is BIT_0 - BIT_15.
-
[in]
chiper
- 0: check in flash, 1 - AES, 0xFF - do not check in flash
-
[in]
publicKeyLen
- public key len (used for the default group ID - BIT_0)
-
[in]
group1KeyLen
- group ID1 length
-
[in]
group2KeyLen
- group ID2 length
-
[in]
publicKey
- public key (used for the default group ID - BIT_0)
Stop Smart Config procedure. Once Smart Config will be stopped, Asynchronous event will be received - SL_OPCODE_WLAN_SMART_CONFIG_STOP_ASYNC_RESPONSE. More...
Enterprise parameters (set NULL in case Enterprise parameters is not in use)
+
+
+
+
Returns
On success, zero is returned. On error, negative is returned In case error number (-71) is returned, it indicates a connection was activated while the device it running in AP role
Internal function for getting WLAN configurations.
+
Returns
On success, zero is returned. On error, -1 is returned
+
Parameters
+
+
[in]
ConfigId
- configuration id
+
SL_WLAN_CFG_AP_ID
+
SL_WLAN_CFG_GENERAL_PARAM_ID
+
SL_WLAN_CFG_P2P_PARAM_ID
+
+
+
[out]
pConfigOpt
- get configurations option
+
SL_WLAN_CFG_AP_ID
+
WLAN_AP_OPT_SSID
+ Get SSID for AP mode.
+ Get up to 32 characters of SSID
+ This options takes _u8 as parameter
+
WLAN_AP_OPT_CHANNEL
+ Get channel for AP mode.
+ This option takes _u8 as a parameter
+
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
+
WLAN_AP_OPT_SECURITY_TYPE
+ Get Security type for AP mode. Security options are:
+
Open security: SL_SEC_TYPE_OPEN
+
WEP security: SL_SEC_TYPE_WEP
+
WPA security: SL_SEC_TYPE_WPA_WPA2
+ This option takes _u8 as a parameter
+
+
+
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_CFG_GENERAL_PARAM_ID
+
WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS
+ Get scan parameters. This option uses slWlanScanParamCommand_t as parameter
+
WLAN_GENERAL_PARAM_OPT_COUNTRY_CODE
+ Get Country Code for AP mode
+ This options takes _u8 buffer as parameter
+
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
+
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
+
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
+
+
+
+
+
[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.
Gets scan results , gets entry from scan result table
+
Parameters
+
+
[in]
Index
- Starting index identifier (range 0-19) for getting scan results
+
[in]
Count
- How many entries to fetch. Max is (20-"Index").
+
[out]
pEntries
- pointer to an allocated Sl_WlanNetworkEntry_t. the number of array items should match "Count" sec_type: SL_SCAN_SEC_TYPE_OPEN, SL_SCAN_SEC_TYPE_WEP, SL_SCAN_SEC_TYPE_WPA or SL_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
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
+
+
+
+
Returns
On success, zero is returned. On error, -1 is returned
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.
+
+
+
+
+
+
+
+
+
_i16 sl_WlanPolicySet
+
(
+
const _u8
+
Type,
+
+
+
+
+
const _u8
+
Policy,
+
+
+
+
+
_u8 *
+
pVal,
+
+
+
+
+
const _u8
+
ValLen
+
+
+
+
)
+
+
+
+
+
+
Set policy values.
+
Parameters
+
+
[in]
Type
Type of policy to be modified. The Options are:
+
+
SL_POLICY_CONNECTION
+
SL_POLICY_SCAN
+
SL_POLICY_PM
+
SL_POLICY_P2P
+
+
+
[in]
Policy
The option value which depends on action type
+
[in]
pVal
An optional value pointer
+
[in]
ValLen
An optional value length, in bytes
+
+
+
+
Returns
On success, zero is returned. On error, -1 is returned
SL_POLICY_CONNECTION type defines three options available to connect the CC31xx device to the AP:
+
+
If Auto Connect 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_POLICY_CONNECTION,SL_CONNECTION_POLICY(1,0,0,0,0),NULL,0)
+
If Fast Connect is set, the CC31xx device tries to establish a fast connection to AP.
+ To set this option, use:
+ sl_WlanPolicySet(SL_POLICY_CONNECTION,SL_CONNECTION_POLICY(0,1,0,0,0),NULL,0)
+
(relevant for P2P mode only) - If Any P2P is set, 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_POLICY_CONNECTION,SL_CONNECTION_POLICY(0,0,0,1,0),NULL,0)
+
For auto smart config upon restart (any command from Host will end this state) use:
+ sl_WlanPolicySet(SL_POLICY_CONNECTION,SL_CONNECTION_POLICY(0,0,0,0,1),NULL,0)
+ The options above could be combined to a single action, if more than one action is required.
+
+
+
+
SL_POLICY_SCAN defines system scan time interval.Default interval is 10 minutes.
+ After settings scan interval, an immediate scan is activated. The next scan will be based on the interval settings.
+
+
For example, setting scan interval to 1 minute interval use:
+ _u32 intervalInSeconds = 60;
+ #define SL_SCAN_ENABLE 1
+ sl_WlanPolicySet(SL_POLICY_SCAN,SL_SCAN_ENABLE, (_u8 *)&intervalInSeconds,sizeof(intervalInSeconds));
+
+
For example, disable scan:
+ #define SL_SCAN_DISABLE 0
+ sl_WlanPolicySet(SL_POLICY_SCAN,SL_SCAN_DISABLE,0,0);
+
+
+
+
SL_POLICY_PM defines a power management policy for Station mode only:
+
For setting normal power management (default) policy use: sl_WlanPolicySet(SL_POLICY_PM , SL_NORMAL_POLICY, NULL,0)
+
For setting low latency power management policy use: sl_WlanPolicySet(SL_POLICY_PM , SL_LOW_LATENCY_POLICY, NULL,0)
+
For setting low power management policy use: sl_WlanPolicySet(SL_POLICY_PM , SL_LOW_POWER_POLICY, NULL,0)
+
For setting always on power management policy use: sl_WlanPolicySet(SL_POLICY_PM , SL_ALWAYS_ON_POLICY, NULL,0)
+
For setting Long Sleep Interval policy use:
+ _u16 PolicyBuff[4] = {0,0,800,0}; // PolicyBuff[2] is max sleep time in mSec
+ sl_WlanPolicySet(SL_POLICY_PM , SL_LONG_SLEEP_INTERVAL_POLICY, (_u8*)PolicyBuff,sizeof(PolicyBuff));
+
+
+
+
SL_POLICY_P2P defines p2p negotiation policy parameters for P2P role:
+
+
To set intent negotiation value, set on of the following: SL_P2P_ROLE_NEGOTIATE - intent 3 SL_P2P_ROLE_GROUP_OWNER - intent 15 SL_P2P_ROLE_CLIENT - intent 0
+
To set negotiation initiator value (initiator policy of first negotiation action frame), set on of the following: SL_P2P_NEG_INITIATOR_ACTIVE SL_P2P_NEG_INITIATOR_PASSIVE SL_P2P_NEG_INITIATOR_RAND_BACKOFF For example:
+ sl_WlanPolicySet(SL_POLICY_P2P, SL_P2P_POLICY(SL_P2P_ROLE_NEGOTIATE,SL_P2P_NEG_INITIATOR_RAND_BACKOFF),NULL,0)
When auto start is enabled, the device connects to a station from the profiles table. Up to 7 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]
pName
up 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]
NameLen
name length
+
[in]
pMacAddr
6 bytes for MAC address
+
[in]
pSecParams
Security parameters - security type (SL_SEC_TYPE_OPEN,SL_SEC_TYPE_WEP,SL_SEC_TYPE_WPA_WPA2, SL_SEC_TYPE_P2P_PBC,SL_SEC_TYPE_P2P_PIN_KEYPAD,SL_SEC_TYPE_P2P_PIN_DISPLAY, SL_SEC_TYPE_WPA_ENT), key, and key length in case of p2p security type pin the key refers to pin code
+
[in]
pSecExtParams
Enterprise 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]
Priority
profile priority. Lowest priority: 0
+
[in]
Options
Not supported
+
+
+
+
Returns
On success, profile stored index is returned. On error, negative value is returned
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_SEC_TYPE_WPA is a deprecated definition, the new definition is SL_SEC_TYPE_WPA_WPA2
+
+
+
+
+
+
+
+
+
_i16 sl_WlanProfileDel
+
(
+
const _i16
+
Index)
+
+
+
+
+
+
Delete WLAN profile.
+
Delete WLAN profile
+
Parameters
+
+
[in]
index
number of profile to delete.Possible values are 0 to 6. Index value 255 will delete all saved profiles
+
+
+
+
Returns
On success, zero is returned. On error, -1 is returned
profile stored index, if index does not exists error is return
+
[out]
pName
up 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]
pNameLen
name length
+
[out]
pMacAddr
6 bytes for MAC address
+
[out]
pSecParams
security parameters - security type (SL_SEC_TYPE_OPEN, SL_SEC_TYPE_WEP, SL_SEC_TYPE_WPA_WPA2 or SL_SEC_TYPE_WPS_PBC, SL_SEC_TYPE_WPS_PIN, SL_SEC_TYPE_WPA_ENT,SL_SEC_TYPE_P2P_PBC,SL_SEC_TYPE_P2P_PIN_KEYPAD or SL_SEC_TYPE_P2P_PIN_DISPLAY), key and key length are not in case of p2p security type pin the key refers to pin code return due to security reasons.
Internal function for setting WLAN configurations.
+
Returns
On success, zero is returned. On error one of the following error codes returned:
+
CONF_ERROR (-1)
+
CONF_NVMEM_ACCESS_FAILED (-2)
+
CONF_OLD_FILE_VERSION (-3)
+
CONF_ERROR_NO_SUCH_COUNTRY_CODE (-4)
+
+
+
Parameters
+
+
[in]
ConfigId
- configuration id
+
SL_WLAN_CFG_AP_ID
+
SL_WLAN_CFG_GENERAL_PARAM_ID
+
SL_WLAN_CFG_P2P_PARAM_ID
+
+
+
[in]
ConfigOpt
- configurations option
+
SL_WLAN_CFG_AP_ID
+
WLAN_AP_OPT_SSID
+ Set SSID for AP mode.
+ This options takes _u8 buffer as parameter
+
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
+
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
+
WLAN_AP_OPT_SECURITY_TYPE
+ Set Security type for AP mode. Security options are:
+
Open security: SL_SEC_TYPE_OPEN
+
WEP security: SL_SEC_TYPE_WEP
+
WPA security: SL_SEC_TYPE_WPA_WPA2
+ This option takes _u8 pointer as a parameter
+
+
+
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_CFG_GENERAL_PARAM_ID
+
WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS
+ Set scan parameters. This option uses slWlanScanParamCommand_t as parameter
+
WLAN_GENERAL_PARAM_OPT_COUNTRY_CODE
+ Set Country Code for AP mode
+ This options takes _u8 2 bytes buffer as parameter
+
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
+
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
+
WLAN_GENERAL_PARAM_OPT_INFO_ELEMENT Set Info Element for AP mode.
+ The Application can set up to MAX_PRIVATE_INFO_ELEMENTS_SUPPROTED info elements per Role (AP / P2P GO).
+ To delete an info element use the relevant index and length = 0.
+ The Application can set up to MAX_PRIVATE_INFO_ELEMENTS_SUPPROTED to the same role.
+ However, for AP - no more than INFO_ELEMENT_MAX_TOTAL_LENGTH_AP bytes can be stored for all info elements.
+ For P2P GO - no more than INFO_ELEMENT_MAX_TOTAL_LENGTH_P2P_GO bytes can be stored for all info elements.
+ This option takes sl_protocol_WlanSetInfoElement_t as parameter
+
+
+
SL_WLAN_CFG_P2P_PARAM_ID
+
WLAN_P2P_OPT_DEV_TYPE
+ Set P2P Device type.Maximum length of 17 characters. Device type is published under P2P I.E,
+ allows to make devices easier to recognize.
+ In case no device type is set, the default type is "1-0050F204-1"
+ This options takes _u8 buffer as parameter
+
WLAN_P2P_OPT_CHANNEL_N_REGS
+ Set P2P Channels.
+ listen channel (either 1/6/11 for 2.4GHz)
+ listen regulatory class (81 for 2.4GHz)
+ oper channel (either 1/6/11 for 2.4GHz)
+ oper regulatory class (81 for 2.4GHz)
+ listen channel and regulatory class will determine the device listen channel during p2p find listen phase
+ oper channel and regulatory class will determine the operating channel preferred by this device (in case it is group owner this will be the operating channel)
+ channels should be one of the social channels (1/6/11). In case no listen/oper channel selected, a random 1/6/11 will be selected. This option takes pointer to _u8[4] as parameter
+
+
+
+
+
[in]
ConfigLen
- configurations len
+
[in]
pValues
- configurations values
+
+
+
+
See Also
+
Note
+
Warning
+
Examples:
+
WLAN_AP_OPT_SSID:
_u8 str[33];
+
memset(str, 0, 33);
+
memcpy(str, ssid, len); // ssid string of 32 characters
The target of the procedure is to let the
+ device to gain the network parameters: SSID and Password (if network is secured)
+ and to connect to it once located in the network range.
+ An external application should be used on a device connected to any mobile network.
+ The external application will transmit over the air the network parameters in secured manner.
+ The Password may be decrypted using a Key.
+ The decryption method may be decided in the command or embedded in the Flash.
+ The procedure can be activated for 1-3 group ID in the range of BIT_0 - BIT_15 where the default group ID id 0 (BIT_0)
+ Once Smart Config has ended successfully, Asynchronous event will be received -
+ SL_OPCODE_WLAN_SMART_CONFIG_START_ASYNC_RESPONSE.
+ The Event will hold the SSID and an extra field that might have been delivered as well (i.e. - device name)
+
Parameters
+
+
[in]
groupIdBitmask
- each bit represent a group ID that should be searched. The Default group ID id BIT_0. 2 more group can be searched in addition. The range is BIT_0 - BIT_15.
+
[in]
chiper
- 0: check in flash, 1 - AES, 0xFF - do not check in flash
+
[in]
publicKeyLen
- public key len (used for the default group ID - BIT_0)
+
[in]
group1KeyLen
- group ID1 length
+
[in]
group2KeyLen
- group ID2 length
+
[in]
publicKey
- public key (used for the default group ID - BIT_0)
The SimpleLink CC32XX family allows to add Wi-Fi and networking capabilities to low-cost embedded products without having prior Wi-Fi, RF or networking expertise. The CC32XX is an ideal solution for sensor and control applications such as home appliances, home automation and smart metering. The CC32XX has integrated a comprehensive TCP/IP network stack, Wi-Fi driver, security supplicant and high-performance applications ARM Cortex-M4 MCU with ultra-low memory footprint, all without compromising the capabilities and robustness of the final application.Refer to the CC32XX Peripheral User Guide for application MCU peripheral APIs.
-
-Modules
-
To make it simple, TI's SimpleLink CC32XX platform capabilities were divided into modules by topic (Silo). These capabilities range from basic device management through wireless network configuration, standard BSD socket and much more. Listed below are the various modules in the SimpleLink CC32XX driver:
-
Device - controls the behavior of the CC32XX device (start/stop, events masking and obtaining specific device status)
-
Wlan - controls the use of the WiFi WLAN module including:
-
Connection features, such as: profiles, policies, SmartConfig
-
Advanced WLAN features, such as: scans, rx filters and rx statistics collection
-
-
-
Socket - controls standard client/server sockets programming options and capabilities
-
Netapp - activates networking applications, such as: HTTP Server, DHCP Server, Ping, DNS and mDNS.
-
Netcfg - controls the configuration of the device addresses (i.e. IP and MAC addresses)
-
FileSystem - provides file system capabilities to TI's CC32XX that can be used by both the CC31XX device and the user.
-
-
-Configuration
-
CC32XX SimpleLink driver is by default configured to support a wide range of application. User based on the application requirement can adjust these configurations. The guide takes you through this process step by step. Please notice that all modifications and porting adjustments of the driver should be made in the user.h header file only. Keep making any of the changes only in this file will ensure smoothly transaction to new versions of the driver at the future!
-
-Modify user.h file
-
The first step is to modify user.h file that includes default configurations and adjustments.
-
-Memory management model
-
The SimpleLink driver support two memory models:
-
Static (default)
-
Dynamic
-
-
CC32XX default configuration is Static. In the dynamic model it will use the malloc and free defined by supported Operating System. If one wishes to define its own memory management, they can define these interfaces
-
-Asynchronous event handlers routines
-
The SimpleLink device generate asynchronous events in several situations. These asynchronous events could be masked. In order to catch these events you have to provide handler routines. Please notice that if you not provide a handler routine and the event is received, the driver will drop this event without any indication of this drop.
-
-Interface communication driver
-
The SimpleLink device supports several standard communication protocol among SPI and UART. CC32XX Host Driver implements SPI Communication Interface The interface for this communication channel includes 4 simple access functions:
-
open
-
close
-
read
-
write
-
-
In CC32XX, SPI implementation uses DMA in order to increase the utilization of the communication channel. If user prefers to user UART, above interfaces need to be redefined
-
-OS adaptation
-
The SimpleLink driver could run on two kind of platforms:
-
Non-Os / Single Threaded (default)
-
Multi-Threaded
-
-
CC32XX SimpleLink Host Driver is ported on both Non-Os and Multi Threaded OS enviroment. The Host driver is made OS independent by implementing an OS Abstraction layer. Reference implementation for OS Abstraction is available for FreeRTOS and TI-RTOS.
-
If you choose to work in multi-threaded environment under different operating system you will have to provide some basic adaptation routines to allow the driver to protect access to resources for different threads (locking object) and to allow synchronization between threads (sync objects). In additional the driver support running without dedicated thread allocated solely to the simple link driver. If you choose to work in this mode, you should also supply a spawn method that will enable to run function on a temporary context.
Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
- Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the
- distribution.
-
- Neither the name of Texas Instruments Incorporated nor the names of
- its contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
The SimpleLink CC31xx/CC2xx family allows to add Wi-Fi and networking capabilities to low-cost embedded products without having prior Wi-Fi, RF or networking expertise. The CC31xx/CC32xx is an ideal solution for microcontroller-based sensor and control applications such as home appliances, home automation and smart metering. The CC31xx/CC32xx has integrated a comprehensive TCP/IP network stack, Wi-Fi driver and security supplicant leading to easier portability to microcontrollers, to an ultra-low memory footprint, all without compromising the capabilities and robustness of the final application.
+
+Module Names
+
To make it simple, TI's SimpleLink CC31xx/CC32xx platform capabilities were divided into modules by topic (Silo). These capabilities range from basic device management through wireless network configuration, standard BSD socket and much more. Listed below are the various modules in the SimpleLink CC31xx/CC32xx driver:
+
+
Device - controls the behaviour of the CC31xx/CC32xx device (start/stop, events masking and obtaining specific device status)
+
Wlan - controls the use of the WiFi WLAN module including:
+
Connection features, such as: profiles, policies, SmartConfig™
+
Advanced WLAN features, such as: scans, rx filters and rx statistics collection
+
+
+
Socket - controls standard client/server sockets programming options and capabilities
+
Netapp - activates networking applications, such as: HTTP Server, DHCP Server, Ping, DNS and mDNS.
+
Netcfg - controls the configuration of the device addresses (i.e. IP and MAC addresses)
+
FileSystem - provides file system capabilities to TI's CC31XX that can be used by both the CC31XX device and the user.
+
+
+Configuration
+
The porting of the SimpleLink driver to any new platform is based on few simple steps. This guide takes you through this process step by step. Please follow the instructions carefully to avoid any problems during this process and to enable efficient and proper work with the device. Please notice that all modifications and porting adjustments of the driver should be made in the user.h header file only. Keep making any of the changes only in this file will ensure smoothly transaction to new versions of the driver at the future!
+
+Modify user.h file
+
The first step is to modify user.h file that includes default configurations and adjustments.
+
+Select the capabilities set required for your application
+
Texas Instruments made a lot of efforts to build set of predefined capability sets that would fit most of the target application. It is recommended to try and choose one of this predefined capabilities set before going to build your own customized set. If you find compatible set you can skip the rest of this step.
+
The available sets are:
+
+
SL_TINY - Compatible to be used on platforms with very limited resources. Provides the best in class foot print in terms of Code and Data consumption.
+
SL_SMALL - Compatible to most common networking applications. Provide the most common APIs with decent balance between code size, data size, functionality and performances
+
SL_FULL - Provide access to all SimpleLink functionalities
+
+
+Memory management model
+
The SimpleLink driver support two memory models:
+
+
Static (default)
+
Dynamic
+
+
CC32XX default configuration is Static. In the dynamic model it will use the malloc and free defined by supported Operating System. If one wishes to define its own memory management, they can define these interfaces
+
+Asynchronous event handlers routines
+
The SimpleLink device generate asynchronous events in several situations. These asynchronous events could be masked. In order to catch these events you have to provide handler routines. Please notice that if you not provide a handler routine and the event is received, the driver will drop this event without any indication of this drop.
+
+Interface communication driver
+
CC32XX Host Driver implements an SPI Communication Interface. The interface for this communication channel includes 4 simple access functions:
+
+
open
+
close
+
read
+
write
+
+
In CC32XX, SPI implementation uses DMA in order to increase the utilization of the communication channel.
+
+OS adaptation
+
The SimpleLink driver could run on two kind of platforms:
+
+
Non-Os / Single Threaded (default)
+
Multi-Threaded
+
+
CC32XX SimpleLink Host Driver is ported on both Non-Os and Multi Threaded OS enviroment. The Host driver is made OS independent by implementing an OS Abstraction layer. Reference implementation for OS Abstraction is available for FreeRTOS and TI-RTOS.
+
If you choose to work in multi-threaded environment under different operating system you will have to provide some basic adaptation routines to allow the driver to protect access to resources for different threads (locking object) and to allow synchronization between threads (sync objects). In additional the driver support running without dedicated thread allocated solely to the simple link driver. If you choose to work in this mode, you should also supply a spawn method that will enable to run function on a temporary context.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
Neither the name of Texas Instruments Incorporated nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
a";bI=bv.getElementsByTagName("*");bF=bv.getElementsByTagName("a")[0];if(!bI||!bI.length||!bF){return{}}bG=av.createElement("select");bx=bG.appendChild(av.createElement("option"));bE=bv.getElementsByTagName("input")[0];bJ={leadingWhitespace:(bv.firstChild.nodeType===3),tbody:!bv.getElementsByTagName("tbody").length,htmlSerialize:!!bv.getElementsByTagName("link").length,style:/top/.test(bF.getAttribute("style")),hrefNormalized:(bF.getAttribute("href")==="/a"),opacity:/^0.55/.test(bF.style.opacity),cssFloat:!!bF.style.cssFloat,checkOn:(bE.value==="on"),optSelected:bx.selected,getSetAttribute:bv.className!=="t",enctype:!!av.createElement("form").enctype,html5Clone:av.createElement("nav").cloneNode(true).outerHTML!=="<:nav>",submitBubbles:true,changeBubbles:true,focusinBubbles:false,deleteExpando:true,noCloneEvent:true,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableMarginRight:true};bE.checked=true;bJ.noCloneChecked=bE.cloneNode(true).checked;bG.disabled=true;bJ.optDisabled=!bx.disabled;try{delete bv.test}catch(bC){bJ.deleteExpando=false}if(!bv.addEventListener&&bv.attachEvent&&bv.fireEvent){bv.attachEvent("onclick",function(){bJ.noCloneEvent=false});bv.cloneNode(true).fireEvent("onclick")}bE=av.createElement("input");bE.value="t";bE.setAttribute("type","radio");bJ.radioValue=bE.value==="t";bE.setAttribute("checked","checked");bv.appendChild(bE);bD=av.createDocumentFragment();bD.appendChild(bv.lastChild);bJ.checkClone=bD.cloneNode(true).cloneNode(true).lastChild.checked;bJ.appendChecked=bE.checked;bD.removeChild(bE);bD.appendChild(bv);bv.innerHTML="";if(bb.getComputedStyle){bA=av.createElement("div");bA.style.width="0";bA.style.marginRight="0";bv.style.width="2px";bv.appendChild(bA);bJ.reliableMarginRight=(parseInt((bb.getComputedStyle(bA,null)||{marginRight:0}).marginRight,10)||0)===0}if(bv.attachEvent){for(by in {submit:1,change:1,focusin:1}){bB="on"+by;bw=(bB in bv);if(!bw){bv.setAttribute(bB,"return;");bw=(typeof bv[bB]==="function")}bJ[by+"Bubbles"]=bw}}bD.removeChild(bv);bD=bG=bx=bA=bv=bE=null;b(function(){var bM,bU,bV,bT,bN,bO,bL,bS,bR,e,bP,bQ=av.getElementsByTagName("body")[0];if(!bQ){return}bL=1;bS="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;";bR="visibility:hidden;border:0;";e="style='"+bS+"border:5px solid #000;padding:0;'";bP="
Get service List Insert into out pBuffer a list of peer's services that are the NWP. The list is in a form of service struct. The user should chose the type of the service struct like: