RPC: Add data field to ping request & response (#836)

* Update protobuf
* Send ping data back
* Add check for has_next, more readability
* Fix nullptr dereference

Co-authored-by: Tony Freeman <tonyfreeman@users.noreply.github.com>
Co-authored-by: Albert Kharisov <albkharisov@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
tonyfreeman
2021-11-23 11:30:54 +03:00
committed by GitHub
parent 949079cb74
commit e54e4a6d77
4 changed files with 29 additions and 14 deletions
+12 -10
View File
@@ -11,11 +11,11 @@
/* Struct definitions */
typedef struct _PB_Status_PingRequest {
char dummy_field;
pb_bytes_array_t *data;
} PB_Status_PingRequest;
typedef struct _PB_Status_PingResponse {
char dummy_field;
pb_bytes_array_t *data;
} PB_Status_PingResponse;
@@ -24,21 +24,23 @@ extern "C" {
#endif
/* Initializer values for message structs */
#define PB_Status_PingRequest_init_default {0}
#define PB_Status_PingResponse_init_default {0}
#define PB_Status_PingRequest_init_zero {0}
#define PB_Status_PingResponse_init_zero {0}
#define PB_Status_PingRequest_init_default {NULL}
#define PB_Status_PingResponse_init_default {NULL}
#define PB_Status_PingRequest_init_zero {NULL}
#define PB_Status_PingResponse_init_zero {NULL}
/* Field tags (for use in manual encoding/decoding) */
#define PB_Status_PingRequest_data_tag 1
#define PB_Status_PingResponse_data_tag 1
/* Struct field encoding specification for nanopb */
#define PB_Status_PingRequest_FIELDLIST(X, a) \
X(a, POINTER, SINGULAR, BYTES, data, 1)
#define PB_Status_PingRequest_CALLBACK NULL
#define PB_Status_PingRequest_DEFAULT NULL
#define PB_Status_PingResponse_FIELDLIST(X, a) \
X(a, POINTER, SINGULAR, BYTES, data, 1)
#define PB_Status_PingResponse_CALLBACK NULL
#define PB_Status_PingResponse_DEFAULT NULL
@@ -50,8 +52,8 @@ extern const pb_msgdesc_t PB_Status_PingResponse_msg;
#define PB_Status_PingResponse_fields &PB_Status_PingResponse_msg
/* Maximum encoded size of messages (where known) */
#define PB_Status_PingRequest_size 0
#define PB_Status_PingResponse_size 0
/* PB_Status_PingRequest_size depends on runtime parameters */
/* PB_Status_PingResponse_size depends on runtime parameters */
#ifdef __cplusplus
} /* extern "C" */