weAut_01 / weAutSys    R 2.2.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines
Data Fields
thr_data_t Struct Reference

Data Fields

union {
   struct cliThr_data_t   cliThrData
 Commandline interpreter structure variant.
   struct modThr_data_t   modThrData
 Modbus handler variant.
   char   stateA [EXTRA_THR_ST_SZ]
 Byte / char array (castable)
}; 
 The thread's respectively thread functions state data.
uint8_t flag
 A flag byte for the threads specific usage.
p2ptFun fun
 The thread's function (pointer to)
pt_t pt
 The (raw) protothread data structure.
uint8_t retC
 The return code of the last schedule.

Detailed Description

State data for a thread (universal variable type)

It is strongly recommended that threads with states larger than fitting in mThr_data_t should use this structure (extending mThr_data_t) for their state. The thread function's (the behaviour) recommended signature takes (only) a pointer to such structure as parameter.

Software using this schema is supported by some handling functions and macros provided.

Note:
The first four elements (pt, flag, retC, fun) are exactly the structure mThr_data_t.
Examples:
main.c.

Field Documentation

The (raw) protothread data structure.

This is the same as .pt in mThr_data_t.

Examples:
main.c.
uint8_t flag

A flag byte for the threads specific usage.

This is the same as .flag in mThr_data_t.

Examples:
main.c.
uint8_t retC

The return code of the last schedule.

This is the same as retC in mThr_data_t.

The thread's function (pointer to)

This is the same as .fun in mThr_data_t. For compatibility with the bequeather even the type is the same, even though in this larger structure the function pointer put here must be of type p2ptFunC.

union { ... }

The thread's respectively thread functions state data.

It is strongly recommended to use no other external or static data for whatever else thread state data but to keep it here in this union. The char [] variant may be cast to any application defined structure of fitting length.


The documentation for this struct was generated from the following file: