Skip to content

Commit

Permalink
Mark raw_req argument as const in modbus_send_raw_request (closes #479)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephane committed Jul 29, 2019
1 parent ca3fcb1 commit e4fb46f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doc/modbus_send_raw_request.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ modbus_send_raw_request - send a raw request

SYNOPSIS
--------
*int modbus_send_raw_request(modbus_t *'ctx', uint8_t *'raw_req', int 'raw_req_length');*
*int modbus_send_raw_request(modbus_t *'ctx', const uint8_t *'raw_req', int 'raw_req_length');*


DESCRIPTION
Expand Down
2 changes: 1 addition & 1 deletion src/modbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ static int send_msg(modbus_t *ctx, uint8_t *msg, int msg_length)
return rc;
}

int modbus_send_raw_request(modbus_t *ctx, uint8_t *raw_req, int raw_req_length)
int modbus_send_raw_request(modbus_t *ctx, const uint8_t *raw_req, int raw_req_length)
{
sft_t sft;
uint8_t req[MAX_MESSAGE_LENGTH];
Expand Down
2 changes: 1 addition & 1 deletion src/modbus.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ MODBUS_API modbus_mapping_t* modbus_mapping_new(int nb_bits, int nb_input_bits,
int nb_registers, int nb_input_registers);
MODBUS_API void modbus_mapping_free(modbus_mapping_t *mb_mapping);

MODBUS_API int modbus_send_raw_request(modbus_t *ctx, uint8_t *raw_req, int raw_req_length);
MODBUS_API int modbus_send_raw_request(modbus_t *ctx, const uint8_t *raw_req, int raw_req_length);

MODBUS_API int modbus_receive(modbus_t *ctx, uint8_t *req);

Expand Down

0 comments on commit e4fb46f

Please sign in to comment.