diff --git a/project/Core/Src/modbus-tcp.c b/project/Core/Src/modbus-tcp.c index d3f4c44..547799d 100644 --- a/project/Core/Src/modbus-tcp.c +++ b/project/Core/Src/modbus-tcp.c @@ -1,25 +1,28 @@ #include "modbus-tcp.h" #include -#include char tcp_buffer[1024]; -#define MAX_REG 25 +#define MAX_REG 100 uint16_t registers[MAX_REG]; static err_t modbus_incomming_data(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err){ - u16_t len; + int i; + int len; + char pc; if (p != NULL){ printf("data not null\n"); //here im going to procces the modbusdata - len = p->tot_len; + tcp_recved( pcb, p->tot_len ); + pc = (char)p->payload; + len =p->tot_len; //putting the bufer in the register array - for(int i=0; ipayload[i];//getting the error "void value not ignored as it ought to be" on this line + for( i=0; i