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>
This commit is contained in:
@@ -176,8 +176,7 @@ console_sendf(const struct command_encoder *ce, va_list args)
|
||||
{
|
||||
// Generate message
|
||||
uint8_t buf[MESSAGE_MAX];
|
||||
uint_fast8_t msglen = command_encodef(buf, ce, args);
|
||||
command_add_frame(buf, msglen);
|
||||
uint_fast8_t msglen = command_encode_and_frame(buf, ce, args);
|
||||
|
||||
// Transmit message
|
||||
int ret = write(main_pfd[MP_TTY_IDX].fd, buf, msglen);
|
||||
|
Reference in New Issue
Block a user