Skip to content

Commit

Permalink
Rename SMSignalBuffer to SmSignalBuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
watney committed Sep 3, 2024
1 parent 0448d15 commit 41cd2e5
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 34 deletions.
2 changes: 1 addition & 1 deletion FppTest/state_machine/DeviceSm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void FppTest::DeviceSm::init(const FwEnumStoreType stateMachineId)
void FppTest::DeviceSm::update(
const FwEnumStoreType stateMachineId,
const DeviceSm_Interface::DeviceSm_Signals signal,
const Fw::SMSignalBuffer &data
const Fw::SmSignalBuffer &data
)
{
switch (this->state) {
Expand Down
8 changes: 4 additions & 4 deletions FppTest/state_machine/DeviceSm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#ifndef DEVICESM_H_
#define DEVICESM_H_

#include <Fw/Sm/SMSignalBuffer.hpp>
#include <Fw/Sm/SmSignalBuffer.hpp>
#include <config/FpConfig.hpp>

namespace FppTest {
Expand All @@ -27,7 +27,7 @@ class DeviceSm_Interface {
virtual bool DeviceSm_g2(
const FwEnumStoreType stateMachineId,
const DeviceSm_Interface::DeviceSm_Signals signal,
const Fw::SMSignalBuffer &data) = 0;
const Fw::SmSignalBuffer &data) = 0;


virtual void DeviceSm_turnOff(const FwEnumStoreType stateMachineId) = 0;
Expand All @@ -36,7 +36,7 @@ class DeviceSm_Interface {
virtual void DeviceSm_a1(
const FwEnumStoreType stateMachineId,
const DeviceSm_Interface::DeviceSm_Signals signal,
const Fw::SMSignalBuffer &data) = 0;
const Fw::SmSignalBuffer &data) = 0;


virtual void DeviceSm_turnOn(const FwEnumStoreType stateMachineId) = 0;
Expand Down Expand Up @@ -67,7 +67,7 @@ class DeviceSm {
void update(
const FwEnumStoreType stateMachineId,
const DeviceSm_Interface::DeviceSm_Signals signal,
const Fw::SMSignalBuffer &data
const Fw::SmSignalBuffer &data
);
};

Expand Down
2 changes: 1 addition & 1 deletion FppTest/state_machine/HackSm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void FppTest::HackSm::init(const FwEnumStoreType stateMachineId)
void FppTest::HackSm::update(
const FwEnumStoreType stateMachineId,
const HackSm_Interface::HackSm_Signals signal,
const Fw::SMSignalBuffer &data
const Fw::SmSignalBuffer &data
)
{
switch (this->state) {
Expand Down
4 changes: 2 additions & 2 deletions FppTest/state_machine/HackSm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#ifndef HACKSM_H_
#define HACKSM_H_

#include <Fw/Sm/SMSignalBuffer.hpp>
#include <Fw/Sm/SmSignalBuffer.hpp>
#include <config/FpConfig.hpp>

namespace FppTest {
Expand Down Expand Up @@ -54,7 +54,7 @@ class HackSm {
void update(
const FwEnumStoreType stateMachineId,
const HackSm_Interface::HackSm_Signals signal,
const Fw::SMSignalBuffer &data
const Fw::SmSignalBuffer &data
);
};

Expand Down
8 changes: 4 additions & 4 deletions FppTest/state_machine/SmTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ SmTest ::~SmTest() {}
// ----------------------------------------------------------------------

void SmTest::schedIn_handler(const NATIVE_INT_TYPE portNum, U32 context) {
Fw::SMSignalBuffer data;
Fw::SmSignalBuffer data;

device1_stateMachineInvoke(DeviceSm_Interface::DeviceSm_Signals::RTI_SIG, data);
device2_stateMachineInvoke(DeviceSm_Interface::DeviceSm_Signals::RTI_SIG, data);
Expand All @@ -42,7 +42,7 @@ void SmTest::schedIn_handler(const NATIVE_INT_TYPE portNum, U32 context) {
//! Overflow hook for state machine device4
void SmTest::device4_stateMachineOverflowHook(
const HackSm_Interface::HackSm_Signals signal, //!< The state machine signal
const Fw::SMSignalBuffer& data //!< The state machine data
const Fw::SmSignalBuffer& data //!< The state machine data
) {

}
Expand All @@ -58,7 +58,7 @@ void SmTest::DeviceSm_turnOff(const FwEnumStoreType stateMachineId) {
void SmTest::DeviceSm_a1(
const FwEnumStoreType stateMachineId,
const DeviceSm_Signals signal,
const Fw::SMSignalBuffer& data
const Fw::SmSignalBuffer& data
) {
printf("Action 1, stateMachineId = %d, signal = %d\n", stateMachineId, signal);
}
Expand All @@ -71,7 +71,7 @@ void SmTest::DeviceSm_a1(
bool SmTest::DeviceSm_g2(
const FwEnumStoreType stateMachineId,
const DeviceSm_Signals signal,
const Fw::SMSignalBuffer& data
const Fw::SmSignalBuffer& data
) {
return true;
}
Expand Down
6 changes: 3 additions & 3 deletions FppTest/state_machine/SmTest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class SmTest :
//! Overflow hook for state machine device4
void device4_stateMachineOverflowHook(
const HackSm_Interface::HackSm_Signals signal, //!< The state machine signal
const Fw::SMSignalBuffer& data //!< The state machine data
const Fw::SmSignalBuffer& data //!< The state machine data
);

// State machine functions
Expand All @@ -81,7 +81,7 @@ class SmTest :
void DeviceSm_a1(
const FwEnumStoreType stateMachineId,
const DeviceSm_Signals signal,
const Fw::SMSignalBuffer& data
const Fw::SmSignalBuffer& data
);

void DeviceSm_a2(const FwEnumStoreType stateMachineId);
Expand All @@ -91,7 +91,7 @@ class SmTest :
bool DeviceSm_g2(
const FwEnumStoreType stateMachineId,
const DeviceSm_Signals signal,
const Fw::SMSignalBuffer& data
const Fw::SmSignalBuffer& data
);

void HackSm_turnOn(const FwEnumStoreType stateMachineId);
Expand Down
2 changes: 1 addition & 1 deletion FppTest/state_machine/test/ut/Tester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void Tester::schedIn_OK() {
ASSERT_EQ(DeviceSm::OFF, this->component.m_stateMachine_device4.state);
ASSERT_EQ(DeviceSm::OFF, this->component.m_stateMachine_device5.state);

Fw::SMSignalBuffer data;
Fw::SmSignalBuffer data;
this->component.device3_stateMachineInvoke(HackSm_Interface::HackSm_Signals::CHECK_SIG, data);
dispatchAll();
ASSERT_EQ(HackSm::DIAG, this->component.m_stateMachine_device3.state);
Expand Down
2 changes: 1 addition & 1 deletion Fw/Sm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
#
####
set(SOURCE_FILES
"${CMAKE_CURRENT_LIST_DIR}/SMSignalBuffer.cpp"
"${CMAKE_CURRENT_LIST_DIR}/SmSignalBuffer.cpp"
)
register_fprime_module()
18 changes: 9 additions & 9 deletions Fw/Sm/SMSignalBuffer.cpp → Fw/Sm/SmSignalBuffer.cpp
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
#include <Fw/Sm/SMSignalBuffer.hpp>
#include <Fw/Sm/SmSignalBuffer.hpp>
#include <Fw/Types/Assert.hpp>

namespace Fw {

SMSignalBuffer::SMSignalBuffer(const U8 *args, NATIVE_UINT_TYPE size) {
SmSignalBuffer::SmSignalBuffer(const U8 *args, NATIVE_UINT_TYPE size) {
SerializeStatus stat = SerializeBufferBase::setBuff(args,size);
FW_ASSERT(FW_SERIALIZE_OK == stat,static_cast<NATIVE_INT_TYPE>(stat));
}

SMSignalBuffer::SMSignalBuffer() {
SmSignalBuffer::SmSignalBuffer() {
}

SMSignalBuffer::~SMSignalBuffer() {
SmSignalBuffer::~SmSignalBuffer() {
}

SMSignalBuffer::SMSignalBuffer(const SMSignalBuffer& other) : Fw::SerializeBufferBase() {
SmSignalBuffer::SmSignalBuffer(const SmSignalBuffer& other) : Fw::SerializeBufferBase() {
SerializeStatus stat = SerializeBufferBase::setBuff(other.m_bufferData,other.getBuffLength());
FW_ASSERT(FW_SERIALIZE_OK == stat,static_cast<NATIVE_INT_TYPE>(stat));
}

SMSignalBuffer& SMSignalBuffer::operator=(const SMSignalBuffer& other) {
SmSignalBuffer& SmSignalBuffer::operator=(const SmSignalBuffer& other) {
if(this == &other) {
return *this;
}
Expand All @@ -29,15 +29,15 @@ namespace Fw {
return *this;
}

NATIVE_UINT_TYPE SMSignalBuffer::getBuffCapacity() const {
NATIVE_UINT_TYPE SmSignalBuffer::getBuffCapacity() const {
return sizeof(this->m_bufferData);
}

const U8* SMSignalBuffer::getBuffAddr() const {
const U8* SmSignalBuffer::getBuffAddr() const {
return this->m_bufferData;
}

U8* SMSignalBuffer::getBuffAddr() {
U8* SmSignalBuffer::getBuffAddr() {
return this->m_bufferData;
}

Expand Down
16 changes: 8 additions & 8 deletions Fw/Sm/SMSignalBuffer.hpp → Fw/Sm/SmSignalBuffer.hpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* SMSignalBuffer.hpp
* SmSignalBuffer.hpp
*
*/

/*
* Description:
* This object contains the SMSignalBuffer type, used for attaching data to state machine signals
* This object contains the SmSignalBuffer type, used for attaching data to state machine signals
*/
#ifndef FW_SM_SIGNAL_BUFFER_HPP
#define FW_SM_SIGNAL_BUFFER_HPP
Expand All @@ -15,19 +15,19 @@

namespace Fw {

class SMSignalBuffer : public SerializeBufferBase {
class SmSignalBuffer : public SerializeBufferBase {
public:

enum {
SERIALIZED_TYPE_ID = 1010,
SERIALIZED_SIZE = FW_COM_BUFFER_MAX_SIZE + sizeof(FwBuffSizeType) // size of buffer + storage of size word
};

SMSignalBuffer(const U8 *args, NATIVE_UINT_TYPE size);
SMSignalBuffer();
SMSignalBuffer(const SMSignalBuffer& other);
virtual ~SMSignalBuffer();
SMSignalBuffer& operator=(const SMSignalBuffer& other);
SmSignalBuffer(const U8 *args, NATIVE_UINT_TYPE size);
SmSignalBuffer();
SmSignalBuffer(const SmSignalBuffer& other);
virtual ~SmSignalBuffer();
SmSignalBuffer& operator=(const SmSignalBuffer& other);

NATIVE_UINT_TYPE getBuffCapacity() const; // !< returns capacity, not current size, of buffer
U8* getBuffAddr();
Expand Down

0 comments on commit 41cd2e5

Please sign in to comment.