drivers: Update CC3100 driver library to SDK release version 1.1.0.

crypto-aes
danicampora 8 years ago
parent c292632b59
commit 2b8a718d73

@ -34,14 +34,16 @@
*
*/
#ifndef __DEVICE_H__
#define __DEVICE_H__
/*****************************************************************************/
/* Include files */
/*****************************************************************************/
#include "simplelink.h"
#ifndef __DEVICE_H__
#define __DEVICE_H__
#ifdef __cplusplus
extern "C" {
#endif
@ -79,6 +81,10 @@ extern "C" {
/* User supplied invalid parameter */
#define SL_INVALPARAM (-2003)
/* Failed to open interface */
#define SL_BAD_INTERFACE (-2004)
/* End of SL internal Error codes */
@ -171,6 +177,8 @@ typedef enum
#define SL_WLAN_CONNECTION_FAILED_EVENT (9)
/* SL_EVENT_CLASS_DEVICE user events */
#define SL_DEVICE_FATAL_ERROR_EVENT (1)
#define SL_DEVICE_ABORT_ERROR_EVENT (2)
/* SL_EVENT_CLASS_BSD user events */
#define SL_SOCKET_TX_FAILED_EVENT (1)
#define SL_SOCKET_ASYNC_EVENT (2)
@ -228,6 +236,8 @@ typedef enum
/* Structure/Enum declarations */
/*****************************************************************************/
#define ROLE_UNKNOWN_ERR (-1)
#ifdef SL_IF_TYPE_UART
typedef struct
{
@ -252,6 +262,14 @@ typedef struct
_u16 Padding;
}SlVersionFull;
typedef struct
{
_u32 AbortType;
_u32 AbortData;
}sl_DeviceReportAbort;
typedef struct
{
_i8 status;
@ -261,6 +279,7 @@ typedef struct
typedef union
{
sl_DeviceReport deviceEvent;
sl_DeviceReportAbort deviceReport;
} _SlDeviceEventData_u;
typedef struct
@ -376,7 +395,7 @@ _i16 sl_Start(const void* pIfHdl, _i8* pDevName, const P_INIT_CALLBACK pInitCal
\warning
*/
#if _SL_INCLUDE_FUNC(sl_Stop)
_i16 sl_Stop(_u16 timeout);
_i16 sl_Stop(const _u16 timeout);
#endif
@ -399,7 +418,7 @@ _i16 sl_Stop(_u16 timeout);
Setting device time and date example:
SlDateTime_t dateTime= {0};
dateTime.sl_tm_day = (_u32)23; // Day of month (DD format) range 1-13
dateTime.sl_tm_day = (_u32)23; // Day of month (DD format) range 1-31
dateTime.sl_tm_mon = (_u32)6; // Month (MM format) in the range of 1-12
dateTime.sl_tm_year = (_u32)2014; // Year (YYYY format)
dateTime.sl_tm_hour = (_u32)17; // Hours in the range of 0-23
@ -413,7 +432,7 @@ _i16 sl_Stop(_u16 timeout);
\endcode
*/
#if _SL_INCLUDE_FUNC(sl_DevSet)
_i32 sl_DevSet(_u8 DeviceSetId ,_u8 Option,_u8 ConfigLen, _u8 *pValues);
_i32 sl_DevSet(const _u8 DeviceSetId ,const _u8 Option,const _u8 ConfigLen,const _u8 *pValues);
#endif
/*!
@ -446,9 +465,11 @@ _i32 sl_DevSet(_u8 DeviceSetId ,_u8 Option,_u8 ConfigLen, _u8 *pValues);
_u8 pConfigOpt;
_u8 pConfigLen;
pConfigOpt = SL_EVENT_CLASS_WLAN;
pConfigLen = sizeof(_u32);
sl_DevGet(SL_DEVICE_STATUS,&pConfigOpt,&pConfigLen,(_u8 *)(&statusWlan));
Example for getting version:
SlVersionFull ver;
pConfigLen = sizeof(ver);
pConfigOpt = SL_DEVICE_GENERAL_VERSION;
sl_DevGet(SL_DEVICE_GENERAL_CONFIGURATION,&pConfigOpt,&pConfigLen,(_u8 *)(&ver));
printf("CHIP %d\nMAC 31.%d.%d.%d.%d\nPHY %d.%d.%d.%d\nNWP %d.%d.%d.%d\nROM %d\nHOST %d.%d.%d.%d\n",
@ -475,7 +496,7 @@ _i32 sl_DevSet(_u8 DeviceSetId ,_u8 Option,_u8 ConfigLen, _u8 *pValues);
\endcode
*/
#if _SL_INCLUDE_FUNC(sl_DevGet)
_i32 sl_DevGet(_u8 DeviceGetId, _u8 *pOption,_u8 *pConfigLen, _u8 *pValues);
_i32 sl_DevGet(const _u8 DeviceGetId,_u8 *pOption,_u8 *pConfigLen, _u8 *pValues);
#endif
@ -527,7 +548,7 @@ _i32 sl_DevGet(_u8 DeviceGetId, _u8 *pOption,_u8 *pConfigLen, _u8 *pValues);
\endcode
*/
#if _SL_INCLUDE_FUNC(sl_EventMaskSet)
_i16 sl_EventMaskSet(_u8 EventClass , _u32 Mask);
_i16 sl_EventMaskSet(const _u8 EventClass ,const _u32 Mask);
#endif
/*!
@ -567,7 +588,7 @@ _i16 sl_EventMaskSet(_u8 EventClass , _u32 Mask);
\endcode
*/
#if _SL_INCLUDE_FUNC(sl_EventMaskGet)
_i16 sl_EventMaskGet(_u8 EventClass, _u32 *pMask);
_i16 sl_EventMaskGet(const _u8 EventClass,_u32 *pMask);
#endif

@ -61,8 +61,8 @@ typedef struct
typedef struct
{
_u16 TxPayloadLen;
_u16 RxPayloadLen;
_u16 ActualRxPayloadLen;
_i16 RxPayloadLen;
_i16 ActualRxPayloadLen;
_u8 *pTxPayload;
_u8 *pRxPayload;
}_SlCmdExt_t;
@ -97,12 +97,20 @@ typedef enum
SOCKET_6,
SOCKET_7,
MAX_SOCKET_ENUM_IDX,
#ifndef SL_TINY_EXT
ACCEPT_ID = MAX_SOCKET_ENUM_IDX,
CONNECT_ID,
#else
CONNECT_ID = MAX_SOCKET_ENUM_IDX,
#endif
#ifndef SL_TINY_EXT
SELECT_ID,
#endif
GETHOSYBYNAME_ID,
#ifndef SL_TINY_EXT
GETHOSYBYSERVICE_ID,
PING_ID,
#endif
START_STOP_ID,
RECV_ID
}_SlActionID_e;
@ -166,21 +174,18 @@ typedef struct
_SlSyncObj_t CmdSyncObj;
_u8 IsCmdRespWaited;
_SlFlowContCB_t FlowContCB;
_SlFlowContCB_t FlowContCB;
_u8 TxSeqNum;
_volatile _u8 RxIrqCnt;
_u8 RxDoneCnt;
_u8 SocketNonBlocking;
_u8 SocketTXFailure;
_u8 RelayFlagsViaRxPayload;
/* for stack reduction the parameters are globals */
_SlFunctionParams_t FunctionParams;
_u8 ActionIndex;
}_SlDriverCb_t;
extern _volatile _u8 RxIrqCnt;
extern _SlDriverCb_t* g_pCB;
extern P_SL_DEV_PING_CALLBACK pPingCallBackFunc;
@ -195,25 +200,47 @@ extern _SlReturnVal_t _SlDrvCmdOp(_SlCmdCtrl_t *pCmdCtrl , void* pTxRxDescBuff
extern _SlReturnVal_t _SlDrvCmdSend(_SlCmdCtrl_t *pCmdCtrl , void* pTxRxDescBuff , _SlCmdExt_t* pCmdExt);
extern _SlReturnVal_t _SlDrvDataReadOp(_SlSd_t Sd, _SlCmdCtrl_t *pCmdCtrl , void* pTxRxDescBuff , _SlCmdExt_t* pCmdExt);
extern _SlReturnVal_t _SlDrvDataWriteOp(_SlSd_t Sd, _SlCmdCtrl_t *pCmdCtrl , void* pTxRxDescBuff , _SlCmdExt_t* pCmdExt);
extern _i16 _SlDrvBasicCmd(_SlOpcode_t Opcode);
extern void _sl_HandleAsync_InitComplete(void *pVoidBuf);
extern void _sl_HandleAsync_Connect(void *pVoidBuf);
#ifndef SL_TINY_EXT
extern _i16 _SlDrvBasicCmd(_SlOpcode_t Opcode);
extern void _sl_HandleAsync_Accept(void *pVoidBuf);
extern void _sl_HandleAsync_DnsGetHostByService(void *pVoidBuf);
extern void _sl_HandleAsync_Select(void *pVoidBuf);
#endif
extern void _sl_HandleAsync_DnsGetHostByName(void *pVoidBuf);
extern void _sl_HandleAsync_DnsGetHostByService(void *pVoidBuf);
extern void _sl_HandleAsync_DnsGetHostByAddr(void *pVoidBuf);
extern void _sl_HandleAsync_PingResponse(void *pVoidBuf);
extern void _SlDrvNetAppEventHandler(void *pArgs);
extern void _SlDrvDeviceEventHandler(void *pArgs);
extern void _SlDrvNetAppEventHandler(void* pArgs);
extern void _SlDrvDeviceEventHandler(void* pArgs);
extern void _sl_HandleAsync_Stop(void *pVoidBuf);
extern _i16 _SlDrvWaitForPoolObj(_u32 ActionID, _u8 SocketID);
extern _u8 _SlDrvWaitForPoolObj(_u8 ActionID, _u8 SocketID);
extern void _SlDrvReleasePoolObj(_u8 pObj);
extern void _SlDrvObjInit(void);
extern _u16 _SlDrvAlignSize(_u16 msgLen);
extern _u8 _SlDrvProtectAsyncRespSetting(_u8 *pAsyncRsp, _u8 ActionID, _u8 SocketID);
extern void _SlDrvSyncObjWaitForever(_SlSyncObj_t *pSyncObj);
extern void _SlDrvSyncObjSignal(_SlSyncObj_t *pSyncObj);
extern void _SlDrvObjLock(_SlLockObj_t *pLockObj, _SlTime_t Timeout);
extern void _SlDrvObjLockWaitForever(_SlLockObj_t *pLockObj);
extern void _SlDrvProtectionObjLockWaitForever();
extern void _SlDrvObjUnLock(_SlLockObj_t *pLockObj);
extern void _SlDrvProtectionObjUnLock();
extern void _SlDrvMemZero(void* Addr, _u16 size);
extern void _SlDrvResetCmdExt(_SlCmdExt_t* pCmdExt);
#define _SL_PROTOCOL_ALIGN_SIZE(msgLen) (((msgLen)+3) & (~3))
#define _SL_IS_PROTOCOL_ALIGNED_SIZE(msgLen) (!((msgLen) & 3))
#define _SL_PROTOCOL_CALC_LEN(pCmdCtrl,pCmdExt) ((pCmdExt) ? \
(_SL_PROTOCOL_ALIGN_SIZE(pCmdCtrl->TxDescLen) + _SL_PROTOCOL_ALIGN_SIZE(pCmdExt->TxPayloadLen)) : \
(_SL_PROTOCOL_ALIGN_SIZE(pCmdCtrl->TxDescLen)))

@ -33,15 +33,17 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef __FS_H__
#define __FS_H__
/*****************************************************************************/
/* Include files */
/*****************************************************************************/
#include "simplelink.h"
#ifndef __FS_H__
#define __FS_H__
#ifdef __cplusplus
extern "C" {
@ -180,7 +182,7 @@ typedef enum
_FS_FILE_OPEN_FLAG_NO_SIGNATURE_TEST = 0x4, /* Relevant to secure file only */
_FS_FILE_OPEN_FLAG_STATIC = 0x8, /* Relevant to secure file only */
_FS_FILE_OPEN_FLAG_VENDOR = 0x10, /* Relevant to secure file only */
_FS_FILE_PUBLIC_WRITE = 0x20, /* Relevant to secure file only, the file can be opened for write without Token */
_FS_FILE_PUBLIC_WRITE= 0x20, /* Relevant to secure file only, the file can be opened for write without Token */
_FS_FILE_PUBLIC_READ = 0x40 /* Relevant to secure file only, the file can be opened for read without Token */
}SlFileOpenFlags_e;
@ -256,7 +258,7 @@ _u32 _sl_GetCreateFsMode(_u32 maxSizeInBytes,_u32 accessFlags);
\endcode
*/
#if _SL_INCLUDE_FUNC(sl_FsOpen)
_i32 sl_FsOpen(_u8 *pFileName,_u32 AccessModeAndMaxSize,_u32 *pToken,_i32 *pFileHandle);
_i32 sl_FsOpen(const _u8 *pFileName,const _u32 AccessModeAndMaxSize,_u32 *pToken,_i32 *pFileHandle);
#endif
/*!
@ -279,7 +281,7 @@ _i32 sl_FsOpen(_u8 *pFileName,_u32 AccessModeAndMaxSize,_u32 *pToken,_i32 *pFile
\endcode
*/
#if _SL_INCLUDE_FUNC(sl_FsClose)
_i16 sl_FsClose(_i32 FileHdl,_u8* pCeritificateFileName,_u8* pSignature,_u32 SignatureLen);
_i16 sl_FsClose(const _i32 FileHdl,const _u8* pCeritificateFileName,const _u8* pSignature,const _u32 SignatureLen);
#endif
/*!
@ -301,7 +303,7 @@ _i16 sl_FsClose(_i32 FileHdl,_u8* pCeritificateFileName,_u8* pSignature,_u32 Sig
\endcode
*/
#if _SL_INCLUDE_FUNC(sl_FsRead)
_i32 sl_FsRead(_i32 FileHdl,_u32 Offset ,_u8* pData,_u32 Len);
_i32 sl_FsRead(const _i32 FileHdl,_u32 Offset ,_u8* pData,_u32 Len);
#endif
/*!
@ -323,7 +325,7 @@ _i32 sl_FsRead(_i32 FileHdl,_u32 Offset ,_u8* pData,_u32 Len);
\endcode
*/
#if _SL_INCLUDE_FUNC(sl_FsWrite)
_i32 sl_FsWrite(_i32 FileHdl,_u32 Offset,_u8* pData,_u32 Len);
_i32 sl_FsWrite(const _i32 FileHdl,_u32 Offset,_u8* pData,_u32 Len);
#endif
/*!
@ -344,7 +346,7 @@ _i32 sl_FsWrite(_i32 FileHdl,_u32 Offset,_u8* pData,_u32 Len);
\endcode
*/
#if _SL_INCLUDE_FUNC(sl_FsGetInfo)
_i16 sl_FsGetInfo(_u8 *pFileName,_u32 Token,SlFsFileInfo_t* pFsFileInfo);
_i16 sl_FsGetInfo(const _u8 *pFileName,const _u32 Token,SlFsFileInfo_t* pFsFileInfo);
#endif
/*!
@ -363,7 +365,7 @@ _i16 sl_FsGetInfo(_u8 *pFileName,_u32 Token,SlFsFileInfo_t* pFsFileInfo);
\endcode
*/
#if _SL_INCLUDE_FUNC(sl_FsDel)
_i16 sl_FsDel(_u8 *pFileName,_u32 Token);
_i16 sl_FsDel(const _u8 *pFileName,const _u32 Token);
#endif
/*!

@ -34,15 +34,17 @@
*
*/
#ifndef __NETAPP_H__
#define __NETAPP_H__
/*****************************************************************************/
/* Include files */
/*****************************************************************************/
#include "simplelink.h"
#ifndef __NETAPP_H__
#define __NETAPP_H__
#ifdef __cplusplus
extern "C" {
@ -356,7 +358,7 @@ typedef void (*P_SL_DEV_PING_CALLBACK)(SlPingReport_t*);
\endcode
*/
#if _SL_INCLUDE_FUNC(sl_NetAppStart)
_i16 sl_NetAppStart(_u32 AppBitMap);
_i16 sl_NetAppStart(const _u32 AppBitMap);
#endif
/*!
\brief Stops a network application
@ -382,7 +384,7 @@ _i16 sl_NetAppStart(_u32 AppBitMap);
\endcode
*/
#if _SL_INCLUDE_FUNC(sl_NetAppStop)
_i16 sl_NetAppStop(_u32 AppBitMap);
_i16 sl_NetAppStop(const _u32 AppBitMap);
#endif
/*!
@ -417,6 +419,8 @@ _i16 sl_NetAppStop(_u32 AppBitMap);
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
\par Example:
\code
_u32 DestinationIP;
@ -430,7 +434,7 @@ _i16 sl_NetAppStop(_u32 AppBitMap);
\endcode
*/
#if _SL_INCLUDE_FUNC(sl_NetAppDnsGetHostByName)
_i16 sl_NetAppDnsGetHostByName(_i8 * hostname, _u16 usNameLen, _u32* out_ip_addr,_u8 family );
_i16 sl_NetAppDnsGetHostByName(_i8 * hostname,const _u16 usNameLen, _u32* out_ip_addr,const _u8 family );
#endif
/*!
@ -490,8 +494,8 @@ _i16 sl_NetAppDnsGetHostByName(_i8 * hostname, _u16 usNameLen, _u32* out_ip_add
*/
#if _SL_INCLUDE_FUNC(sl_NetAppDnsGetHostByService)
_i32 sl_NetAppDnsGetHostByService(_i8 *pServiceName, /* string containing all (or only part): name + subtype + service */
_u8 ServiceLen,
_u8 Family, /* 4-IPv4 , 16-IPv6 */
const _u8 ServiceLen,
const _u8 Family, /* 4-IPv4 , 16-IPv6 */
_u32 pAddr[],
_u32 *pPort,
_u16 *pTextLen, /* in: max len , out: actual len */
@ -549,11 +553,11 @@ _i32 sl_NetAppDnsGetHostByService(_i8 *pServiceName, /* string containing all
*/
#if _SL_INCLUDE_FUNC(sl_NetAppGetServiceList)
_i16 sl_NetAppGetServiceList(_u8 IndexOffest,
_u8 MaxServiceCount,
_u8 Flags,
_i8 *pBuffer,
_u32 RxBufferLength
_i16 sl_NetAppGetServiceList(const _u8 IndexOffest,
const _u8 MaxServiceCount,
const _u8 Flags,
_i8 *pBuffer,
const _u32 RxBufferLength
);
#endif
@ -582,7 +586,7 @@ _i16 sl_NetAppGetServiceList(_u8 IndexOffest,
The size of the service length should be smaller than 255.
*/
#if _SL_INCLUDE_FUNC(sl_NetAppMDNSUnRegisterService)
_i16 sl_NetAppMDNSUnRegisterService(const _i8 *pServiceName,_u8 ServiceNameLen);
_i16 sl_NetAppMDNSUnRegisterService(const _i8 *pServiceName,const _u8 ServiceNameLen);
#endif
/*!
@ -651,12 +655,12 @@ _i16 sl_NetAppMDNSUnRegisterService(const _i8 *pServiceName,_u8 ServiceNameLen);
*/
#if _SL_INCLUDE_FUNC(sl_NetAppMDNSRegisterService)
_i16 sl_NetAppMDNSRegisterService( const _i8* pServiceName,
_u8 ServiceNameLen,
const _u8 ServiceNameLen,
const _i8* pText,
_u8 TextLen,
_u16 Port,
_u32 TTL,
_u32 Options);
const _u8 TextLen,
const _u16 Port,
const _u32 TTL,
_u32 Options);
#endif
/*!
@ -720,7 +724,7 @@ _i16 sl_NetAppMDNSRegisterService( const _i8* pServiceName,
\endcode
*/
#if _SL_INCLUDE_FUNC(sl_NetAppPingStart)
_i16 sl_NetAppPingStart(SlPingStartCommand_t* pPingParams,_u8 family,SlPingReport_t *pReport,const P_SL_DEV_PING_CALLBACK pPingCallback);
_i16 sl_NetAppPingStart(const SlPingStartCommand_t* pPingParams,const _u8 family,SlPingReport_t *pReport,const P_SL_DEV_PING_CALLBACK pPingCallback);
#endif
/*!
@ -732,10 +736,27 @@ _i16 sl_NetAppPingStart(SlPingStartCommand_t* pPingParams,_u8 family,SlPingRepor
\param[in] AppId Application id, could be one of the following: \n
- SL_NET_APP_HTTP_SERVER_ID
- SL_NET_APP_DHCP_SERVER_ID
- SL_NET_APP_DHCP_SERVER_ID
- SL_NET_APP_MDNS_ID
- SL_NET_APP_DEVICE_CONFIG_ID
\param[in] SetOptions set option, could be one of the following: \n
NETAPP_SET_BASIC_OPT
- 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
\param[in] OptionLen option structure length
@ -770,7 +791,7 @@ _i16 sl_NetAppPingStart(SlPingStartCommand_t* pPingParams,_u8 family,SlPingRepor
*/
#if _SL_INCLUDE_FUNC(sl_NetAppSet)
_i32 sl_NetAppSet(_u8 AppId ,_u8 Option,_u8 OptionLen, _u8 *pOptionValue);
_i32 sl_NetAppSet(const _u8 AppId ,const _u8 Option,const _u8 OptionLen,const _u8 *pOptionValue);
#endif
/*!
@ -782,9 +803,27 @@ _i32 sl_NetAppSet(_u8 AppId ,_u8 Option,_u8 OptionLen, _u8 *pOptionValue);
\param[in] AppId Application id, could be one of the following: \n
- SL_NET_APP_HTTP_SERVER_ID
- SL_NET_APP_DHCP_SERVER_ID
- SL_NET_APP_MDNS_ID
- SL_NET_APP_DEVICE_CONFIG_ID
\param[in] SetOptions set option, could be one of the following: \n
- 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
\param[in] Options Get option, could be one of the following: \n
NETAPP_SET_BASIC_OPT
\param[in] OptionLen The length of the allocated memory as input, when the
function complete, the value of this parameter would be
@ -824,7 +863,7 @@ _i32 sl_NetAppSet(_u8 AppId ,_u8 Option,_u8 OptionLen, _u8 *pOptionValue);
\endcode
*/
#if _SL_INCLUDE_FUNC(sl_NetAppGet)
_i32 sl_NetAppGet(_u8 AppId, _u8 Option,_u8 *pOptionLen, _u8 *pOptionValue);
_i32 sl_NetAppGet(const _u8 AppId,const _u8 Option,_u8 *pOptionLen, _u8 *pOptionValue);
#endif

@ -33,15 +33,17 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef __NETCFG_H__
#define __NETCFG_H__
/*****************************************************************************/
/* Include files */
/*****************************************************************************/
#include "simplelink.h"
#ifndef __NETCFG_H__
#define __NETCFG_H__
#ifdef __cplusplus
extern "C" {
#endif
@ -182,7 +184,7 @@ typedef struct
*/
#if _SL_INCLUDE_FUNC(sl_NetCfgSet)
_i32 sl_NetCfgSet(_u8 ConfigId ,_u8 ConfigOpt, _u8 ConfigLen, _u8 *pValues);
_i32 sl_NetCfgSet(const _u8 ConfigId,const _u8 ConfigOpt,const _u8 ConfigLen,const _u8 *pValues);
#endif
@ -262,7 +264,7 @@ _i32 sl_NetCfgSet(_u8 ConfigId ,_u8 ConfigOpt, _u8 ConfigLen, _u8 *pValues);
*/
#if _SL_INCLUDE_FUNC(sl_NetCfgGet)
_i32 sl_NetCfgGet(_u8 ConfigId ,_u8 *pConfigOpt, _u8 *pConfigLen, _u8 *pValues);
_i32 sl_NetCfgGet(const _u8 ConfigId ,_u8 *pConfigOpt, _u8 *pConfigLen, _u8 *pValues);
#endif
/*!

@ -55,7 +55,7 @@ extern "C" {
#define NONOS_WAIT_FOREVER 0xFF
#define NONOS_NO_WAIT 0x01
#define NONOS_NO_WAIT 0x00
#define NONOS_RET_OK (0)
#define NONOS_RET_ERR (0xFF)

@ -168,25 +168,25 @@ extern "C" {
#define _SL_INCLUDE_FUNC(Name) (_SL_INC_##Name)
/* Driver */
#define _SL_INC_sl_NetAppStart __nap
#define _SL_INC_sl_NetAppStart __nap__ext
#define _SL_INC_sl_NetAppStop __nap__ext
#define _SL_INC_sl_NetAppStop __nap
#define _SL_INC_sl_NetAppDnsGetHostByName __nap__clt
#define _SL_INC_sl_NetAppDnsGetHostByName __nap__clt
#define _SL_INC_sl_NetAppDnsGetHostByService __nap__clt
#define _SL_INC_sl_NetAppMDNSRegisterService __nap__clt
#define _SL_INC_sl_NetAppMDNSUnRegisterService __nap__clt
#define _SL_INC_sl_NetAppMDNSRegisterUnregisterService __nap__clt
#define _SL_INC_sl_NetAppGetServiceList __nap__clt
#define _SL_INC_sl_NetAppDnsGetHostByService __nap__ext
#define _SL_INC_sl_NetAppMDNSRegisterService __nap__ext
#define _SL_INC_sl_NetAppMDNSUnRegisterService __nap__ext
#define _SL_INC_sl_NetAppMDNSRegisterUnregisterService __nap__ext
#define _SL_INC_sl_NetAppGetServiceList __nap__ext
#define _SL_INC_sl_DnsGetHostByAddr __nap__ext
#define _SL_INC_sl_NetAppPingStart __nap__ext
#define _SL_INC_sl_NetAppPingReport __nap__ext
#define _SL_INC_sl_NetAppSet __nap__ext
#define _SL_INC_sl_NetAppGet __nap__ext
#define _SL_INC_sl_NetAppPingStart __nap
#define _SL_INC_sl_NetAppPingReport __nap
/* FS */
#define _SL_INC_sl_FsOpen __nvm
@ -210,14 +210,11 @@ extern "C" {
#define _SL_INC_sl_NetCfgSet __ncg
#define _SL_INC_sl_NetAppSet __nap
#define _SL_INC_sl_NetAppGet __nap
/* socket */
#define _SL_INC_sl_Socket __sck
#define _SL_INC_sl_Close __sck__ext
#define _SL_INC_sl_Close __sck
#define _SL_INC_sl_Accept __sck__srv
@ -306,7 +303,7 @@ extern "C" {
#define _SL_INC_sl_StatusGet __dev
#ifdef SL_IF_TYPE_UART
#define _SL_INC_sl_UartSetMode __dev
#define _SL_INC_sl_UartSetMode __dev__ext
#endif
#define _SL_INC_sl_EventMaskGet __dev__ext

@ -149,6 +149,7 @@ typedef struct
#define SL_FLAGS_MASK (0xF)
#define SL_OPCODE_DEVICE_INITCOMPLETE 0x0008
#define SL_OPCODE_DEVICE_ABORT 0x000C
#define SL_OPCODE_DEVICE_STOP_COMMAND 0x8473
#define SL_OPCODE_DEVICE_STOP_RESPONSE 0x0473
#define SL_OPCODE_DEVICE_STOP_ASYNC_RESPONSE 0x0073
@ -351,9 +352,6 @@ typedef struct
#define SL_OPCODE_WLAN_SMARTCONFIGOPTGET 0x8C8E
#define SL_OPCODE_WLAN_SMARTCONFIGOPTGETRESPONSE 0x0C8E
#define SL_OPCODE_FREE_BSD_RECV_BUFFER 0xCCCB
#define SL_OPCODE_FREE_NON_BSD_READ_BUFFER 0xCCCD
/* Rx Filters opcodes */
#define SL_OPCODE_WLAN_WLANRXFILTERADDCOMMAND 0x8C6C
@ -1032,6 +1030,7 @@ typedef struct
_u16 rxKbitsSec;
_u32 outOfOrderPackets;
_u32 missedPackets;
_i16 token;
}_CtestAsyncResponse_t;
typedef struct
@ -1162,8 +1161,15 @@ typedef _BasicResponse_t _FsWriteResponse_t;
/* Set Max Async Payload length depending on flavor (Tiny, Small, etc.) */
#define SL_ASYNC_MAX_PAYLOAD_LEN 160 /* size must be aligned to 4 */
/* TODO: Set MAx Async Payload length depending on flavor (Tiny, Small, etc.) */
#ifdef SL_TINY_EXT
#define SL_ASYNC_MAX_PAYLOAD_LEN 120 /* size must be aligned to 4 */
#else
#define SL_ASYNC_MAX_PAYLOAD_LEN 160 /* size must be aligned to 4 */
#endif
#define SL_ASYNC_MAX_MSG_LEN (_SL_RESP_HDR_SIZE + SL_ASYNC_MAX_PAYLOAD_LEN)
#define RECV_ARGS_SIZE (sizeof(_SocketResponse_t))

@ -58,7 +58,7 @@
Listed below are the various modules in the SimpleLink CC31xx/CC32xx driver:
-# \ref device - controls the behaviour of the CC31xx/CC32xx device (start/stop, events masking and obtaining specific device status)
-# \ref wlan - controls the use of the WiFi WLAN module including:
- Connection features, such as: profiles, policies, SmartConfig
- Connection features, such as: profiles, policies, SmartConfig<EFBFBD>
- Advanced WLAN features, such as: scans, rx filters and rx statistics collection
-# \ref socket - controls standard client/server sockets programming options and capabilities
-# \ref netapp - activates networking applications, such as: HTTP Server, DHCP Server, Ping, DNS and mDNS.
@ -250,11 +250,11 @@ extern "C"
/*****************************************************************************/
/* Macro declarations for Host Driver version */
/*****************************************************************************/
#define SL_DRIVER_VERSION "1.0.0.1"
#define SL_DRIVER_VERSION "1.0.0.10"
#define SL_MAJOR_VERSION_NUM 1L
#define SL_MINOR_VERSION_NUM 0L
#define SL_VERSION_NUM 0L
#define SL_SUB_VERSION_NUM 1L
#define SL_SUB_VERSION_NUM 10L
/*****************************************************************************/
@ -264,15 +264,17 @@ extern "C"
#ifdef SL_TINY
#undef SL_INC_ARG_CHECK
#undef SL_INC_EXT_API
#undef SL_INC_SOCK_CLIENT_SIDE_API
#undef SL_INC_SOCK_SEND_API
#undef SL_INC_SOCK_SERVER_SIDE_API
#undef SL_INC_WLAN_PKG
#undef SL_INC_NET_APP_PKG
#undef SL_INC_NET_CFG_PKG
#undef SL_INC_FS_PKG
#define SL_INC_SOCK_SERVER_SIDE_API
#define SL_INC_SOCK_RECV_API
#define SL_INC_SOCKET_PKG
#undef SL_INC_SET_UART_MODE
#undef SL_INC_STD_BSD_API_NAMING
#undef SL_INC_SOCK_CLIENT_SIDE_API
#undef SL_INC_NET_APP_PKG
#undef SL_INC_SOCK_RECV_API
#undef SL_INC_SOCK_SEND_API
#undef SL_INC_SOCKET_PKG
#endif
#ifdef SL_SMALL
@ -287,6 +289,7 @@ extern "C"
#define SL_INC_SOCK_SERVER_SIDE_API
#define SL_INC_SOCK_RECV_API
#define SL_INC_SOCK_SEND_API
#define SL_INC_SET_UART_MODE
#endif
#ifdef SL_FULL
@ -301,6 +304,7 @@ extern "C"
#define SL_INC_SOCK_SERVER_SIDE_API
#define SL_INC_SOCK_RECV_API
#define SL_INC_SOCK_SEND_API
#define SL_INC_SET_UART_MODE
#endif
#define SL_RET_CODE_OK (0)
@ -314,7 +318,11 @@ extern "C"
#define sl_SyncObjClear(pObj) sl_SyncObjWait(pObj,SL_OS_NO_WAIT)
#ifndef SL_TINY_EXT
#define SL_MAX_SOCKETS (8)
#else
#define SL_MAX_SOCKETS (2)
#endif
/*****************************************************************************/
@ -339,14 +347,14 @@ typedef void (*_SlSpawnEntryFunc_t)(void* pValue);
#endif
#ifndef _SL_USER_TYPES
#define _u8 unsigned char
#define _i8 signed char
typedef unsigned char _u8;
typedef signed char _i8;
#define _u16 unsigned short
#define _i16 signed short
typedef unsigned short _u16;
typedef signed short _i16;
#define _u32 unsigned long
#define _i32 signed long
typedef unsigned long _u32;
typedef signed long _i32;
#define _volatile volatile
#define _const const
#endif
@ -362,6 +370,23 @@ typedef _i16 _SlReturnVal_t;
/*
* This event status used to block or continue the event propagation
* through all the registered external libs/user application
*
*/
typedef enum {
EVENT_PROPAGATION_BLOCK = 0,
EVENT_PROPAGATION_CONTINUE
} _SlEventPropogationStatus_e;
/*****************************************************************************/
/* Include files */
/*****************************************************************************/
@ -389,6 +414,323 @@ typedef _i16 _SlReturnVal_t;
#include "wlan_rx_filters.h"
/* The general events dispatcher which is
* initialized to the user handler */
#ifdef sl_GeneralEvtHdlr
#define _SlDrvHandleGeneralEvents sl_GeneralEvtHdlr
#endif
/* The wlan events dispatcher which is
* initialized to the user handler */
#ifdef sl_WlanEvtHdlr
#define _SlDrvHandleWlanEvents sl_WlanEvtHdlr
#endif
/* The NetApp events dispatcher which is
* initialized to the user handler */
#ifdef sl_NetAppEvtHdlr
#define _SlDrvHandleNetAppEvents sl_NetAppEvtHdlr
#endif
/* The http server events dispatcher which is
* initialized to the user handler if exists */
#ifdef sl_HttpServerCallback
#define _SlDrvHandleHttpServerEvents sl_HttpServerCallback
#endif
/* The socket events dispatcher which is
* initialized to the user handler */
#ifdef sl_SockEvtHdlr
#define _SlDrvHandleSockEvents sl_SockEvtHdlr
#endif
#ifndef __CONCAT
#define __CONCAT(x,y) x ## y
#endif
#define __CONCAT2(x,y) __CONCAT(x,y)
/*
* The section below handles the external lib event registration
* according to the desired events it specified in its API header file.
* The external lib should be first installed by the user (see user.h)
*/
#ifdef SL_EXT_LIB_1
/* General Event Registration */
#if __CONCAT2(SL_EXT_LIB_1, _NOTIFY_GENERAL_EVENT)
extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_1, _GeneralEventHdl) (SlDeviceEvent_t *);
#define SlExtLib1GeneralEventHandler __CONCAT2(SL_EXT_LIB_1, _GeneralEventHdl)
#undef EXT_LIB_REGISTERED_GENERAL_EVENTS
#define EXT_LIB_REGISTERED_GENERAL_EVENTS
#endif
/* Wlan Event Registration */
#if __CONCAT2(SL_EXT_LIB_1, _NOTIFY_WLAN_EVENT)
extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_1, _WlanEventHdl) (SlWlanEvent_t *);
#define SlExtLib1WlanEventHandler __CONCAT2(SL_EXT_LIB_1, _WlanEventHdl)
#undef EXT_LIB_REGISTERED_WLAN_EVENTS
#define EXT_LIB_REGISTERED_WLAN_EVENTS
#endif
/* NetApp Event Registration */
#if __CONCAT2(SL_EXT_LIB_1, _NOTIFY_NETAPP_EVENT)
extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_1, _NetAppEventHdl) (SlNetAppEvent_t *);
#define SlExtLib1NetAppEventHandler __CONCAT2(SL_EXT_LIB_1, _NetAppEventHdl)
#undef EXT_LIB_REGISTERED_NETAPP_EVENTS
#define EXT_LIB_REGISTERED_NETAPP_EVENTS
#endif
/* Http Server Event Registration */
#if __CONCAT2(SL_EXT_LIB_1, _NOTIFY_HTTP_SERVER_EVENT)
extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_1, _HttpServerEventHdl) (SlHttpServerEvent_t* , SlHttpServerResponse_t*);
#define SlExtLib1HttpServerEventHandler __CONCAT2(SL_EXT_LIB_1, _HttpServerEventHdl)
#undef EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
#define EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
#endif
/* Socket Event Registration */
#if __CONCAT2(SL_EXT_LIB_1, _NOTIFY_SOCK_EVENT)
extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_1, _SockEventHdl) (SlSockEvent_t *);
#define SlExtLib1SockEventHandler __CONCAT2(SL_EXT_LIB_1, _SockEventHdl)
#undef EXT_LIB_REGISTERED_SOCK_EVENTS
#define EXT_LIB_REGISTERED_SOCK_EVENTS
#endif
#endif
#ifdef SL_EXT_LIB_2
/* General Event Registration */
#if __CONCAT2(SL_EXT_LIB_2, _NOTIFY_GENERAL_EVENT)
extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_2, _GeneralEventHdl) (SlDeviceEvent_t *);
#define SlExtLib2GeneralEventHandler __CONCAT2(SL_EXT_LIB_2, _GeneralEventHdl)
#undef EXT_LIB_REGISTERED_GENERAL_EVENTS
#define EXT_LIB_REGISTERED_GENERAL_EVENTS
#endif
/* Wlan Event Registration */
#if __CONCAT2(SL_EXT_LIB_2, _NOTIFY_WLAN_EVENT)
extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_2, _WlanEventHdl) (SlWlanEvent_t *);
#define SlExtLib2WlanEventHandler __CONCAT2(SL_EXT_LIB_2, _WlanEventHdl)
#undef EXT_LIB_REGISTERED_WLAN_EVENTS
#define EXT_LIB_REGISTERED_WLAN_EVENTS
#endif
/* NetApp Event Registration */
#if __CONCAT2(SL_EXT_LIB_2, _NOTIFY_NETAPP_EVENT)
extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_2, _NetAppEventHdl) (SlNetAppEvent_t *);
#define SlExtLib2NetAppEventHandler __CONCAT2(SL_EXT_LIB_2, _NetAppEventHdl)
#undef EXT_LIB_REGISTERED_NETAPP_EVENTS
#define EXT_LIB_REGISTERED_NETAPP_EVENTS
#endif
/* Http Server Event Registration */
#if __CONCAT2(SL_EXT_LIB_2, _NOTIFY_HTTP_SERVER_EVENT)
extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_2, _HttpServerEventHdl) (SlHttpServerEvent_t* , SlHttpServerResponse_t*);
#define SlExtLib2HttpServerEventHandler __CONCAT2(SL_EXT_LIB_2, _HttpServerEventHdl)
#undef EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
#define EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
#endif
/* Socket Event Registration */
#if __CONCAT2(SL_EXT_LIB_2, _NOTIFY_SOCK_EVENT)
extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_2, _SockEventHdl) (SlSockEvent_t *);
#define SlExtLib2SockEventHandler __CONCAT2(SL_EXT_LIB_2, _SockEventHdl)
#undef EXT_LIB_REGISTERED_SOCK_EVENTS
#define EXT_LIB_REGISTERED_SOCK_EVENTS
#endif
#endif
#ifdef SL_EXT_LIB_3
/* General Event Registration */
#if __CONCAT2(SL_EXT_LIB_3, _NOTIFY_GENERAL_EVENT)
extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_3, _GeneralEventHdl) (SlDeviceEvent_t *);
#define SlExtLib3GeneralEventHandler __CONCAT2(SL_EXT_LIB_3, _GeneralEventHdl)
#undef EXT_LIB_REGISTERED_GENERAL_EVENTS
#define EXT_LIB_REGISTERED_GENERAL_EVENTS
#endif
/* Wlan Event Registration */
#if __CONCAT2(SL_EXT_LIB_3, _NOTIFY_WLAN_EVENT)
extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_3, _WlanEventHdl) (SlWlanEvent_t *);
#define SlExtLib3WlanEventHandler __CONCAT2(SL_EXT_LIB_3, _WlanEventHdl)
#undef EXT_LIB_REGISTERED_WLAN_EVENTS
#define EXT_LIB_REGISTERED_WLAN_EVENTS
#endif
/* NetApp Event Registration */
#if __CONCAT2(SL_EXT_LIB_3, _NOTIFY_NETAPP_EVENT)
extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_3, _NetAppEventHdl) (SlNetAppEvent_t *);
#define SlExtLib3NetAppEventHandler __CONCAT2(SL_EXT_LIB_3, _NetAppEventHdl)
#undef EXT_LIB_REGISTERED_NETAPP_EVENTS
#define EXT_LIB_REGISTERED_NETAPP_EVENTS
#endif
/* Http Server Event Registration */
#if __CONCAT2(SL_EXT_LIB_3, _NOTIFY_HTTP_SERVER_EVENT)
extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_3, _HttpServerEventHdl) (SlHttpServerEvent_t* , SlHttpServerResponse_t*);
#define SlExtLib3HttpServerEventHandler __CONCAT2(SL_EXT_LIB_3, _HttpServerEventHdl)
#undef EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
#define EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
#endif
/* Socket Event Registration */
#if __CONCAT2(SL_EXT_LIB_3, _NOTIFY_SOCK_EVENT)
extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_3, _SockEventHdl) (SlSockEvent_t *);
#define SlExtLib3SockEventHandler __CONCAT2(SL_EXT_LIB_3, _SockEventHdl)
#undef EXT_LIB_REGISTERED_SOCK_EVENTS
#define EXT_LIB_REGISTERED_SOCK_EVENTS
#endif
#endif
#ifdef SL_EXT_LIB_4
/* General Event Registration */
#if __CONCAT2(SL_EXT_LIB_4, _NOTIFY_GENERAL_EVENT)
extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_4, _GeneralEventHdl) (SlDeviceEvent_t *);
#define SlExtLib4GeneralEventHandler __CONCAT2(SL_EXT_LIB_4, _GeneralEventHdl)
#undef EXT_LIB_REGISTERED_GENERAL_EVENTS
#define EXT_LIB_REGISTERED_GENERAL_EVENTS
#endif
/* Wlan Event Registration */
#if __CONCAT2(SL_EXT_LIB_4, _NOTIFY_WLAN_EVENT)
extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_4, _WlanEventHdl) (SlWlanEvent_t *);
#define SlExtLib4WlanEventHandler __CONCAT2(SL_EXT_LIB_4, _WlanEventHdl)
#undef EXT_LIB_REGISTERED_WLAN_EVENTS
#define EXT_LIB_REGISTERED_WLAN_EVENTS
#endif
/* NetApp Event Registration */
#if __CONCAT2(SL_EXT_LIB_4, _NOTIFY_NETAPP_EVENT)
extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_4, _NetAppEventHdl) (SlNetAppEvent_t *);
#define SlExtLib4NetAppEventHandler __CONCAT2(SL_EXT_LIB_4, _NetAppEventHdl)
#undef EXT_LIB_REGISTERED_NETAPP_EVENTS
#define EXT_LIB_REGISTERED_NETAPP_EVENTS
#endif
/* Http Server Event Registration */
#if __CONCAT2(SL_EXT_LIB_4, _NOTIFY_HTTP_SERVER_EVENT)
extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_4, _HttpServerEventHdl) (SlHttpServerEvent_t* , SlHttpServerResponse_t*);
#define SlExtLib4HttpServerEventHandler __CONCAT2(SL_EXT_LIB_4, _HttpServerEventHdl)
#undef EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
#define EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
#endif
/* Socket Event Registration */
#if __CONCAT2(SL_EXT_LIB_4, _NOTIFY_SOCK_EVENT)
extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_4, _SockEventHdl) (SlSockEvent_t *);
#define SlExtLib4SockEventHandler __CONCAT2(SL_EXT_LIB_4, _SockEventHdl)
#undef EXT_LIB_REGISTERED_SOCK_EVENTS
#define EXT_LIB_REGISTERED_SOCK_EVENTS
#endif
#endif
#ifdef SL_EXT_LIB_5
/* General Event Registration */
#if __CONCAT2(SL_EXT_LIB_5, _NOTIFY_GENERAL_EVENT)
extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_5, _GeneralEventHdl) (SlDeviceEvent_t *);
#define SlExtLib5GeneralEventHandler __CONCAT2(SL_EXT_LIB_5, _GeneralEventHdl)
#undef EXT_LIB_REGISTERED_GENERAL_EVENTS
#define EXT_LIB_REGISTERED_GENERAL_EVENTS
#endif
/* Wlan Event Registration */
#if __CONCAT2(SL_EXT_LIB_5, _NOTIFY_WLAN_EVENT)
extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_5, _WlanEventHdl) (SlWlanEvent_t *);
#define SlExtLib5WlanEventHandler __CONCAT2(SL_EXT_LIB_5, _WlanEventHdl)
#undef EXT_LIB_REGISTERED_WLAN_EVENTS
#define EXT_LIB_REGISTERED_WLAN_EVENTS
#endif
/* NetApp Event Registration */
#if __CONCAT2(SL_EXT_LIB_5, _NOTIFY_NETAPP_EVENT)
extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_5, _NetAppEventHdl) (SlNetAppEvent_t *);
#define SlExtLib5NetAppEventHandler __CONCAT2(SL_EXT_LIB_5, _NetAppEventHdl)
#undef EXT_LIB_REGISTERED_NETAPP_EVENTS
#define EXT_LIB_REGISTERED_NETAPP_EVENTS
#endif
/* Http Server Event Registration */
#if __CONCAT2(SL_EXT_LIB_5, _NOTIFY_HTTP_SERVER_EVENT)
extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_5, _HttpServerEventHdl) (SlHttpServerEvent_t* , SlHttpServerResponse_t*);
#define SlExtLib5HttpServerEventHandler __CONCAT2(SL_EXT_LIB_5, _HttpServerEventHdl)
#undef EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
#define EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
#endif
/* Socket Event Registration */
#if __CONCAT2(SL_EXT_LIB_5, _NOTIFY_SOCK_EVENT)
extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_5, _SockEventHdl) (SlSockEvent_t *);
#define SlExtLib5SockEventHandler __CONCAT2(SL_EXT_LIB_5, _SockEventHdl)
#undef EXT_LIB_REGISTERED_SOCK_EVENTS
#define EXT_LIB_REGISTERED_SOCK_EVENTS
#endif
#endif
#if defined(EXT_LIB_REGISTERED_GENERAL_EVENTS)
extern void _SlDrvHandleGeneralEvents(SlDeviceEvent_t *slGeneralEvent);
#endif
#if defined(EXT_LIB_REGISTERED_WLAN_EVENTS)
extern void _SlDrvHandleWlanEvents(SlWlanEvent_t *slWlanEvent);
#endif
#if defined (EXT_LIB_REGISTERED_NETAPP_EVENTS)
extern void _SlDrvHandleNetAppEvents(SlNetAppEvent_t *slNetAppEvent);
#endif
#if defined(EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS)
extern void _SlDrvHandleHttpServerEvents(SlHttpServerEvent_t *slHttpServerEvent, SlHttpServerResponse_t *slHttpServerResponse);
#endif
#if defined(EXT_LIB_REGISTERED_SOCK_EVENTS)
extern void _SlDrvHandleSockEvents(SlSockEvent_t *slSockEvent);
#endif
typedef void (*_SlSpawnEntryFunc_t)(void* pValue);
/* Async functions description*/
@ -399,17 +741,31 @@ typedef _i16 _SlReturnVal_t;
\par
Parameters: \n
<b>pSlDeviceEvent->Event = SL_DEVICE_FATAL_ERROR_EVENT </b>
- <b>pSlDeviceEvent->Event = SL_DEVICE_FATAL_ERROR_EVENT </b>
- pSlDeviceEvent->EventData.deviceEvent fields:
- status: An error code indication from the device
- sender: The sender originator which is based on SlErrorSender_e enum
\par Example:
- sender: The sender originator which is based on SlErrorSender_e enum
- <b>pSlDeviceEvent->Event = SL_DEVICE_ABORT_ERROR_EVENT </b>
Indicates a severe error occured and the device stopped
- pSlDeviceEvent->EventData.deviceReport fields:
- AbortType: An idication of the event type
- AbortData: Additional info about the data error
\par Example for fatal error:
\code
printf(General Event Handler - ID=%d Sender=%d\n\n",
pSlDeviceEvent->EventData.deviceEvent.status, // status of the general event
pSlDeviceEvent->EventData.deviceEvent.sender); // sender type
\endcode
\par Example for abort request:
\code
printf(Abort type =%d Abort Data=%d\n\n",
pSlDeviceEvent->EventData.deviceReport.AbortType,
pSlDeviceEvent->EventData.deviceReport.AbortData);
\endcode
*/
#if (defined(sl_GeneralEvtHdlr))
extern void sl_GeneralEvtHdlr(SlDeviceEvent_t *pSlDeviceEvent);
@ -490,7 +846,7 @@ extern void sl_GeneralEvtHdlr(SlDeviceEvent_t *pSlDeviceEvent);
- status
*/
#if (defined(sl_WlanEvtHdlr))
extern void sl_WlanEvtHdlr(SlWlanEvent_t *pSlWlanEvent);
extern void sl_WlanEvtHdlr(SlWlanEvent_t* pSlWlanEvent);
#endif
@ -501,27 +857,27 @@ extern void sl_WlanEvtHdlr(SlWlanEvent_t *pSlWlanEvent);
\par
Parameters:
- <b>pSlWlanEvent->Event = SL_NETAPP_IPV4_IPACQUIRED_EVENT</b>, IPV4 acquired event
- pSlWlanEvent->EventData.ipAcquiredV4 fields:
- <b>pSlNetApp->Event = SL_NETAPP_IPV4_IPACQUIRED_EVENT</b>, IPV4 acquired event
- pSlNetApp->EventData.ipAcquiredV4 fields:
- ip
- gateway
- dns
- <b>pSlWlanEvent->Event = SL_NETAPP_IP_LEASED_EVENT</b>, AP or P2P go dhcp lease event
- pSlWlanEvent->EventData.ipLeased fields:
- <b>pSlNetApp->Event = SL_NETAPP_IP_LEASED_EVENT</b>, AP or P2P go dhcp lease event
- pSlNetApp->EventData.ipLeased fields:
- ip_address
- lease_time
- mac
- <b>pSlWlanEvent->Event = SL_NETAPP_IP_RELEASED_EVENT</b>, AP or P2P go dhcp ip release event
- pSlWlanEvent->EventData.ipReleased fields
- <b>pSlNetApp->Event = SL_NETAPP_IP_RELEASED_EVENT</b>, AP or P2P go dhcp ip release event
- pSlNetApp->EventData.ipReleased fields
- ip_address
- mac
- reason
*/
#if (defined(sl_NetAppEvtHdlr))
extern void sl_NetAppEvtHdlr(SlNetAppEvent_t *pSlNetApp);
extern void sl_NetAppEvtHdlr(SlNetAppEvent_t* pSlNetApp);
#endif
/*!
@ -532,18 +888,18 @@ extern void sl_NetAppEvtHdlr(SlNetAppEvent_t *pSlNetApp);
\par
Parameters:\n
- <b>pSlSockEvent->Event = SL_SOCKET_TX_FAILED_EVENT</b>
- pSlSockEvent->EventData fields:
- pSlSockEvent->SockTxFailData fields:
- sd
- status
- <b>pSlSockEvent->Event = SL_SOCKET_ASYNC_EVENT</b>
- pSlSockEvent->EventData fields:
- pSlSockEvent->SockAsyncData fields:
- sd
- type: SSL_ACCEPT or RX_FRAGMENTATION_TOO_BIG or OTHER_SIDE_CLOSE_SSL_DATA_NOT_ENCRYPTED
- val
*/
#if (defined(sl_SockEvtHdlr))
extern void sl_SockEvtHdlr(SlSockEvent_t *pSlSockEvent);
extern void sl_SockEvtHdlr(SlSockEvent_t* pSlSockEvent);
#endif
/*!

@ -34,14 +34,16 @@
*
*/
#ifndef __SL_SOCKET_H__
#define __SL_SOCKET_H__
/*****************************************************************************/
/* Include files */
/*****************************************************************************/
#include "simplelink.h"
#ifndef __SL_SOCKET_H__
#define __SL_SOCKET_H__
#ifdef __cplusplus
extern "C" {
@ -155,6 +157,60 @@ extern "C" {
#define SL_ESEC_ALT_NAME_E (-177) /* alt name size problem, too big */
#define SL_ESEC_AES_GCM_AUTH_E (-180) /* AES-GCM Authentication check failure */
#define SL_ESEC_AES_CCM_AUTH_E (-181) /* AES-CCM Authentication check failure */
#define SL_SOCKET_ERROR_E (-208) /* Error state on socket */
#define SL_ESEC_MEMORY_ERROR (-203) /* out of memory */
#define SL_ESEC_VERIFY_FINISHED_ERROR (-204) /* verify problem on finished */
#define SL_ESEC_VERIFY_MAC_ERROR (-205) /* verify mac problem */
#define SL_ESEC_UNKNOWN_HANDSHAKE_TYPE (-207) /* weird handshake type */
#define SL_ESEC_SOCKET_ERROR_E (-208) /* error state on socket */
#define SL_ESEC_SOCKET_NODATA (-209) /* expected data, not there */
#define SL_ESEC_INCOMPLETE_DATA (-210) /* don't have enough data to complete task */
#define SL_ESEC_UNKNOWN_RECORD_TYPE (-211) /* unknown type in record hdr */
#define SL_ESEC_FATAL_ERROR (-213) /* recvd alert fatal error */
#define SL_ESEC_ENCRYPT_ERROR (-214) /* error during encryption */
#define SL_ESEC_NO_PEER_KEY (-216) /* need peer's key */
#define SL_ESEC_NO_PRIVATE_KEY (-217) /* need the private key */
#define SL_ESEC_RSA_PRIVATE_ERROR (-218) /* error during rsa priv op */
#define SL_ESEC_NO_DH_PARAMS (-219) /* server missing DH params */
#define SL_ESEC_BUILD_MSG_ERROR (-220) /* build message failure */
#define SL_ESEC_BAD_HELLO (-221) /* client hello malformed */
#define SL_ESEC_DOMAIN_NAME_MISMATCH (-222) /* peer subject name mismatch */
#define SL_ESEC_WANT_READ (-223) /* want read, call again */
#define SL_ESEC_NOT_READY_ERROR (-224) /* handshake layer not ready */
#define SL_ESEC_PMS_VERSION_ERROR (-225) /* pre m secret version error */
#define SL_ESEC_VERSION_ERROR (-226) /* record layer version error */
#define SL_ESEC_WANT_WRITE (-227) /* want write, call again */
#define SL_ESEC_BUFFER_ERROR (-228) /* malformed buffer input */
#define SL_ESEC_VERIFY_CERT_ERROR (-229) /* verify cert error */
#define SL_ESEC_VERIFY_SIGN_ERROR (-230) /* verify sign error */
#define SL_ESEC_LENGTH_ERROR (-241) /* record layer length error */
#define SL_ESEC_PEER_KEY_ERROR (-242) /* can't decode peer key */
#define SL_ESEC_ZERO_RETURN (-243) /* peer sent close notify */
#define SL_ESEC_SIDE_ERROR (-244) /* wrong client/server type */
#define SL_ESEC_NO_PEER_CERT (-245) /* peer didn't send key */
#define SL_ESEC_ECC_CURVETYPE_ERROR (-250) /* Bad ECC Curve Type */
#define SL_ESEC_ECC_CURVE_ERROR (-251) /* Bad ECC Curve */
#define SL_ESEC_ECC_PEERKEY_ERROR (-252) /* Bad Peer ECC Key */
#define SL_ESEC_ECC_MAKEKEY_ERROR (-253) /* Bad Make ECC Key */
#define SL_ESEC_ECC_EXPORT_ERROR (-254) /* Bad ECC Export Key */
#define SL_ESEC_ECC_SHARED_ERROR (-255) /* Bad ECC Shared Secret */
#define SL_ESEC_NOT_CA_ERROR (-257) /* Not a CA cert error */
#define SL_ESEC_BAD_PATH_ERROR (-258) /* Bad path for opendir */
#define SL_ESEC_BAD_CERT_MANAGER_ERROR (-259) /* Bad Cert Manager */
#define SL_ESEC_MAX_CHAIN_ERROR (-268) /* max chain depth exceeded */
#define SL_ESEC_SUITES_ERROR (-271) /* suites pointer error */
#define SL_ESEC_SSL_NO_PEM_HEADER (-272) /* no PEM header found */
#define SL_ESEC_OUT_OF_ORDER_E (-273) /* out of order message */
#define SL_ESEC_SANITY_CIPHER_E (-275) /* sanity check on cipher error */
#define SL_ESEC_GEN_COOKIE_E (-277) /* Generate Cookie Error */
#define SL_ESEC_NO_PEER_VERIFY (-278) /* Need peer cert verify Error */
#define SL_ESEC_UNKNOWN_SNI_HOST_NAME_E (-281) /* Unrecognized host name Error */
/* begin negotiation parameter errors */
#define SL_ESEC_UNSUPPORTED_SUITE (-290) /* unsupported cipher suite */
#define SL_ESEC_MATCH_SUITE_ERROR (-291 ) /* can't match cipher suite */
/* ssl tls security start with -300 offset */
#define SL_ESEC_CLOSE_NOTIFY (-300) /* ssl/tls alerts */
#define SL_ESEC_UNEXPECTED_MESSAGE (-310) /* ssl/tls alerts */
@ -262,7 +318,13 @@ extern "C" {
#define SL_SEC_MASK_TLS_DHE_RSA_WITH_AES_256_CBC_SHA (1 << 3)
#define SL_SEC_MASK_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (1 << 4)
#define SL_SEC_MASK_TLS_ECDHE_RSA_WITH_RC4_128_SHA (1 << 5)
#define SL_SEC_MASK_SECURE_DEFAULT ((SEC_MASK_TLS_ECDHE_RSA_WITH_RC4_128_SHA << 1) - 1)
#define SL_SEC_MASK_TLS_RSA_WITH_AES_128_CBC_SHA256 (1 << 6)
#define SL_SEC_MASK_TLS_RSA_WITH_AES_256_CBC_SHA256 (1 << 7)
#define SL_SEC_MASK_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 (1 << 8)
#define SL_SEC_MASK_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 (1 << 9)
#define SL_SEC_MASK_SECURE_DEFAULT ((SL_SEC_MASK_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 << 1) - 1)
#define SL_MSG_DONTWAIT (0x00000008) /* Nonblocking IO */
@ -415,28 +477,41 @@ typedef struct
_u32 NonblockingEnabled;/* 0 = disabled;1 = enabled;default = 1*/
}SlSockNonblocking_t;
typedef struct
{
_u8 sd;
_u8 type;
_u16 val;
_u8 sd;
_u8 type;
_i16 val;
_u8* pExtraInfo;
} SlSocketAsyncEvent_t;
typedef struct
{
_i16 status;
_u16 sd;
SlSocketAsyncEvent_t socketAsyncEvent;
} SlSockEventData_t;
_i16 status;
_u8 sd;
_u8 padding;
} SlSockTxFailEventData_t;
typedef union
{
SlSockTxFailEventData_t SockTxFailData;
SlSocketAsyncEvent_t SockAsyncData;
} SlSockEventData_u;
typedef struct
{
_u32 Event;
SlSockEventData_t EventData;
SlSockEventData_u socketAsyncEvent;
} SlSockEvent_t;