aboutsummaryrefslogtreecommitdiffstats
path: root/src/command.h
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2018-05-24 13:07:43 -0400
committerKevin O'Connor <kevin@koconnor.net>2018-05-28 10:43:39 -0400
commitc8af3feee6b35e33ab989ca8af0b48d738d4aedf (patch)
tree1a50e691bfe80403f38b7cec5c45f8171c7e8ae5 /src/command.h
parentcb4e165071ad56c4cf881f5221f02eeefde5de53 (diff)
downloadkutter-c8af3feee6b35e33ab989ca8af0b48d738d4aedf.tar.gz
kutter-c8af3feee6b35e33ab989ca8af0b48d738d4aedf.tar.xz
kutter-c8af3feee6b35e33ab989ca8af0b48d738d4aedf.zip
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 <kevin@koconnor.net>
Diffstat (limited to 'src/command.h')
-rw-r--r--src/command.h4
1 files changed, 3 insertions, 1 deletions
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);