OK so I have found the bug in celestrondriver.cpp, it's in the piece of code that sends the East or West to the Celestron mount (0 for east, 1 for west).
The code tests if the degrees passed to it are > 0 if they are it sends east to the mount, for my location degrees are 0 but minutes and seconds are not so the code should be if degrees are > or = to 0;
bool CelestronDriver::set_location(double longitude, double latitude)
{
LOGF_DEBUG("Setting location (%.3f,%.3f)", longitude, latitude);
// Convert from INDI standard to regular east/west -180 to 180
if (longitude > 180)
longitude -= 360;
int lat_d, lat_m, lat_s;
int long_d, long_m, long_s;
getSexComponents(latitude, &lat_d, &lat_m, &lat_s);
getSexComponents(longitude, &long_d, &long_m, &long_s);
char cmd[9];
cmd[0] = 'W';
cmd[1] = static_cast<char>(abs(lat_d));
cmd[2] = static_cast<char>(lat_m);
cmd[3] = static_cast<char>(lat_s);
cmd[4] = lat_d > 0 ? 0 : 1;
cmd[5] = static_cast<char>(abs(long_d)); // not sure how the conversion from int to char will work for longtitudes > 127
cmd[6] = static_cast<char>(long_m);
cmd[7] = static_cast<char>(long_s);
cmd[8] = long_d > 0 ? 0 : 1; //Error is here as in my case the degrees are 0 and the minutes are not, should be cmd[8] = long_d >= 0 ? 0 : 1;
set_sim_response("#");
return send_command(cmd, 9, response, 1, false, true);
}
How do I report this bug?
Ken