void XPlaneUDPClient::sendVEHX(int p, double dat_lat, double dat_lon, double dat_ele, float veh_psi_true, float veh_the, float veh_phi) {
char buf[45];
memset(buf,0, sizeof(buf));
strcpy(buf, "VEHX");
memcpy(buf + 5, &p, 4);
memcpy(buf + 9, &dat_lat, 8);
memcpy(buf + 17, &dat_lon, 8);
memcpy(buf + 25, &dat_ele, 8);
memcpy(buf + 33, &veh_psi_true, 4);
memcpy(buf + 37, &veh_the, 4);
memcpy(buf + 41, &veh_phi, 4);
sendto(sock, (void *) buf, sizeof(buf), 0, (struct sockaddr *) &serverAddr,
slen);
if (debug) {
cerr << "Sent datagram VEHX with value " << dat_lat << " " << dat_lon << " " << dat_ele << " "
<< veh_psi_true << " " << veh_the << " " << veh_phi << " to " << p << endl;
}
}
Hi,
what do you think about extending the library to also send other commands to X-Plane via UDP? I started with VEHX and would be happy, if you include it in your lib: