BLE-Stack APIs  3.00.00
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Modules | Files | Functions
ICall

This module implements the Indirect Call Layer. More...

Modules

 ICall Constants
 
 ICall Data Structures
 

Files

file  icall.h
 ICall layer interface.
 

Functions

ICall_Errno ICall_abort (void)
 Aborts. More...
 
void * ICall_allocMsg (size_t size)
 Allocates memory block for a message. More...
 
void ICall_createRemoteTasks (void)
 Create remote tasks. More...
 
ICall_Semaphore ICall_createSemaphore (uint_fast8_t mode, int initcount)
 Creates a semaphore. More...
 
ICall_Errno ICall_createTask (void(*entryfn)(size_t arg), uint_fast8_t priority, uint_fast16_t stacksize, size_t arg)
 Creates a new RTOS task. More...
 
uint32_t icall_directAPI (uint8_t service, icall_lite_id_t id,...)
 generic variadic function to translate API id to a functional call in the stack context, More...
 
ICall_Errno ICall_disableInt (int intnum)
 Disables interrupt. More...
 
ICall_Errno ICall_disableMInt (void)
 Disables master interrupt and context switching. More...
 
ICall_Errno ICall_enableInt (int intnum)
 Enables interrupt. More...
 
ICall_Errno ICall_enableMInt (void)
 Enables master interrupt and context switching. More...
 
ICall_Errno ICall_enrollService (ICall_ServiceEnum service, ICall_ServiceFunc fn, ICall_EntityID *entity, ICall_SyncHandle *msgSyncHdl)
 Registers a service entity. More...
 
ICall_Errno ICall_entityId2ServiceId (ICall_EntityID entityId, ICall_ServiceEnum *servId)
 Transforms and entityId into a serviceId. Note that this function is useful in case an application waits for messages from both a server and another application, in which case, the application can only use ICall_fetchMsg , not ICall_fetchServiceMsg because the latter will return ICALL_ERRNO_CORRUPT_MSG when a message sent by the other application is about to be fetched.
This function, then, is useful to retrieve service id matching the source entity id in case the source entity id is not that of the other application. More...
 
ICall_Errno ICall_fetchMsg (ICall_EntityID *src, ICall_EntityID *dest, void **msg)
 Retrieves a message, queued to receive queue of the calling thread. More...
 
ICall_Errno ICall_fetchServiceMsg (ICall_ServiceEnum *src, ICall_EntityID *dest, void **msg)
 Retrieves a message received at the message queue associated with the calling thread. More...
 
void ICall_free (void *msg)
 Frees an allocated memory block. More...
 
void ICall_freeMsg (void *msg)
 Frees the memory block allocated for a message. More...
 
ICall_EntityID ICall_getEntityId (void)
 Retrieves an entity ID of (arbitrary) one of the entities registered from the calling thread. More...
 
uint_fast8_t ICall_getLocalMsgEntityId (ICall_ServiceEnum service, ICall_EntityID entity)
 Retrieves an internal ID understood only by a service entity, corresponding to an ICall entity ID. More...
 
uint_fast32_t ICall_getMaxMSecs (void)
 Gets the maximum timeout period supported by ICall_setTimerMSecs function. More...
 
uint_fast32_t ICall_getTickPeriod (void)
 Gets the tick period. More...
 
uint_fast32_t ICall_getTicks (void)
 Gets the current tick counter value. More...
 
void ICall_init (void)
 Initializes the dispatcher implementation. More...
 
void * ICall_malloc (uint_least16_t size)
 Allocates a memory block. More...
 
ICall_Errno ICall_postSemaphore (ICall_Semaphore sem)
 Post on a semaphore. More...
 
ICall_Errno ICall_pwrConfigACAction (ICall_PwrBitmap_t bitmap)
 Configures power constraint/dependency set/release actions upon activity counter change. More...
 
ICall_Errno ICall_pwrDispense (ICall_PwrBitmap_t bitmap)
 Releases power constraints and dependencies. More...
 
uint_fast8_t ICall_pwrGetTransitionState (void)
 Retrieves power transition state. More...
 
uint32_t ICall_pwrGetXOSCStartupTime (uint_fast32_t timeUntilWakeupInMs)
 
bool ICall_pwrIsStableXOSCHF (void)
 Checks whether HF XOSC is stable. This function must be called after HF XOSC is turned on (through power dependency). More...
 
ICall_Errno ICall_pwrRegisterNotify (ICall_PwrNotifyFn fn, ICall_PwrNotifyData *obj)
 Registers a power state transition notify function. More...
 
ICall_Errno ICall_pwrRequire (ICall_PwrBitmap_t bitmap)
 Sets power constraints and dependencies. More...
 
ICall_Errno ICall_pwrSwitchXOSCHF (void)
 Switch clock source to HF XOSC. This function must be called after HF XOSC is stable. More...
 
bool ICall_pwrUpdActivityCounter (bool incFlag)
 Increments or decrements power activity counter. More...
 
ICall_Errno ICall_registerApp (ICall_EntityID *entity, ICall_SyncHandle *msgSyncHdl)
 Registers an application. More...
 
ICall_Errno ICall_registerISR (int intnum, void(*isrfunc)(void))
 Registers an interrupt service routine. More...
 
ICall_Errno ICall_registerISR_Ext (int intnum, void(*isrfunc)(void), int intPriority)
 ICall Register ISR.
 
ICall_EntityID ICall_searchServiceEntity (ICall_ServiceEnum service)
 Search for a service entity entry. More...
 
ICall_Errno ICall_send (ICall_EntityID src, ICall_EntityID dest, ICall_MSGFormat format, void *msg)
 Sends a message to an entity. More...
 
ICall_Errno ICall_sendServiceMsg (ICall_EntityID src, ICall_ServiceEnum dest, ICall_MSGFormat format, void *msg)
 Sends a message to a registered server. More...
 
ICall_Errno ICall_setTimer (uint_fast32_t ticks, ICall_TimerCback cback, void *arg, ICall_TimerID *id)
 Set up or restart a timer. Note that the timer setup initially by this function may be restarted using ICall_setTimerMSecs function as well. More...
 
ICall_Errno ICall_setTimerMSecs (uint_fast32_t msecs, ICall_TimerCback cback, void *arg, ICall_TimerID *id)
 Set up or restart a timer. Note that the timer setup initially by this function may be restarted using ICall_setTimer function as well. More...
 
ICall_Errno ICall_signal (ICall_SyncHandle msgSyncHdl)
 Signals a semaphore. More...
 
void ICall_stopTimer (ICall_TimerID id)
 Stops a timer. More...
 
uint_fast8_t ICall_threadServes (ICall_ServiceEnum service)
 Checks whether the calling thread provides the designated service. More...
 
ICall_Errno ICall_wait (uint_fast32_t milliseconds)
 Waits for a signal to the semaphore associated with the calling thread. More...
 
ICall_Errno ICall_waitMatch (uint_least32_t milliseconds, ICall_MsgMatchFn matchFn, ICall_ServiceEnum *src, ICall_EntityID *dest, void **msg)
 Waits for and retrieves a message received at the message queue associated with the calling thread, which matches a certain condition. More...
 
ICall_Errno ICall_waitSemaphore (ICall_Semaphore sem, uint_fast32_t milliseconds)
 Waits on a semaphore. More...
 

Detailed Description

This module implements the Indirect Call Layer.


Function Documentation

ICall_Errno ICall_abort ( void  )

Aborts.

This is preferred over C runtime abort function, in an external image since the C runtime abort is only guaranteed in a root image which contains the C runtime entry function that is executed upon startup.

void* ICall_allocMsg ( size_t  size)

Allocates memory block for a message.

Parameters
sizesize of the message body in bytes.
Returns
pointer to the start of the message body of the newly allocated memory block, or NULL if the allocation failed.
void ICall_createRemoteTasks ( void  )

Create remote tasks.

Note
One remote task shall be created per external image.
This function must be called after calling ICall_init .

The external image information must be stored either in a custom icall_addrs.h header file in an include path when ICALL_FEATURE_SEPARATE_IMGINFO compile flag is not defined, or as a set of external constants.

If ICALL_FEATURE_SEPARATE_IMGINFO compile flag is not defined, the following macros must be defined in the ICallAddrs.h file: ICALL_STACK0_ADDR, ICALL_ADDR_MAPS, ICALL_TASK_PRIORITIES and ICALL_TASK_STACK_SIZES.

If ICALL_FEATURE_SEPARATE_IMGINFO compile flag is defined, the following constants have to be linked into an image that include ICall module: ICall_imgEntries, ICall_imgTaskPriorities, ICall_imgTaskStackSizes and ICall_numImages.

ICall_Semaphore ICall_createSemaphore ( uint_fast8_t  mode,
int  initcount 
)

Creates a semaphore.

Parameters
modeSemaphore mode
ICALL_SEMAPHORE_MODE_COUNTING, or
ICALL_SEMAPHORE_MODE_BINARY
initcountinitial count value
Returns
created semaphore when successful
NULL when creation failed
ICall_Errno ICall_createTask ( void(*)(size_t arg)  entryfn,
uint_fast8_t  priority,
uint_fast16_t  stacksize,
size_t  arg 
)

Creates a new RTOS task.

Parameters
entryfntask entry function.
prioritytask priority as understood by the underlying RTOS
stacksizestack size as understood by the underlying RTOS
argargument to pass to the task entry function
Returns
ICALL_ERRNO_SUCCESS when successful
ICALL_ERRNO_NO_RESOURCE when creation failed
uint32_t icall_directAPI ( uint8_t  service,
icall_lite_id_t  id,
  ... 
)

generic variadic function to translate API id to a functional call in the stack context,

Maximum number of supported parameters is define in the stack build, can be 4, 8 or 12 parameters (uint32_t).

Parameters
serviceservice the API belongs to
idId of the stack API to call.
...: all parameters corresponding to the stack API to call.
Returns
register r0 will be populated with any return value fill by the Stack API.
ICall_Errno ICall_disableInt ( int  intnum)

Disables interrupt.

Parameters
intnuminterrupt number
Returns
ICALL_ERRNO_SUCCESS
ICall_Errno ICall_disableMInt ( void  )

Disables master interrupt and context switching.

Returns
ICALL_ERRNO_SUCCESS
ICall_Errno ICall_enableInt ( int  intnum)

Enables interrupt.

Parameters
intnuminterrupt number
Returns
ICALL_ERRNO_SUCCESS.
ICall_Errno ICall_enableMInt ( void  )

Enables master interrupt and context switching.

Returns
ICALL_ERRNO_SUCCESS
ICall_Errno ICall_enrollService ( ICall_ServiceEnum  service,
ICall_ServiceFunc  fn,
ICall_EntityID entity,
ICall_SyncHandle msgSyncHdl 
)

Registers a service entity.

Parameters
serviceservice id of the enrolling service
fnhandler function which handles function calls to the service.
entitypointer to a variable to store the assigned entity id
msgSyncHdlpointer to a variable to store the synchronous object handle associated with the calling thread.
Returns
ICALL_ERRNO_SUCCESS when successful.
ICALL_ERRNO_INVALID_PARAMETER when service id is already registered by another entity.
ICALL_ERRNO_NO_RESOURCE when maximum number of services are already registered.
ICall_Errno ICall_entityId2ServiceId ( ICall_EntityID  entityId,
ICall_ServiceEnum servId 
)

Transforms and entityId into a serviceId. Note that this function is useful in case an application waits for messages from both a server and another application, in which case, the application can only use ICall_fetchMsg , not ICall_fetchServiceMsg because the latter will return ICALL_ERRNO_CORRUPT_MSG when a message sent by the other application is about to be fetched.
This function, then, is useful to retrieve service id matching the source entity id in case the source entity id is not that of the other application.

Parameters
entityIdentity id
servIdpointer to a variable to store the resultant service id
Returns
ICALL_ERRNO_SUCCESS if the transformation was successful.
ICALL_ERRNO_INVALID_SERVICE if no matching service is found for the entity id.
ICall_Errno ICall_fetchMsg ( ICall_EntityID src,
ICall_EntityID dest,
void **  msg 
)

Retrieves a message, queued to receive queue of the calling thread.

Parameters
srcpointer to a variable to store the sender entity id of the received message.
destpointer to a variable to store the destination entity id of the received message.
msgpointer to a pointer variable to store the starting address of a received message body.
Returns
ICALL_ERRNO_SUCCESS when a message was successfully retrieved.
ICALL_ERRNO_NOMSG when no message was queued to the receive queue at the moment.
ICALL_ERRNO_UNKNOWN_THREAD when the calling thread does not have a received queue associated with it. This happens when neither ICall_enrollService nor ICall_registerApp was ever called from the calling thread.
ICall_Errno ICall_fetchServiceMsg ( ICall_ServiceEnum src,
ICall_EntityID dest,
void **  msg 
)

Retrieves a message received at the message queue associated with the calling thread.

Note that this function should be used by an application which does not expect any message from non-server entity.

Parameters
srcpointer to a variable to store the service id of the registered server which sent the retrieved message
destpointer to a variable to store the entity id of the destination of the message.
msgpointer to a pointer variable to store the starting address of the message body being retrieved.
Returns
ICALL_ERRNO_SUCCESS when the operation was successful and a message was retrieved.
ICALL_ERRNO_NOMSG when there is no queued message at the moment.
ICALL_ERRNO_CORRUPT_MSG when a message queued in front of the thread's receive queue was not sent by a server. Note that in this case, the message is not retrieved but thrown away.
ICALL_ERRNO_UNKNOWN_THREAD when this function is called from a thread which has not registered an entity, either through ICall_enrollService or through ICall_registerApp .
void ICall_free ( void *  msg)

Frees an allocated memory block.

Parameters
msgpointer to a memory block to free.
void ICall_freeMsg ( void *  msg)

Frees the memory block allocated for a message.

Parameters
msgpointer to the start of the message body which was returned from ICall_allocMsg .
ICall_EntityID ICall_getEntityId ( void  )

Retrieves an entity ID of (arbitrary) one of the entities registered from the calling thread.

Note that, if multiple entities were registered from the same thread, this function shall arbitrarily pick one of the entities.

Returns
A valid entity ID or ICALL_INVALID_ENTITY_ID when no entity was registered from the calling thread.
uint_fast8_t ICall_getLocalMsgEntityId ( ICall_ServiceEnum  service,
ICall_EntityID  entity 
)

Retrieves an internal ID understood only by a service entity, corresponding to an ICall entity ID.

This function is used when a message body includes a field indicating a software entity and the destination of the message has its own internal message routing mechanism with its own entity enumeration system.

Parameters
serviceService enumeration value for the service. Currently ICALL_SERVICE_CLASS_BLE_MSG is supported.
entityICall entity ID.
Returns
Stack specific 8 bit ID or 0xFF when failed.
uint_fast32_t ICall_getMaxMSecs ( void  )

Gets the maximum timeout period supported by ICall_setTimerMSecs function.

Returns
maximum timeout period in milliseconds
uint_fast32_t ICall_getTickPeriod ( void  )

Gets the tick period.

Returns
tick period in microseconds.
uint_fast32_t ICall_getTicks ( void  )

Gets the current tick counter value.

Returns
current tick counter value
void ICall_init ( void  )

Initializes the dispatcher implementation.

Note
This shall be only called from an image which included dispatcher implementation.
void* ICall_malloc ( uint_least16_t  size)

Allocates a memory block.

Parameters
sizesize of the block in bytes.
Returns
address of the allocated memory block or NULL if allocation fails.
ICall_Errno ICall_postSemaphore ( ICall_Semaphore  sem)

Post on a semaphore.

Parameters
semsemaphore.
Returns
ICALL_ERRNO_SUCCESS when the operation was successful
ICall_Errno ICall_pwrConfigACAction ( ICall_PwrBitmap_t  bitmap)

Configures power constraint/dependency set/release actions upon activity counter change.

When activity counter value drops to zero, all constraints and dependencies configured by this function shall be released.
When activity counter value increments to one, all constraints and dependencies configured by this function shall be set.

Parameters
bitmapa bitmap of constraint or dependency flags.
The flag definition is specific to each platform. For instance, see ICallCC26xxDefs.h.
Returns
ICALL_ERRNO_SUCCESS when successful
ICALL_ERRNO_INVALID_PARAMETER when an invalid flag in the bitmap is detected.
ICall_Errno ICall_pwrDispense ( ICall_PwrBitmap_t  bitmap)

Releases power constraints and dependencies.

Parameters
bitmapa bitmap of constraint or dependency flags.
The flag definition is specific to each platform. For instance, see ICallCC26xxDefs.h.
Returns
ICALL_ERRNO_SUCCESS when successful
ICALL_ERRNO_INVALID_PARAMETER when an invalid flag in the bitmap is detected.
uint_fast8_t ICall_pwrGetTransitionState ( void  )

Retrieves power transition state.

Returns
Implementation specific transition state when successful
Zero when the function is not implemented.
uint32_t ICall_pwrGetXOSCStartupTime ( uint_fast32_t  timeUntilWakeupInMs)

Gets the estimated crystal oscillator startup time.

Returns
estimated crystal oscillator startup time
bool ICall_pwrIsStableXOSCHF ( void  )

Checks whether HF XOSC is stable. This function must be called after HF XOSC is turned on (through power dependency).

Returns
TRUE when HF XOSC is stable.
FALSE when HF XOSC is not stable.
ICall_Errno ICall_pwrRegisterNotify ( ICall_PwrNotifyFn  fn,
ICall_PwrNotifyData obj 
)

Registers a power state transition notify function.

The registered notify function shall be called when the power state changes.

Parameters
fnnotify function pointer
objpointer to data object to be passed to notify function.
This pointer must not be NULL and can point to an aggregate type containing the ICall_PwrNotifyData. The object must not be released.
Returns
ICALL_ERRNO_SUCCESS when successful
ICALL_ERRNO_NO_RESOURCE when registration failed
ICall_Errno ICall_pwrRequire ( ICall_PwrBitmap_t  bitmap)

Sets power constraints and dependencies.

Parameters
bitmapa bitmap of constraint or dependency flags.
The flag definition is specific to each platform. For instance, see ICallCC26xxDefs.h.
Returns
ICALL_ERRNO_SUCCESS when successful
ICALL_ERRNO_INVALID_PARAMETER when an invalid flag in the bitmap is detected.
ICall_Errno ICall_pwrSwitchXOSCHF ( void  )

Switch clock source to HF XOSC. This function must be called after HF XOSC is stable.

Returns
ICALL_ERRNO_SUCCESS
bool ICall_pwrUpdActivityCounter ( bool  incFlag)

Increments or decrements power activity counter.

When power activity counter is greater than zero, the device shall stay in the active power state. The caller has to make sure that it decrements the counter as many times as it has incremented the counter when there is no activity that requires the active power state. It is recommended that each client increments the counter by just one, but it is not mandated to be so.

Parameters
incFlagTRUE to indicate incrementing the counter.
FALSE to indicate decrementing the counter.
Returns
TRUE if power is required.
FALSE if power is not required.
ICall_Errno ICall_registerApp ( ICall_EntityID entity,
ICall_SyncHandle msgSyncHdl 
)

Registers an application.

Note
This function must be called from the thread from which ICall_wait function will be called.
Parameters
entitypointer to a variable to store entity id assigned to the application.
msgSyncHdlpointer to a variable to store the synchronous object handle associated with the calling thread.
Returns
ICALL_ERRNO_SUCCESS when successful.
ICALL_ERRNO_NO_RESOURCE when ran out of resource.
ICall_Errno ICall_registerISR ( int  intnum,
void(*)(void)  isrfunc 
)

Registers an interrupt service routine.

Parameters
intnuminterrupt number
isrfuncpointer to the interrupt service function
Returns
ICALL_ERRNO_SUCCESS when successful.
ICALL_ERRNO_NO_RESOURCE when the registration failed due to lack of resources.
ICall_EntityID ICall_searchServiceEntity ( ICall_ServiceEnum  service)

Search for a service entity entry.

Parameters
serviceservice id
Returns
entity id of the service
ICALL_INVALID_ENTITY_ID when none found.
ICall_Errno ICall_send ( ICall_EntityID  src,
ICall_EntityID  dest,
ICall_MSGFormat  format,
void *  msg 
)

Sends a message to an entity.

Parameters
srcentity id of the sender
destentity id of the destination of the message.
formatmessage format. See ICall_sendServiceMsg .
msgpointer to the message body.
Returns
ICALL_ERRNO_SUCCESS when successful.
ICALL_ERRNO_INVALID_PARAMETER when either src or dest is not a valid entity id or when dest is an entity id of an entity that does not receive a message (e.g., ICall primitive service entity).
ICall_Errno ICall_sendServiceMsg ( ICall_EntityID  src,
ICall_ServiceEnum  dest,
ICall_MSGFormat  format,
void *  msg 
)

Sends a message to a registered server.

Parameters
srcEntity id of the sender of the message
destService id
formatMessage format: ICALL_MSG_FORMAT_KEEP, ICALL_MSG_FORMAT_1ST_CHAR_TASK_ID or ICALL_MSG_FORMAT_3RD_CHAR_TASK_ID. Message format indicates whether and which field of the message must be transformed into a implementation specific sender identity for an external image.
When a service message interface is defined, it may contain a field that is not understood by the client but only understood by the system on the server's side. The format provides an information to the messaging system on such a server so that it can generically tag necessary information to the message.
msgpointer to the message body to send.
Note that if message is successfully sent, the caller should not reference the message any longer.
However, if the function fails, the caller still owns the reference to the message. That is, caller may attempt another send, or may free the memory block, etc.
Returns
ICALL_ERRNO_SUCCESS when successful
ICALL_ERRNO_INVALID_SERVICE when the 'dest' is unregistered service.
ICALL_ERRNO_INVALID_PARAMETER when the 'src' is an out of range entity id or when 'dest' is is a service that does not receive a message (such as ICall primitive service).
Note that as far as 'src' is within the range, this function won't notice the 'src' entity id as invalid.
ICall_Errno ICall_setTimer ( uint_fast32_t  ticks,
ICall_TimerCback  cback,
void *  arg,
ICall_TimerID id 
)

Set up or restart a timer. Note that the timer setup initially by this function may be restarted using ICall_setTimerMSecs function as well.

Parameters
tickstimeout period in ticks after which the callback function shall be called.
cbackcallback function pointer
argargument to pass to the callback function
idpointer to the timer ID. If a new timer must be set up, the value of the timer ID must be set to ICALL_INVALID_TIMER_ID when making this call and when the function returns successfully, the variable will be assigned a new timer ID value. The value other than ICALL_INVALID_TIMER_ID shall be regarded as a request to restart the earlier set timer.
Returns
ICALL_ERRNO_SUCCESS when successful
ICALL_ERRNO_NO_RESOURCE when ran out of resource. Check ICall heap size and OS heap size if this happens.

ICall_getTickPeriod

ICall_Errno ICall_setTimerMSecs ( uint_fast32_t  msecs,
ICall_TimerCback  cback,
void *  arg,
ICall_TimerID id 
)

Set up or restart a timer. Note that the timer setup initially by this function may be restarted using ICall_setTimer function as well.

Parameters
msecstimeout period in milliseconds after which callback function shall be called.
cbackcallback function pointer
argargument to pass to the callback function
idpointer to the timer ID. If a new timer must be set up, the value of the timer ID must be set to ICALL_INVALID_TIMER_ID when making this call and when the function returns successfully, the variable will be assigned a new timer ID value. The value other than ICALL_INVALID_TIMER_ID shall be regarded as a request to restart the earlier set timer.
Returns
ICALL_ERRNO_SUCCESS when successful
ICALL_ERRNO_INVALID_PARAMETER when msecs is greater than maximum value supported
ICALL_ERRNO_NO_RESOURCE when ran out of resource. Check ICall heap size and OS heap size if this happens.

ICall_getMaxMSecs

ICall_Errno ICall_signal ( ICall_SyncHandle  msgSyncHdl)

Signals a semaphore.

Parameters
msgSyncHdlhandle of a synchronous object to signal
Returns
ICALL_ERRNO_SUCCESS
void ICall_stopTimer ( ICall_TimerID  id)

Stops a timer.

Parameters
idtimer ID.
uint_fast8_t ICall_threadServes ( ICall_ServiceEnum  service)

Checks whether the calling thread provides the designated service.

Parameters
serviceService enumeration value for the service.
Returns
Non-zero if the current thread provides the designated service.
Zero, otherwise.
ICall_Errno ICall_wait ( uint_fast32_t  milliseconds)

Waits for a signal to the semaphore associated with the calling thread.

Note that the semaphore associated with a thread is signaled when a message is queued to the message receive queue of the thread or when ICall_signal function is called onto the semaphore.

Parameters
millisecondstimeout period in milliseconds.
Returns
ICALL_ERRNO_SUCCESS when the semaphore is signaled.
ICALL_ERRNO_TIMEOUT when designated timeout period has passed since the call of the function without the semaphore being signaled.
ICall_Errno ICall_waitMatch ( uint_least32_t  milliseconds,
ICall_MsgMatchFn  matchFn,
ICall_ServiceEnum src,
ICall_EntityID dest,
void **  msg 
)

Waits for and retrieves a message received at the message queue associated with the calling thread, which matches a certain condition.

Parameters
millisecondstimeout period in milliseconds.
matchFnpointer to a function that would return TRUE when the message matches its condition.
srcpointer to a variable to store the service id of the registered server which sent the retrieved message, or NULL if not interested in storing service id.
destpointer to a variable to store the entity id of the destination of the message, of NULL if not interested in storing the destination entity id.
msgpointer to a pointer variable to store the starting address of the message body being retrieved. The pointer must not be NULL.
Returns
ICALL_ERRNO_SUCCESS when the operation was successful and a message was retrieved.
ICALL_ERRNO_TIMEOUT when designated timeout period has passed since the call of the function without the semaphore being signaled.
ICALL_ERRNO_UNKNOWN_THREAD when this function is called from a thread which has not registered an entity, either through ICall_enrollService or through ICall_registerApp .
ICall_Errno ICall_waitSemaphore ( ICall_Semaphore  sem,
uint_fast32_t  milliseconds 
)

Waits on a semaphore.

Parameters
semsemaphore.
millisecondstimeout in milliseconds or ICALL_TIMEOUT_FOREVER to wait forever
Returns
ICALL_ERRNO_SUCCESS when the operation was successful and semaphore was acquired.
ICALL_ERRNO_TIMEOUT when designated timeout period has passed since the call of the function without the semaphore being signaled.
Copyright 2016, Texas Instruments Incorporated