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

Update BufferAccumulator to FPv3 #1944

Merged
merged 23 commits into from
Apr 27, 2023

Conversation

kubiak-jpl
Copy link
Contributor

Originating Project/Creator @kubiak-jpl
Affected Component BufferAccumulator
Affected Architectures(s) N/A
Related Issue(s) N/A
Has Unit Tests (y/n) y
Builds Without Errors (y/n) y
Unit Tests Pass (y/n) y
Documentation Included (y/n) n

Change Description

  1. Update BufferAccumulator to FPv3
  2. Add the BA_DrainBuffers command to drain a fixed number of buffers from the internal FIFO

Rationale

Allows existing BufferAccumulator code to be using in FP deployments

Testing/Review Recommendations

Future Work

Additional documentation work is necessary

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.

return status;
}

bool BufferAccumulator::ArrayFIFOBuffer ::dequeue(Fw::Buffer& e) {

Check notice

Code scanning / CodeQL

Long function without assertion

All functions of more than 10 lines should have at least one assertion.
// Handler implementations for user-defined typed input ports
// ----------------------------------------------------------------------

void BufferAccumulator ::bufferSendInFill_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.
// Command handler implementations
// ----------------------------------------------------------------------

void BufferAccumulator ::BA_SetMode_cmdHandler(const FwOpcodeType opCode,

Check notice

Code scanning / CodeQL

Long function without assertion

All functions of more than 10 lines should have at least one assertion.
Comment on lines +26 to +27
BufferAccumulator ::
BufferAccumulator(const char* const compName)

Check notice

Code scanning / CodeQL

Long function without assertion

All functions of more than 10 lines should have at least one assertion.
// Private helper methods
// ----------------------------------------------------------------------

void BufferAccumulator ::sendStoredBuffer() {

Check notice

Code scanning / CodeQL

Long function without assertion

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

bufferQueue.init(this->bufferMemory, actualBuffers);
}
void BufferAccumulator ::allocateQueue(

Check notice

Code scanning / CodeQL

Long function without assertion

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

}
BufferAccumulator::ArrayFIFOBuffer ::~ArrayFIFOBuffer() {}

Check notice

Code scanning / CodeQL

More than one statement per line

This line contains 2 statements; only one is allowed.
{
BufferAccumulatorComponentBase::init(queueDepth, instance);
}
BufferAccumulator ::~BufferAccumulator() {}

Check notice

Code scanning / CodeQL

More than one statement per line

This line contains 2 statements; only one is allowed.
// ----------------------------------------------------------------------
// Public functions
// ----------------------------------------------------------------------
bool BufferAccumulator::ArrayFIFOBuffer ::enqueue(const Fw::Buffer& e) {

Check notice

Code scanning / CodeQL

Long function without assertion

All functions of more than 10 lines should have at least one assertion.
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
}

void BufferAccumulator ::BA_DrainBuffers_cmdHandler(

Check notice

Code scanning / CodeQL

Long function without assertion

All functions of more than 10 lines should have at least one assertion.
@kubiak-jpl
Copy link
Contributor Author

@timcanham I update the comments in the fpp file.

@timcanham @LeStarch Do the CodeQL warnings need to be addressed? I'm not convinced they point to anything worth addressing

@LeStarch
Copy link
Collaborator

@timcanham is this ready to go?

Fixed spelling error
@LeStarch LeStarch merged commit b13a99f into nasa:devel Apr 27, 2023
Boehm-Michael pushed a commit to Boehm-Michael/fprime that referenced this pull request Jun 22, 2023
* Adding updated BufferAccumulator files to public repo

* Ported BufferAccumulator to FPv3

* Cleanup notes and todos

* Cleanup old build system files

* Updated format of code after a clang-format pass

* Style changes in BufferAccumulator

* Replace NULL with nullptr in BufferAccumulator

* Removed unnecessary cast and void arguments

* Construct initial version of the Fw::Buffer objects to prevent UBSAN error

* Fixing incorrect variable in asser message

* Removing superfluous parenthesis on the placement new

* Adding header for placement new

* Adding explicit operator to appease CPPlint

* Added DRAINBUFFERS and NOBLOCK

* Fixed Tester.cpp void arguments

* Remove void

* Remove void

* remove void

* Remove void

* string header fix

* Update comments in BufferAccumulator fdd

* Update BufferAccumulator.fpp

Fixed spelling error

---------

Co-authored-by: M Starch <LeStarch@googlemail.com>
Co-authored-by: Timothy Canham <timothy.canham@jpl.nasa.gov>
thomas-bc pushed a commit that referenced this pull request Aug 4, 2023
* Adding updated BufferAccumulator files to public repo

* Ported BufferAccumulator to FPv3

* Cleanup notes and todos

* Cleanup old build system files

* Updated format of code after a clang-format pass

* Style changes in BufferAccumulator

* Replace NULL with nullptr in BufferAccumulator

* Removed unnecessary cast and void arguments

* Construct initial version of the Fw::Buffer objects to prevent UBSAN error

* Fixing incorrect variable in asser message

* Removing superfluous parenthesis on the placement new

* Adding header for placement new

* Adding explicit operator to appease CPPlint

* Added DRAINBUFFERS and NOBLOCK

* Fixed Tester.cpp void arguments

* Remove void

* Remove void

* remove void

* Remove void

* string header fix

* Update comments in BufferAccumulator fdd

* Update BufferAccumulator.fpp

Fixed spelling error

---------

Co-authored-by: M Starch <LeStarch@googlemail.com>
Co-authored-by: Timothy Canham <timothy.canham@jpl.nasa.gov>
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.

4 participants