F´ Flight Software - C/C++ Documentation
NASA-v1.5.0
A framework for building embedded system applications to NASA flight quality standards.
|
Go to the documentation of this file.
8 #define DEBUG_PRINT(x,...)
16 return sizeof(m_buff);
33 ActiveComponentBase::ActiveComponentBase(
const char* name) : QueuedComponentBase(name) {
38 DEBUG_PRINT(
"ActiveComponent %s destructor.\n",this->getObjName());
45 #if FW_OBJECT_TO_STRING == 1 && FW_OBJECT_NAMES == 1
46 void ActiveComponentBase::toString(
char* buffer,
NATIVE_INT_TYPE size) {
47 (void)snprintf(buffer, size,
"ActComp: %s", this->m_objName);
56 #if FW_OBJECT_NAMES == 1
57 taskName = this->getObjName();
61 taskName = taskNameChar;
65 #if FW_BAREMETAL_SCHEDULER == 1
110 void ActiveComponentBase::s_baseTask(
void* ptr) {
127 bool quitLoop =
false;
130 switch (loopStatus) {
void setStarted(bool started)
set task to started when thread is fully up. Avoids a VxWorks race condition.
static void s_baseBareTask(void *)
function provided to task class for new thread.
Os::Task m_task
task object for active component
Os::Task::TaskStatus join(void **value_ptr)
provide return value of thread if value_ptr is not NULL
virtual MsgDispatchStatus doDispatch(void)=0
method to dispatch a single message in the queue.
SerializeStatus
forward declaration for string
static NATIVE_INT_TYPE getNumTasks(void)
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
uint8_t U8
8-bit unsigned integer
Os::Queue m_queue
queue object for active component
virtual void preamble(void)
A function that will be called before the event loop is entered.
void start(NATIVE_INT_TYPE identifier, NATIVE_INT_TYPE priority, NATIVE_INT_TYPE stackSize, NATIVE_INT_TYPE cpuAffinity=-1)
called by instantiator when task is to be started
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.
QueueStatus send(const Fw::SerializeBufferBase &buffer, NATIVE_INT_TYPE priority, QueueBlocking block)
send a message
void init(void)
Object initializer.
@ MSG_DISPATCH_OK
Dispatch was normal.
@ TASK_OK
message sent/received okay
@ ACTIVE_COMPONENT_EXIT
message to exit active component task
#define DEBUG_PRINT(x,...)
unsigned int NATIVE_UINT_TYPE
native unsigned integer type declaration
const U8 * getBuffAddr(void) const
gets buffer address for data reading, const version
bool isStarted(void)
check to see if task is started
virtual void finalizer(void)
A function that will be called after exiting the loop.
NATIVE_INT_TYPE getNumMsgs(void) const
get the number of messages in the queue
NATIVE_UINT_TYPE getBuffCapacity(void) const
returns capacity, not current size, of buffer
virtual ~ActiveComponentBase()
Destructor.
TaskStatus start(const Fw::StringBase &name, NATIVE_INT_TYPE identifier, NATIVE_INT_TYPE priority, NATIVE_INT_TYPE stackSize, taskRoutine routine, void *arg, NATIVE_INT_TYPE cpuAffinity=-1)
start the task
@ MSG_DISPATCH_EXIT
A message was sent requesting an exit of the loop.
U8 * getBuffAddr(void)
gets buffer address for data filling
#define FW_TASK_NAME_MAX_SIZE
Max size of task name.
@ QUEUE_NONBLOCKING
Queue receive always returns even if there is no message.
void exit(void)
exit task in active component
int NATIVE_INT_TYPE
native integer type declaration
TaskStatus join(void **value_ptr)
Wait for task to finish.
virtual void loop(void)
The function that will loop dispatching messages.