mirror of
https://github.com/alexhopeoconnor/firmware.git
synced 2026-10-19 01:41:30 +10:00
125 lines
5.6 KiB
C++
125 lines
5.6 KiB
C++
/* Automatically generated nanopb header */
|
|
/* Generated by nanopb-0.4.9.1 */
|
|
|
|
#ifndef PB_MESHTASTIC_MESHTASTIC_DEVICEONLY_LEGACY_PB_H_INCLUDED
|
|
#define PB_MESHTASTIC_MESHTASTIC_DEVICEONLY_LEGACY_PB_H_INCLUDED
|
|
#include <pb.h>
|
|
#include <vector>
|
|
#include "meshtastic/deviceonly.pb.h"
|
|
#include "meshtastic/telemetry.pb.h"
|
|
|
|
#if PB_PROTO_HEADER_VERSION != 40
|
|
#error Regenerate this file with the current version of nanopb generator.
|
|
#endif
|
|
|
|
/* Struct definitions */
|
|
/* Legacy NodeInfoLite descriptor used only to decode pre-split
|
|
/prefs/nodes.proto saves during the v24 -> v25 migration boot.
|
|
This preserves the original NodeInfoLite-compatible field numbers needed
|
|
to parse old wire bytes cleanly, including user (2), position (3),
|
|
device_metrics (6), and the legacy-only compatibility fields via_mqtt (8),
|
|
is_favorite (10), and is_ignored (11). Steady-state code does not use
|
|
this struct; it is dropped after migration completes. This file should be
|
|
removed once DEVICESTATE_MIN_VER advances past 24. */
|
|
typedef struct _meshtastic_NodeInfoLite_Legacy {
|
|
uint32_t num;
|
|
bool has_user;
|
|
meshtastic_UserLite user;
|
|
bool has_position;
|
|
meshtastic_PositionLite position;
|
|
float snr;
|
|
uint32_t last_heard;
|
|
bool has_device_metrics;
|
|
meshtastic_DeviceMetrics device_metrics;
|
|
uint8_t channel;
|
|
bool via_mqtt;
|
|
bool has_hops_away;
|
|
uint8_t hops_away;
|
|
bool is_favorite;
|
|
bool is_ignored;
|
|
uint8_t next_hop;
|
|
uint32_t bitfield;
|
|
} meshtastic_NodeInfoLite_Legacy;
|
|
|
|
/* Legacy NodeDatabase shape: one repeated array of fat NodeInfoLite_Legacy
|
|
with no satellite position/telemetry arrays. */
|
|
typedef struct _meshtastic_NodeDatabase_Legacy {
|
|
uint32_t version;
|
|
std::vector<meshtastic_NodeInfoLite_Legacy> nodes;
|
|
} meshtastic_NodeDatabase_Legacy;
|
|
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/* Initializer values for message structs */
|
|
#define meshtastic_NodeInfoLite_Legacy_init_default {0, false, meshtastic_UserLite_init_default, false, meshtastic_PositionLite_init_default, 0, 0, false, meshtastic_DeviceMetrics_init_default, 0, 0, false, 0, 0, 0, 0, 0}
|
|
#define meshtastic_NodeDatabase_Legacy_init_default {0, {0}}
|
|
#define meshtastic_NodeInfoLite_Legacy_init_zero {0, false, meshtastic_UserLite_init_zero, false, meshtastic_PositionLite_init_zero, 0, 0, false, meshtastic_DeviceMetrics_init_zero, 0, 0, false, 0, 0, 0, 0, 0}
|
|
#define meshtastic_NodeDatabase_Legacy_init_zero {0, {0}}
|
|
|
|
/* Field tags (for use in manual encoding/decoding) */
|
|
#define meshtastic_NodeInfoLite_Legacy_num_tag 1
|
|
#define meshtastic_NodeInfoLite_Legacy_user_tag 2
|
|
#define meshtastic_NodeInfoLite_Legacy_position_tag 3
|
|
#define meshtastic_NodeInfoLite_Legacy_snr_tag 4
|
|
#define meshtastic_NodeInfoLite_Legacy_last_heard_tag 5
|
|
#define meshtastic_NodeInfoLite_Legacy_device_metrics_tag 6
|
|
#define meshtastic_NodeInfoLite_Legacy_channel_tag 7
|
|
#define meshtastic_NodeInfoLite_Legacy_via_mqtt_tag 8
|
|
#define meshtastic_NodeInfoLite_Legacy_hops_away_tag 9
|
|
#define meshtastic_NodeInfoLite_Legacy_is_favorite_tag 10
|
|
#define meshtastic_NodeInfoLite_Legacy_is_ignored_tag 11
|
|
#define meshtastic_NodeInfoLite_Legacy_next_hop_tag 12
|
|
#define meshtastic_NodeInfoLite_Legacy_bitfield_tag 13
|
|
#define meshtastic_NodeDatabase_Legacy_version_tag 1
|
|
#define meshtastic_NodeDatabase_Legacy_nodes_tag 2
|
|
|
|
/* Struct field encoding specification for nanopb */
|
|
#define meshtastic_NodeInfoLite_Legacy_FIELDLIST(X, a) \
|
|
X(a, STATIC, SINGULAR, UINT32, num, 1) \
|
|
X(a, STATIC, OPTIONAL, MESSAGE, user, 2) \
|
|
X(a, STATIC, OPTIONAL, MESSAGE, position, 3) \
|
|
X(a, STATIC, SINGULAR, FLOAT, snr, 4) \
|
|
X(a, STATIC, SINGULAR, FIXED32, last_heard, 5) \
|
|
X(a, STATIC, OPTIONAL, MESSAGE, device_metrics, 6) \
|
|
X(a, STATIC, SINGULAR, UINT32, channel, 7) \
|
|
X(a, STATIC, SINGULAR, BOOL, via_mqtt, 8) \
|
|
X(a, STATIC, OPTIONAL, UINT32, hops_away, 9) \
|
|
X(a, STATIC, SINGULAR, BOOL, is_favorite, 10) \
|
|
X(a, STATIC, SINGULAR, BOOL, is_ignored, 11) \
|
|
X(a, STATIC, SINGULAR, UINT32, next_hop, 12) \
|
|
X(a, STATIC, SINGULAR, UINT32, bitfield, 13)
|
|
#define meshtastic_NodeInfoLite_Legacy_CALLBACK NULL
|
|
#define meshtastic_NodeInfoLite_Legacy_DEFAULT NULL
|
|
#define meshtastic_NodeInfoLite_Legacy_user_MSGTYPE meshtastic_UserLite
|
|
#define meshtastic_NodeInfoLite_Legacy_position_MSGTYPE meshtastic_PositionLite
|
|
#define meshtastic_NodeInfoLite_Legacy_device_metrics_MSGTYPE meshtastic_DeviceMetrics
|
|
|
|
#define meshtastic_NodeDatabase_Legacy_FIELDLIST(X, a) \
|
|
X(a, STATIC, SINGULAR, UINT32, version, 1) \
|
|
X(a, CALLBACK, REPEATED, MESSAGE, nodes, 2)
|
|
extern bool meshtastic_NodeDatabase_Legacy_callback(pb_istream_t *istream, pb_ostream_t *ostream, const pb_field_t *field);
|
|
#define meshtastic_NodeDatabase_Legacy_CALLBACK meshtastic_NodeDatabase_Legacy_callback
|
|
#define meshtastic_NodeDatabase_Legacy_DEFAULT NULL
|
|
#define meshtastic_NodeDatabase_Legacy_nodes_MSGTYPE meshtastic_NodeInfoLite_Legacy
|
|
|
|
extern const pb_msgdesc_t meshtastic_NodeInfoLite_Legacy_msg;
|
|
extern const pb_msgdesc_t meshtastic_NodeDatabase_Legacy_msg;
|
|
|
|
/* Defines for backwards compatibility with code written before nanopb-0.4.0 */
|
|
#define meshtastic_NodeInfoLite_Legacy_fields &meshtastic_NodeInfoLite_Legacy_msg
|
|
#define meshtastic_NodeDatabase_Legacy_fields &meshtastic_NodeDatabase_Legacy_msg
|
|
|
|
/* Maximum encoded size of messages (where known) */
|
|
/* meshtastic_NodeDatabase_Legacy_size depends on runtime parameters */
|
|
#define MESHTASTIC_MESHTASTIC_DEVICEONLY_LEGACY_PB_H_MAX_SIZE meshtastic_NodeInfoLite_Legacy_size
|
|
#define meshtastic_NodeInfoLite_Legacy_size 196
|
|
|
|
#ifdef __cplusplus
|
|
} /* extern "C" */
|
|
#endif
|
|
|
|
#endif
|