Skip to content

Commit eea6aca

Browse files
m-aleemMishaal Aleembocchino
authored
Switch the type of the Task priority to FwTaskPriorityType (#3617)
* Change the type of the Task priority to FwTaskPriorityType * Fix missed UT arg update --------- Co-authored-by: Mishaal Aleem <aleem@fprime-fsw-0.jpl.nasa.gov> Co-authored-by: Rob Bocchino <bocchino@jpl.nasa.gov>
1 parent 836a044 commit eea6aca

14 files changed

Lines changed: 27 additions & 26 deletions

File tree

Drv/Ip/SocketComponentHelper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ SocketComponentHelper::SocketComponentHelper() {}
2222
SocketComponentHelper::~SocketComponentHelper() {}
2323

2424
void SocketComponentHelper::start(const Fw::StringBase &name,
25-
const Os::Task::ParamType priority,
25+
const FwTaskPriorityType priority,
2626
const Os::Task::ParamType stack,
2727
const Os::Task::ParamType cpuAffinity) {
2828
FW_ASSERT(m_task.getState() == Os::Task::State::NOT_STARTED); // It is a coding error to start this task multiple times

Drv/Ip/SocketComponentHelper.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,18 @@ class SocketComponentHelper {
4646
/**
4747
* \brief start the socket read task to start producing data
4848
*
49-
* Starts up the socket reading task and when reopen was configured, will open up the socket.
50-
*
49+
* Starts up the socket reading task and when reopen was configured, will open up the socket.
50+
*
5151
* \note: users must now use `setAutomaticOpen` to configure the socket to automatically open connections. The
5252
* default behavior is to automatically open connections.
5353
*
5454
* \param name: name of the task
55-
* \param priority: priority of the started task. See: Os::Task::start. Default: TASK_DEFAULT, not prioritized
55+
* \param priority: priority of the started task. See: Os::Task::start. Default: TASK_PRIORITY_DEFAULT, not prioritized
5656
* \param stack: stack size provided to the task. See: Os::Task::start. Default: TASK_DEFAULT, posix threads default
5757
* \param cpuAffinity: cpu affinity provided to task. See: Os::Task::start. Default: TASK_DEFAULT, don't care
5858
*/
5959
void start(const Fw::StringBase &name,
60-
const Os::Task::ParamType priority = Os::Task::TASK_DEFAULT,
60+
const FwTaskPriorityType priority = Os::Task::TASK_PRIORITY_DEFAULT,
6161
const Os::Task::ParamType stack = Os::Task::TASK_DEFAULT,
6262
const Os::Task::ParamType cpuAffinity = Os::Task::TASK_DEFAULT);
6363

@@ -88,8 +88,8 @@ class SocketComponentHelper {
8888
* \brief set socket to automatically open connections when true, or not when false
8989
*
9090
* When passed `true`, this instructs the socket to automatically open a socket and reopen socket failed connections. When passed `false`
91-
* the user must explicitly call the `open` method to open the socket initially and when a socket fails.
92-
*
91+
* the user must explicitly call the `open` method to open the socket initially and when a socket fails.
92+
*
9393
* \param auto_open: true to automatically open and reopen sockets, false otherwise
9494
*/
9595
void setAutomaticOpen(bool auto_open);

Drv/LinuxGpioDriver/LinuxGpioDriver.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class LinuxGpioDriver final : public LinuxGpioDriverComponentBase {
6767

6868
//! \brief start interrupt detection thread
6969
//!
70-
Drv::GpioStatus start(const FwSizeType priority = Os::Task::TASK_DEFAULT,
70+
Drv::GpioStatus start(const FwTaskPriorityType priority = Os::Task::TASK_PRIORITY_DEFAULT,
7171
const FwSizeType stackSize = Os::Task::TASK_DEFAULT,
7272
const FwSizeType cpuAffinity = Os::Task::TASK_DEFAULT,
7373
const PlatformUIntType identifier = static_cast<PlatformUIntType>(Os::Task::TASK_DEFAULT));

Drv/LinuxGpioDriver/LinuxGpioDriverCommon.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace Drv {
2121

2222
LinuxGpioDriver ::LinuxGpioDriver(const char* const compName) : LinuxGpioDriverComponentBase(compName) {}
2323

24-
Drv::GpioStatus LinuxGpioDriver ::start(const FwSizeType priority,
24+
Drv::GpioStatus LinuxGpioDriver ::start(const FwTaskPriorityType priority,
2525
const FwSizeType stackSize,
2626
const FwSizeType cpuAffinity,
2727
const PlatformUIntType identifier) {

Drv/LinuxUartDriver/LinuxUartDriver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ void LinuxUartDriver ::serialReadTaskEntry(void* ptr) {
363363
}
364364
}
365365

366-
void LinuxUartDriver ::start(Os::Task::ParamType priority, Os::Task::ParamType stackSize, Os::Task::ParamType cpuAffinity) {
366+
void LinuxUartDriver ::start(FwTaskPriorityType priority, Os::Task::ParamType stackSize, Os::Task::ParamType cpuAffinity) {
367367
Os::TaskString task("SerReader");
368368
Os::Task::Arguments arguments(task, serialReadTaskEntry, this, priority, stackSize, cpuAffinity);
369369
Os::Task::Status stat = this->m_readTask.start(arguments);

Drv/LinuxUartDriver/LinuxUartDriver.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class LinuxUartDriver final : public LinuxUartDriverComponentBase {
7272
//! start the serial poll thread.
7373
//! buffSize is the max receive buffer size
7474
//!
75-
void start(Os::Task::ParamType priority = Os::Task::TASK_DEFAULT,
75+
void start(FwTaskPriorityType priority = Os::Task::TASK_PRIORITY_DEFAULT,
7676
Os::Task::ParamType stackSize = Os::Task::TASK_DEFAULT,
7777
Os::Task::ParamType cpuAffinity = Os::Task::TASK_DEFAULT);
7878

Drv/TcpClient/test/ut/TcpClientTester.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void TcpClientTester ::setup_helper(Drv::TcpServerSocket& server, Drv::SocketDes
4040
if (recv_thread) {
4141
Os::TaskString name("receiver thread");
4242
this->component.setAutomaticOpen(reconnect);
43-
this->component.start(name, Os::Task::TASK_DEFAULT, Os::Task::TASK_DEFAULT);
43+
this->component.start(name, Os::Task::TASK_PRIORITY_DEFAULT, Os::Task::TASK_DEFAULT);
4444
}
4545
}
4646

Drv/TcpServer/test/ut/TcpServerTester.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void TcpServerTester ::setup_helper(bool recv_thread, bool reconnect) {
3333
if (recv_thread) {
3434
Os::TaskString name("receiver thread");
3535
this->component.setAutomaticOpen(reconnect);
36-
this->component.start(name, Os::Task::TASK_DEFAULT, Os::Task::TASK_DEFAULT);
36+
this->component.start(name, Os::Task::TASK_PRIORITY_DEFAULT, Os::Task::TASK_DEFAULT);
3737
}
3838
// Component should always launch the listening server on configure
3939
// The thread will retry if the configure fails
@@ -179,7 +179,7 @@ void TcpServerTester ::test_advanced_reconnect() {
179179
void TcpServerTester ::test_no_automatic_send_connection() {
180180
Drv::TcpClientSocket client;
181181
Drv::SocketDescriptor client_fd;
182-
182+
183183
// Set up the server without automatic connection
184184
this->setup_helper(false, true);
185185
this->component.setAutomaticOpen(false);

Drv/Udp/test/ut/UdpTester.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void UdpTester::test_with_loop(U32 iterations, bool recv_thread) {
5252
// Start up a receive thread
5353
if (recv_thread) {
5454
Os::TaskString name("receiver thread");
55-
this->component.start(name, true, Os::Task::TASK_DEFAULT, Os::Task::TASK_DEFAULT);
55+
this->component.start(name, true, Os::Task::TASK_PRIORITY_DEFAULT, Os::Task::TASK_DEFAULT);
5656
}
5757

5858
// Loop through a bunch of client disconnects

Fw/Comp/ActiveComponentBase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ namespace Fw {
4343
}
4444
#endif
4545

46-
void ActiveComponentBase::start(Os::Task::ParamType priority, Os::Task::ParamType stackSize, Os::Task::ParamType cpuAffinity, Os::Task::ParamType identifier) {
46+
void ActiveComponentBase::start(FwTaskPriorityType priority, Os::Task::ParamType stackSize, Os::Task::ParamType cpuAffinity, Os::Task::ParamType identifier) {
4747
Os::TaskString taskName;
4848

4949
#if FW_OBJECT_NAMES == 1

0 commit comments

Comments
 (0)