The udpinit_thread:

• ที่นี่ก่อนอื่นเราจะสร้าง a new
netconn connection.
NETCONN_UDP argument จะสร้าง a UDP connection.
• ถัดไปเราจะ
ผูก the connection เข้ากับ available IP address ใดๆ(อันที่คุณตั้งค่าใน the cubeMX)และ the Port 7. นี้จะทำหน้าที่
เป็น the IP and port ของ the Client.
• ถ้า the bind สำเร็จ, เราจะต่อถึง the server. ที่นี่ the destination IP คือ the IP of the server (computer), และ the port
คือ port of the server.
• จากนั้นเราจะรับ the data จาก the server. The
netconn_recv function จะรอจนกว่า the data ถูกรับ.
• เนื่องจากนี่เป็นเพียงบทแนะนำการทดสอบเท่านั้น เราจะแก้ไข message นี้, และจัดเก็บมันไว้ใน
smgs เพื่อให้เราสามารถส่งมันกลับไปยัง
server.
• ถัดไปเราจะเรียก the
udpsend function เพื่อส่ง the data กลับไปยัง the server.
• สุดท้ายลบ the
netbuf