mirror of
https://github.com/nasa/fprime.git
synced 2025-12-11 04:35:25 -06:00
Add NOT_SUPPORTED to OS' statues (#3281)
* adding not-supported status because sometimes it's useful to report not supported * updating shadow enums to match actual enum
This commit is contained in:
parent
d25775f7b2
commit
a7f9bc7460
@ -24,6 +24,7 @@ class ConditionVariableInterface {
|
|||||||
ERROR_MUTEX_NOT_HELD, //!< When trying to wait but we don't hold the mutex
|
ERROR_MUTEX_NOT_HELD, //!< When trying to wait but we don't hold the mutex
|
||||||
ERROR_DIFFERENT_MUTEX, //!< When trying to use a different mutex than expected mutex
|
ERROR_DIFFERENT_MUTEX, //!< When trying to use a different mutex than expected mutex
|
||||||
ERROR_NOT_IMPLEMENTED, //!< When trying to use a feature that isn't implemented
|
ERROR_NOT_IMPLEMENTED, //!< When trying to use a feature that isn't implemented
|
||||||
|
NOT_SUPPORTED, //!< ConditionVariable does not support operation
|
||||||
ERROR_OTHER //!< All other errors
|
ERROR_OTHER //!< All other errors
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -9,6 +9,7 @@ module Os {
|
|||||||
OP_OK, @< Operation was successful
|
OP_OK, @< Operation was successful
|
||||||
ERROR_BUSY, @< Mutex is busy
|
ERROR_BUSY, @< Mutex is busy
|
||||||
ERROR_DEADLOCK, @< Deadlock condition detected
|
ERROR_DEADLOCK, @< Deadlock condition detected
|
||||||
|
NOT_SUPPORTED, @< Mutex feature is not supported
|
||||||
ERROR_OTHER @< All other errors
|
ERROR_OTHER @< All other errors
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,7 +14,8 @@ module Os {
|
|||||||
SEND_ERROR, @< message send error
|
SEND_ERROR, @< message send error
|
||||||
RECEIVE_ERROR, @< message receive error
|
RECEIVE_ERROR, @< message receive error
|
||||||
INVALID_PRIORITY, @< invalid priority requested
|
INVALID_PRIORITY, @< invalid priority requested
|
||||||
FULL, @< queue was full when attempting to send a message
|
FULL, @< Queue was full when attempting to send a message
|
||||||
|
NOT_SUPPORTED, @< Queue feature is not supported
|
||||||
UNKNOWN_ERROR @< Unexpected error; can't match with returns
|
UNKNOWN_ERROR @< Unexpected error; can't match with returns
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -7,9 +7,10 @@ module Os {
|
|||||||
|
|
||||||
@ FPP shadow-enum representing Os::RawTime::Status
|
@ FPP shadow-enum representing Os::RawTime::Status
|
||||||
enum RawTimeStatus {
|
enum RawTimeStatus {
|
||||||
OP_OK, @< Operation was successful
|
OP_OK, @< Operation was successful
|
||||||
OP_OVERFLOW, @< Operation result caused an overflow
|
OP_OVERFLOW, @< Operation result caused an overflow
|
||||||
INVALID_PARAMS, @< Parameters invalid for current platform
|
INVALID_PARAMS, @< Parameters invalid for current platform
|
||||||
|
NOT_SUPPORTED, @< RawTime feature is not supported
|
||||||
OTHER_ERROR, @< All other errors
|
OTHER_ERROR, @< All other errors
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -16,6 +16,7 @@ enum TaskStatus {
|
|||||||
JOIN_ERROR, @< error trying to join the task
|
JOIN_ERROR, @< error trying to join the task
|
||||||
ERROR_RESOURCES, @< unable to allocate more tasks
|
ERROR_RESOURCES, @< unable to allocate more tasks
|
||||||
ERROR_PERMISSION, @< permissions error setting-up tasks
|
ERROR_PERMISSION, @< permissions error setting-up tasks
|
||||||
|
NOT_SUPPORTED, @< Task feature is not supported
|
||||||
INVALID_STATE, @< Task is in an invalid state for the operation
|
INVALID_STATE, @< Task is in an invalid state for the operation
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
13
Os/Mutex.hpp
13
Os/Mutex.hpp
@ -14,11 +14,12 @@ struct MutexHandle {};
|
|||||||
|
|
||||||
class MutexInterface {
|
class MutexInterface {
|
||||||
public:
|
public:
|
||||||
enum Status {
|
enum Status {
|
||||||
OP_OK, //!< Operation was successful
|
OP_OK, //!< Operation was successful
|
||||||
ERROR_BUSY, //!< Mutex is busy
|
ERROR_BUSY, //!< Mutex is busy
|
||||||
ERROR_DEADLOCK, //!< Deadlock condition detected
|
ERROR_DEADLOCK, //!< Deadlock condition detected
|
||||||
ERROR_OTHER //!< All other errors
|
NOT_SUPPORTED, //!< Mutex does not support operation
|
||||||
|
ERROR_OTHER //!< All other errors
|
||||||
};
|
};
|
||||||
|
|
||||||
//! \brief default constructor
|
//! \brief default constructor
|
||||||
@ -97,7 +98,7 @@ class ScopeLock {
|
|||||||
ScopeLock& operator=(const ScopeLock& other) = delete;
|
ScopeLock& operator=(const ScopeLock& other) = delete;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Mutex& m_mutex; //!< Stores the mutex reference
|
Mutex& m_mutex; //!< Stores the mutex reference
|
||||||
};
|
};
|
||||||
} // namespace Os
|
} // namespace Os
|
||||||
|
|
||||||
|
|||||||
15
Os/Queue.hpp
15
Os/Queue.hpp
@ -8,9 +8,9 @@
|
|||||||
#include <FpConfig.hpp>
|
#include <FpConfig.hpp>
|
||||||
#include <Fw/Obj/ObjBase.hpp>
|
#include <Fw/Obj/ObjBase.hpp>
|
||||||
#include <Fw/Types/Serializable.hpp>
|
#include <Fw/Types/Serializable.hpp>
|
||||||
|
#include <Os/Mutex.hpp>
|
||||||
#include <Os/Os.hpp>
|
#include <Os/Os.hpp>
|
||||||
#include <Os/QueueString.hpp>
|
#include <Os/QueueString.hpp>
|
||||||
#include <Os/Mutex.hpp>
|
|
||||||
namespace Os {
|
namespace Os {
|
||||||
// Forward declaration for registry
|
// Forward declaration for registry
|
||||||
class QueueRegistry;
|
class QueueRegistry;
|
||||||
@ -36,7 +36,8 @@ class QueueInterface {
|
|||||||
SEND_ERROR, //!< message send error
|
SEND_ERROR, //!< message send error
|
||||||
RECEIVE_ERROR, //!< message receive error
|
RECEIVE_ERROR, //!< message receive error
|
||||||
INVALID_PRIORITY, //!< invalid priority requested
|
INVALID_PRIORITY, //!< invalid priority requested
|
||||||
FULL, //!< queue was full when attempting to send a message
|
FULL, //!< Queue was full when attempting to send a message
|
||||||
|
NOT_SUPPORTED, //!< Queue feature is not supported
|
||||||
UNKNOWN_ERROR //!< Unexpected error; can't match with returns
|
UNKNOWN_ERROR //!< Unexpected error; can't match with returns
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -277,11 +278,11 @@ class Queue final : public QueueInterface {
|
|||||||
static Os::Mutex& getStaticMutex();
|
static Os::Mutex& getStaticMutex();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QueueString m_name; //!< queue name
|
QueueString m_name; //!< queue name
|
||||||
FwSizeType m_depth; //!< Queue depth
|
FwSizeType m_depth; //!< Queue depth
|
||||||
FwSizeType m_size; //!< Maximum message size
|
FwSizeType m_size; //!< Maximum message size
|
||||||
static Os::Mutex s_countLock; //!< Lock the count
|
static Os::Mutex s_countLock; //!< Lock the count
|
||||||
static FwSizeType s_queueCount; //!< Count of the number of queues
|
static FwSizeType s_queueCount; //!< Count of the number of queues
|
||||||
|
|
||||||
#if FW_QUEUE_REGISTRATION
|
#if FW_QUEUE_REGISTRATION
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -6,29 +6,27 @@
|
|||||||
#define OS_RAWTIME_HPP_
|
#define OS_RAWTIME_HPP_
|
||||||
|
|
||||||
#include <FpConfig.hpp>
|
#include <FpConfig.hpp>
|
||||||
#include <Fw/Types/Serializable.hpp>
|
|
||||||
#include <Fw/Time/TimeInterval.hpp>
|
#include <Fw/Time/TimeInterval.hpp>
|
||||||
|
#include <Fw/Types/Serializable.hpp>
|
||||||
#include <Os/Os.hpp>
|
#include <Os/Os.hpp>
|
||||||
|
|
||||||
|
|
||||||
namespace Os {
|
namespace Os {
|
||||||
|
|
||||||
struct RawTimeHandle {};
|
struct RawTimeHandle {};
|
||||||
|
|
||||||
class RawTime; // Forward declaration
|
class RawTime; // Forward declaration
|
||||||
|
|
||||||
class RawTimeInterface : public Fw::Serializable {
|
class RawTimeInterface : public Fw::Serializable {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Serialization size for RawTime objects, configured in config/FpConfig.h
|
// Serialization size for RawTime objects, configured in config/FpConfig.h
|
||||||
static const FwSizeType SERIALIZED_SIZE = FW_RAW_TIME_SERIALIZATION_MAX_SIZE;
|
static const FwSizeType SERIALIZED_SIZE = FW_RAW_TIME_SERIALIZATION_MAX_SIZE;
|
||||||
|
|
||||||
enum Status {
|
enum Status {
|
||||||
OP_OK, //!< Operation was successful
|
OP_OK, //!< Operation was successful
|
||||||
OP_OVERFLOW, //!< Operation result caused an overflow
|
OP_OVERFLOW, //!< Operation result caused an overflow
|
||||||
INVALID_PARAMS, //!< Parameters invalid for current platform
|
INVALID_PARAMS, //!< Parameters invalid for current platform
|
||||||
OTHER_ERROR //!< All other errors
|
NOT_SUPPORTED, //!< RawTime does not support operation
|
||||||
|
OTHER_ERROR //!< All other errors
|
||||||
};
|
};
|
||||||
|
|
||||||
//! \brief default constructor
|
//! \brief default constructor
|
||||||
@ -42,7 +40,8 @@ class RawTimeInterface : public Fw::Serializable {
|
|||||||
virtual RawTimeHandle* getHandle() = 0;
|
virtual RawTimeHandle* getHandle() = 0;
|
||||||
|
|
||||||
//! \brief provide a pointer to a RawTime delegate object
|
//! \brief provide a pointer to a RawTime delegate object
|
||||||
static RawTimeInterface* getDelegate(RawTimeHandleStorage& aligned_new_memory, const RawTimeInterface* to_copy=nullptr);
|
static RawTimeInterface* getDelegate(RawTimeHandleStorage& aligned_new_memory,
|
||||||
|
const RawTimeInterface* to_copy = nullptr);
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
// RawTime operations to be implemented by an OSAL implementation
|
// RawTime operations to be implemented by an OSAL implementation
|
||||||
|
|||||||
@ -37,6 +37,7 @@ namespace Os {
|
|||||||
JOIN_ERROR, //!< error trying to join the task
|
JOIN_ERROR, //!< error trying to join the task
|
||||||
ERROR_RESOURCES, //!< unable to allocate more tasks
|
ERROR_RESOURCES, //!< unable to allocate more tasks
|
||||||
ERROR_PERMISSION, //!< permissions error setting-up tasks
|
ERROR_PERMISSION, //!< permissions error setting-up tasks
|
||||||
|
NOT_SUPPORTED, //!< Task feature is not supported
|
||||||
INVALID_STATE, //!< Task is in an invalid state for the operation
|
INVALID_STATE, //!< Task is in an invalid state for the operation
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user