Skip to content
Snippets Groups Projects
ECSS_Definitions.hpp 3.06 KiB
#ifndef ECSS_SERVICES_ECSS_DEFINITIONS_H
#define ECSS_SERVICES_ECSS_DEFINITIONS_H

/**
 * @file
 * This file contains constant definitions that are used throughout the ECSS services. They often refer to maximum
 * values and upper limits for the storage of data in the services.
 *
 * @todo All these constants need to be redefined and revised after the design and the requirements are finalized.
 */

/**
 * The maximum size of a regular ECSS message, in bytes
 */
#define ECSS_MAX_MESSAGE_SIZE 1024U

/**
 * The maximum size of a string to be read or appended to a Message, in bytes
 *
 * This is used by the Message::appendString() and Message::readString() functions
 */
#define ECSS_MAX_STRING_SIZE 256U

/**
 * The maximum size of a string to be used by ST[13] \ref LargePacketTransferService, in bytes
 *
 * This is used by the Message::appendString() and Message::readString() functions
 */
#define ECSS_MAX_FIXED_OCTET_STRING_SIZE 256U

/**
 * The total number of different message types that can be handled by this project
 */
#define ECSS_TOTAL_MESSAGE_TYPES (10U * 20U)

/**
 * The CCSDS packet version, as specified in section 7.4.1
 */
#define CCSDS_PACKET_VERSION 0

/**
 * The ECSS packet version, as specified in requirement 7.4.4.1c
 */
#define ECSS_PUS_VERSION 2U

/**
 * The CCSDS sequence flags have the constant value 0x3, as specified in section 7.4.1
 */
#define ECSS_SEQUENCE_FLAGS 0x3

/**
 * @brief Maximum number of TC requests that can be contained in a single message request
 * @details This definition accounts for the maximum number of TC packet requests that can be
 * contained in the message of a request. This was defined for the time based command scheduling
 * service and specifically to address the needs of the sub-services containing a TC packet in
 * their message request.
 * @attention This definition is probably dependent on the ECSS_TC_REQUEST_STRING_SIZE
 */
#define ECSS_MAX_REQUEST_COUNT 20

/**
 * @brief Maximum length of a String converted TC packet message
 * @details This definition refers to the maximum length that an embedded TC packet, meaning a TC
 * packet contained in a message request as a part of the request.
 */
#define ECSS_TC_REQUEST_STRING_SIZE 64

/**
 * The maximum number of activities that can be in the time-based schedule
 * @see TimeBasedSchedulingService
 */
#define ECSS_MAX_NUMBER_OF_TIME_SCHED_ACTIVITIES 10

/**
 * @brief Time margin used in the time based command scheduling service ST[11]
 * @details This defines the time margin in seconds, from the current rime, that an activity must
 * have in order
 * @see TimeBasedSchedulingService
 */
#define ECSS_TIME_MARGIN_FOR_ACTIVATION 60

/**
 * @brief Size of the multimap that holds every event-action definition
 * @see EventActionService
 */
#define ECSS_EVENT_ACTION_STRUCT_MAP_SIZE 256

/**
 * The maximum delta between the specified release time and the actual release time
 * @see TimeBasedSchedulingService
 */
#define ECSS_MAX_DELTA_OF_RELEASE_TIME 60


/**
 * @brief The maximum size of a log message
 */
#define LOGGER_MAX_MESSAGE_SIZE 512

#endif // ECSS_SERVICES_ECSS_DEFINITIONS_H