Skip to content

Commit

Permalink
Refactor to match the new INDI style properties
Browse files Browse the repository at this point in the history
  • Loading branch information
AvalonService committed Nov 23, 2023
1 parent 925b2fd commit 1b1206f
Show file tree
Hide file tree
Showing 7 changed files with 590 additions and 577 deletions.
9 changes: 6 additions & 3 deletions indi-avalonud/README
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ How to Use

$ indiserver indi_avalonud_telescope indi_avalonud_focuser indi_avalonud_aux

You can then connect to the driver from any client.
If you're using KStars, the driver will be automatically listed in KStars' Device Manager
You can then connect to the drivers from any client.
If you're using KStars, the drivers will be automatically listed in KStars' Device Manager
and the only configuration required is to enter the controller IP address in the Connection tab
of the driver before connecting.
of each driver before connecting.

The drivers sonnects to ports 5450 and 5451 on the controller.

451 changes: 229 additions & 222 deletions indi-avalonud/indi_avalonud_aux.cpp

Large diffs are not rendered by default.

126 changes: 57 additions & 69 deletions indi-avalonud/indi_avalonud_aux.h
Original file line number Diff line number Diff line change
@@ -1,28 +1,21 @@
/*
Skeleton Focuser Driver
Avalon Unified Driver Aux
Modify this driver when developing new absolute position
based focusers. This driver uses serial communication by default
but it can be changed to use networked TCP/UDP connection as well.
Copyright (C) 2020,2023
Copyright(c) 2019 Jasem Mutlaq. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
Thanks to Rigel Systems, especially Gene Nolan and Leon Palmer,
for their support in writing this driver.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#pragma once
Expand All @@ -39,8 +32,6 @@ class AUDAUX : public INDI::DefaultDevice
AUDAUX();
~AUDAUX();

virtual bool Handshake();

virtual bool Connect();
virtual bool Disconnect();

Expand All @@ -64,53 +55,50 @@ class AUDAUX : public INDI::DefaultDevice
int tid;
unsigned int features;

IText ConfigT[1];
ITextVectorProperty ConfigTP;

IText LowLevelSWT[2];
ITextVectorProperty LowLevelSWTP;

IText HWTypeT[1];
ITextVectorProperty HWTypeTP;

IText HWIdentifierT[1];
ITextVectorProperty HWIdentifierTP;

ISwitch SystemManagementS[2];
ISwitchVectorProperty SystemManagementSP;

INumber OUTPortPWMDUTYCYCLEN[1];
INumberVectorProperty OUTPortPWMDUTYCYCLENP;

ISwitch OUTPortPWMS[2];
ISwitchVectorProperty OUTPortPWMSP;

ISwitch OUTPort1S[2];
ISwitchVectorProperty OUTPort1SP;

ISwitch OUTPort2S[2];
ISwitchVectorProperty OUTPort2SP;

ISwitch USBPort1S[2];
ISwitchVectorProperty USBPort1SP;

ISwitch USBPort2S[2];
ISwitchVectorProperty USBPort2SP;

ISwitch USBPort3S[2];
ISwitchVectorProperty USBPort3SP;

ISwitch USBPort4S[2];
ISwitchVectorProperty USBPort4SP;

INumber PSUN[4];
INumberVectorProperty PSUNP;

INumber SMN[3];
INumberVectorProperty SMNP;

INumber CPUN[1];
INumberVectorProperty CPUNP;
INDI::PropertyText ConfigTP {1};
enum {
LLSW_NAME,
LLSW_VERSION,
LLSW_N
};
INDI::PropertyText LowLevelSWTP {LLSW_N};
INDI::PropertyText HWTypeTP {1};
INDI::PropertyText HWIdentifierTP {1};
enum {
SMNT_SHUTDOWN,
SMNT_REBOOT,
SMNT_N
};
INDI::PropertySwitch SystemManagementSP {SMNT_N};
INDI::PropertyNumber OUTPortPWMDUTYCYCLENP {1};
enum {
POWER_ON,
POWER_OFF,
POWER_N
};
INDI::PropertySwitch OUTPortPWMSP {POWER_N};
INDI::PropertySwitch OUTPort1SP {POWER_N};
INDI::PropertySwitch OUTPort2SP {POWER_N};
INDI::PropertySwitch USBPort1SP {POWER_N};
INDI::PropertySwitch USBPort2SP {POWER_N};
INDI::PropertySwitch USBPort3SP {POWER_N};
INDI::PropertySwitch USBPort4SP {POWER_N};
enum {
PSU_VOLTAGE,
PSU_CURRENT,
PSU_POWER,
PSU_CHARGE,
PSU_N
};
INDI::PropertyNumber PSUNP {PSU_N};
enum {
SM_FEEDTIME,
SM_BUFFERLOAD,
SM_UPTIME,
SM_N
};
INDI::PropertyNumber SMNP {SM_N};
INDI::PropertyNumber CPUNP {1};

bool readStatus();

Expand Down
Loading

0 comments on commit 1b1206f

Please sign in to comment.