Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding telemetry and event automatic processing for GenericHub #2078

Merged
merged 2 commits into from
Jun 12, 2023

Conversation

LeStarch
Copy link
Collaborator

Originating Project/Creator
Affected Component
Affected Architectures(s)
Related Issue(s)
Has Unit Tests (y/n)
Builds Without Errors (y/n)
Unit Tests Pass (y/n)
Documentation Included (y/n)

Change Description

GenericHub's difficult in deployment comes from primarily from the specific wrangling of standard types across the hub. This PR adds in dedicated telemetry and event processing such that the hub can be used with FPP pattern specifiers when connecting components to it.

@LeStarch LeStarch requested review from timcanham and thomas-bc June 10, 2023 03:09

}

void GenericHubComponentImpl ::TlmRecv_handler(const NATIVE_INT_TYPE portNum,

Check notice

Code scanning / CodeQL

Use of basic integral type

portNum uses the basic integral type int rather than a typedef with size and signedness.
}
}

void GenericHubComponentImpl ::LogRecv_handler(const NATIVE_INT_TYPE portNum,

Check notice

Code scanning / CodeQL

Use of basic integral type

portNum uses the basic integral type int rather than a typedef with size and signedness.
@@ -62,8 +61,7 @@
bufferDeallocate_out(0, fwBuffer);
}

void GenericHubComponentImpl ::dataIn_handler(const NATIVE_INT_TYPE portNum,
Fw::Buffer& fwBuffer) {
void GenericHubComponentImpl ::dataIn_handler(const NATIVE_INT_TYPE portNum, Fw::Buffer& fwBuffer) {

Check notice

Code scanning / CodeQL

Use of basic integral type

portNum uses the basic integral type int rather than a typedef with size and signedness.
}
}

void GenericHubComponentImpl ::LogRecv_handler(const NATIVE_INT_TYPE portNum,

Check notice

Code scanning / CodeQL

Long function without assertion

All functions of more than 10 lines should have at least one assertion.

}

void GenericHubComponentImpl ::TlmRecv_handler(const NATIVE_INT_TYPE portNum,

Check notice

Code scanning / CodeQL

Long function without assertion

All functions of more than 10 lines should have at least one assertion.
@@ -62,8 +61,7 @@
bufferDeallocate_out(0, fwBuffer);
}

void GenericHubComponentImpl ::dataIn_handler(const NATIVE_INT_TYPE portNum,
Fw::Buffer& fwBuffer) {
void GenericHubComponentImpl ::dataIn_handler(const NATIVE_INT_TYPE portNum, Fw::Buffer& fwBuffer) {

Check notice

Code scanning / CodeQL

Long function without assertion

All functions of more than 10 lines should have at least one assertion.
@@ -62,8 +61,7 @@
bufferDeallocate_out(0, fwBuffer);
}

void GenericHubComponentImpl ::dataIn_handler(const NATIVE_INT_TYPE portNum,
Fw::Buffer& fwBuffer) {
void GenericHubComponentImpl ::dataIn_handler(const NATIVE_INT_TYPE portNum, Fw::Buffer& fwBuffer) {

Check notice

Code scanning / CodeQL

Function too long

dataIn_handler has too many lines (80, while 60 are allowed).
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeQL found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.

Svc/GenericHub/GenericHub.fpp Outdated Show resolved Hide resolved
Svc/GenericHub/GenericHubComponentImpl.cpp Show resolved Hide resolved
Svc/GenericHub/GenericHubComponentImpl.cpp Outdated Show resolved Hide resolved
Svc/GenericHub/GenericHubComponentImpl.cpp Outdated Show resolved Hide resolved
Svc/GenericHub/GenericHubComponentImpl.cpp Outdated Show resolved Hide resolved
U8 buffer[sizeof(FwEventIdType) + Fw::Time::SERIALIZED_SIZE + Fw::LogSeverity::SERIALIZED_SIZE + FW_LOG_BUFFER_MAX_SIZE];
Fw::ExternalSerializeBuffer serializer(buffer, sizeof(buffer));
serializer.resetSer();
FW_ASSERT(serializer.serialize(id) == Fw::SerializeStatus::FW_SERIALIZE_OK);;

Check notice

Code scanning / CodeQL

More than one statement per line

This line contains 2 statements; only one is allowed.
FW_ASSERT(serializer.serialize(timeTag) == Fw::SerializeStatus::FW_SERIALIZE_OK);
FW_ASSERT(serializer.serialize(val) == Fw::SerializeStatus::FW_SERIALIZE_OK);
U32 size = serializer.getBuffLength();
this->send_data(HubType::HUB_TYPE_CHANNEL, portNum, buffer, size);

Check warning

Code scanning / CodeQL

Unchecked function argument

This use of parameter portNum has not been checked.
FW_ASSERT(serializer.serialize(severity) == Fw::SerializeStatus::FW_SERIALIZE_OK);
FW_ASSERT(serializer.serialize(args) == Fw::SerializeStatus::FW_SERIALIZE_OK);
U32 size = serializer.getBuffLength();
this->send_data(HubType::HUB_TYPE_EVENT, portNum, buffer, size);

Check warning

Code scanning / CodeQL

Unchecked function argument

This use of parameter portNum has not been checked.
@thomas-bc thomas-bc merged commit f0e039b into nasa:devel Jun 12, 2023
Boehm-Michael pushed a commit to Boehm-Michael/fprime that referenced this pull request Jun 22, 2023
…2078)

* Adding telemetry and event automatic processing for GenericHub

* Fixes as suggested by review
thomas-bc pushed a commit that referenced this pull request Aug 4, 2023
* Adding telemetry and event automatic processing for GenericHub

* Fixes as suggested by review
thomas-bc added a commit that referenced this pull request Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants