/* Write an UDS response on the output channel. */
static int write_response(struct upgrade_uds_t *self_p, int32_t length, uint8_t code)
/* Write an UDS response on the output channel. */
static int write_response(struct upgrade_uds_t *self_p, int32_t length, uint8_t code)
{
    length = htonl(length + 1);
    chan_write(self_p->chout_p, &length, sizeof(length));
    chan_write(self_p->chout_p, &code, sizeof(code));
    return (0);
}