XDK API  3.4.0
Documentation
Macros
Porting - Operating System
+ Collaboration diagram for Porting - Operating System:

Macros

#define _SlLockObj_t   WlanDriver_OsLockObject
 type definition for a locking object container More...
 
#define _SlSyncObj_t   WlanDriver_OsSyncObject
 type definition for a sync object container More...
 
#define _SlTime_t   WlanDriver_OsTime
 type definition for a time value More...
 
#define sl_LockObjCreate(pLockObj, pName)   WlanDriver_OsLockObjectCreate(pLockObj)
 This function creates a locking object. More...
 
#define sl_LockObjDelete(pLockObj)   WlanDriver_OsLockObjectDelete(pLockObj)
 This function deletes a locking object. More...
 
#define sl_LockObjLock(pLockObj, TimeOut)   WlanDriver_OsLockObjectWait(pLockObj, TimeOut)
 This function locks a locking object. More...
 
#define sl_LockObjUnlock(pLockObj)   WlanDriver_OsLockUnlock(pLockObj)
 This function unlock a locking object. More...
 
#define SL_OS_NO_WAIT   (WLANDRIVER_OS_NO_WAIT)
 
#define SL_OS_RET_CODE_OK   (WLANDRIVER_SUCCESS)
 
#define SL_OS_WAIT_FOREVER   (WLANDRIVER_OS_WAIT_FOREVER)
 
#define SL_PLATFORM_EXTERNAL_SPAWN
 This function call the pEntry callback from a different context. More...
 
#define SL_PLATFORM_MULTI_THREADED
 
#define sl_Spawn(pEntry, pValue, flags)   WlanDriver_OsiSpawn(pEntry , pValue , flags);
 
#define sl_SyncObjCreate(pSyncObj, pName)   WlanDriver_OsSyncObjectCreate(pSyncObj)
 This function creates a sync object. More...
 
#define sl_SyncObjDelete(pSyncObj)   WlanDriver_OsSyncObjectDelete(pSyncObj)
 This function deletes a sync object. More...
 
#define sl_SyncObjSignal(pSyncObj)   WlanDriver_OsSyncObjectSignal(pSyncObj)
 This function generates a sync signal for the object. More...
 
#define sl_SyncObjSignalFromIRQ(pSyncObj)   WlanDriver_OsSyncSignalFromISR(pSyncObj)
 This function generates a sync signal for the object from Interrupt. More...
 
#define sl_SyncObjWait(pSyncObj, TimeOut)   WlanDriver_OsSyncObjectWait(pSyncObj, TimeOut)
 This function waits for a sync signal of the specific sync object. 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:

  1. Uncomment SL_PLATFORM_MULTI_THREADED define
  2. Bind locking object routines
  3. Bind synchronization object routines
  4. Optional - Bind spawn thread routine

Macro Definition Documentation

#define _SlLockObj_t   WlanDriver_OsLockObject

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.
belongs to porting_sec
#define _SlSyncObj_t   WlanDriver_OsSyncObject

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.
belongs to porting_sec
#define _SlTime_t   WlanDriver_OsTime
Note
On each porting or platform the type could be whatever is needed - integer, pointer to structure etc.
belongs to porting_sec
#define sl_LockObjCreate (   pLockObj,
  pName 
)    WlanDriver_OsLockObjectCreate(pLockObj)

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 porting_sec
Warning
#define sl_LockObjDelete (   pLockObj)    WlanDriver_OsLockObjectDelete(pLockObj)
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 porting_sec
Warning
#define sl_LockObjLock (   pLockObj,
  TimeOut 
)    WlanDriver_OsLockObjectWait(pLockObj, TimeOut)

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
Returns
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 porting_sec
Warning
#define sl_LockObjUnlock (   pLockObj)    WlanDriver_OsLockUnlock(pLockObj)
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
Note
belongs to porting_sec
Warning
#define SL_OS_NO_WAIT   (WLANDRIVER_OS_NO_WAIT)
See also
Note
belongs to porting_sec
Warning
#define SL_OS_RET_CODE_OK   (WLANDRIVER_SUCCESS)
See also
Note
belongs to porting_sec
Warning
#define SL_OS_WAIT_FOREVER   (WLANDRIVER_OS_WAIT_FOREVER)
See also
Note
belongs to porting_sec
Warning
#define SL_PLATFORM_EXTERNAL_SPAWN
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 porting_sec
Warning
#define SL_PLATFORM_MULTI_THREADED
#define sl_Spawn (   pEntry,
  pValue,
  flags 
)    WlanDriver_OsiSpawn(pEntry , pValue , flags);
#define sl_SyncObjCreate (   pSyncObj,
  pName 
)    WlanDriver_OsSyncObjectCreate(pSyncObj)

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 porting_sec
Warning
#define sl_SyncObjDelete (   pSyncObj)    WlanDriver_OsSyncObjectDelete(pSyncObj)
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 porting_sec
Warning
#define sl_SyncObjSignal (   pSyncObj)    WlanDriver_OsSyncObjectSignal(pSyncObj)

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)    WlanDriver_OsSyncSignalFromISR(pSyncObj)

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 
)    WlanDriver_OsSyncObjectWait(pSyncObj, TimeOut)
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
Note
belongs to porting_sec
Warning

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 Sat Jul 28 2018 21:51:56 by doxygen 1.8.8