From c8af3feee6b35e33ab989ca8af0b48d738d4aedf Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Thu, 24 May 2018 13:07:43 -0400 Subject: command: Add a command_encode_and_frame() helper Add a helper function that calls command_encodef() followed by command_add_frame(). Signed-off-by: Kevin O'Connor --- src/command.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/command.h') diff --git a/src/command.h b/src/command.h index dd960cdf..2dd195ea 100644 --- a/src/command.h +++ b/src/command.h @@ -65,8 +65,10 @@ uint8_t *command_parsef(uint8_t *p, uint8_t *maxend , const struct command_parser *cp, uint32_t *args); uint_fast8_t command_encodef(uint8_t *buf, const struct command_encoder *ce , va_list args); -void command_sendf(const struct command_encoder *ce, ...); void command_add_frame(uint8_t *buf, uint_fast8_t msglen); +uint_fast8_t command_encode_and_frame( + uint8_t *buf, const struct command_encoder *ce, va_list args); +void command_sendf(const struct command_encoder *ce, ...); int_fast8_t command_find_block(uint8_t *buf, uint_fast8_t buf_len , uint_fast8_t *pop_count); void command_dispatch(uint8_t *buf, uint_fast8_t msglen); -- cgit v1.2.3-70-g09d2