Skip to content

Commit 78b109e

Browse files
kevin-f-ortegaLeStarch
authored andcommitted
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
1 parent b787d0a commit 78b109e

File tree

9 files changed

+32
-25
lines changed

9 files changed

+32
-25
lines changed

Os/Condition.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class ConditionVariableInterface {
2424
ERROR_MUTEX_NOT_HELD, //!< When trying to wait but we don't hold the mutex
2525
ERROR_DIFFERENT_MUTEX, //!< When trying to use a different mutex than expected mutex
2626
ERROR_NOT_IMPLEMENTED, //!< When trying to use a feature that isn't implemented
27+
NOT_SUPPORTED, //!< ConditionVariable does not support operation
2728
ERROR_OTHER //!< All other errors
2829
};
2930

Os/Models/Mutex.fpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module Os {
99
OP_OK, @< Operation was successful
1010
ERROR_BUSY, @< Mutex is busy
1111
ERROR_DEADLOCK, @< Deadlock condition detected
12+
NOT_SUPPORTED, @< Mutex feature is not supported
1213
ERROR_OTHER @< All other errors
1314
}
1415
}

Os/Models/Queue.fpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ module Os {
1414
SEND_ERROR, @< message send error
1515
RECEIVE_ERROR, @< message receive error
1616
INVALID_PRIORITY, @< invalid priority requested
17-
FULL, @< queue was full when attempting to send a message
17+
FULL, @< Queue was full when attempting to send a message
18+
NOT_SUPPORTED, @< Queue feature is not supported
1819
UNKNOWN_ERROR @< Unexpected error; can't match with returns
1920
}
2021

Os/Models/RawTime.fpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ module Os {
77

88
@ FPP shadow-enum representing Os::RawTime::Status
99
enum RawTimeStatus {
10-
OP_OK, @< Operation was successful
10+
OP_OK, @< Operation was successful
1111
OP_OVERFLOW, @< Operation result caused an overflow
1212
INVALID_PARAMS, @< Parameters invalid for current platform
13+
NOT_SUPPORTED, @< RawTime feature is not supported
1314
OTHER_ERROR, @< All other errors
1415
}
1516

Os/Models/Task.fpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ enum TaskStatus {
1616
JOIN_ERROR, @< error trying to join the task
1717
ERROR_RESOURCES, @< unable to allocate more tasks
1818
ERROR_PERMISSION, @< permissions error setting-up tasks
19+
NOT_SUPPORTED, @< Task feature is not supported
1920
INVALID_STATE, @< Task is in an invalid state for the operation
2021
}
2122
}

Os/Mutex.hpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ struct MutexHandle {};
1414

1515
class MutexInterface {
1616
public:
17-
enum Status {
18-
OP_OK, //!< Operation was successful
19-
ERROR_BUSY, //!< Mutex is busy
20-
ERROR_DEADLOCK, //!< Deadlock condition detected
21-
ERROR_OTHER //!< All other errors
17+
enum Status {
18+
OP_OK, //!< Operation was successful
19+
ERROR_BUSY, //!< Mutex is busy
20+
ERROR_DEADLOCK, //!< Deadlock condition detected
21+
NOT_SUPPORTED, //!< Mutex does not support operation
22+
ERROR_OTHER //!< All other errors
2223
};
2324

2425
//! \brief default constructor
@@ -97,7 +98,7 @@ class ScopeLock {
9798
ScopeLock& operator=(const ScopeLock& other) = delete;
9899

99100
private:
100-
Mutex& m_mutex; //!< Stores the mutex reference
101+
Mutex& m_mutex; //!< Stores the mutex reference
101102
};
102103
} // namespace Os
103104

Os/Queue.hpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
#include <FpConfig.hpp>
99
#include <Fw/Obj/ObjBase.hpp>
1010
#include <Fw/Types/Serializable.hpp>
11+
#include <Os/Mutex.hpp>
1112
#include <Os/Os.hpp>
1213
#include <Os/QueueString.hpp>
13-
#include <Os/Mutex.hpp>
1414
namespace Os {
1515
// Forward declaration for registry
1616
class QueueRegistry;
@@ -36,7 +36,8 @@ class QueueInterface {
3636
SEND_ERROR, //!< message send error
3737
RECEIVE_ERROR, //!< message receive error
3838
INVALID_PRIORITY, //!< invalid priority requested
39-
FULL, //!< queue was full when attempting to send a message
39+
FULL, //!< Queue was full when attempting to send a message
40+
NOT_SUPPORTED, //!< Queue feature is not supported
4041
UNKNOWN_ERROR //!< Unexpected error; can't match with returns
4142
};
4243

@@ -277,11 +278,11 @@ class Queue final : public QueueInterface {
277278
static Os::Mutex& getStaticMutex();
278279

279280
private:
280-
QueueString m_name; //!< queue name
281-
FwSizeType m_depth; //!< Queue depth
282-
FwSizeType m_size; //!< Maximum message size
283-
static Os::Mutex s_countLock; //!< Lock the count
284-
static FwSizeType s_queueCount; //!< Count of the number of queues
281+
QueueString m_name; //!< queue name
282+
FwSizeType m_depth; //!< Queue depth
283+
FwSizeType m_size; //!< Maximum message size
284+
static Os::Mutex s_countLock; //!< Lock the count
285+
static FwSizeType s_queueCount; //!< Count of the number of queues
285286

286287
#if FW_QUEUE_REGISTRATION
287288
public:

Os/RawTime.hpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,27 @@
66
#define OS_RAWTIME_HPP_
77

88
#include <FpConfig.hpp>
9-
#include <Fw/Types/Serializable.hpp>
109
#include <Fw/Time/TimeInterval.hpp>
10+
#include <Fw/Types/Serializable.hpp>
1111
#include <Os/Os.hpp>
1212

13-
1413
namespace Os {
1514

1615
struct RawTimeHandle {};
1716

18-
class RawTime; // Forward declaration
17+
class RawTime; // Forward declaration
1918

2019
class RawTimeInterface : public Fw::Serializable {
21-
2220
public:
23-
2421
// Serialization size for RawTime objects, configured in config/FpConfig.h
2522
static const FwSizeType SERIALIZED_SIZE = FW_RAW_TIME_SERIALIZATION_MAX_SIZE;
2623

2724
enum Status {
28-
OP_OK, //!< Operation was successful
29-
OP_OVERFLOW, //!< Operation result caused an overflow
30-
INVALID_PARAMS, //!< Parameters invalid for current platform
31-
OTHER_ERROR //!< All other errors
25+
OP_OK, //!< Operation was successful
26+
OP_OVERFLOW, //!< Operation result caused an overflow
27+
INVALID_PARAMS, //!< Parameters invalid for current platform
28+
NOT_SUPPORTED, //!< RawTime does not support operation
29+
OTHER_ERROR //!< All other errors
3230
};
3331

3432
//! \brief default constructor
@@ -42,7 +40,8 @@ class RawTimeInterface : public Fw::Serializable {
4240
virtual RawTimeHandle* getHandle() = 0;
4341

4442
//! \brief provide a pointer to a RawTime delegate object
45-
static RawTimeInterface* getDelegate(RawTimeHandleStorage& aligned_new_memory, const RawTimeInterface* to_copy=nullptr);
43+
static RawTimeInterface* getDelegate(RawTimeHandleStorage& aligned_new_memory,
44+
const RawTimeInterface* to_copy = nullptr);
4645

4746
// ------------------------------------------------------------------
4847
// RawTime operations to be implemented by an OSAL implementation

Os/Task.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ namespace Os {
3737
JOIN_ERROR, //!< error trying to join the task
3838
ERROR_RESOURCES, //!< unable to allocate more tasks
3939
ERROR_PERMISSION, //!< permissions error setting-up tasks
40+
NOT_SUPPORTED, //!< Task feature is not supported
4041
INVALID_STATE, //!< Task is in an invalid state for the operation
4142
};
4243

0 commit comments

Comments
 (0)