SIM_FlightAxis: add env variable for ip address

This commit is contained in:
Bob Long 2024-11-27 14:24:12 +11:00
parent 3a1faf6f54
commit fa0754bd90
1 changed files with 4 additions and 0 deletions

View File

@ -134,9 +134,13 @@ FlightAxis::FlightAxis(const char *frame_str) :
} }
const char *colon = strchr(frame_str, ':'); const char *colon = strchr(frame_str, ':');
const char *env = getenv("REALFLIGHT_IPADDR");
if (colon) { if (colon) {
controller_ip = colon+1; controller_ip = colon+1;
} }
else if (env) {
controller_ip = env;
}
for (uint8_t i=0; i<ARRAY_SIZE(sim_defaults); i++) { for (uint8_t i=0; i<ARRAY_SIZE(sim_defaults); i++) {
AP_Param::set_default_by_name(sim_defaults[i].name, sim_defaults[i].value); AP_Param::set_default_by_name(sim_defaults[i].name, sim_defaults[i].value);
if (sim_defaults[i].save) { if (sim_defaults[i].save) {