Infineon Logo AIROC BTSDK v4.9 - Documentation
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Semaphores

Semaphore management functionss. More...

Functions

wiced_semaphore_t * wiced_rtos_create_semaphore (void)
 Creates a new instance of semaphore. More...
 
wiced_result_t wiced_rtos_init_semaphore (wiced_semaphore_t *semaphore)
 Initialises a semaphore. More...
 
wiced_result_t wiced_rtos_set_semaphore (wiced_semaphore_t *semaphore)
 Set (post/put/increment) a semaphore. More...
 
wiced_result_t wiced_rtos_get_semaphore (wiced_semaphore_t *semaphore, uint32_t timeout_ms)
 Get (wait/decrement) a semaphore. More...
 

Detailed Description

Semaphore management functionss.

Function Documentation

wiced_semaphore_t* wiced_rtos_create_semaphore ( void  )

Creates a new instance of semaphore.

Creates a new semaphore (Allocates memory for a new semaphore instance and returns the pointer)

Returns
valid pointer : on success.
NULL : if an error occurred
wiced_result_t wiced_rtos_get_semaphore ( wiced_semaphore_t *  semaphore,
uint32_t  timeout_ms 
)

Get (wait/decrement) a semaphore.

Attempts to get (wait/decrement) a semaphore. If semaphore is at zero already, then the calling thread will be suspended until another thread sets the semaphore with wiced_rtos_set_semaphore

Parameters
semaphore: a pointer to the semaphore handle
timeout_msthe number of milliseconds to wait before returning
Returns
WICED_SUCCESS : on success.
WICED_ERROR : if an error occurred
wiced_result_t wiced_rtos_init_semaphore ( wiced_semaphore_t *  semaphore)

Initialises a semaphore.

Initialises a counting semaphore

Parameters
semaphore: a pointer to the semaphore handle to be initialised
Returns
WICED_SUCCESS : on success.
WICED_ERROR : if an error occurred
wiced_result_t wiced_rtos_set_semaphore ( wiced_semaphore_t *  semaphore)

Set (post/put/increment) a semaphore.

Set (post/put/increment) a semaphore

Parameters
semaphore: a pointer to the semaphore handle to be set
Returns
WICED_SUCCESS : on success.
WICED_ERROR : if an error occurred