The python script snippet below connects to the udp data stream (socket 5606). It the retrieves and stores the package into a large string (data) . then I can unpack out the required data from the string i need.
Im trying to convert this over to AppGameKit Ive made some attempts but not getting anywhere.
When I looked at the reference guide it seems the functions are there but i believe im using it completely wrong.
Is there any way I can adapt this code into a working AppGameKit format, or am i barking up the wrong tree?
the original project (which works very well) is an extra dash for Project cars 1 & 2. It receive the telemetry data sent by the game and creates a speedo , rev counter , split times , lap times etc. I made it initially on my raspberry pi so python was Ideal.
Ther are some friends in my racing comunity would like me to do a similar app for android. I originally looked at kivy but the build process is always hit and miss, so i wanted to try something more stable.
import socket
import struct
UDP_IP_ADDRESS = "0.0.0.0"
UDP_PORT_NO = 5606
serverSock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
serverSock.bind((UDP_IP_ADDRESS, UDP_PORT_NO))
while True
data, addr = serverSock.recvfrom(1367)
if data is not None:
package_type=struct.unpack('B', package[2:3])[0] & 0x3