#include "modbus-tcp.h" #include char tcp_buffer[1024]; #define MAX_REG 250 char registers[MAX_REG]; static err_t modbus_incomming_data(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err){ int i; int len; char *pc; uint8_t bg_red = 0; uint8_t bg_green = 0; uint8_t bg_blue = 0; uint8_t txt_red = 0; uint8_t txt_green = 0; uint8_t txt_blue = 0; uint8_t nr_img = 0; char text[200]; for(i = 0; i < 100;i++){ text[i] = 95; // _ } if (p != NULL){ printf("data not null\n"); //here im going to procces the modbusdata tcp_recved( pcb, p->tot_len ); pc = (char*)p->payload; len =p->tot_len; //putting the bufer in the register array for( i=0; i