From 9da1b6ada41e5c2247e932d4c0d1f33a3ad23a66 Mon Sep 17 00:00:00 2001 From: Stéphane Raimbault Date: Tue, 12 Apr 2011 22:13:57 +0200 Subject: [PATCH] Rename req_* variables to msg_* in send_msg() --- src/modbus.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/modbus.c b/src/modbus.c index 376f4fb..e1eb586 100644 --- a/src/modbus.c +++ b/src/modbus.c @@ -140,23 +140,23 @@ static unsigned int compute_response_length_from_request(modbus_t *ctx, uint8_t } /* Sends a request/response */ -static int send_msg(modbus_t *ctx, uint8_t *req, int req_length) +static int send_msg(modbus_t *ctx, uint8_t *msg, int msg_length) { int rc; int i; - req_length = ctx->backend->send_msg_pre(req, req_length); + msg_length = ctx->backend->send_msg_pre(msg, msg_length); if (ctx->debug) { - for (i = 0; i < req_length; i++) - printf("[%.2X]", req[i]); + for (i = 0; i < msg_length; i++) + printf("[%.2X]", msg[i]); printf("\n"); } /* In recovery mode, the write command will be issued until to be successful! Disabled by default. */ do { - rc = ctx->backend->send(ctx, req, req_length); + rc = ctx->backend->send(ctx, msg, msg_length); if (rc == -1) { _error_print(ctx, NULL); if (ctx->error_recovery && @@ -167,7 +167,7 @@ static int send_msg(modbus_t *ctx, uint8_t *req, int req_length) } } while (ctx->error_recovery && rc == -1); - if (rc > 0 && rc != req_length) { + if (rc > 0 && rc != msg_length) { errno = EMBBADDATA; return -1; } -- libgit2 0.21.4