Fix integration test found by CI! verstr field was too short

This commit is contained in:
Kevin Hester
2021-04-16 11:51:04 +08:00
parent 568032cbc7
commit 405f7e0caa
7 changed files with 19 additions and 16 deletions

View File

@@ -125,7 +125,7 @@ extern const pb_msgdesc_t ChannelFile_msg;
/* Maximum encoded size of messages (where known) */
#define LegacyRadioConfig_size 4
#define LegacyRadioConfig_LegacyPreferences_size 2
#define DeviceState_size 5184
#define DeviceState_size 5190
#define ChannelFile_size 832
#ifdef __cplusplus

View File

@@ -107,7 +107,7 @@ typedef struct _MyNodeInfo {
uint32_t num_bands;
char region[12];
char hw_model_deprecated[16];
char firmware_version[12];
char firmware_version[18];
CriticalErrorCode error_code;
uint32_t error_address;
uint32_t error_count;
@@ -495,7 +495,7 @@ extern const pb_msgdesc_t ToRadio_PeerInfo_msg;
#define Data_size 260
#define MeshPacket_size 309
#define NodeInfo_size 133
#define MyNodeInfo_size 95
#define MyNodeInfo_size 101
#define LogRecord_size 81
#define FromRadio_size 318
#define ToRadio_size 312

View File

@@ -18,7 +18,7 @@ size_t pb_encode_to_bytes(uint8_t *destbuf, size_t destbufsize, const pb_msgdesc
pb_ostream_t stream = pb_ostream_from_buffer(destbuf, destbufsize);
if (!pb_encode(&stream, fields, src_struct)) {
DEBUG_MSG("Panic: can't encode protobuf %s, did you make a field too large?\n", PB_GET_ERROR(&stream));
DEBUG_MSG("Panic: can't encode protobuf reason='%s', reason=%s\n", PB_GET_ERROR(&stream));
assert(0); // If this asser fails it probably means you made a field too large for the max limits specified in mesh.options
} else {
return stream.bytes_written;
@@ -30,7 +30,7 @@ bool pb_decode_from_bytes(const uint8_t *srcbuf, size_t srcbufsize, const pb_msg
{
pb_istream_t stream = pb_istream_from_buffer(srcbuf, srcbufsize);
if (!pb_decode(&stream, fields, dest_struct)) {
DEBUG_MSG("Error: can't decode protobuf %s, pb_msgdesc 0x%p\n", PB_GET_ERROR(&stream), fields);
DEBUG_MSG("Error: can't decode protobuf reason='%s', pb_msgdesc 0x%p, reason=%s\n", PB_GET_ERROR(&stream), fields);
return false;
} else {
return true;