From 3fffb7958319926bef860b59d7e8c6b2fcdaf15f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Soja?= Date: Sun, 28 Jul 2024 11:13:28 +0200 Subject: [PATCH] Feature - ZWO AM5 Buzzer setup (#2087) --- drivers.xml | 4 ++-- drivers/telescope/lx200am5.cpp | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers.xml b/drivers.xml index 5e39bb5919..a0179aba2d 100644 --- a/drivers.xml +++ b/drivers.xml @@ -81,11 +81,11 @@ indi_lx200am5 - 1.1 + 1.2 indi_lx200am5 - 1.1 + 1.2 indi_celestron_gps diff --git a/drivers/telescope/lx200am5.cpp b/drivers/telescope/lx200am5.cpp index 1264bf9822..6786283001 100644 --- a/drivers/telescope/lx200am5.cpp +++ b/drivers/telescope/lx200am5.cpp @@ -35,7 +35,7 @@ LX200AM5::LX200AM5() { - setVersion(1, 1); + setVersion(1, 2); setLX200Capability(LX200_HAS_PULSE_GUIDING); @@ -106,6 +106,17 @@ bool LX200AM5::initProperties() BuzzerSP[Low].fill("LOW", "Low", ISS_OFF); BuzzerSP[High].fill("HIGH", "High", ISS_ON); BuzzerSP.fill(getDeviceName(), "BUZZER", "Buzzer", OPTIONS_TAB, IP_RW, ISR_1OFMANY, 60, IPS_IDLE); + BuzzerSP.onUpdate([this]{ + if (setBuzzer(BuzzerSP.findOnSwitchIndex())) + { + BuzzerSP.setState(IPState::IPS_OK); + } + else + { + BuzzerSP.setState(IPState::IPS_ALERT); + } + BuzzerSP.apply(); + }); return true; } @@ -342,7 +353,7 @@ bool LX200AM5::getTrackMode() bool LX200AM5::setBuzzer(int value) { char command[DRIVER_LEN] = {0}; - snprintf(command, DRIVER_LEN, ":SBu%d", value); + snprintf(command, DRIVER_LEN, ":SBu%d#", value); return sendCommand(command); }