Hi,
I'm working on an INDI client for android. It uses the INDI for java library which behaves differently with the switch vectors and this causes different bugs. I'm trying to correct the Indi for Java behavior but I don't understand some things in the INDI API.
Here is an extract of the communication between Ekos and an indiserver running indi_lx200classic in simulation mode. I switch on and off the north button.
Sent by the client (switching on):
<newSwitchVector device="LX200 Classic" name="TELESCOPE_MOTION_NS">
<oneSwitch name="MOTION_NORTH">
On
</oneSwitch>
</newSwitchVector>
Answer from the driver:
<setSwitchVector device="LX200 Classic" name="TELESCOPE_MOTION_NS" state="Busy" timeout="60" timestamp="2014-08-06T20:12:53" message="Moving toward North.">
<oneSwitch name="MOTION_NORTH">
On
</oneSwitch>
<oneSwitch name="MOTION_SOUTH">
Off
</oneSwitch>
</setSwitchVector>
Then I switch off the north button:
<newSwitchVector device="LX200 Classic" name="TELESCOPE_MOTION_NS">
<oneSwitch name="MOTION_NORTH">
On
</oneSwitch>
</newSwitchVector>
<setSwitchVector device="LX200 Classic" name="TELESCOPE_MOTION_NS" state="Idle" timeout="60" timestamp="2014-08-06T20:12:56" message="Movement toward North halted.">
<oneSwitch name="MOTION_NORTH">
Off
</oneSwitch>
<oneSwitch name="MOTION_SOUTH">
Off
</oneSwitch>
</setSwitchVector>
It seems a bit strange to send the command newSwitchVector with the value On to turn Off the switch. An other strange thing I noticed is that all the switch vectors are defined with the OneOfMany rule even if all the switchs are off in normal operation (ie. north/south, west/east, abort motion). The AtMostOne rule seems more appropriated for those.
Why it is like this ? What should be the correct implementation for the driver and the client ?
Romain