src/luos.c
error_return_t Luos_ReadMsg(service_t *service, msg_t **returned_msg)
{
    error_return_t error = SUCCEED;
    while (error == SUCCEED)
    {
        error = MsgAlloc_PullMsg(service->ll_service, returned_msg);
        // check if the content of this message need to be managed by Luos and do it if it is.
        if (error == SUCCEED)
        {
            if (Luos_MsgHandler(service, *returned_msg) == FAILED)
            {
                // This message is for the user, pass it to the user.
                return SUCCEED;
            }
        }
        MsgAlloc_ClearMsgFromLuosTasks(*returned_msg);
    }
    return FAILED;
}
/******************************************************************************
 * @brief read last msg from buffer for a service
 * @param service who receive the message we are looking for
 * @param returned_msg oldest message of the service
 * @return FAILED if no message available
 ******************************************************************************/
@brief read last msg from buffer for a service
@param service who receive the message we are looking for
@param returned_msg oldest message of the service
@return FAILED if no message available
@brief read last msg from buffer for a service @param service who receive the message we are looking for @param returned_msg oldest message of the service @return FAILED if no message available
error_return_t Luos_ReadMsg(service_t *service, msg_t **returned_msg)
{
    error_return_t error = SUCCEED;
    while (error == SUCCEED)
    {
        error = MsgAlloc_PullMsg(service->ll_service, returned_msg);
        if (error == SUCCEED)
        {
            if (Luos_MsgHandler(service, *returned_msg) == FAILED)
            {
                return SUCCEED;
            }
        }
        MsgAlloc_ClearMsgFromLuosTasks(*returned_msg);
    }
    return FAILED;
}
error_return_t Luos_ReadMsg ( service_t * service , msg_t * * returned_msg ) { error_return_t error = SUCCEED ; while ( error == SUCCEED ) { error = MsgAlloc_PullMsg ( service -> ll_service , returned_msg ) ; if ( error == SUCCEED ) { if ( Luos_MsgHandler ( service , * returned_msg ) == FAILED ) { return SUCCEED ; } } MsgAlloc_ClearMsgFromLuosTasks ( * returned_msg ) ; } return FAILED ; }
@brief read last msg from buffer for a service
 @param service who receive the message we are looking for
 @param returned_msg oldest message of the service
 @return FAILED if no message available
@brief read last msg from buffer for a service @param service who receive the message we are looking for @param returned_msg oldest message of the service @return FAILED if no message available
// check if the content of this message need to be managed by Luos and do it if it is. // This message is for the user, pass it to the user.