Coder Social home page Coder Social logo

Comments (1)

skliper avatar skliper commented on August 16, 2024

TX and RX PDU sizes can be different. Transmit maximum size is configurable via table using outgoing_file_chunk_size as defined below. Note the actual TX PDU also includes the PDU header which is variable size. The CCSDS header also needs to be accounted for to get to the final size over the SB.

uint16 outgoing_file_chunk_size; /**< maximum size of outgoing file data PDUs - must be
* smaller than file data character array */

CF_MAX_PDU_SIZE is defined in the interface header here, note this includes the PDU headers but not the CCSDS header:

/* CF_MAX_PDU_SIZE must be the max possible PDU for any channel. Channels can be configured with a smaller max. */
#define CF_MAX_PDU_SIZE (512)

The outgoing_file_chunk_size is limited by this structure size:

CF/fsw/src/cf_cfdp_pdu.h

Lines 371 to 381 in 27dcaf5

/**
* @brief PDU file data content
*
* To serve as a sanity check, this should accommodate the largest data block possible.
* In that light, it should be sized based on the minimum encoded header size, rather than
* the maximum, as that case leaves the most space for data.
*/
typedef struct CF_CFDP_PduFileDataContent
{
uint8 data[CF_MAX_PDU_SIZE - sizeof(CF_CFDP_PduFileDataHeader_t) - CF_CFDP_MIN_HEADER_SIZE];
} CF_CFDP_PduFileDataContent_t;

Note the comment below is actually misleading, since CF gets a buffer from SB and writes from the file to it directly:

CF/docs/dox_src/cfs_cf.dox

Lines 460 to 462 in 27dcaf5

For outgoing file transactions, the engine uses a statically allocated buffer for
PDUs. The size of this buffer is defined by platform configuration parameter,
CF_MAX_PDU_SIZE. The engine informs the CF app when it has a PDU

On the receive side the PDU is processed "in place", so it isn't restricted by local CF buffer sizes. There's a misleading comment here:

CF/docs/dox_src/cfs_cf.dox

Lines 455 to 458 in 27dcaf5

For incoming file transactions, CF uses a statically allocated buffer for the
incoming PDU. The size of this buffer is defined by the platform configuration
parameter, CF_MAX_PDU_SIZE. The incoming PDU's are copied from the Software Bus
into this buffer and then passed to the engine.

Note that there is a structure defined below, but it's only used for size checking of outgoing_file_chunk_size and not directly:

CF/fsw/src/cf_cfdp_pdu.h

Lines 371 to 381 in 27dcaf5

/**
* @brief PDU file data content
*
* To serve as a sanity check, this should accommodate the largest data block possible.
* In that light, it should be sized based on the minimum encoded header size, rather than
* the maximum, as that case leaves the most space for data.
*/
typedef struct CF_CFDP_PduFileDataContent
{
uint8 data[CF_MAX_PDU_SIZE - sizeof(CF_CFDP_PduFileDataHeader_t) - CF_CFDP_MIN_HEADER_SIZE];
} CF_CFDP_PduFileDataContent_t;

This comment is also wrong, since outgoing_file_chunk_size is common across channels:

* the PDU headers and everything. While this is the max value for all
* channels, the outgoing_file_chunk_size in the configuration table
* is different for each channel so a smaller size can be used.

Also no longer applicable:

CF/fsw/src/cf_cfdp_types.h

Lines 413 to 415 in 27dcaf5

/* NOTE: the use of CF_CFDP_PduHeader_t below is correct, but the CF_PduRecvMsg_t and CF_PduSendMsg_t
* structures are both longer than these definitions. They are always backed by a buffer
* of size CF_MAX_PDU_SIZE */

from cf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.