Sir,
The packet definition is fine for normal generic multi-transport use.
if you want to use TCP then on the receive side you want to read packet
in either of the 2 ways below:
1. Just read to parse a header number of bytes, if packet valid read the
number of data bytes + CRC, then process
A simple protocol I often use is a header/data system like:
//header
uint8_t flag; //number that is start of packet
uint8_t version; //protocol version number or type of packet
uint32_t bytes; //number of bytes in data packet
uint32_t headerCRC; //CRC of the header
//Data packet
uint8_t
/**
* @file
*
* lwIP Options Configuration
*/
/*
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
modification,
* are permitted provided that the following conditions are met:
*
On 21/12/2019 08:53, goldsimon wrote:
>
> Urvi wrote:
>> [..]
>>
>> But when I send 1 data packet of size=6 bytes (call tcp_write() and
>> then
>> tcp_output()) and next packet of size=45 bytes (call tcp_write() and
>> then
>> tcp_output()), then at server side it receives as a one single data
>>
I use an STM32F407 and LWIP and support a Modbus TCP client and Web Server
simultaneously as well as an MQTT server. I suspect you have a configuration
issue. Check to see the number of Sockets LWIP is configured to support. In my
configuration I am very resource constrained and had to
check the maximum number of simultaneous TCP connections you have
configured for LWIP.
On Sat, Dec 21, 2019 at 5:06 AM MrFord wrote:
> Hi everyone. I have stm32f767zi and the lwip / socket library. I have a
> task.
> The first is to read data from the device via modbus TCP. The second is
>
Hi everyone. I have stm32f767zi and the lwip / socket library. I have a task.
The first is to read data from the device via modbus TCP. The second is data
output to a web browser. That is, the tcp client and the tcp server must be
running on the device at the same time. The problem is that when
Urvi wrote:
>[..]
>
>But when I send 1 data packet of size=6 bytes (call tcp_write() and
>then
>tcp_output()) and next packet of size=45 bytes (call tcp_write() and
>then
>tcp_output()), then at server side it receives as a one single data
>packet
>of size=51 bytes; due to this my complete data