Lines Matching refs:rx_adu
109 prx_data = &ctx->rx_adu.data[0]; in modbus_ascii_rx_adu()
133 hex2bin(pmsg, 2, &ctx->rx_adu.unit_id, 1); in modbus_ascii_rx_adu()
136 hex2bin(pmsg, 2, &ctx->rx_adu.fc, 1); in modbus_ascii_rx_adu()
141 ctx->rx_adu.length = 0; in modbus_ascii_rx_adu()
148 ctx->rx_adu.length++; in modbus_ascii_rx_adu()
153 ctx->rx_adu.crc = frame_lrc; in modbus_ascii_rx_adu()
257 ctx->rx_adu.unit_id = cfg->uart_buf[0]; in modbus_rtu_rx_adu()
258 ctx->rx_adu.fc = cfg->uart_buf[1]; in modbus_rtu_rx_adu()
261 ctx->rx_adu.length = cfg->uart_buf_ctr - 4; in modbus_rtu_rx_adu()
265 memcpy(ctx->rx_adu.data, data_ptr, ctx->rx_adu.length); in modbus_rtu_rx_adu()
267 ctx->rx_adu.crc = sys_get_le16(&cfg->uart_buf[crc_idx]); in modbus_rtu_rx_adu()
270 cfg->uart_buf_ctr - sizeof(ctx->rx_adu.crc)); in modbus_rtu_rx_adu()
272 if (ctx->rx_adu.crc != calc_crc) { in modbus_rtu_rx_adu()