Trident IoT Z-Wave SDK
 
Loading...
Searching...
No Matches
Z-Wave User Task API
+ Collaboration diagram for Z-Wave User Task API:

Data Structures

struct  ZW_UserTask_Buffer_t
 A buffer structure to allocate the needed memory for a task in user space. More...
 
struct  ZW_UserTask_t
 

Enumerations

enum  ZW_UserTask_Priority_t {
  USERTASK_PRIORITY_BACKGROUND = 0 ,
  USERTASK_PRIORITY_NORMAL ,
  USERTASK_PRIORITY_HIGHEST
}
 
enum  ReturnCode_t {
  Code_Success = 0 ,
  Code_Fail_Unknown ,
  Code_Fail_NoMemory ,
  Code_Fail_LimitReached ,
  Code_Fail_NotFound ,
  Code_Fail_Suspended ,
  Code_Fail_InvalidState ,
  Code_Fail_InvalidOperation ,
  Code_Fail_InvalidParameter ,
  Code_DependencyUnavailable ,
  Code_Fail_Busy ,
  Code_Fail_Timeout ,
  Code_Fail_Driver ,
  Code_Fail_NotImplemented ,
  Code_Fail_NotAllowed
}
 

Functions

ReturnCode_t ZW_UserTask_Init (void)
 Initializes this module.
 
ReturnCode_t ZW_UserTask_CreateTask (ZW_UserTask_t *task, TaskHandle_t *xHandle)
 Used to create user application level tasks.
 
bool ZW_UserTask_ApplicationRegisterTask (void(*appTaskFunc)(SApplicationHandles *), uint8_t iZwRxQueueTaskNotificationBitNumber, uint8_t iZwCommandStatusQueueTaskNotificationBitNumber, const SProtocolConfig_t *pProtocolConfig)
 Used to create the main application task at highest UserTask priority.
 

Detailed Description

Enumeration Type Documentation

◆ ReturnCode_t

Return code used by the functions in this module.

Enumerator
Code_Success 

Success.

Code_Fail_Unknown 

Default failed code with no helping indication.

Code_Fail_NoMemory 

Failed due to lack of memory.

Code_Fail_LimitReached 

A set limit is reached for this operation.

Code_Fail_NotFound 

A specific entity could not be found.

Code_Fail_Suspended 

The operation or the entire module is globally suspended and cannot be utilized at this point in time.

Code_Fail_InvalidState 

Not in an appropriate state for this call.

Code_Fail_InvalidOperation 

This operation can not be allowed at this point.

Code_Fail_InvalidParameter 

Wrong/invalid input parameters.

Code_DependencyUnavailable 

A required resource or dependency that this operation relies on was not setup or available. Perhaps wrong initialization order.

Code_Fail_Busy 

A resource needed by this operation or call is busy. Try again later. Potential racing condition or untimely action.

Code_Fail_Timeout 

Failed due to timeout.

Code_Fail_Driver 

Error occurred at the driver level.

Code_Fail_NotImplemented 

This operation is not supported due to limited implementation or need.

Code_Fail_NotAllowed 

This operation cannot be performed, since it is blocked or not allowed.

◆ ZW_UserTask_Priority_t

Enumerator
USERTASK_PRIORITY_BACKGROUND 

Right above idle priority. Good for HMI and worker threads.

USERTASK_PRIORITY_NORMAL 

The default 'APP'-task priority.

USERTASK_PRIORITY_HIGHEST 

High priority UserTask. Good for handling interrupts requests.

Function Documentation

◆ ZW_UserTask_ApplicationRegisterTask()

bool ZW_UserTask_ApplicationRegisterTask ( void(*)(SApplicationHandles *) appTaskFunc,
uint8_t iZwRxQueueTaskNotificationBitNumber,
uint8_t iZwCommandStatusQueueTaskNotificationBitNumber,
const SProtocolConfig_t * pProtocolConfig )

Used to create the main application task at highest UserTask priority.

This function further registers Queue Notification Bit Numbers so that an association is created between the bit number and the event handle to invoke for that event, when it occurs.

This function should only be called once, or false is returned

Attention
This task is the only UserTask that should use the ZAF API functions. Accessing the ZAF API functions from any other ZW_UserTask.h generated tasks will lead to undefined behavior
Parameters
appTaskFuncApplication task that will be triggered by FreeRTOS. (function pointer)
iZwRxQueueTaskNotificationBitNumberThe bit number set by Protocol when a message has been put on the ZW Rx queue. (Receiving EAPPLICATIONEVENT_ZWRX events)
iZwCommandStatusQueueTaskNotificationBitNumberThe bit number Set by Protocol when a message has been put on the ZW command status queue. (Receiving EAPPLICATIONEVENT_ZWCOMMANDSTATUS events)
pProtocolConfigPointer to a statically allocated Protocol Config structure.
See also
SProtocolConfig_t
Returns
true if the main APP task was created successfully, false if not.

◆ ZW_UserTask_CreateTask()

ReturnCode_t ZW_UserTask_CreateTask ( ZW_UserTask_t * task,
TaskHandle_t * xHandle )

Used to create user application level tasks.

Parameters
[in]taskThe task definition as input.
See also
See ZW_UserTask_t for more info.
Parameters
[out]xHandleUsed to return the task handle. Can be NULL Return Returns ReturnCode_t. See ReturnCode_t for more info.

◆ ZW_UserTask_Init()

ReturnCode_t ZW_UserTask_Init ( void )

Initializes this module.

Attention
Should not be used directly.

Return Returns ReturnCode_t.

See also
See ReturnCode_t for more info.