/* This function sets the indicated error response code into the response frame. Then the routine is called to calculate the error check value.  */
static void mbs_exception_rsp(struct modbus_context *ctx, uint8_t excep_code)
/* This function sets the indicated error response code into the response frame. Then the routine is called to calculate the error check value.  */
static void mbs_exception_rsp(struct modbus_context *ctx, uint8_t excep_code)
{
	const uint8_t excep_bit = BIT(7);
	LOG_INF("FC 0x%02x Error 0x%02x", ctx->rx_adu.fc, excep_code);
	update_excep_ctr(ctx);
	ctx->tx_adu.fc |= excep_bit;
	ctx->tx_adu.data[0] = excep_code;
	ctx->tx_adu.length = 1;
}