|
|
|
@ -31,9 +31,6 @@
@@ -31,9 +31,6 @@
|
|
|
|
|
|
|
|
|
|
extern const AP_HAL::HAL& hal; |
|
|
|
|
|
|
|
|
|
#define FLIGHTAXIS_SERVER_IP "192.168.2.48" |
|
|
|
|
#define FLIGHTAXIS_SERVER_PORT 18083 |
|
|
|
|
|
|
|
|
|
namespace SITL { |
|
|
|
|
|
|
|
|
|
// the asprintf() calls are not worth checking for SITL
|
|
|
|
@ -46,6 +43,10 @@ FlightAxis::FlightAxis(const char *home_str, const char *frame_str) :
@@ -46,6 +43,10 @@ FlightAxis::FlightAxis(const char *home_str, const char *frame_str) :
|
|
|
|
|
rate_hz = 250 / target_speedup; |
|
|
|
|
heli_demix = strstr(frame_str, "helidemix") != NULL; |
|
|
|
|
rev4_servos = strstr(frame_str, "rev4") != NULL; |
|
|
|
|
const char *colon = strchr(frame_str, ':'); |
|
|
|
|
if (colon) { |
|
|
|
|
controller_ip = colon+1; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
@ -87,7 +88,7 @@ char *FlightAxis::soap_request(const char *action, const char *fmt, ...)
@@ -87,7 +88,7 @@ char *FlightAxis::soap_request(const char *action, const char *fmt, ...)
|
|
|
|
|
|
|
|
|
|
// open SOAP socket to FlightAxis
|
|
|
|
|
SocketAPM sock(false); |
|
|
|
|
if (!sock.connect(FLIGHTAXIS_SERVER_IP, FLIGHTAXIS_SERVER_PORT)) { |
|
|
|
|
if (!sock.connect(controller_ip, controller_port)) { |
|
|
|
|
free(req1); |
|
|
|
|
return nullptr; |
|
|
|
|
} |
|
|
|
@ -151,7 +152,7 @@ Connection: Keep-Alive
@@ -151,7 +152,7 @@ Connection: Keep-Alive
|
|
|
|
|
void FlightAxis::exchange_data(const struct sitl_input &input) |
|
|
|
|
{ |
|
|
|
|
if (!controller_started) { |
|
|
|
|
printf("Starting controller\n"); |
|
|
|
|
printf("Starting controller at %s\n", controller_ip); |
|
|
|
|
// call a restore first. This allows us to connect after the aircraft is changed in RealFlight
|
|
|
|
|
char *reply = soap_request("RestoreOriginalControllerDevice", R"(<?xml version='1.0' encoding='UTF-8'?> |
|
|
|
|
<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
|
|
|
|
|