Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Fw/Comp/PassiveComponentBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ namespace Fw {
}

void PassiveComponentBase ::
setIdBase(const U32 idBase)
setIdBase(const FwIdType idBase)
{
this->m_idBase = idBase;
}

U32 PassiveComponentBase ::
FwIdType PassiveComponentBase ::
getIdBase() const
{
return this->m_idBase;
Expand Down
6 changes: 3 additions & 3 deletions Fw/Comp/PassiveComponentBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ namespace Fw {
public:
//! Set the ID base
void setIdBase(
const U32 //< The new ID base
const FwIdType //< The new ID base
);
//! Get the ID base
//! \return The ID base
U32 getIdBase() const;
FwIdType getIdBase() const;

protected:
PassiveComponentBase(const char* name); //!< Named constructor
Expand All @@ -29,7 +29,7 @@ namespace Fw {
void toString(char* str, FwSizeType size) override; //!< returns string description of component
#endif
private:
U32 m_idBase; //!< ID base for opcodes etc.
FwIdType m_idBase; //!< ID base for opcodes etc.
FwEnumStoreType m_instance; //!< instance of component object


Expand Down
4 changes: 2 additions & 2 deletions Fw/Dp/test/ut/TestMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ TEST(Header, BufferInConstructor) {
// Fill with data
fillWithData(buffer);
// Use the buffer to create a container
const FwDpIdType id = STest::Pick::lowerUpper(0, std::numeric_limits<FwDpIdType>::max());
const FwDpIdType id = static_cast<FwDpIdType>(STest::Pick::lowerUpper(0, static_cast<U32>(std::numeric_limits<FwDpIdType>::max())));
DpContainer container(id, buffer);
// Check the header
checkHeader(id, buffer, container);
Expand Down Expand Up @@ -144,7 +144,7 @@ TEST(Header, BufferSet) {
// Fill with data
fillWithData(buffer);
// Use the buffer to create a container
const FwDpIdType id = STest::Pick::lowerUpper(0, std::numeric_limits<FwDpIdType>::max());
const FwDpIdType id = static_cast<FwDpIdType>(STest::Pick::lowerUpper(0, static_cast<U32>(std::numeric_limits<FwDpIdType>::max())));
DpContainer container;
container.setId(id);
container.setBuffer(buffer);
Expand Down
1 change: 1 addition & 0 deletions Fw/FPrimeBasicTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ extern "C" {
#include <config/FwTaskPriorityTypeAliasAc.h>
#include <config/FwQueuePriorityTypeAliasAc.h>

#include <config/FwIdTypeAliasAc.h>
#include <config/FwChanIdTypeAliasAc.h>
#include <config/FwDpIdTypeAliasAc.h>
#include <config/FwDpPriorityTypeAliasAc.h>
Expand Down
10 changes: 5 additions & 5 deletions Fw/Tlm/test/ut/TlmTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ TEST(FwTlmTest,TlmPacketSerializeSingle) {
Fw::TlmBuffer buffIn;
ASSERT_EQ(Fw::FW_SERIALIZE_OK,buffIn.serialize(static_cast<U32>(12)));
Fw::Time timeIn(TB_WORKSTATION_TIME,10,11);
U32 id = 10;
FwChanIdType id = 10;

ASSERT_EQ(Fw::FW_SERIALIZE_OK,pktIn.resetPktSer());
ASSERT_EQ(Fw::FW_SERIALIZE_OK,pktIn.addValue(id,timeIn,buffIn));
Expand Down Expand Up @@ -58,7 +58,7 @@ TEST(FwTlmTest,TlmPacketSerializeFill) {
Fw::TlmBuffer buffIn;
ASSERT_EQ(Fw::FW_SERIALIZE_OK,buffIn.serialize(static_cast<U32>(entry)));
Fw::Time timeIn(TB_WORKSTATION_TIME,entry+1,entry+2);
U32 id = static_cast<U32>(NUM_ENTRIES-entry);
FwChanIdType id = static_cast<FwChanIdType>(NUM_ENTRIES-entry);

ASSERT_EQ(Fw::FW_SERIALIZE_OK,pktIn.addValue(id,timeIn,buffIn));
}
Expand All @@ -68,7 +68,7 @@ TEST(FwTlmTest,TlmPacketSerializeFill) {
Fw::TlmBuffer buffIn;
ASSERT_EQ(Fw::FW_SERIALIZE_OK,buffIn.serialize(static_cast<U32>(12)));
Fw::Time timeIn(TB_WORKSTATION_TIME,10,11);
U32 id = 10;
FwChanIdType id = 10;

ASSERT_EQ(Fw::FW_SERIALIZE_NO_ROOM_LEFT,pktIn.addValue(id,timeIn,buffIn));
}
Expand All @@ -85,7 +85,7 @@ TEST(FwTlmTest,TlmPacketSerializeFill) {
// Deserialize data
Fw::TlmBuffer buffOut;
Fw::Time timeOut;
U32 id = 0;
FwChanIdType id = 0;
ASSERT_EQ(Fw::FW_SERIALIZE_OK,pktOut.extractValue(id,timeOut,buffOut,sizeof(U32)));
ASSERT_EQ(NUM_ENTRIES-entry,id);
Fw::Time expTime(TB_WORKSTATION_TIME,entry+1,entry+2);
Expand All @@ -99,7 +99,7 @@ TEST(FwTlmTest,TlmPacketSerializeFill) {
{
Fw::TlmBuffer buffOut;
Fw::Time timeOut;
U32 id = 0;
FwChanIdType id = 0;
ASSERT_EQ(Fw::FW_DESERIALIZE_BUFFER_EMPTY,pktOut.extractValue(id,timeOut,buffOut,sizeof(U32)));
}

Expand Down
10 changes: 5 additions & 5 deletions Svc/ActiveLogger/ActiveLogger.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ module Svc {

@ Filter a particular ID
async command SET_ID_FILTER(
ID: U32
ID: FwEventIdType
idFilterEnabled: Enabled @< ID filter state
) \
opcode 2
Expand All @@ -117,31 +117,31 @@ module Svc {

@ Indicate ID is filtered
event ID_FILTER_ENABLED(
ID: U32 @< The ID filtered
ID: FwEventIdType @< The ID filtered
) \
severity activity high \
id 1 \
format "ID {} is filtered."

@ Attempted to add ID to full ID filter ID
event ID_FILTER_LIST_FULL(
ID: U32 @< The ID filtered
ID: FwEventIdType @< The ID filtered
) \
severity warning low \
id 2 \
format "ID filter list is full. Cannot filter {} ."

@ Removed an ID from the filter
event ID_FILTER_REMOVED(
ID: U32 @< The ID removed
ID: FwEventIdType @< The ID removed
) \
severity activity high \
id 3 \
format "ID filter ID {} removed."

@ ID not in filter
event ID_FILTER_NOT_FOUND(
ID: U32 @< The ID removed
ID: FwEventIdType @< The ID removed
) \
severity warning low \
id 4 \
Expand Down
2 changes: 1 addition & 1 deletion Svc/ActiveLogger/ActiveLoggerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ namespace Svc {
void ActiveLoggerImpl::SET_ID_FILTER_cmdHandler(
FwOpcodeType opCode, //!< The opcode
U32 cmdSeq, //!< The command sequence number
U32 ID,
FwEventIdType ID,
Enabled idEnabled //!< ID filter state
) {

Expand Down
2 changes: 1 addition & 1 deletion Svc/ActiveLogger/ActiveLoggerImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace Svc {
void SET_ID_FILTER_cmdHandler(
FwOpcodeType opCode, //!< The opcode
U32 cmdSeq, //!< The command sequence number
U32 ID,
FwEventIdType ID,
ActiveLogger_Enabled idFilterEnabled //!< ID filter state
);

Expand Down
8 changes: 4 additions & 4 deletions Svc/ActiveTextLogger/test/ut/ActiveTextLoggerTester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ namespace Svc {
std::cout << "readLine: " << buf << std::endl;
char textStr[512];
snprintf(textStr, sizeof(textStr),
"EVENT: (%d) (%d:%d,%d) %s: %s",
"EVENT: (%" PRI_FwEventIdType ") (%d:%d,%d) %s: %s",
id,timeTag.getTimeBase(),timeTag.getSeconds(),timeTag.getUSeconds(),severityString,text.toChar());
ASSERT_STREQ(textStr,buf);
(void) Fw::StringUtils::string_copy(oldLine, buf, static_cast<FwSizeType>(sizeof(oldLine)));
Expand Down Expand Up @@ -145,7 +145,7 @@ namespace Svc {
else {
char textStr[512];
snprintf(textStr, sizeof(textStr),
"EVENT: (%d) (%d:%d,%d) %s: %s",
"EVENT: (%" PRI_FwEventIdType ") (%d:%d,%d) %s: %s",
id,timeTag.getTimeBase(),timeTag.getSeconds(),timeTag.getUSeconds(),severityString,text.toChar());
ASSERT_EQ(0,strcmp(textStr,buf));
}
Expand Down Expand Up @@ -207,7 +207,7 @@ namespace Svc {
std::cout << "readLine: " << buf << std::endl;
char textStr[512];
snprintf(textStr, sizeof(textStr),
"EVENT: (%d) (%d:%d,%d) %s: %s",
"EVENT: (%" PRI_FwEventIdType ") (%d:%d,%d) %s: %s",
id,timeTag.getTimeBase(),timeTag.getSeconds(),timeTag.getUSeconds(),severityString,text.toChar());
ASSERT_EQ(0,strcmp(textStr,buf));
(void) Fw::StringUtils::string_copy(oldLine, buf, static_cast<FwSizeType>(sizeof(oldLine)));
Expand Down Expand Up @@ -373,7 +373,7 @@ namespace Svc {
std::cout << "readLine: " << buf << std::endl;
char textStr[512];
snprintf(textStr, sizeof(textStr),
"EVENT: (%d) (%d:%d,%d) %s: %s",
"EVENT: (%" PRI_FwEventIdType ") (%d:%d,%d) %s: %s",
id,timeTag.getTimeBase(), timeTag.getSeconds(), timeTag.getUSeconds(), severityString, text.toChar());
ASSERT_EQ(0, strcmp(textStr, buf));
}
Expand Down
14 changes: 7 additions & 7 deletions Svc/CmdDispatcher/CmdDispatcher.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ module Svc {
# ----------------------------------------------------------------------

event OpCodeRegistered(
Opcode: U32 @< The opcode to register
Opcode: FwOpcodeType @< The opcode to register
$port: I32 @< The registration port
slot: I32 @< The dispatch slot it was placed in
) \
Expand All @@ -103,7 +103,7 @@ module Svc {

@ Op code dispatched event
event OpCodeDispatched(
Opcode: U32 @< The opcode dispatched
Opcode: FwOpcodeType @< The opcode dispatched
$port: I32 @< The port dispatched to
) \
severity command \
Expand All @@ -112,15 +112,15 @@ module Svc {

@ Op code completed event
event OpCodeCompleted(
Opcode: U32 @< The I32 command argument
Opcode: FwOpcodeType @< The I32 command argument
) \
severity command \
id 2 \
format "Opcode 0x{x} completed"

@ Op code completed with error event
event OpCodeError(
Opcode: U32 @< The opcode with the error
Opcode: FwOpcodeType @< The opcode with the error
error: Fw.CmdResponse @< The error value
) \
severity command \
Expand All @@ -137,15 +137,15 @@ module Svc {

@ Received an invalid opcode
event InvalidCommand(
Opcode: U32 @< Invalid opcode
Opcode: FwOpcodeType @< Invalid opcode
) \
severity warning high \
id 5 \
format "Invalid opcode 0x{x} received"

@ Exceeded the number of commands that can be simultaneously executed
event TooManyCommands(
Opcode: U32 @< The opcode that overflowed the list
Opcode: FwOpcodeType @< The opcode that overflowed the list
) \
severity warning high \
id 6 \
Expand Down Expand Up @@ -177,7 +177,7 @@ module Svc {

@ Op code reregistered event
event OpCodeReregistered(
Opcode: U32 @< The opcode reregistered
Opcode: FwOpcodeType @< The opcode reregistered
$port: I32 @< The reregistration port
) \
severity diagnostic \
Expand Down
2 changes: 1 addition & 1 deletion Svc/CmdDispatcher/test/ut/CommandDispatcherImplTester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ namespace Svc {
FwOpcodeType testOpCode = 0x50;
this->clearEvents();
Fw::ComBuffer buff;
ASSERT_EQ(buff.serialize(U32(100)),Fw::FW_SERIALIZE_OK);
ASSERT_EQ(buff.serialize(static_cast<FwOpcodeType>(100)),Fw::FW_SERIALIZE_OK);
ASSERT_EQ(buff.serialize(testOpCode),Fw::FW_SERIALIZE_OK);
ASSERT_EQ(buff.serialize(testCmdArg),Fw::FW_SERIALIZE_OK);

Expand Down
4 changes: 2 additions & 2 deletions Svc/CmdSequencer/CmdSequencerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ namespace Svc {
void CmdSequencerComponentImpl ::
commandError(
const U32 number,
const U32 opCode,
const FwOpcodeType opCode,
const U32 error
)
{
Expand Down Expand Up @@ -483,7 +483,7 @@ namespace Svc {

}

void CmdSequencerComponentImpl::commandComplete(const U32 opcode) {
void CmdSequencerComponentImpl::commandComplete(const FwOpcodeType opcode) {
this->log_ACTIVITY_LO_CS_CommandComplete(
this->m_sequence->getLogFileName(),
this->m_executedCount,
Expand Down
4 changes: 2 additions & 2 deletions Svc/CmdSequencer/CmdSequencerImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ namespace Svc {

//! Record a completed command
void commandComplete(
const U32 opCode //!< The opcode
const FwOpcodeType opCode //!< The opcode
);

//! Record a sequence complete event
Expand All @@ -739,7 +739,7 @@ namespace Svc {
//! Record an error in executing a sequence command
void commandError(
const U32 number, //!< The command number
const U32 opCode, //!< The command opcode
const FwOpcodeType opCode, //!< The command opcode
const U32 error //!< The error code
);

Expand Down
10 changes: 5 additions & 5 deletions Svc/CmdSequencer/Events.fppi
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ event CS_FileCrcFailure(
event CS_CommandComplete(
fileName: string size 60 @< The name of the sequence file
recordNumber: U32 @< The record number of the command
opCode: U32 @< The command opcode
opCode: FwOpcodeType @< The command opcode
) \
severity activity low \
id 8 \
Expand All @@ -92,7 +92,7 @@ event CS_SequenceComplete(
event CS_CommandError(
fileName: string size 60 @< The name of the sequence file
recordNumber: U32 @< The record number
opCode: U32 @< The opcode
opCode: FwOpcodeType @< The opcode
errorStatus: U32 @< The error status
) \
severity warning high \
Expand Down Expand Up @@ -145,7 +145,7 @@ event CS_PortSequenceStarted(

@ A command status came back when no sequence was running
event CS_UnexpectedCompletion(
$opcode: U32 @< The reported opcode
$opcode: FwOpcodeType @< The reported opcode
) \
severity warning high \
id 16 \
Expand Down Expand Up @@ -203,7 +203,7 @@ event CS_CmdStarted(
event CS_JoinWaiting(
filename: string size 60 @< The sequence file
recordNumber: U32 @< The record number
opCode: U32 @< The opcode
opCode: FwOpcodeType @< The opcode
) \
severity activity high \
id 23 \
Expand All @@ -220,4 +220,4 @@ event CS_NoRecords(
) \
severity warning low \
id 25 \
format "Sequence file {} has no records. Ignoring."
format "Sequence file {} has no records. Ignoring."
10 changes: 5 additions & 5 deletions Svc/CmdSequencer/docs/AMPCSSequence.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ Deserialize and return the next record stored in the serial buffer.
The deserialized record contains the following binary data in its
argument field:

Field | Size in Bytes | Value
----------------- | ------------- | -----------
Packet Descriptor | 4 | `Fw::ComPacket::FW_PACKET_COMMAND`
Opcode | 4 | The opcode stored in bytes 0-1 of the serial record, zero-extended to four bytes
Arguments | Variable | Bytes 2-end of the serial record
Field | Size in Bytes | Value
----------------- | -------------------------------- | -----------------
Packet Descriptor | sizeof(FwPacketDescriptorType) | `Fw::ComPacket::FW_PACKET_COMMAND`
Opcode | sizeof(FwOpcodeType) | The opcode stored in bytes 0-1 of the serial record, zero-extended to sizeof(FwOpcodeType) bytes
Arguments | Variable | Bytes 2-end of the serial record

### 2.4 `reset`

Expand Down
Loading
Loading