put

The put method adds a message to the end of the message queue.

Signature
RiCOSResult RiCOSMessageQueue_put(
   RiCOSMessageQueue *const me, gen_ptr message,
   RiCBoolean fromISR);
Parameters
me

The RiCOSMessageQueue to which to add the message

message

The message to be added to the queue

fromISR

A Boolean value that determines whether the message being added was generated from an interrupt service routine (ISR)

Returns

The RiCOSResult object, as defined in the RiCOS*.h files

Example
RiCOSResult RiCOSMessageQueue_put(
   RiCOSMessageQueue * const me, gen_ptr message,
   RiCBoolean fromISR)
{
   static gen_ptr NULL_VAL = NULL;
   int timeout = WAIT_FOREVER;
   int priority = MSG_PRI_NORMAL;

   if (message == NULL) message = NULL_VAL;

   if (fromISR) {
      timeout = NO_WAIT;
      priority = MSG_PRI_URGENT;
   }
   return (msgQSend(me->hVxMQ, (char*)&message,
      sizeof(message), timeout, priority) == OK);
}

Feedback