Skip to content

Enhancement: send VEHX (and maybe other) commands to X-Plane #3

Description

@HellGL

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:


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;
    }

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions