From e820138748013cada5e47d7e1249a6e36d2797ce Mon Sep 17 00:00:00 2001 From: Martin Cooper Date: Mon, 9 Sep 2019 17:54:51 -0700 Subject: [PATCH] Don't send EasyComm I commands to EasyComm II rotators. When setting position, an EasyComm I command sequence was being sent to EasyComm II controllers. Since this sequence is not valid for EasyComm II, controllers were forced to implement the older format to work with rotctl. Instead, send the EasyComm I command sequence only to EasyComm I controllers, and send a valid sequence to EasyComm II controllers. --- easycomm/easycomm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/easycomm/easycomm.c b/easycomm/easycomm.c index 0d1f67b12..e06965ce1 100644 --- a/easycomm/easycomm.c +++ b/easycomm/easycomm.c @@ -93,7 +93,12 @@ easycomm_rot_set_position(ROT *rot, azimuth_t az, elevation_t el) int retval; rig_debug(RIG_DEBUG_TRACE, "%s called: %f %f\n", __FUNCTION__, az, el); - sprintf(cmdstr, "AZ%.1f EL%.1f UP000 XXX DN000 XXX\n", az, el); + if (rot->caps->rot_model == ROT_MODEL_EASYCOMM1) { + sprintf(cmdstr, "AZ%.1f EL%.1f UP000 XXX DN000 XXX\n", az, el); + } + else { // for easycomm 2 & 3 and upwards + sprintf(cmdstr, "AZ%.1f EL%.1f\n", az, el); + } retval = easycomm_transaction(rot, cmdstr, NULL, 0); if (retval != RIG_OK) { return retval;