Эх сурвалжийг харах

Mark raw_req argument as const in modbus_send_raw_request (closes #479)

Stéphane Raimbault 5 жил өмнө
parent
commit
e4fb46fed7

+ 1 - 1
doc/modbus_send_raw_request.txt

@@ -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

+ 1 - 1
src/modbus.c

@@ -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];

+ 1 - 1
src/modbus.h

@@ -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);