I need to send and receive UDP packets from Teensy

424 views Asked by At

I have a communication diagram like

enter image description here

In this project, there is a udp communication between python code in linux os and teensy.Different sensors connected to teensy and teensy send the sensor datas to linux with udp.

I must send udp request to teensy to get sensor datas.

The person who wrote the code to run on Teensy wrote such a line for request and receive operations. Then there is information about the parameters. E.g;

Request

Start_Packet/Size_of_Packet/Communication_Type/Message_ID/Message/CRC16/End_Packet

Response

Start_Packet/Size_of_Packet/Communication_Type/Message_ID/Message/CRC16/End_Packet

Start_Packet: $

Size_of_Packet: Only message bytes length.

Communication_Types:

UNKNOWN_COMMUNICATION 0

CAN0 1

..

Message_ID: Packet number. Max: 100 if not response data message id = 0xFF

Message: Data to be send. Max: 18 bytes

CRC16: Before the CRC16 bytes will be calculated. CRC16_CCIT_ZERO http://www.sunshine2k.de/coding/javascript/crc/crc_js.html

End_Packet: #

I can not understand this request response lines. For example in python client, I sent the data as a string and server received. But in there, how should be request ?

0

There are 0 answers