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:
kevin-f-ortega 2025-02-26 15:42:40 -08:00 committed by GitHub
parent d25775f7b2
commit a7f9bc7460
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 32 additions and 25 deletions

View File

@ -24,6 +24,7 @@ class ConditionVariableInterface {
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_NOT_IMPLEMENTED, //!< When trying to use a feature that isn't implemented
NOT_SUPPORTED, //!< ConditionVariable does not support operation
ERROR_OTHER //!< All other errors
};

View File

@ -9,6 +9,7 @@ module Os {
OP_OK, @< Operation was successful
ERROR_BUSY, @< Mutex is busy
ERROR_DEADLOCK, @< Deadlock condition detected
NOT_SUPPORTED, @< Mutex feature is not supported
ERROR_OTHER @< All other errors
}
}

View File

@ -14,7 +14,8 @@ module Os {
SEND_ERROR, @< message send error
RECEIVE_ERROR, @< message receive error
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
}

View File

@ -7,9 +7,10 @@ module Os {
@ FPP shadow-enum representing Os::RawTime::Status
enum RawTimeStatus {
OP_OK, @< Operation was successful
OP_OK, @< Operation was successful
OP_OVERFLOW, @< Operation result caused an overflow
INVALID_PARAMS, @< Parameters invalid for current platform
NOT_SUPPORTED, @< RawTime feature is not supported
OTHER_ERROR, @< All other errors
}

View File

@ -16,6 +16,7 @@ enum TaskStatus {
JOIN_ERROR, @< error trying to join the task
ERROR_RESOURCES, @< unable to allocate more 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
}
}

View File

@ -14,11 +14,12 @@ struct MutexHandle {};
class MutexInterface {
public:
enum Status {
OP_OK, //!< Operation was successful
ERROR_BUSY, //!< Mutex is busy
ERROR_DEADLOCK, //!< Deadlock condition detected
ERROR_OTHER //!< All other errors
enum Status {
OP_OK, //!< Operation was successful
ERROR_BUSY, //!< Mutex is busy
ERROR_DEADLOCK, //!< Deadlock condition detected
NOT_SUPPORTED, //!< Mutex does not support operation
ERROR_OTHER //!< All other errors
};
//! \brief default constructor
@ -97,7 +98,7 @@ class ScopeLock {
ScopeLock& operator=(const ScopeLock& other) = delete;
private:
Mutex& m_mutex; //!< Stores the mutex reference
Mutex& m_mutex; //!< Stores the mutex reference
};
} // namespace Os

View File

@ -8,9 +8,9 @@
#include <FpConfig.hpp>
#include <Fw/Obj/ObjBase.hpp>
#include <Fw/Types/Serializable.hpp>
#include <Os/Mutex.hpp>
#include <Os/Os.hpp>
#include <Os/QueueString.hpp>
#include <Os/Mutex.hpp>
namespace Os {
// Forward declaration for registry
class QueueRegistry;
@ -36,7 +36,8 @@ class QueueInterface {
SEND_ERROR, //!< message send error
RECEIVE_ERROR, //!< message receive error
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
};
@ -277,11 +278,11 @@ class Queue final : public QueueInterface {
static Os::Mutex& getStaticMutex();
private:
QueueString m_name; //!< queue name
FwSizeType m_depth; //!< Queue depth
FwSizeType m_size; //!< Maximum message size
static Os::Mutex s_countLock; //!< Lock the count
static FwSizeType s_queueCount; //!< Count of the number of queues
QueueString m_name; //!< queue name
FwSizeType m_depth; //!< Queue depth
FwSizeType m_size; //!< Maximum message size
static Os::Mutex s_countLock; //!< Lock the count
static FwSizeType s_queueCount; //!< Count of the number of queues
#if FW_QUEUE_REGISTRATION
public:

View File

@ -6,29 +6,27 @@
#define OS_RAWTIME_HPP_
#include <FpConfig.hpp>
#include <Fw/Types/Serializable.hpp>
#include <Fw/Time/TimeInterval.hpp>
#include <Fw/Types/Serializable.hpp>
#include <Os/Os.hpp>
namespace Os {
struct RawTimeHandle {};
class RawTime; // Forward declaration
class RawTime; // Forward declaration
class RawTimeInterface : public Fw::Serializable {
public:
// Serialization size for RawTime objects, configured in config/FpConfig.h
static const FwSizeType SERIALIZED_SIZE = FW_RAW_TIME_SERIALIZATION_MAX_SIZE;
enum Status {
OP_OK, //!< Operation was successful
OP_OVERFLOW, //!< Operation result caused an overflow
INVALID_PARAMS, //!< Parameters invalid for current platform
OTHER_ERROR //!< All other errors
OP_OK, //!< Operation was successful
OP_OVERFLOW, //!< Operation result caused an overflow
INVALID_PARAMS, //!< Parameters invalid for current platform
NOT_SUPPORTED, //!< RawTime does not support operation
OTHER_ERROR //!< All other errors
};
//! \brief default constructor
@ -42,7 +40,8 @@ class RawTimeInterface : public Fw::Serializable {
virtual RawTimeHandle* getHandle() = 0;
//! \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

View File

@ -37,6 +37,7 @@ namespace Os {
JOIN_ERROR, //!< error trying to join the task
ERROR_RESOURCES, //!< unable to allocate more 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
};