Comments (2)
Hi @CYG01571 looks the packet points (nx_packet_prepend_ptr, etc) are not set correctly, here is my sample how to send data, could you update your code and test again?
VOID tftp_send(UCHAR *data_ptr, UINT data_size)
{
NX_PACKET *my_packet;
UINT status;
UINT packet_length;
ULONG i;
/* Loop to send the data. */
send_data_length = 0;
while(send_data_length < data_size)
{
/* Allocate a TFTP packet. */
status = nx_tftp_client_packet_allocate(&client_pool, &my_packet, NX_IP_PERIODIC_RATE);
/* Check status. */
if (status)
{
printf("ERROR");
break;
}
/* Write ABCs into the packet payload! */
if (send_data_length + 512 < data_size)
packet_length = 512;
else
packet_length = data_size - send_data_length;
/* Write ABCs into the packet payload! */
status = nx_packet_data_append(my_packet, buffer + send_data_length, packet_length, &client_pool, NX_IP_PERIODIC_RATE);
/* Check status. */
if (status)
{
printf("ERROR");
nx_packet_release(my_packet);
break;
}
/* Write this packet to the file via TFTP. */
status = nx_tftp_client_file_write(&client, my_packet, NX_IP_PERIODIC_RATE);
/* Check status. */
if (status)
{
printf("ERROR");
break;
}
send_data_length += packet_length;
}
}
from netxduo.
Dear bo-ms,
Thank you for your quickly response!
I resolved this issue for your advice.
I could send a large file to TFTP server!
Your advice was very useful because I didn't notice a thing that I should use nx_packet_data_append() API.
Best Regards.
from netxduo.
Related Issues (20)
- TLS crypto method "NX_CRYPTO_NONE" issue
- Tcp socket receive problem for large messages HOT 4
- DNS cleint at non-blocking mode
- Missing include guards
- Wrong type across netxduo and threadx
- crypto hardware acceleration support HOT 15
- Inconsistent types across files
- NX_BSD_TIMEOUT_PROCESS_IN_TIMER
- CoAP addon HOT 1
- ULONG64 definition failing for rx architecture
- PPP LCP Negotiation stops at state 4.
- BSD addon fails to compile HOT 3
- BSD socket create failed!
- Deployment in Device Update for IoT Hub is Failed with NETX DUO 6.4.1 HOT 3
- Improper handled of out of order packets in case Application connection restarts in multiple loop HOT 3
- http(s) client: how to download a big file chunk by chunk ? HOT 1
- DHCPv6 Server instance sends IPv6 response packets on incorrect index when DHCPv6 Client and DHCPv6 Server are brought up simultaneously
- Module (DHCPv6 Client) is getting a new IPv6 address each time we disconnect and reconnect from the Home Wi-Fi
- Can NETX DHCPv6 support simultaneous DHCPv6 Client & DHCPv6 Server on two interfaces?
- NetX BSD fails when select() is passed a timeout
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from netxduo.