Skip to content

Commit

Permalink
Fix nasa#348, Moves interface definition files to inc
Browse files Browse the repository at this point in the history
  • Loading branch information
chillfig committed Dec 16, 2022
1 parent e1daebe commit b66ac5e
Show file tree
Hide file tree
Showing 11 changed files with 81 additions and 48 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
project(CFS_CF C)

include_directories(fsw/src)
include_directories(fsw/mission_inc)
include_directories(fsw/platform_inc)
include_directories(${CFS_IO_LIB_MISSION_DIR}/fsw/public_inc)

set(APP_SRC_FILES
Expand All @@ -24,6 +21,9 @@ set(APP_SRC_FILES
# Create the app module
add_cfe_app(cf ${APP_SRC_FILES})

# This permits direct access to public headers in the fsw/inc directory
target_include_directories(cf PUBLIC fsw/inc)

# configuration table
add_cfe_tables(cf fsw/tables/cf_def_config.c)

Expand Down
File renamed without changes.
73 changes: 73 additions & 0 deletions fsw/inc/cf_extern_typedefs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/************************************************************************
* NASA Docket No. GSC-18,447-1, and identified as “CFS CFDP (CF)
* Application version 3.0.0”
*
* Copyright (c) 2019 United States Government as represented by the
* Administrator of the National Aeronautics and Space Administration.
* All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
************************************************************************/

/**
* @file
*
* Declarations and prototypes for cf_extern_typedefs module
*/

#ifndef CF_EXTERN_TYPEDEFS_H
#define CF_EXTERN_TYPEDEFS_H

#include "cf_platform_cfg.h"

/**
* @brief Values for CFDP file transfer class
*
* The CFDP specification prescribes two classes/modes of file
* transfer protocol operation - unacknowledged/simple or
* acknowledged/reliable.
*
* Defined per section 7.1 of CCSDS 727.0-B-5
*/
typedef enum
{
CF_CFDP_CLASS_1 = 0, /**< \brief CFDP class 1 - Unreliable transfer */
CF_CFDP_CLASS_2 = 1, /**< \brief CFDP class 2 - Reliable transfer */
} CF_CFDP_Class_t;

/**
* @brief CF queue identifiers
*/
typedef enum
{
CF_QueueIdx_PEND = 0, /**< \brief first one on this list is active */
CF_QueueIdx_TXA = 1,
CF_QueueIdx_TXW = 2,
CF_QueueIdx_RX = 3,
CF_QueueIdx_HIST = 4,
CF_QueueIdx_HIST_FREE = 5,
CF_QueueIdx_FREE = 6,
CF_QueueIdx_NUM = 7,
} CF_QueueIdx_t;

/**
* @brief Cache of source and destination filename
*
* This pairs a source and destination file name together
* to be retained for future reference in the transaction/history
*/
typedef struct CF_TxnFilenames
{
char src_filename[CF_FILENAME_MAX_LEN];
char dst_filename[CF_FILENAME_MAX_LEN];
} CF_TxnFilenames_t;

#endif /* CF_EXTERN_TYPEDEFS_H */
2 changes: 1 addition & 1 deletion fsw/src/cf_msg.h → fsw/inc/cf_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include "cfe.h"
#include "cf_platform_cfg.h"
#include "cf_cfdp.h"
#include "cf_extern_typedefs.h"
#include "cf_tbldefs.h"

#define CF_ALL_CHANNELS (255)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion fsw/src/cf_tbldefs.h → fsw/inc/cf_tbldefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#define CF_TBLDEFS_H

#include "cf_platform_cfg.h"
#include "cf_cfdp_pdu.h"
#include "cf_extern_typedefs.h"

/**
* \brief Configuration entry for directory polling
Expand Down
16 changes: 0 additions & 16 deletions fsw/src/cf_cfdp_pdu.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@

#include "common_types.h"
#include "cf_platform_cfg.h"
#include "cf_platform_cfg.h"

#include <stddef.h>

Expand Down Expand Up @@ -215,21 +214,6 @@ typedef enum
CF_CFDP_FileDirective_INVALID_MAX = 13, /**< \brief Maximum used to limit range */
} CF_CFDP_FileDirective_t;

/**
* @brief Values for CFDP file transfer class
*
* The CFDP specification prescribes two classes/modes of file
* transfer protocol operation - unacknowledged/simple or
* acknowledged/reliable.
*
* Defined per section 7.1 of CCSDS 727.0-B-5
*/
typedef enum
{
CF_CFDP_CLASS_1 = 0, /**< \brief CFDP class 1 - Unreliable transfer */
CF_CFDP_CLASS_2 = 1, /**< \brief CFDP class 2 - Reliable transfer */
} CF_CFDP_Class_t;

/**
* @brief Values for "acknowledgment transfer status"
*
Expand Down
28 changes: 1 addition & 27 deletions fsw/src/cf_cfdp_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "common_types.h"
#include "cf_cfdp_pdu.h"
#include "cf_platform_cfg.h"
#include "cf_msg.h"
#include "cf_clist.h"
#include "cf_chunk.h"
#include "cf_timer.h"
Expand Down Expand Up @@ -113,18 +114,6 @@ typedef enum
CF_RxEofRet_INVALID = 3,
} CF_RxEofRet_t;

/**
* @brief Cache of source and destination filename
*
* This pairs a source and destination file name together
* to be retained for future reference in the transaction/history
*/
typedef struct CF_TxnFilenames
{
char src_filename[CF_FILENAME_MAX_LEN];
char dst_filename[CF_FILENAME_MAX_LEN];
} CF_TxnFilenames_t;

/**
* @brief Direction identifier
*
Expand Down Expand Up @@ -391,21 +380,6 @@ typedef struct CF_Transaction
CF_StateFlags_t flags;
} CF_Transaction_t;

/**
* @brief CF queue identifiers
*/
typedef enum
{
CF_QueueIdx_PEND = 0, /**< \brief first one on this list is active */
CF_QueueIdx_TXA = 1,
CF_QueueIdx_TXW = 2,
CF_QueueIdx_RX = 3,
CF_QueueIdx_HIST = 4,
CF_QueueIdx_HIST_FREE = 5,
CF_QueueIdx_FREE = 6,
CF_QueueIdx_NUM = 7,
} CF_QueueIdx_t;

/**
* @brief Identifies the type of timer tick being processed
*/
Expand Down
2 changes: 2 additions & 0 deletions unit-test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ add_cfe_coverage_stubs(cf_internal

target_link_libraries(coverage-cf_internal-stubs ut_core_api_stubs ut_assert)
target_include_directories(coverage-cf_internal-stubs PUBLIC utilities)
target_include_directories(coverage-cf_internal-stubs PUBLIC ../fsw/inc)
target_include_directories(coverage-cf_internal-stubs PUBLIC ../fsw/src)

# Generate a dedicated "testrunner" executable for each test file
# Accomplish this by cycling through all the app's source files,
Expand Down

0 comments on commit b66ac5e

Please sign in to comment.