XDK API  3.6.0
Documentation
Files | Data Structures | Macros | Typedefs | Functions
+ Collaboration diagram for Wlan Driver:

Files

file  BCDS_WlanDriver.h
 

Data Structures

struct  WlanDriver_SlSpawnMsg_S
 structure definition for spawn message More...
 

Macros

#define WLANDRIVER_COM_TIMEOUT   UINT32_C(5000)
 
#define WLANDRIVER_FAILURE   INT32_C(-1)
 
#define WLANDRIVER_MAX_DELAY   (UINT32_MAX)
 
#define WLANDRIVER_NOT_ENOUGH_MEMORY   (-1L)
 
#define WLANDRIVER_OS_NO_WAIT   UINT32_C(0)
 
#define WLANDRIVER_OS_WAIT_FOREVER   (UINT32_MAX)
 
#define WLANDRIVER_SPI_ERROR   INT32_C(-1)
 
#define WLANDRIVER_SPI_LOCK_TIMEOUT   UINT32_C(5000)
 
#define WLANDRIVER_SPI_RW_ERROR   UINT32_C(0)
 
#define WLANDRIVER_SUCCESS   INT32_C(0)
 

Typedefs

typedef signed int Fd_t
 
typedef void(* WLANDRIVER_EVENT_HANDLER )(void *pValue)
 
typedef short(* WLANDRIVER_OSI_SPAWN_ENTRY )(void *pValue)
 type definition for a spawn entry callback More...
 
typedef void * WlanDriver_OsLockObject
 
typedef void * WlanDriver_OsSyncObject
 
typedef uint32_t WlanDriver_OsTime
 
typedef struct
WlanDriver_SlSpawnMsg_S 
WlanDriver_SlSpawnMsg_T
 

Functions

Retcode_T WlanDriver_DeInit (void)
 Function to De-Initialize the WIFI Driver Layer. disabling WiFi clock , Powering off the WiFi module,Deleting the task and queue created. More...
 
Retcode_T WlanDriver_DeviceDisable (void)
 Function to write given no of bytes over SPI Function to disable the WIFI device. More...
 
Retcode_T WlanDriver_DeviceEnable (void)
 Function to enable the WIFI device. More...
 
Retcode_T WlanDriver_Init (void)
 Function to Initialize the WIFI Driver Layer. More...
 
int32_t WlanDriver_OsiSpawn (WLANDRIVER_OSI_SPAWN_ENTRY pEntry, void *pValue, unsigned long flags)
 This function call the pEntry callback from a different context. More...
 
int32_t WlanDriver_OsLockObjectCreate (WlanDriver_OsLockObject *pLockObj)
 This function creates a locking object (mutex semaphore) Locking object are used to protect a resource from mutual accesses of two or more threads. More...
 
int32_t WlanDriver_OsLockObjectDelete (WlanDriver_OsLockObject *pLockObj)
 This function deletes a locking object. More...
 
int32_t WlanDriver_OsLockObjectWait (WlanDriver_OsLockObject *pLockObj, WlanDriver_OsTime TimeOut)
 For details refer API documentation is in the interface header file WlanDriverInterface.h. More...
 
int32_t WlanDriver_OsLockUnlock (WlanDriver_OsLockObject *pLockObj)
 This function unlock a locking object. More...
 
int32_t WlanDriver_OsSyncObjectClear (WlanDriver_OsSyncObject *pSyncObj)
 This API tries to take the sync object without no wait time. More...
 
int32_t WlanDriver_OsSyncObjectCreate (WlanDriver_OsSyncObject *pSyncObj)
 This function creates a sync object (binary semaphore) The sync object is used for synchronization between different thread or ISR and a thread. More...
 
int32_t WlanDriver_OsSyncObjectDelete (WlanDriver_OsSyncObject *pSyncObj)
 This function deletes a sync object (binary semaphore) if the input parameter is valid. More...
 
int32_t WlanDriver_OsSyncObjectSignal (WlanDriver_OsSyncObject *pSyncObj)
 This function generates a sync signal for the object (binary semaphore) All suspended threads waiting on this sync object are resumed. More...
 
int32_t WlanDriver_OsSyncObjectWait (WlanDriver_OsSyncObject *pSyncObj, WlanDriver_OsTime TimeOut)
 This function waits for a sync signal of the specific sync object. More...
 
int32_t WlanDriver_OsSyncSignalFromISR (WlanDriver_OsSyncObject *pSyncObj)
 This function generates a sync signal for the object from Interrupt. More...
 
int WlanDriver_RegInterruptHdlr (WLANDRIVER_EVENT_HANDLER InterruptHdl, void *pValue)
 Function to register the Interrupt handler. More...
 
Retcode_T WlanDriver_SetDeviceTime (struct tm *tm)
 Function to set the current device time. More...
 
void WlanDriver_SimpleLinkSpawnTask (void *pvParameters)
 This is the simplelink spawn task required to call SimpleLink Driver's callback from a different context. More...
 
int WlanDriver_SpiClose (Fd_t fd)
 Function to close the SPI port. More...
 
Fd_t WlanDriver_SpiOpen (char *ifName, unsigned long flags)
 Function to Initialize the SPI port. More...
 
int WlanDriver_SpiRead (Fd_t fd, unsigned char *pBuff, int len)
 Function to read given number of bytes over SPI. More...
 
int WlanDriver_SpiWrite (Fd_t fd, unsigned char *pBuff, int len)
 Function to write given no of bytes over SPI. More...
 

Detailed Description

The interface header exports High-level Wlan Driver API's for integrating wifi stack which are used to initialize the Wlan Driver , Register Interrupt Handler and Wlan Driver Os Sync Objects creation and Deletion etc.,

Note
Data type 'Fd_t' is custom for third party wifi driver and hence for porting we cannot change this to BCDS standard datatype

Data Structure Documentation

struct WlanDriver_SlSpawnMsg_S

Data Fields

WLANDRIVER_OSI_SPAWN_ENTRY pEntry
 
void * pValue
 

Field Documentation

void* pValue

Macro Definition Documentation

#define WLANDRIVER_COM_TIMEOUT   UINT32_C(5000)
#define WLANDRIVER_FAILURE   INT32_C(-1)

Definition representing failure

#define WLANDRIVER_MAX_DELAY   (UINT32_MAX)

Definition representing Maximum delay

#define WLANDRIVER_NOT_ENOUGH_MEMORY   (-1L)
#define WLANDRIVER_OS_NO_WAIT   UINT32_C(0)

Definition representing wait for ever time value for OS API TimeOut

#define WLANDRIVER_OS_WAIT_FOREVER   (UINT32_MAX)

Definition representing wait for ever time value for OS API TimeOut

#define WLANDRIVER_SPI_ERROR   INT32_C(-1)
#define WLANDRIVER_SPI_LOCK_TIMEOUT   UINT32_C(5000)
#define WLANDRIVER_SPI_RW_ERROR   UINT32_C(0)
#define WLANDRIVER_SUCCESS   INT32_C(0)

Definition representing Success

Typedef Documentation

typedef signed int Fd_t

fileDescriptor for SPI port

typedef void(* WLANDRIVER_EVENT_HANDLER)(void *pValue)

type definition of wifi event handler

typedef short(* WLANDRIVER_OSI_SPAWN_ENTRY)(void *pValue)
Returns
The function which gets invoked inside stack returns the type short, hence in V1.2.0 simplelink stack this change is required the spawn mechanism enable to run a function on different context. This mechanism allow to transfer the execution context from interrupt context to thread context or changing the context from an unknown user thread to general context. The implementation of the spawn mechanism depends on the user's system requirements and could varies from implementation of serialized execution using single thread to creating thread per call
Note
The stack size of the execution thread must be at least of TBD bytes!
typedef void* WlanDriver_OsLockObject
typedef void* WlanDriver_OsSyncObject
typedef uint32_t WlanDriver_OsTime

Function Documentation

Retcode_T WlanDriver_DeInit ( void  )
Returns
In case of any other error refer BSP_WiFi_CC3100MOD_Connect error codes
Retcode_T WlanDriver_DeviceDisable ( void  )
Returns
any error value refer BSP_WiFi_CC3100MOD_Disable error codes
Note
This function will be called by the WiFi driver API mapped in <user.h> header file
Retcode_T WlanDriver_DeviceEnable ( void  )
Returns
any error value refer BSP_WiFi_CC3100MOD_Enable error codes
Note
This function will be called by the WiFi driver API mapped in <user.h> header file
Retcode_T WlanDriver_Init ( void  )
Returns
RETCODE_OK when successful
RETCODE_OUT_OF_RESOURCES Failed to create Semaphore while calling xSemaphoreCreateBinary.
RETCODE_RTOS_QUEUE_ERROR Failed to create SpawnQAndTask while calling CreateSpawnQAndTask.
In case of any other error refer BSP_WiFi_CC3100MOD_Connect error codes
int32_t WlanDriver_OsiSpawn ( WLANDRIVER_OSI_SPAWN_ENTRY  pEntry,
void *  pValue,
unsigned long  flags 
)
Parameters
[in]pEntry- pointer to the entry callback
[in]pValue- pointer to any type of memory structure that would be passed to pEntry callback from the execution thread.
[in]flags- execution flags - reserved for future usage
Returns
WLANDRIVER_SUCCESS - if flags set to SL_SPAWN_FLAG_FROM_SL_IRQ_HANDLER and xQueueSendFromISR is returning pdTRUE
WLANDRIVER_FAILURE - if flags set to SL_SPAWN_FLAG_FROM_SL_IRQ_HANDLER and xQueueSendFromISR is returning pdFAIL
WLANDRIVER_SUCCESS - if flags set to some value other than SL_SPAWN_FLAG_FROM_SL_IRQ_HANDLER and xQueueSendFromISR is returning pdTRUE
WLANDRIVER_FAILURE - if flags set to some value other than SL_SPAWN_FLAG_FROM_SL_IRQ_HANDLER and xQueueSendFromISR is returning pdFAIL
int32_t WlanDriver_OsLockObjectCreate ( WlanDriver_OsLockObject pLockObj)
Parameters
[in]pLockObjpointer to the locking object control block
Returns
WLANDRIVER_SUCCESS - successfully created lock object
WLANDRIVER_FAILURE - Failure when input parameter is NULL.
int32_t WlanDriver_OsLockObjectDelete ( WlanDriver_OsLockObject pLockObj)
Parameters
[in]pLockObjpointer to the locking object control block
Returns
WLANDRIVER_SUCCESS - successfully deleted lock object
WLANDRIVER_FAILURE - Failure when input parameter is NULL.
int32_t WlanDriver_OsLockObjectWait ( WlanDriver_OsLockObject pLockObj,
WlanDriver_OsTime  TimeOut 
)

This function locks a locking object All other threads that call this function before this thread calls the WlanDriver_osLockUnlock would be suspended

Parameters
[in]pLockObjpointer to the lock object control block
[in]Timeoutnumeric value specifies the maximum number of mSec to stay suspended while waiting for the locking object
Returns
WLANDRIVER_SUCCESS - reception of the locking object within the TimeOut window
WLANDRIVER_FAILURE - Failure when input parameter is NULL.
WLANDRIVER_FAILURE - Failure when xSemaphoreTake returns pdFAIL.
int32_t WlanDriver_OsLockUnlock ( WlanDriver_OsLockObject pLockObj)
Parameters
[in]pLockObjpointer to the lock object control block
Returns
WLANDRIVER_SUCCESS - successfully released the lock object
WLANDRIVER_FAILURE - Failure when input parameter is NULL.
int32_t WlanDriver_OsSyncObjectClear ( WlanDriver_OsSyncObject pSyncObj)
Parameters
[in]pSyncObjpointer to the sync object control block
Returns
WLANDRIVER_SUCCESS - successful reception of the signal
WLANDRIVER_FAILURE - Failure when input parameter is NULL.
int32_t WlanDriver_OsSyncObjectCreate ( WlanDriver_OsSyncObject pSyncObj)
Parameters
[in]pSyncObjpointer to the sync object control block
Returns
WLANDRIVER_SUCCESS - successfully created synchronous object
WLANDRIVER_FAILURE - Failure when input parameter is NULL.
int32_t WlanDriver_OsSyncObjectDelete ( WlanDriver_OsSyncObject pSyncObj)
Parameters
[in]pSyncObjpointer to the sync object control block
Returns
WLANDRIVER_SUCCESS - successfully deleted synchronous object
WLANDRIVER_FAILURE - Failure when input parameter is NULL.
int32_t WlanDriver_OsSyncObjectSignal ( WlanDriver_OsSyncObject pSyncObj)
Parameters
[in]pSyncObjpointer to the sync object control block
Returns
WLANDRIVER_SUCCESS - successfully released the synchronous object
WLANDRIVER_FAILURE - Failure when input parameter is NULL.
Note
This API gives the synchronous object successfully if it was already taken by some one. If the sync object given as input was not taken and this API call simply returns since sync object shall not be given if it is not taken
int32_t WlanDriver_OsSyncObjectWait ( WlanDriver_OsSyncObject pSyncObj,
WlanDriver_OsTime  TimeOut 
)
Parameters
[in]pSyncObjpointer to the sync object control block
[in]Timeoutnumeric value specifies the maximum number of mSec to stay suspended while waiting for the sync signal
Returns
WLANDRIVER_SUCCESS - reception of the signal within the TimeOut window
WLANDRIVER_FAILURE - Failure when input parameter is NULL.
int32_t WlanDriver_OsSyncSignalFromISR ( WlanDriver_OsSyncObject pSyncObj)
Parameters
[in]pSyncObjpointer to the sync object control block
Returns
WLANDRIVER_SUCCESS - successfully released the synchronous object from interrupt
WLANDRIVER_FAILURE - Failure when input parameter is NULL.
int WlanDriver_RegInterruptHdlr ( WLANDRIVER_EVENT_HANDLER  InterruptHdl,
void *  pValue 
)
Returns
WLANDRIVER_SUCCESS when successful
WLANDRIVER_FAILURE when the value of input pointer(pValue) is NULL
Note
This function will be called by the WiFi driver API mapped in <user.h> header file
Retcode_T WlanDriver_SetDeviceTime ( struct tm *  tm)
Parameters
[in]tm- pointer to all kinds of useful information about the current time.
Returns
RETCODE_OK on success, or an error code otherwise.

+ Here is the caller graph for this function:

void WlanDriver_SimpleLinkSpawnTask ( void *  pvParameters)
Parameters
[in]pvParameterspointer to the task parameter
int WlanDriver_SpiClose ( Fd_t  fd)
Returns
WLANDRIVER_SPI_ERROR - if spiHandle is NULL
any error value refer #MCU_SPI_Deinitialize error codes
Note
The return type 'int' and input parameter 'Fd_t' cannot be replaced with BCDS datatype since prototype has to match one on one with third party function data type
Fd_t WlanDriver_SpiOpen ( char *  ifName,
unsigned long  flags 
)
Returns
WLANDRIVER_SPI_ERROR - if spiHandle is NULL
WLANDRIVER_SPI_ERROR - if MCU_SPI_Initialize returns some error code other than RETCODE_OK
WLANDRIVER_SUCCESS when successful
Note
The return type 'Fd_t' and input parameters 'char*'and 'unsigned long' cannot be replaced with BCDS datatype since prototype has to match one on one with third party function data type
int WlanDriver_SpiRead ( Fd_t  fd,
unsigned char *  pBuff,
int  len 
)
Parameters
[in]fd-file descriptor for spi port, which is not used in current implementation
[in]pBuff- pointer to the first location of a buffer that contains enough space for all expected data
[in/out]len - number of bytes to read from the communication channel
Returns
WLANDRIVER_SPI_RW_ERROR - spi read failed
RETCODE_TIMEOUT - if xSemaphoreTake fails.
Note
The return value consist of (First 1 MSByte represents Package ID, Next byte represents Severity and Last 2 LSBytes represents error code).
Returns
#len - on success returns number of bytes received.
Note
The return type 'int' and input parameters 'Fd_t','unsigned char*'and 'int' cannot be replaced with BCDS datatype since prototype has to match one on one with third party function data type
int WlanDriver_SpiWrite ( Fd_t  fd,
unsigned char *  pBuff,
int  len 
)
Parameters
[in]fd-file descriptor for spi port, which is not used in current implementation
[in]pBuff- pointer to the first location of a buffer that contains the data to send over the communication channel.
[in/out]len - number of bytes to write to the communication channel
Returns
WLANDRIVER_SPI_RW_ERROR - spi write failed if MCU_SPI_Send returns some value other than RETCODE_OK.
RETCODE_TIMEOUT - if xSemaphoreTake fails.
#len - on success returns number of bytes sent.
Note
The return type 'int' and input parameters 'Fd_t','unsigned char*'and 'int' cannot be replaced with BCDS datatype since prototype has to match one on one with third party function data type

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