Skip to content

Commit

Permalink
Removed confusing commented-out byte arrays in variable length messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamshapiro0 committed Jun 11, 2024
1 parent 805d428 commit a144463
Showing 1 changed file with 41 additions and 37 deletions.
78 changes: 41 additions & 37 deletions src/point_one/fusion_engine/messages/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,12 @@ inline p1_ostream& operator<<(p1_ostream& stream, SaveAction action) {
* version 1.0).
* @ingroup config_types
*
* This message must be followed by the parameter value to be used:
*
* ```
* {MessageHeader, SetConfigMessage, Parameter[data_length_bytes]}
* ```
*
* The format of the parameter value is defined by the the specified @ref
* config_type (@ref ConfigType). For example, an antenna lever arm definition
* may require three 32-bit `float` values, one for each axis, while a serial
Expand Down Expand Up @@ -630,14 +636,6 @@ struct P1_ALIGNAS(4) SetConfigMessage : public MessagePayload {

/** The size of the parameter value (in bytes). */
uint32_t config_length_bytes = 0;

/**
* A pointer to the beginning of the configuration parameter value.
*
* The size and format of the contents is specified by the @ref config_type.
* See @ref ConfigType.
*/
// uint8_t config_change_data[0];
};

/**
Expand Down Expand Up @@ -1495,14 +1493,14 @@ struct P1_ALIGNAS(4) TroposphereConfig {
};

/**
* @brief A submessage header for configuration data associated with the
* @ref ConfigType::INTERFACE_CONFIG.
* @brief I/O interface parameter configuration submessage (used when sending
* a @ref SetConfigMessage for @ref ConfigType::INTERFACE_CONFIG).
* @ingroup config_types
*
* In @ref SetConfigMessage, @ref GetConfigMessage, and @ref
* ConfigResponseMessage this struct can be used to access settings
* associated with a a particular interface. For example, to set the baudrate
* for serial port 1:
* ConfigResponseMessage, this struct can be used to access settings
* associated with a a particular I/O interface. For example, to set the
* baudrate for serial port 1:
*
* ```
* {
Expand All @@ -1514,6 +1512,15 @@ struct P1_ALIGNAS(4) TroposphereConfig {
* uint32_t 115200
* }
* ```
*
* This message must be followed by the parameter value to be used:
*
* ```
* {MessageHeader, SetConfigMessage, InterfaceConfigSubmessage, Parameter}
* ```
*
* See @ref InterfaceConfigType for a complete list of parameters and their
* data formats.
*/
struct P1_ALIGNAS(4) InterfaceConfigSubmessage {
/**
Expand All @@ -1530,15 +1537,6 @@ struct P1_ALIGNAS(4) InterfaceConfigSubmessage {
InterfaceConfigType subtype = InterfaceConfigType::INVALID;

uint8_t reserved[3] = {0};

/**
* A pointer to the beginning of the configuration parameter value if
* setting/describing.
*
* The size and format of the contents is specified by the @ref subtype.
* See @ref InterfaceConfigType.
*/
//uint8_t config_data[0];
};

/**************************************************************************/ /**
Expand Down Expand Up @@ -1598,6 +1596,13 @@ inline p1_ostream& operator<<(p1_ostream& stream, DataType val) {
* MessageType::IMPORT_DATA, version 1.0).
* @ingroup import_export
*
* This message must be followed by @ref data_length_bytes bytes containing
* the data to be imported:
*
* ```
* {MessageHeader, ImportDataMessage, Payload[data_length_bytes]}
* ```
*
* # Expected Response
* The device will respond with a @ref CommandResponseMessage indicating whether
* or not the request succeeded.
Expand All @@ -1620,12 +1625,6 @@ struct P1_ALIGNAS(4) ImportDataMessage {
uint8_t reserved2[4] = {0};
/** @brief Number of bytes to update. */
uint32_t data_length_bytes = 0;

/**
* This is followed by `data_length_bytes` bytes containing the data to be
* imported.
*/
// uint8_t data[data_length_bytes]
};

/**
Expand Down Expand Up @@ -1656,6 +1655,13 @@ struct P1_ALIGNAS(4) ExportDataMessage {
* MessageType::PLATFORM_STORAGE_DATA, version 1.0).
* @ingroup import_export
*
* This message will be followed by @ref data_length_bytes bytes containing
* the data storage contents:
*
* ```
* {MessageHeader, PlatformStorageDataMessage, Payload[data_length_bytes]}
* ```
*
* See also @ref ExportDataMessage.
*
* Changes:
Expand Down Expand Up @@ -1687,10 +1693,6 @@ struct P1_ALIGNAS(4) PlatformStorageDataMessage {
DataVersion data_version;
/** Number of bytes in data contents. */
uint32_t data_length_bytes = 0;
/**
* This is followed by `data_length_bytes` bytes containing the data contents.
*/
// uint8_t data[data_length_bytes]
};

/**************************************************************************/ /**
Expand Down Expand Up @@ -2501,6 +2503,13 @@ struct P1_ALIGNAS(4) MessageRateResponseEntry {
* @brief Response to a @ref GetMessageRate request (@ref
* MessageType::MESSAGE_RATE_RESPONSE, version 1.1).
* @ingroup io_interfaces
*
* This message will be followed by @ref num_rates @ref MessageRateResponseEntry
* elements:
*
* ```
* {MessageHeader, MessageRateResponse, MessageRateResponseEntry[num_rates]}
* ```
*/
struct P1_ALIGNAS(4) MessageRateResponse : public MessagePayload {
static constexpr MessageType MESSAGE_TYPE =
Expand All @@ -2518,11 +2527,6 @@ struct P1_ALIGNAS(4) MessageRateResponse : public MessagePayload {

/** The output interface corresponding with this response. */
InterfaceID output_interface = {};

/**
* This is followed by `num_rates` @ref MessageRateResponseEntry elements.
*/
// MessageRateResponseEntry rates[num_rates]
};

/**************************************************************************/ /**
Expand Down

0 comments on commit a144463

Please sign in to comment.