I have a list contains hex values. I want to send this list over UDP socket and in the other end C program will receive it. So the list should be converted to bytes and send over socket.
I tried the below code:
frames_to_send = [0x00, 0x01, 0x02, 0x03, 0x05]
UDPServerSocket.sendto(bytearray(frames_to_send), ("127.0.0.1", 5555))
it gives me the following error:
Exception has occurred: TypeError
'bytes' object cannot be interpreted as an integer
If I send string over socket, the client application is receiving, so my server client program is working fine... I need guidance on how to send binary data which is list as hex.
sendto. Maybe you have problem in different place - i.e. inrecvfromor when you try to use received data as integer. Full error message (which you didn't show) should show where exactly you have problem.