Skip to content

Commit

Permalink
Regenerate everything
Browse files Browse the repository at this point in the history
  • Loading branch information
woodfell committed Jun 15, 2024
1 parent 3a37ad2 commit 99701e0
Show file tree
Hide file tree
Showing 59 changed files with 11,823 additions and 2 deletions.
112 changes: 112 additions & 0 deletions c/include/libsbp/cpp/message_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -5357,6 +5357,118 @@ struct MessageTraits<sbp_msg_print_dep_t> {
}
};

template <>
struct MessageTraits<sbp_msg_profiling_resource_counter_t> {
static constexpr sbp_msg_type_t id = SbpMsgProfilingResourceCounter;
static constexpr const char *name = "MSG_PROFILING_RESOURCE_COUNTER";
static const sbp_msg_profiling_resource_counter_t &get(const sbp_msg_t &msg) {
return msg.profiling_resource_counter;
}
static sbp_msg_profiling_resource_counter_t &get(sbp_msg_t &msg) {
return msg.profiling_resource_counter;
}
static void to_sbp_msg(const sbp_msg_profiling_resource_counter_t &msg,
sbp_msg_t *sbp_msg) {
sbp_msg->profiling_resource_counter = msg;
}
static sbp_msg_t to_sbp_msg(const sbp_msg_profiling_resource_counter_t &msg) {
sbp_msg_t sbp_msg;
sbp_msg.profiling_resource_counter = msg;
return sbp_msg;
}
static s8 send(sbp_state_t *state, u16 sender_id,
const sbp_msg_profiling_resource_counter_t &msg,
sbp_write_fn_t write) {
return sbp_msg_profiling_resource_counter_send(state, sender_id, &msg,
write);
}
static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written,
const sbp_msg_profiling_resource_counter_t &msg) {
return sbp_msg_profiling_resource_counter_encode(buf, len, n_written, &msg);
}
static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read,
sbp_msg_profiling_resource_counter_t *msg) {
return sbp_msg_profiling_resource_counter_decode(buf, len, n_read, msg);
}
static size_t encoded_len(const sbp_msg_profiling_resource_counter_t &msg) {
return sbp_msg_profiling_resource_counter_encoded_len(&msg);
}
};

template <>
struct MessageTraits<sbp_msg_profiling_system_info_t> {
static constexpr sbp_msg_type_t id = SbpMsgProfilingSystemInfo;
static constexpr const char *name = "MSG_PROFILING_SYSTEM_INFO";
static const sbp_msg_profiling_system_info_t &get(const sbp_msg_t &msg) {
return msg.profiling_system_info;
}
static sbp_msg_profiling_system_info_t &get(sbp_msg_t &msg) {
return msg.profiling_system_info;
}
static void to_sbp_msg(const sbp_msg_profiling_system_info_t &msg,
sbp_msg_t *sbp_msg) {
sbp_msg->profiling_system_info = msg;
}
static sbp_msg_t to_sbp_msg(const sbp_msg_profiling_system_info_t &msg) {
sbp_msg_t sbp_msg;
sbp_msg.profiling_system_info = msg;
return sbp_msg;
}
static s8 send(sbp_state_t *state, u16 sender_id,
const sbp_msg_profiling_system_info_t &msg,
sbp_write_fn_t write) {
return sbp_msg_profiling_system_info_send(state, sender_id, &msg, write);
}
static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written,
const sbp_msg_profiling_system_info_t &msg) {
return sbp_msg_profiling_system_info_encode(buf, len, n_written, &msg);
}
static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read,
sbp_msg_profiling_system_info_t *msg) {
return sbp_msg_profiling_system_info_decode(buf, len, n_read, msg);
}
static size_t encoded_len(const sbp_msg_profiling_system_info_t &msg) {
return sbp_msg_profiling_system_info_encoded_len(&msg);
}
};

template <>
struct MessageTraits<sbp_msg_profiling_thread_info_t> {
static constexpr sbp_msg_type_t id = SbpMsgProfilingThreadInfo;
static constexpr const char *name = "MSG_PROFILING_THREAD_INFO";
static const sbp_msg_profiling_thread_info_t &get(const sbp_msg_t &msg) {
return msg.profiling_thread_info;
}
static sbp_msg_profiling_thread_info_t &get(sbp_msg_t &msg) {
return msg.profiling_thread_info;
}
static void to_sbp_msg(const sbp_msg_profiling_thread_info_t &msg,
sbp_msg_t *sbp_msg) {
sbp_msg->profiling_thread_info = msg;
}
static sbp_msg_t to_sbp_msg(const sbp_msg_profiling_thread_info_t &msg) {
sbp_msg_t sbp_msg;
sbp_msg.profiling_thread_info = msg;
return sbp_msg;
}
static s8 send(sbp_state_t *state, u16 sender_id,
const sbp_msg_profiling_thread_info_t &msg,
sbp_write_fn_t write) {
return sbp_msg_profiling_thread_info_send(state, sender_id, &msg, write);
}
static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written,
const sbp_msg_profiling_thread_info_t &msg) {
return sbp_msg_profiling_thread_info_encode(buf, len, n_written, &msg);
}
static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read,
sbp_msg_profiling_thread_info_t *msg) {
return sbp_msg_profiling_thread_info_decode(buf, len, n_read, msg);
}
static size_t encoded_len(const sbp_msg_profiling_thread_info_t &msg) {
return sbp_msg_profiling_thread_info_encoded_len(&msg);
}
};

template <>
struct MessageTraits<sbp_msg_protection_level_dep_a_t> {
static constexpr sbp_msg_type_t id = SbpMsgProtectionLevelDepA;
Expand Down
4 changes: 4 additions & 0 deletions c/include/libsbp/profiling.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,9 @@
#ifndef LIBSBP_PROFILING_MESSAGES_H
#define LIBSBP_PROFILING_MESSAGES_H
#include <libsbp/profiling/MSG_MEASUREMENT_POINT.h>
#include <libsbp/profiling/MSG_PROFILING_RESOURCE_COUNTER.h>
#include <libsbp/profiling/MSG_PROFILING_SYSTEM_INFO.h>
#include <libsbp/profiling/MSG_PROFILING_THREAD_INFO.h>
#include <libsbp/profiling/ResourceBucket.h>

#endif /* LIBSBP_PROFILING_MESSAGES_H */
207 changes: 207 additions & 0 deletions c/include/libsbp/profiling/MSG_PROFILING_RESOURCE_COUNTER.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
/*
* Copyright (C) 2015-2021 Swift Navigation Inc.
* Contact: https://support.swiftnav.com
*
* This source is subject to the license found in the file 'LICENSE' which must
* be be distributed together with this source. All other rights reserved.
*
* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
* EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
*/

/*****************************************************************************
* Automatically generated from yaml/swiftnav/sbp/profiling.yaml
* with generate.py. Please do not hand edit!
*****************************************************************************/

#ifndef LIBSBP_PROFILING_MSG_PROFILING_RESOURCE_COUNTER_H
#define LIBSBP_PROFILING_MSG_PROFILING_RESOURCE_COUNTER_H

#include <math.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>

#include <libsbp/common.h>
#include <libsbp/profiling/ResourceBucket.h>
#include <libsbp/profiling_macros.h>
#include <libsbp/string/sbp_string.h>

#ifdef __cplusplus
extern "C" {
#endif

/******************************************************************************
*
* SBP_MSG_PROFILING_RESOURCE_COUNTER
*
*****************************************************************************/
/** Information about resource buckets
*
* Information about resource buckets. Refer to product documentation to
* understand the meaning and values in this message.
*/
typedef struct {
/**
* Message number in complete sequence
*/
u8 seq_no;

/**
* Length of message sequence
*/
u8 seq_len;

/**
* List of resource buckets
*/
sbp_resource_bucket_t buckets[SBP_MSG_PROFILING_RESOURCE_COUNTER_BUCKETS_MAX];
/**
* Number of elements in buckets
*
* When sending a message fill in this field with the number elements set in
* buckets before calling an appropriate libsbp send function
*
* When receiving a message query this field for the number of elements in
* buckets. The value of any elements beyond the index specified in this field
* is undefined
*/
u8 n_buckets;
} sbp_msg_profiling_resource_counter_t;

/**
* Get encoded size of an instance of sbp_msg_profiling_resource_counter_t
*
* @param msg sbp_msg_profiling_resource_counter_t instance
* @return Length of on-wire representation
*/
static inline size_t sbp_msg_profiling_resource_counter_encoded_len(
const sbp_msg_profiling_resource_counter_t *msg) {
return SBP_MSG_PROFILING_RESOURCE_COUNTER_ENCODED_OVERHEAD +
(msg->n_buckets * SBP_RESOURCE_BUCKET_ENCODED_LEN);
}

/**
* Encode an instance of sbp_msg_profiling_resource_counter_t to wire
* representation
*
* This function encodes the given instance in to the user provided buffer. The
* buffer provided to this function must be large enough to store the encoded
* message otherwise it will return SBP_ENCODE_ERROR without writing anything to
* the buffer.
*
* Specify the length of the destination buffer in the \p len parameter. If
* non-null the number of bytes written to the buffer will be returned in \p
* n_written.
*
* @param buf Destination buffer
* @param len Length of \p buf
* @param n_written If not null, on success will be set to the number of bytes
* written to \p buf
* @param msg Instance of sbp_msg_profiling_resource_counter_t to encode
* @return SBP_OK on success, or other libsbp error code
*/
SBP_EXPORT s8 sbp_msg_profiling_resource_counter_encode(
uint8_t *buf, uint8_t len, uint8_t *n_written,
const sbp_msg_profiling_resource_counter_t *msg);

/**
* Decode an instance of sbp_msg_profiling_resource_counter_t from wire
* representation
*
* This function decodes the wire representation of a
* sbp_msg_profiling_resource_counter_t message to the given instance. The
* caller must specify the length of the buffer in the \p len parameter. If
* non-null the number of bytes read from the buffer will be returned in \p
* n_read.
*
* @param buf Wire representation of the sbp_msg_profiling_resource_counter_t
* instance
* @param len Length of \p buf
* @param n_read If not null, on success will be set to the number of bytes read
* from \p buf
* @param msg Destination
* @return SBP_OK on success, or other libsbp error code
*/
SBP_EXPORT s8 sbp_msg_profiling_resource_counter_decode(
const uint8_t *buf, uint8_t len, uint8_t *n_read,
sbp_msg_profiling_resource_counter_t *msg);
/**
* Send an instance of sbp_msg_profiling_resource_counter_t with the given write
* function
*
* An equivalent of #sbp_message_send which operates specifically on
* sbp_msg_profiling_resource_counter_t
*
* The given message will be encoded to wire representation and passed in to the
* given write function callback. The write callback will be called several
* times for each invocation of this function.
*
* @param s SBP state
* @param sender_id SBP sender id
* @param msg Message to send
* @param write Write function
* @return SBP_OK on success, or other libsbp error code
*/
SBP_EXPORT s8 sbp_msg_profiling_resource_counter_send(
sbp_state_t *s, u16 sender_id,
const sbp_msg_profiling_resource_counter_t *msg, sbp_write_fn_t write);

/**
* Compare two instances of sbp_msg_profiling_resource_counter_t
*
* The two instances will be compared and a value returned consistent with the
* return codes of comparison functions from the C standard library
*
* 0 will be returned if \p a and \p b are considered equal
* A value less than 0 will be returned if \p a is considered to be less than \p
* b A value greater than 0 will be returned if \p b is considered to be greater
* than \p b
*
* @param a sbp_msg_profiling_resource_counter_t instance
* @param b sbp_msg_profiling_resource_counter_t instance
* @return 0, <0, >0
*/
SBP_EXPORT int sbp_msg_profiling_resource_counter_cmp(
const sbp_msg_profiling_resource_counter_t *a,
const sbp_msg_profiling_resource_counter_t *b);

#ifdef __cplusplus
}

static inline bool operator==(const sbp_msg_profiling_resource_counter_t &lhs,
const sbp_msg_profiling_resource_counter_t &rhs) {
return sbp_msg_profiling_resource_counter_cmp(&lhs, &rhs) == 0;
}

static inline bool operator!=(const sbp_msg_profiling_resource_counter_t &lhs,
const sbp_msg_profiling_resource_counter_t &rhs) {
return sbp_msg_profiling_resource_counter_cmp(&lhs, &rhs) != 0;
}

static inline bool operator<(const sbp_msg_profiling_resource_counter_t &lhs,
const sbp_msg_profiling_resource_counter_t &rhs) {
return sbp_msg_profiling_resource_counter_cmp(&lhs, &rhs) < 0;
}

static inline bool operator<=(const sbp_msg_profiling_resource_counter_t &lhs,
const sbp_msg_profiling_resource_counter_t &rhs) {
return sbp_msg_profiling_resource_counter_cmp(&lhs, &rhs) <= 0;
}

static inline bool operator>(const sbp_msg_profiling_resource_counter_t &lhs,
const sbp_msg_profiling_resource_counter_t &rhs) {
return sbp_msg_profiling_resource_counter_cmp(&lhs, &rhs) > 0;
}

static inline bool operator>=(const sbp_msg_profiling_resource_counter_t &lhs,
const sbp_msg_profiling_resource_counter_t &rhs) {
return sbp_msg_profiling_resource_counter_cmp(&lhs, &rhs) >= 0;
}

#endif // ifdef __cplusplus

#endif /* LIBSBP_PROFILING_MSG_PROFILING_RESOURCE_COUNTER_H */
Loading

0 comments on commit 99701e0

Please sign in to comment.