Skip to content

Commit

Permalink
Merge pull request #55 from jphickey/fix-54-add-eds
Browse files Browse the repository at this point in the history
Fix #54, Add EDS file for BP
  • Loading branch information
dzbaker authored Jan 16, 2024
2 parents 6b90f35 + c4bd6cd commit 1d68b21
Show file tree
Hide file tree
Showing 4 changed files with 425 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ include_directories(fsw/src)
set(APP_SRC_FILES
fsw/src/bp_app.c
fsw/src/bp_cmd.c
fsw/src/bp_dispatch.c
fsw/src/bp_flow.c
fsw/src/bp_cla_bundle_io.c
fsw/src/bp_storage.c
Expand All @@ -22,6 +21,12 @@ set(APP_SRC_FILES
fsw/custom/bp_tlmcfg.c
)

if (CFE_EDS_ENABLED_BUILD)
list(APPEND APP_SRC_FILES fsw/src/bp_eds_dispatch.c)
else(CFE_EDS_ENABLED_BUILD)
list(APPEND APP_SRC_FILES fsw/src/bp_dispatch.c)
endif(CFE_EDS_ENABLED_BUILD)

set(APP_TABLE_FILES
fsw/tables/bp_flowtable.c
)
Expand Down
323 changes: 323 additions & 0 deletions eds/bp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,323 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2006-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.
This document adheres to the Electronic Data Sheet (EDS) XML schema
as prescribed in CCSDS book 876.0.
Purpose:
This describes all interface objects for the Bundle Protocol (BP)
CFS application
-->
<PackageFile xmlns="http://www.ccsds.org/schema/sois/seds">
<Package name="BP" shortDescription="Bundle Protocol Application">
<DataTypeSet>

<StringDataType length="${BP/FLOW_NAME_SIZE}" name="FlowName" />
<StringDataType length="${BP/STORE_NAME_SIZE}" name="StoreName" />

<ContainerDataType name="CustomTlm">
<EntryList>
<Entry type="BASE_TYPES/uint32" name="NumFreeFlashBlocks" />
<Entry type="BASE_TYPES/uint32" name="NumUsedFlashBlocks" />
<Entry type="BASE_TYPES/uint32" name="NumFailFlashBlocks" />
<Entry type="BASE_TYPES/uint32" name="FlashErrorCount" />
</EntryList>
</ContainerDataType>

<ContainerDataType name="IOStats">
<EntryList>
<Entry type="BASE_TYPES/int8" name="SendHealthy" />
<Entry type="BASE_TYPES/int8" name="ReceiveHealthy" />
<Entry type="BASE_TYPES/uint16" name="SendNotReady" />
<Entry type="BASE_TYPES/uint32" name="BytesSentPerSecond" />
<Entry type="BASE_TYPES/uint32" name="BytesReceivedPerSecond" />
</EntryList>
</ContainerDataType>
<ContainerDataType name="FlowStats">
<EntryList>
<Entry type="FlowName" name="Name" />
<Entry type="BASE_TYPES/int8" name="Enabled" />
<Entry type="BASE_TYPES/int8" name="Active" />
<Entry type="BASE_TYPES/int8" name="Healthy" />
<Entry type="BASE_TYPES/uint16" name="DataInDropped" />
<Entry type="BASE_TYPES/uint16" name="DataOutDropped" />
<Entry type="BASE_TYPES/uint32" name="LibFlags" />
<Entry type="BASE_TYPES/uint32" name="Timeout" />
<Entry type="BASE_TYPES/int32" name="Priority" />
<Entry type="IOStats" name="IOStats" />
</EntryList>
</ContainerDataType>

<ContainerDataType name="FlowNameCmd_Payload">
<EntryList>
<Entry type="FlowName" name="Name" />
</EntryList>
</ContainerDataType>
<ContainerDataType name="FlowNameWithPriorityCmd_Payload">
<EntryList>
<Entry type="FlowName" name="Name" />
<Entry type="BASE_TYPES/uint16" name="Priority" />
</EntryList>
</ContainerDataType>
<ContainerDataType name="FlowNameWithTimeoutCmd_Payload">
<EntryList>
<Entry type="FlowName" name="Name" />
<Entry type="BASE_TYPES/uint32" name="Timeout" />
</EntryList>
</ContainerDataType>

<ContainerDataType name="HkPkt_Payload">
<EntryList>
<Entry type="BASE_TYPES/uint16" name="ValidCmdCnt" />
<Entry type="BASE_TYPES/uint16" name="InvalidCmdCnt" />
<Entry type="BASE_TYPES/uint32" name="EnableMask" />
<Entry type="BASE_TYPES/uint32" name="MemInUse" />
<Entry type="BASE_TYPES/uint32" name="MemHighWater" />
<Entry type="CustomTlm" name="CustomTlm" />
</EntryList>
</ContainerDataType>


<ContainerDataType name="HkPkt" baseType="CFE_HDR/TelemetryHeader">
<EntryList>
<Entry type="HkPkt_Payload" name="Payload" />
</EntryList>
</ContainerDataType>
<ContainerDataType name="FlowHkPkt" baseType="CFE_HDR/TelemetryHeader">
<EntryList>
<Entry type="FlowStats" name="FlowStats" />
</EntryList>
</ContainerDataType>


<ContainerDataType name="SendAppTlmBase" baseType="CFE_HDR/CommandHeader" />
<ContainerDataType name="WakeupBase" baseType="CFE_HDR/CommandHeader" />
<ContainerDataType name="CommandBase" baseType="CFE_HDR/CommandHeader" />

<ContainerDataType name="NoopCmd" baseType="CommandBase">
<ConstraintSet>
<ValueConstraint entry="Sec.FunctionCode" value="0" />
</ConstraintSet>
</ContainerDataType>
<ContainerDataType name="ResetAppCmd" baseType="CommandBase">
<ConstraintSet>
<ValueConstraint entry="Sec.FunctionCode" value="1" />
</ConstraintSet>
</ContainerDataType>
<ContainerDataType name="ReloadFlowTableCmd" baseType="CommandBase">
<ConstraintSet>
<ValueConstraint entry="Sec.FunctionCode" value="2" />
</ConstraintSet>
</ContainerDataType>
<ContainerDataType name="EnableFlowCmd" baseType="CommandBase">
<ConstraintSet>
<ValueConstraint entry="Sec.FunctionCode" value="3" />
</ConstraintSet>
<EntryList>
<Entry type="FlowNameCmd_Payload" name="Payload" />
</EntryList>
</ContainerDataType>
<ContainerDataType name="DisableFlowCmd" baseType="CommandBase">
<ConstraintSet>
<ValueConstraint entry="Sec.FunctionCode" value="4" />
</ConstraintSet>
<EntryList>
<Entry type="FlowNameCmd_Payload" name="Payload" />
</EntryList>
</ContainerDataType>
<ContainerDataType name="FlushFlowCmd" baseType="CommandBase">
<ConstraintSet>
<ValueConstraint entry="Sec.FunctionCode" value="5" />
</ConstraintSet>
<EntryList>
<Entry type="FlowNameCmd_Payload" name="Payload" />
</EntryList>
</ContainerDataType>
<ContainerDataType name="PauseFlowCmd" baseType="CommandBase">
<ConstraintSet>
<ValueConstraint entry="Sec.FunctionCode" value="6" />
</ConstraintSet>
<EntryList>
<Entry type="FlowNameCmd_Payload" name="Payload" />
</EntryList>
</ContainerDataType>
<ContainerDataType name="ResumeFlowCmd" baseType="CommandBase">
<ConstraintSet>
<ValueConstraint entry="Sec.FunctionCode" value="7" />
</ConstraintSet>
<EntryList>
<Entry type="FlowNameCmd_Payload" name="Payload" />
</EntryList>
</ContainerDataType>
<ContainerDataType name="OverrideTimeoutCmd" baseType="CommandBase">
<ConstraintSet>
<ValueConstraint entry="Sec.FunctionCode" value="8" />
</ConstraintSet>
<EntryList>
<Entry type="FlowNameWithTimeoutCmd_Payload" name="Payload" />
</EntryList>
</ContainerDataType>
<ContainerDataType name="DisableOverrideTimeoutCmd" baseType="CommandBase">
<ConstraintSet>
<ValueConstraint entry="Sec.FunctionCode" value="9" />
</ConstraintSet>
<EntryList>
<Entry type="FlowNameCmd_Payload" name="Payload" />
</EntryList>
</ContainerDataType>
<ContainerDataType name="OverridePriorityCmd" baseType="CommandBase">
<ConstraintSet>
<ValueConstraint entry="Sec.FunctionCode" value="10" />
</ConstraintSet>
<EntryList>
<Entry type="FlowNameWithPriorityCmd_Payload" name="Payload" />
</EntryList>
</ContainerDataType>
<ContainerDataType name="DisableOverridePriorityCmd" baseType="CommandBase">
<ConstraintSet>
<ValueConstraint entry="Sec.FunctionCode" value="11" />
</ConstraintSet>
<EntryList>
<Entry type="FlowNameCmd_Payload" name="Payload" />
</EntryList>
</ContainerDataType>


<ContainerDataType name="SendAppTlmCmd" baseType="SendAppTlmBase">
<ConstraintSet>
<ValueConstraint entry="Sec.FunctionCode" value="0" />
</ConstraintSet>
</ContainerDataType>
<ContainerDataType name="SendEnabledFlowTlmCmd" baseType="SendAppTlmBase">
<ConstraintSet>
<ValueConstraint entry="Sec.FunctionCode" value="1" />
</ConstraintSet>
</ContainerDataType>
<ContainerDataType name="SendDisabledFlowTlmCmd" baseType="SendAppTlmBase">
<ConstraintSet>
<ValueConstraint entry="Sec.FunctionCode" value="2" />
</ConstraintSet>
</ContainerDataType>

<ContainerDataType name="ProcessWakeupCmd" baseType="WakeupBase">
<ConstraintSet>
<ValueConstraint entry="Sec.FunctionCode" value="1" />
</ConstraintSet>
</ContainerDataType>

<ContainerDataType name="PktTblEntry">
<EntryList>
<Entry type="CFE_SB/MsgIdValue" name="StreamId" />
<Entry type="BASE_TYPES/uint8" name="Priority" />
<Entry type="BASE_TYPES/uint8" name="Reliability" />
<Entry type="BASE_TYPES/uint16" name="BuffLim" />
</EntryList>
</ContainerDataType>

<ArrayDataType name="PktTbl" dataTypeRef="PktTblEntry">
<DimensionList>
<Dimension size="${BP/PKTTBL_MAX_ROWS}" />
</DimensionList>
</ArrayDataType>

<ContainerDataType name="FlowTblEntry">
<EntryList>
<Entry type="FlowName" name="Name" />
<Entry type="BASE_TYPES/uint8" name="Enabled" />
<Entry type="BASE_TYPES/uint16" name="SrcServ" />
<Entry type="BASE_TYPES/uint32" name="DstNode" />
<Entry type="BASE_TYPES/uint16" name="DstServ" />
<Entry type="BASE_TYPES/uint32" name="Timeout" />
<Entry type="BASE_TYPES/uint32" name="Lifetime" />
<Entry type="BASE_TYPES/uint16" name="Priority" />
<Entry type="BASE_TYPES/uint32" name="MaxActive" />
<Entry type="StoreName" name="Store" />
<Entry type="PktTbl" name="PktTbl" />
<Entry type="CFE_SB/MsgIdValue" name="RecvStreamId" />
<Entry type="BASE_TYPES/uint16" name="PipeDepth" />
</EntryList>
</ContainerDataType>

<ArrayDataType name="FlowTbl" dataTypeRef="FlowTblEntry">
<DimensionList>
<Dimension size="${BP/MAX_FLOWS}" />
</DimensionList>
</ArrayDataType>

<ContainerDataType name="FlowTable">
<EntryList>
<Entry type="BASE_TYPES/uint32" name="LocalNodeIpn" />
<Entry type="FlowTbl" name="Flows" />
</EntryList>
</ContainerDataType>

</DataTypeSet>

<ComponentSet>
<Component name="Application">
<RequiredInterfaceSet>
<Interface name="CMD" shortDescription="Software bus telecommand interface" type="CFE_SB/Telecommand">
<GenericTypeMapSet>
<GenericTypeMap name="TelecommandDataType" type="CommandBase" />
</GenericTypeMapSet>
</Interface>
<Interface name="SEND_APP_TLM" shortDescription="Send App Telemetry interface" type="CFE_SB/Telecommand">
<GenericTypeMapSet>
<GenericTypeMap name="TelecommandDataType" type="SendAppTlmBase" />
</GenericTypeMapSet>
</Interface>
<Interface name="WAKEUP" shortDescription="Wakeup interface" type="CFE_SB/Telecommand">
<GenericTypeMapSet>
<GenericTypeMap name="TelecommandDataType" type="WakeupBase" />
</GenericTypeMapSet>
</Interface>
<Interface name="HK_TLM" shortDescription="Software bus housekeeping telemetry interface" type="CFE_SB/Telemetry">
<GenericTypeMapSet>
<GenericTypeMap name="TelemetryDataType" type="HkPkt" />
</GenericTypeMapSet>
</Interface>
<Interface name="FLOW_HK_TLM" shortDescription="Flow telemetry interface" type="CFE_SB/Telemetry">
<GenericTypeMapSet>
<GenericTypeMap name="TelemetryDataType" type="FlowHkPkt" />
</GenericTypeMapSet>
</Interface>
</RequiredInterfaceSet>
<Implementation>
<VariableSet>
<Variable type="BASE_TYPES/uint16" readOnly="true" name="CmdTopicId" initialValue="${CFE_MISSION/BP_CMD_TOPICID}" />
<Variable type="BASE_TYPES/uint16" readOnly="true" name="SendAppTlmTopicId" initialValue="${CFE_MISSION/BP_SEND_APP_TLM_TOPICID}" />
<Variable type="BASE_TYPES/uint16" readOnly="true" name="WakeupTopicId" initialValue="${CFE_MISSION/BP_WAKEUP_TOPICID}" />
<Variable type="BASE_TYPES/uint16" readOnly="true" name="HkTlmTopicId" initialValue="${CFE_MISSION/BP_HK_TLM_TOPICID}" />
<Variable type="BASE_TYPES/uint16" readOnly="true" name="FlowHkTlmTopicId" initialValue="${CFE_MISSION/BP_FLOW_HK_TLM_TOPICID}" />
</VariableSet>
<!-- Assign fixed numbers to the "TopicId" parameter of each interface -->
<ParameterMapSet>
<ParameterMap interface="CMD" parameter="TopicId" variableRef="CmdTopicId" />
<ParameterMap interface="SEND_APP_TLM" parameter="TopicId" variableRef="SendAppTlmTopicId" />
<ParameterMap interface="WAKEUP" parameter="TopicId" variableRef="WakeupTopicId" />
<ParameterMap interface="HK_TLM" parameter="TopicId" variableRef="HkTlmTopicId" />
<ParameterMap interface="FLOW_HK_TLM" parameter="TopicId" variableRef="FlowHkTlmTopicId" />
</ParameterMapSet>
</Implementation>
</Component>
</ComponentSet>


</Package>
</PackageFile>
8 changes: 8 additions & 0 deletions fsw/custom/bp_tlmcfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
* Typedefs
************************************************/

#ifdef CFE_EDS_ENABLED_BUILD

#include "bp_eds_typedefs.h"

#else

/*
* Supplemental Housekeeping Packet Structure
*/
Expand All @@ -42,6 +48,8 @@ typedef struct
uint32 FlashErrorCount;
} BP_CustomTlm_t;

#endif

/************************************************
* Exported Functions
************************************************/
Expand Down
Loading

0 comments on commit 1d68b21

Please sign in to comment.