8#define DEBUG_PRINT(x,...)
16 return sizeof(m_buff);
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) {
48 if (snprintf(buffer, size,
"ActComp: %s", this->m_objName) < 0) {
63#if FW_OBJECT_NAMES == 1
64 taskName = this->getObjName();
68 taskName = taskNameChar;
72#if FW_BAREMETAL_SCHEDULER == 1
94 void ActiveComponentBase::s_baseBareTask(
void* ptr) {
107 switch (loopStatus) {
118 void ActiveComponentBase::s_baseTask(
void* ptr) {
122 comp->m_task.setStarted(
true);
135 bool quitLoop =
false;
138 switch (loopStatus) {
PlatformIntType NATIVE_INT_TYPE
uint8_t U8
8-bit unsigned integer
PlatformUIntType NATIVE_UINT_TYPE
#define FW_TASK_NAME_MAX_SIZE
Max size of task name.
C++-compatible configuration header for fprime configuration.
#define DEBUG_PRINT(x,...)
@ ACTIVE_COMPONENT_EXIT
message to exit active component task
Os::Task m_task
task object for active component
ActiveComponentBase(const char *name)
Constructor.
void exit()
exit task in active component
virtual ~ActiveComponentBase()
Destructor.
void start(NATIVE_UINT_TYPE priority=Os::Task::TASK_DEFAULT, NATIVE_UINT_TYPE stackSize=Os::Task::TASK_DEFAULT, NATIVE_UINT_TYPE cpuAffinity=Os::Task::TASK_DEFAULT, NATIVE_UINT_TYPE identifier=Os::Task::TASK_DEFAULT)
called by instantiator when task is to be started
Os::Task::TaskStatus join(void **value_ptr)
provide return value of thread if value_ptr is not NULL
virtual void loop()
The function that will loop dispatching messages.
virtual void finalizer()
A function that will be called after exiting the loop.
virtual void preamble()
A function that will be called before the event loop is entered.
const U8 * getBuffAddr() const
gets buffer address for data reading, const version
NATIVE_UINT_TYPE getBuffCapacity() const
returns capacity, not current size, of buffer
U8 * getBuffAddr()
gets buffer address for data filling
void init()
Object initializer.
virtual MsgDispatchStatus doDispatch()=0
method to dispatch a single message in the queue.
Os::Queue m_queue
queue object for active component
@ MSG_DISPATCH_OK
Dispatch was normal.
@ MSG_DISPATCH_EXIT
A message was sent requesting an exit of the loop.
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
QueueStatus send(const Fw::SerializeBufferBase &buffer, NATIVE_INT_TYPE priority, QueueBlocking block)
send a message
@ QUEUE_NONBLOCKING
Queue receive always returns even if there is no message.
NATIVE_INT_TYPE getNumMsgs() const
get the number of messages in the queue
static const NATIVE_UINT_TYPE TASK_DEFAULT
void(* taskRoutine)(void *ptr)
prototype for task routine started in task context
TaskStatus join(void **value_ptr)
Wait for task to finish.
@ TASK_OK
message sent/received okay
bool isStarted()
check to see if task is started
void setStarted(bool started)
set task to started when thread is fully up. Avoids a VxWorks race condition.
TaskStatus start(const Fw::StringBase &name, taskRoutine routine, void *arg, NATIVE_UINT_TYPE priority=TASK_DEFAULT, NATIVE_UINT_TYPE stackSize=TASK_DEFAULT, NATIVE_UINT_TYPE cpuAffinity=TASK_DEFAULT, NATIVE_UINT_TYPE identifier=TASK_DEFAULT)
start the task
static NATIVE_INT_TYPE getNumTasks()
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.