Protobufs
This commit is contained in:
+1
-1
Submodule protobufs updated: 9d589c1321...f5b94bc367
@@ -6,10 +6,34 @@
|
||||
#error Regenerate this file with the current version of nanopb generator.
|
||||
#endif
|
||||
|
||||
PB_BIND(meshtastic_SensorData, meshtastic_SensorData, AUTO)
|
||||
PB_BIND(meshtastic_FileTransfer, meshtastic_FileTransfer, 4)
|
||||
|
||||
|
||||
PB_BIND(meshtastic_DirectoryListing, meshtastic_DirectoryListing, 4)
|
||||
|
||||
|
||||
PB_BIND(meshtastic_I2CTransaction, meshtastic_I2CTransaction, 2)
|
||||
|
||||
|
||||
PB_BIND(meshtastic_SdCardInfo, meshtastic_SdCardInfo, AUTO)
|
||||
|
||||
|
||||
PB_BIND(meshtastic_I2CResult, meshtastic_I2CResult, 2)
|
||||
|
||||
|
||||
PB_BIND(meshtastic_InterdeviceMessage, meshtastic_InterdeviceMessage, 4)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
PB_BIND(meshtastic_InterdeviceMessage, meshtastic_InterdeviceMessage, 2)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -10,38 +10,194 @@
|
||||
#endif
|
||||
|
||||
/* Enum definitions */
|
||||
typedef enum _meshtastic_MessageType {
|
||||
meshtastic_MessageType_ACK = 0,
|
||||
meshtastic_MessageType_COLLECT_INTERVAL = 160, /* in ms */
|
||||
meshtastic_MessageType_BEEP_ON = 161, /* duration ms */
|
||||
meshtastic_MessageType_BEEP_OFF = 162, /* cancel prematurely */
|
||||
meshtastic_MessageType_SHUTDOWN = 163,
|
||||
meshtastic_MessageType_POWER_ON = 164,
|
||||
meshtastic_MessageType_SCD41_TEMP = 176,
|
||||
meshtastic_MessageType_SCD41_HUMIDITY = 177,
|
||||
meshtastic_MessageType_SCD41_CO2 = 178,
|
||||
meshtastic_MessageType_AHT20_TEMP = 179,
|
||||
meshtastic_MessageType_AHT20_HUMIDITY = 180,
|
||||
meshtastic_MessageType_TVOC_INDEX = 181
|
||||
} meshtastic_MessageType;
|
||||
/* Version of the interdevice protocol spoken on the link. Both sides send
|
||||
theirs in the ping/pong handshake; a peer reporting a different one runs
|
||||
firmware that does not match and is not talked to.
|
||||
|
||||
On a change that breaks the other side (renumbered fields, changed
|
||||
semantics, removed messages), raise the value of CURRENT. Do not add
|
||||
another entry: this enum carries a single constant, not a history. */
|
||||
typedef enum _meshtastic_InterdeviceVersion {
|
||||
meshtastic_InterdeviceVersion_INTERDEVICE_VERSION_UNSPECIFIED = 0,
|
||||
/* Never use 1: ping/pong were bools before the handshake existed, and a
|
||||
bool true is the same varint on the wire as the number 1, so firmware
|
||||
predating the handshake would pass it. */
|
||||
meshtastic_InterdeviceVersion_INTERDEVICE_VERSION_CURRENT = 2
|
||||
} meshtastic_InterdeviceVersion;
|
||||
|
||||
/* Defines the supported file operations */
|
||||
typedef enum _meshtastic_FileOperation {
|
||||
meshtastic_FileOperation_GET = 0,
|
||||
meshtastic_FileOperation_POST = 1,
|
||||
meshtastic_FileOperation_PUT = 2,
|
||||
meshtastic_FileOperation_DELETE = 3
|
||||
} meshtastic_FileOperation;
|
||||
|
||||
/* Outcome of a file or directory operation. The requester must be able to
|
||||
tell a transient condition from a definitive one: BUSY is worth another
|
||||
try, NOT_FOUND is not. */
|
||||
typedef enum _meshtastic_FileStatus {
|
||||
meshtastic_FileStatus_FILE_UNSPECIFIED = 0,
|
||||
meshtastic_FileStatus_FILE_OK = 1,
|
||||
/* Retry later: the co-processor is doing card maintenance (mount,
|
||||
free space scan) and cannot serve the request right now */
|
||||
meshtastic_FileStatus_FILE_BUSY = 2,
|
||||
meshtastic_FileStatus_FILE_NO_CARD = 3,
|
||||
meshtastic_FileStatus_FILE_NOT_FOUND = 4,
|
||||
/* PUT only: offset did not match the current end of the file. file_size
|
||||
carries the size the file actually has, so the writer can resync (or
|
||||
recognize its own chunk as already written after a lost response). */
|
||||
meshtastic_FileStatus_FILE_OFFSET_CONFLICT = 5,
|
||||
meshtastic_FileStatus_FILE_IO_ERROR = 6,
|
||||
meshtastic_FileStatus_FILE_NOT_A_FILE = 7 /* path is a directory (GET) or not one (listing) */
|
||||
} meshtastic_FileStatus;
|
||||
|
||||
/* What to do with the SD card of the co-processor */
|
||||
typedef enum _meshtastic_SdCommand {
|
||||
meshtastic_SdCommand_SD_COMMAND_UNSPECIFIED = 0,
|
||||
meshtastic_SdCommand_SD_MOUNT = 1, /* mount a card that is in the slot, also after an eject */
|
||||
meshtastic_SdCommand_SD_EJECT = 2, /* flush and release the card so it can be pulled safely */
|
||||
meshtastic_SdCommand_SD_FORMAT = 3 /* wipe the card and put a fresh FAT on it, then mount it */
|
||||
} meshtastic_SdCommand;
|
||||
|
||||
typedef enum _meshtastic_SdCardInfo_CardType {
|
||||
meshtastic_SdCardInfo_CardType_NONE = 0,
|
||||
meshtastic_SdCardInfo_CardType_MMC = 1,
|
||||
meshtastic_SdCardInfo_CardType_SD = 2,
|
||||
meshtastic_SdCardInfo_CardType_SDHC = 3,
|
||||
meshtastic_SdCardInfo_CardType_SDXC = 4,
|
||||
meshtastic_SdCardInfo_CardType_UNKNOWN_CARD = 5
|
||||
} meshtastic_SdCardInfo_CardType;
|
||||
|
||||
typedef enum _meshtastic_SdCardInfo_FatType {
|
||||
meshtastic_SdCardInfo_FatType_UNKNOWN_FAT = 0,
|
||||
meshtastic_SdCardInfo_FatType_FAT16 = 1,
|
||||
meshtastic_SdCardInfo_FatType_FAT32 = 2,
|
||||
meshtastic_SdCardInfo_FatType_EXFAT = 3
|
||||
} meshtastic_SdCardInfo_FatType;
|
||||
|
||||
typedef enum _meshtastic_I2CResult_Status {
|
||||
/* Never sent: an all-defaults (e.g. accidentally empty) message must
|
||||
not decode as a successful transaction */
|
||||
meshtastic_I2CResult_Status_UNSPECIFIED = 0,
|
||||
meshtastic_I2CResult_Status_OK = 1,
|
||||
meshtastic_I2CResult_Status_NACK_ADDRESS = 2,
|
||||
meshtastic_I2CResult_Status_NACK_DATA = 3,
|
||||
meshtastic_I2CResult_Status_ERROR = 4
|
||||
} meshtastic_I2CResult_Status;
|
||||
|
||||
/* Struct definitions */
|
||||
typedef struct _meshtastic_SensorData {
|
||||
/* The message type */
|
||||
meshtastic_MessageType type;
|
||||
pb_size_t which_data;
|
||||
union {
|
||||
float float_value;
|
||||
uint32_t uint32_value;
|
||||
} data;
|
||||
} meshtastic_SensorData;
|
||||
typedef PB_BYTES_ARRAY_T(4096) meshtastic_FileTransfer_filedata_t;
|
||||
/* Message for file operations */
|
||||
typedef struct _meshtastic_FileTransfer {
|
||||
meshtastic_FileOperation operation; /* File operation (GET, POST, PUT, DELETE) */
|
||||
char filepath[256]; /* Path of the file on the SD card */
|
||||
meshtastic_FileTransfer_filedata_t filedata; /* Chunk content (POST/PUT request, GET response) */
|
||||
meshtastic_FileStatus status; /* Response: outcome of the operation */
|
||||
char message[255]; /* Response: human readable detail, may be empty */
|
||||
uint64_t offset; /* Byte offset of this chunk within the file (ranged GET/PUT) */
|
||||
/* GET request: number of bytes to read, 0 = max chunk size. A response
|
||||
carries at most the filedata max_size (see interdevice.options) per
|
||||
chunk; larger requests are truncated, visible in the filedata length. */
|
||||
uint32_t length;
|
||||
uint64_t file_size; /* GET response: total size of the file */
|
||||
} meshtastic_FileTransfer;
|
||||
|
||||
/* Message for structured directory listing */
|
||||
typedef struct _meshtastic_DirectoryListing {
|
||||
char directory[256]; /* Path of the directory */
|
||||
/* One page of entry names, full FAT LFN length. Subdirectories carry a
|
||||
trailing slash. Note that a name whose directory prefix pushes the
|
||||
combined path past the FileTransfer.filepath limit cannot round-trip.
|
||||
Page size is the max_count in interdevice.options; page through with
|
||||
offset and total_count. */
|
||||
pb_size_t filenames_count;
|
||||
char filenames[16][256];
|
||||
meshtastic_FileStatus status; /* Response: outcome of the operation */
|
||||
char message[255]; /* Response: human readable detail, may be empty */
|
||||
uint32_t offset; /* Request: skip this many entries (paging) */
|
||||
uint32_t total_count; /* Response: total number of entries in the directory */
|
||||
} meshtastic_DirectoryListing;
|
||||
|
||||
typedef PB_BYTES_ARRAY_T(256) meshtastic_I2CTransaction_write_data_t;
|
||||
/* A single I2C transaction: an optional write followed by an optional
|
||||
read with repeated start, matching the TwoWire usage of sensor drivers
|
||||
(beginTransmission/write.../endTransmission(false)/requestFrom) */
|
||||
typedef struct _meshtastic_I2CTransaction {
|
||||
uint32_t address; /* 7-bit device address */
|
||||
meshtastic_I2CTransaction_write_data_t write_data; /* Bytes to write, may be empty */
|
||||
/* Number of bytes to read after the write, 0 = write-only. Bounded by
|
||||
the read_data max_size of I2CResult (see interdevice.options); larger
|
||||
requests are truncated, visible in the returned byte count. */
|
||||
uint32_t read_len;
|
||||
} meshtastic_I2CTransaction;
|
||||
|
||||
/* SD card statistics */
|
||||
typedef struct _meshtastic_SdCardInfo {
|
||||
/* Card initialized and usable. False while `busy` is set does not mean
|
||||
there is no card: the co-processor does not know yet. */
|
||||
bool present;
|
||||
meshtastic_SdCardInfo_CardType card_type;
|
||||
meshtastic_SdCardInfo_FatType fat_type;
|
||||
uint64_t card_size; /* Filesystem size in bytes */
|
||||
uint64_t used_bytes; /* Used bytes (may be expensive to compute on FAT32) */
|
||||
uint64_t free_bytes; /* Free bytes */
|
||||
/* used_bytes/free_bytes are only meaningful when true: the scan behind
|
||||
them runs in the background after mount and can take a while, and a
|
||||
full card is otherwise indistinguishable from a scan in progress */
|
||||
bool stats_valid;
|
||||
/* The co-processor is mounting a card right now, so whether one is
|
||||
present is not decided yet. Ask again rather than concluding the slot
|
||||
is empty. */
|
||||
bool busy;
|
||||
/* A card answers in the slot but carries no filesystem that could be
|
||||
mounted (present is false then). Formatting it makes it usable. */
|
||||
bool unformatted;
|
||||
} meshtastic_SdCardInfo;
|
||||
|
||||
typedef PB_BYTES_ARRAY_T(256) meshtastic_I2CResult_read_data_t;
|
||||
/* Result of an I2CTransaction */
|
||||
typedef struct _meshtastic_I2CResult {
|
||||
meshtastic_I2CResult_Status status;
|
||||
meshtastic_I2CResult_read_data_t read_data; /* Data read from the device, empty for write-only transactions */
|
||||
} meshtastic_I2CResult;
|
||||
|
||||
typedef PB_BYTES_ARRAY_T(128) meshtastic_InterdeviceMessage_i2c_scan_result_t;
|
||||
/* Main message for interdevice communication */
|
||||
typedef struct _meshtastic_InterdeviceMessage {
|
||||
pb_size_t which_data;
|
||||
union {
|
||||
char nmea[1024];
|
||||
meshtastic_SensorData sensor;
|
||||
uint16_t beep;
|
||||
meshtastic_I2CTransaction i2c_transaction;
|
||||
meshtastic_I2CResult i2c_result;
|
||||
bool i2c_scan; /* Request: scan the secondary I2C bus */
|
||||
meshtastic_InterdeviceMessage_i2c_scan_result_t i2c_scan_result; /* Response: 7-bit addresses of discovered devices */
|
||||
meshtastic_FileTransfer file_transfer;
|
||||
meshtastic_DirectoryListing directory_listing;
|
||||
bool get_sd_info; /* Request: SD card statistics */
|
||||
meshtastic_SdCardInfo sd_info; /* Response */
|
||||
/* Link liveness probe and version handshake. The receiver answers ping
|
||||
with pong, echoing the id. Touches no peripherals, so it works with
|
||||
nothing attached. Both carry the version the sender speaks; a peer
|
||||
that answers with a different one speaks another protocol and must
|
||||
not be used. */
|
||||
meshtastic_InterdeviceVersion ping;
|
||||
meshtastic_InterdeviceVersion pong;
|
||||
/* Response: the request could not be decoded or is of an unhandled
|
||||
type, so the requester fails fast instead of burning its timeout.
|
||||
Echoes the id when known, 0 when the frame was undecodable. Never
|
||||
sent in reaction to a nack. */
|
||||
bool nack;
|
||||
/* Request: mount the card, or release it so it can be pulled safely. The
|
||||
co-processor answers with sd_info. Without an eject the card is mounted
|
||||
on its own and kept mounted; after one it stays released until a mount
|
||||
is asked for. */
|
||||
meshtastic_SdCommand sd_command;
|
||||
} data;
|
||||
/* Correlates a response with its request: responses echo the id of the
|
||||
request they answer. 0 for unsolicited messages (e.g. the nmea stream). */
|
||||
uint32_t id;
|
||||
} meshtastic_InterdeviceMessage;
|
||||
|
||||
|
||||
@@ -50,53 +206,205 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/* Helper constants for enums */
|
||||
#define _meshtastic_MessageType_MIN meshtastic_MessageType_ACK
|
||||
#define _meshtastic_MessageType_MAX meshtastic_MessageType_TVOC_INDEX
|
||||
#define _meshtastic_MessageType_ARRAYSIZE ((meshtastic_MessageType)(meshtastic_MessageType_TVOC_INDEX+1))
|
||||
#define _meshtastic_InterdeviceVersion_MIN meshtastic_InterdeviceVersion_INTERDEVICE_VERSION_UNSPECIFIED
|
||||
#define _meshtastic_InterdeviceVersion_MAX meshtastic_InterdeviceVersion_INTERDEVICE_VERSION_CURRENT
|
||||
#define _meshtastic_InterdeviceVersion_ARRAYSIZE ((meshtastic_InterdeviceVersion)(meshtastic_InterdeviceVersion_INTERDEVICE_VERSION_CURRENT+1))
|
||||
|
||||
#define meshtastic_SensorData_type_ENUMTYPE meshtastic_MessageType
|
||||
#define _meshtastic_FileOperation_MIN meshtastic_FileOperation_GET
|
||||
#define _meshtastic_FileOperation_MAX meshtastic_FileOperation_DELETE
|
||||
#define _meshtastic_FileOperation_ARRAYSIZE ((meshtastic_FileOperation)(meshtastic_FileOperation_DELETE+1))
|
||||
|
||||
#define _meshtastic_FileStatus_MIN meshtastic_FileStatus_FILE_UNSPECIFIED
|
||||
#define _meshtastic_FileStatus_MAX meshtastic_FileStatus_FILE_NOT_A_FILE
|
||||
#define _meshtastic_FileStatus_ARRAYSIZE ((meshtastic_FileStatus)(meshtastic_FileStatus_FILE_NOT_A_FILE+1))
|
||||
|
||||
#define _meshtastic_SdCommand_MIN meshtastic_SdCommand_SD_COMMAND_UNSPECIFIED
|
||||
#define _meshtastic_SdCommand_MAX meshtastic_SdCommand_SD_FORMAT
|
||||
#define _meshtastic_SdCommand_ARRAYSIZE ((meshtastic_SdCommand)(meshtastic_SdCommand_SD_FORMAT+1))
|
||||
|
||||
#define _meshtastic_SdCardInfo_CardType_MIN meshtastic_SdCardInfo_CardType_NONE
|
||||
#define _meshtastic_SdCardInfo_CardType_MAX meshtastic_SdCardInfo_CardType_UNKNOWN_CARD
|
||||
#define _meshtastic_SdCardInfo_CardType_ARRAYSIZE ((meshtastic_SdCardInfo_CardType)(meshtastic_SdCardInfo_CardType_UNKNOWN_CARD+1))
|
||||
|
||||
#define _meshtastic_SdCardInfo_FatType_MIN meshtastic_SdCardInfo_FatType_UNKNOWN_FAT
|
||||
#define _meshtastic_SdCardInfo_FatType_MAX meshtastic_SdCardInfo_FatType_EXFAT
|
||||
#define _meshtastic_SdCardInfo_FatType_ARRAYSIZE ((meshtastic_SdCardInfo_FatType)(meshtastic_SdCardInfo_FatType_EXFAT+1))
|
||||
|
||||
#define _meshtastic_I2CResult_Status_MIN meshtastic_I2CResult_Status_UNSPECIFIED
|
||||
#define _meshtastic_I2CResult_Status_MAX meshtastic_I2CResult_Status_ERROR
|
||||
#define _meshtastic_I2CResult_Status_ARRAYSIZE ((meshtastic_I2CResult_Status)(meshtastic_I2CResult_Status_ERROR+1))
|
||||
|
||||
#define meshtastic_FileTransfer_operation_ENUMTYPE meshtastic_FileOperation
|
||||
#define meshtastic_FileTransfer_status_ENUMTYPE meshtastic_FileStatus
|
||||
|
||||
#define meshtastic_DirectoryListing_status_ENUMTYPE meshtastic_FileStatus
|
||||
|
||||
|
||||
#define meshtastic_SdCardInfo_card_type_ENUMTYPE meshtastic_SdCardInfo_CardType
|
||||
#define meshtastic_SdCardInfo_fat_type_ENUMTYPE meshtastic_SdCardInfo_FatType
|
||||
|
||||
#define meshtastic_I2CResult_status_ENUMTYPE meshtastic_I2CResult_Status
|
||||
|
||||
#define meshtastic_InterdeviceMessage_data_ping_ENUMTYPE meshtastic_InterdeviceVersion
|
||||
#define meshtastic_InterdeviceMessage_data_pong_ENUMTYPE meshtastic_InterdeviceVersion
|
||||
#define meshtastic_InterdeviceMessage_data_sd_command_ENUMTYPE meshtastic_SdCommand
|
||||
|
||||
|
||||
/* Initializer values for message structs */
|
||||
#define meshtastic_SensorData_init_default {_meshtastic_MessageType_MIN, 0, {0}}
|
||||
#define meshtastic_InterdeviceMessage_init_default {0, {""}}
|
||||
#define meshtastic_SensorData_init_zero {_meshtastic_MessageType_MIN, 0, {0}}
|
||||
#define meshtastic_InterdeviceMessage_init_zero {0, {""}}
|
||||
#define meshtastic_FileTransfer_init_default {_meshtastic_FileOperation_MIN, "", {0, {0}}, _meshtastic_FileStatus_MIN, "", 0, 0, 0}
|
||||
#define meshtastic_DirectoryListing_init_default {"", 0, {"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""}, _meshtastic_FileStatus_MIN, "", 0, 0}
|
||||
#define meshtastic_I2CTransaction_init_default {0, {0, {0}}, 0}
|
||||
#define meshtastic_SdCardInfo_init_default {0, _meshtastic_SdCardInfo_CardType_MIN, _meshtastic_SdCardInfo_FatType_MIN, 0, 0, 0, 0, 0, 0}
|
||||
#define meshtastic_I2CResult_init_default {_meshtastic_I2CResult_Status_MIN, {0, {0}}}
|
||||
#define meshtastic_InterdeviceMessage_init_default {0, {""}, 0}
|
||||
#define meshtastic_FileTransfer_init_zero {_meshtastic_FileOperation_MIN, "", {0, {0}}, _meshtastic_FileStatus_MIN, "", 0, 0, 0}
|
||||
#define meshtastic_DirectoryListing_init_zero {"", 0, {"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""}, _meshtastic_FileStatus_MIN, "", 0, 0}
|
||||
#define meshtastic_I2CTransaction_init_zero {0, {0, {0}}, 0}
|
||||
#define meshtastic_SdCardInfo_init_zero {0, _meshtastic_SdCardInfo_CardType_MIN, _meshtastic_SdCardInfo_FatType_MIN, 0, 0, 0, 0, 0, 0}
|
||||
#define meshtastic_I2CResult_init_zero {_meshtastic_I2CResult_Status_MIN, {0, {0}}}
|
||||
#define meshtastic_InterdeviceMessage_init_zero {0, {""}, 0}
|
||||
|
||||
/* Field tags (for use in manual encoding/decoding) */
|
||||
#define meshtastic_SensorData_type_tag 1
|
||||
#define meshtastic_SensorData_float_value_tag 2
|
||||
#define meshtastic_SensorData_uint32_value_tag 3
|
||||
#define meshtastic_FileTransfer_operation_tag 1
|
||||
#define meshtastic_FileTransfer_filepath_tag 2
|
||||
#define meshtastic_FileTransfer_filedata_tag 3
|
||||
#define meshtastic_FileTransfer_status_tag 4
|
||||
#define meshtastic_FileTransfer_message_tag 5
|
||||
#define meshtastic_FileTransfer_offset_tag 6
|
||||
#define meshtastic_FileTransfer_length_tag 7
|
||||
#define meshtastic_FileTransfer_file_size_tag 8
|
||||
#define meshtastic_DirectoryListing_directory_tag 1
|
||||
#define meshtastic_DirectoryListing_filenames_tag 2
|
||||
#define meshtastic_DirectoryListing_status_tag 3
|
||||
#define meshtastic_DirectoryListing_message_tag 4
|
||||
#define meshtastic_DirectoryListing_offset_tag 5
|
||||
#define meshtastic_DirectoryListing_total_count_tag 6
|
||||
#define meshtastic_I2CTransaction_address_tag 1
|
||||
#define meshtastic_I2CTransaction_write_data_tag 2
|
||||
#define meshtastic_I2CTransaction_read_len_tag 3
|
||||
#define meshtastic_SdCardInfo_present_tag 1
|
||||
#define meshtastic_SdCardInfo_card_type_tag 2
|
||||
#define meshtastic_SdCardInfo_fat_type_tag 3
|
||||
#define meshtastic_SdCardInfo_card_size_tag 4
|
||||
#define meshtastic_SdCardInfo_used_bytes_tag 5
|
||||
#define meshtastic_SdCardInfo_free_bytes_tag 6
|
||||
#define meshtastic_SdCardInfo_stats_valid_tag 7
|
||||
#define meshtastic_SdCardInfo_busy_tag 8
|
||||
#define meshtastic_SdCardInfo_unformatted_tag 9
|
||||
#define meshtastic_I2CResult_status_tag 1
|
||||
#define meshtastic_I2CResult_read_data_tag 2
|
||||
#define meshtastic_InterdeviceMessage_nmea_tag 1
|
||||
#define meshtastic_InterdeviceMessage_sensor_tag 2
|
||||
#define meshtastic_InterdeviceMessage_beep_tag 2
|
||||
#define meshtastic_InterdeviceMessage_i2c_transaction_tag 3
|
||||
#define meshtastic_InterdeviceMessage_i2c_result_tag 4
|
||||
#define meshtastic_InterdeviceMessage_i2c_scan_tag 5
|
||||
#define meshtastic_InterdeviceMessage_i2c_scan_result_tag 6
|
||||
#define meshtastic_InterdeviceMessage_file_transfer_tag 7
|
||||
#define meshtastic_InterdeviceMessage_directory_listing_tag 8
|
||||
#define meshtastic_InterdeviceMessage_get_sd_info_tag 9
|
||||
#define meshtastic_InterdeviceMessage_sd_info_tag 10
|
||||
#define meshtastic_InterdeviceMessage_ping_tag 11
|
||||
#define meshtastic_InterdeviceMessage_pong_tag 12
|
||||
#define meshtastic_InterdeviceMessage_nack_tag 13
|
||||
#define meshtastic_InterdeviceMessage_sd_command_tag 14
|
||||
#define meshtastic_InterdeviceMessage_id_tag 15
|
||||
|
||||
/* Struct field encoding specification for nanopb */
|
||||
#define meshtastic_SensorData_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, UENUM, type, 1) \
|
||||
X(a, STATIC, ONEOF, FLOAT, (data,float_value,data.float_value), 2) \
|
||||
X(a, STATIC, ONEOF, UINT32, (data,uint32_value,data.uint32_value), 3)
|
||||
#define meshtastic_SensorData_CALLBACK NULL
|
||||
#define meshtastic_SensorData_DEFAULT NULL
|
||||
#define meshtastic_FileTransfer_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, UENUM, operation, 1) \
|
||||
X(a, STATIC, SINGULAR, STRING, filepath, 2) \
|
||||
X(a, STATIC, SINGULAR, BYTES, filedata, 3) \
|
||||
X(a, STATIC, SINGULAR, UENUM, status, 4) \
|
||||
X(a, STATIC, SINGULAR, STRING, message, 5) \
|
||||
X(a, STATIC, SINGULAR, UINT64, offset, 6) \
|
||||
X(a, STATIC, SINGULAR, UINT32, length, 7) \
|
||||
X(a, STATIC, SINGULAR, UINT64, file_size, 8)
|
||||
#define meshtastic_FileTransfer_CALLBACK NULL
|
||||
#define meshtastic_FileTransfer_DEFAULT NULL
|
||||
|
||||
#define meshtastic_DirectoryListing_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, STRING, directory, 1) \
|
||||
X(a, STATIC, REPEATED, STRING, filenames, 2) \
|
||||
X(a, STATIC, SINGULAR, UENUM, status, 3) \
|
||||
X(a, STATIC, SINGULAR, STRING, message, 4) \
|
||||
X(a, STATIC, SINGULAR, UINT32, offset, 5) \
|
||||
X(a, STATIC, SINGULAR, UINT32, total_count, 6)
|
||||
#define meshtastic_DirectoryListing_CALLBACK NULL
|
||||
#define meshtastic_DirectoryListing_DEFAULT NULL
|
||||
|
||||
#define meshtastic_I2CTransaction_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, UINT32, address, 1) \
|
||||
X(a, STATIC, SINGULAR, BYTES, write_data, 2) \
|
||||
X(a, STATIC, SINGULAR, UINT32, read_len, 3)
|
||||
#define meshtastic_I2CTransaction_CALLBACK NULL
|
||||
#define meshtastic_I2CTransaction_DEFAULT NULL
|
||||
|
||||
#define meshtastic_SdCardInfo_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, BOOL, present, 1) \
|
||||
X(a, STATIC, SINGULAR, UENUM, card_type, 2) \
|
||||
X(a, STATIC, SINGULAR, UENUM, fat_type, 3) \
|
||||
X(a, STATIC, SINGULAR, UINT64, card_size, 4) \
|
||||
X(a, STATIC, SINGULAR, UINT64, used_bytes, 5) \
|
||||
X(a, STATIC, SINGULAR, UINT64, free_bytes, 6) \
|
||||
X(a, STATIC, SINGULAR, BOOL, stats_valid, 7) \
|
||||
X(a, STATIC, SINGULAR, BOOL, busy, 8) \
|
||||
X(a, STATIC, SINGULAR, BOOL, unformatted, 9)
|
||||
#define meshtastic_SdCardInfo_CALLBACK NULL
|
||||
#define meshtastic_SdCardInfo_DEFAULT NULL
|
||||
|
||||
#define meshtastic_I2CResult_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, UENUM, status, 1) \
|
||||
X(a, STATIC, SINGULAR, BYTES, read_data, 2)
|
||||
#define meshtastic_I2CResult_CALLBACK NULL
|
||||
#define meshtastic_I2CResult_DEFAULT NULL
|
||||
|
||||
#define meshtastic_InterdeviceMessage_FIELDLIST(X, a) \
|
||||
X(a, STATIC, ONEOF, STRING, (data,nmea,data.nmea), 1) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (data,sensor,data.sensor), 2)
|
||||
X(a, STATIC, ONEOF, UINT32, (data,beep,data.beep), 2) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (data,i2c_transaction,data.i2c_transaction), 3) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (data,i2c_result,data.i2c_result), 4) \
|
||||
X(a, STATIC, ONEOF, BOOL, (data,i2c_scan,data.i2c_scan), 5) \
|
||||
X(a, STATIC, ONEOF, BYTES, (data,i2c_scan_result,data.i2c_scan_result), 6) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (data,file_transfer,data.file_transfer), 7) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (data,directory_listing,data.directory_listing), 8) \
|
||||
X(a, STATIC, ONEOF, BOOL, (data,get_sd_info,data.get_sd_info), 9) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (data,sd_info,data.sd_info), 10) \
|
||||
X(a, STATIC, ONEOF, UENUM, (data,ping,data.ping), 11) \
|
||||
X(a, STATIC, ONEOF, UENUM, (data,pong,data.pong), 12) \
|
||||
X(a, STATIC, ONEOF, BOOL, (data,nack,data.nack), 13) \
|
||||
X(a, STATIC, ONEOF, UENUM, (data,sd_command,data.sd_command), 14) \
|
||||
X(a, STATIC, SINGULAR, UINT32, id, 15)
|
||||
#define meshtastic_InterdeviceMessage_CALLBACK NULL
|
||||
#define meshtastic_InterdeviceMessage_DEFAULT NULL
|
||||
#define meshtastic_InterdeviceMessage_data_sensor_MSGTYPE meshtastic_SensorData
|
||||
#define meshtastic_InterdeviceMessage_data_i2c_transaction_MSGTYPE meshtastic_I2CTransaction
|
||||
#define meshtastic_InterdeviceMessage_data_i2c_result_MSGTYPE meshtastic_I2CResult
|
||||
#define meshtastic_InterdeviceMessage_data_file_transfer_MSGTYPE meshtastic_FileTransfer
|
||||
#define meshtastic_InterdeviceMessage_data_directory_listing_MSGTYPE meshtastic_DirectoryListing
|
||||
#define meshtastic_InterdeviceMessage_data_sd_info_MSGTYPE meshtastic_SdCardInfo
|
||||
|
||||
extern const pb_msgdesc_t meshtastic_SensorData_msg;
|
||||
extern const pb_msgdesc_t meshtastic_FileTransfer_msg;
|
||||
extern const pb_msgdesc_t meshtastic_DirectoryListing_msg;
|
||||
extern const pb_msgdesc_t meshtastic_I2CTransaction_msg;
|
||||
extern const pb_msgdesc_t meshtastic_SdCardInfo_msg;
|
||||
extern const pb_msgdesc_t meshtastic_I2CResult_msg;
|
||||
extern const pb_msgdesc_t meshtastic_InterdeviceMessage_msg;
|
||||
|
||||
/* Defines for backwards compatibility with code written before nanopb-0.4.0 */
|
||||
#define meshtastic_SensorData_fields &meshtastic_SensorData_msg
|
||||
#define meshtastic_FileTransfer_fields &meshtastic_FileTransfer_msg
|
||||
#define meshtastic_DirectoryListing_fields &meshtastic_DirectoryListing_msg
|
||||
#define meshtastic_I2CTransaction_fields &meshtastic_I2CTransaction_msg
|
||||
#define meshtastic_SdCardInfo_fields &meshtastic_SdCardInfo_msg
|
||||
#define meshtastic_I2CResult_fields &meshtastic_I2CResult_msg
|
||||
#define meshtastic_InterdeviceMessage_fields &meshtastic_InterdeviceMessage_msg
|
||||
|
||||
/* Maximum encoded size of messages (where known) */
|
||||
#define MESHTASTIC_MESHTASTIC_INTERDEVICE_PB_H_MAX_SIZE meshtastic_InterdeviceMessage_size
|
||||
#define meshtastic_InterdeviceMessage_size 1026
|
||||
#define meshtastic_SensorData_size 9
|
||||
#define meshtastic_DirectoryListing_size 4657
|
||||
#define meshtastic_FileTransfer_size 4646
|
||||
#define meshtastic_I2CResult_size 261
|
||||
#define meshtastic_I2CTransaction_size 271
|
||||
#define meshtastic_InterdeviceMessage_size 4666
|
||||
#define meshtastic_SdCardInfo_size 45
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
|
||||
@@ -121,7 +121,9 @@ typedef enum _meshtastic_TelemetrySensorType {
|
||||
/* ICM-42607-P 6‑Axis IMU */
|
||||
meshtastic_TelemetrySensorType_ICM42607P = 53,
|
||||
/* SPA06 pressure and temperature */
|
||||
meshtastic_TelemetrySensorType_SPA06 = 54
|
||||
meshtastic_TelemetrySensorType_SPA06 = 54,
|
||||
/* HM330X PM SENSOR */
|
||||
meshtastic_TelemetrySensorType_HM330X = 55
|
||||
} meshtastic_TelemetrySensorType;
|
||||
|
||||
/* Struct definitions */
|
||||
@@ -502,8 +504,8 @@ extern "C" {
|
||||
|
||||
/* Helper constants for enums */
|
||||
#define _meshtastic_TelemetrySensorType_MIN meshtastic_TelemetrySensorType_SENSOR_UNSET
|
||||
#define _meshtastic_TelemetrySensorType_MAX meshtastic_TelemetrySensorType_SPA06
|
||||
#define _meshtastic_TelemetrySensorType_ARRAYSIZE ((meshtastic_TelemetrySensorType)(meshtastic_TelemetrySensorType_SPA06+1))
|
||||
#define _meshtastic_TelemetrySensorType_MAX meshtastic_TelemetrySensorType_HM330X
|
||||
#define _meshtastic_TelemetrySensorType_ARRAYSIZE ((meshtastic_TelemetrySensorType)(meshtastic_TelemetrySensorType_HM330X+1))
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user