Instrument Neutral Distributed Interface INDI 2.2.5
Public Member Functions | List of all members
AlpacaDiscovery Class Reference

Implementation of the ASCOM Alpaca Discovery Protocol. More...

#include <alpaca_discovery.h>

Public Member Functions

 AlpacaDiscovery (int discoveryPort=32227, int alpacaPort=11111)
 Constructor.
 
 ~AlpacaDiscovery ()
 Destructor.
 
bool start ()
 Start the discovery server.
 
bool stop ()
 Stop the discovery server.
 
bool isRunning () const
 Check if the discovery server is running.
 
void setDiscoveryPort (int port)
 Set the discovery port.
 
int getDiscoveryPort () const
 Get the discovery port.
 
void setAlpacaPort (int port)
 Set the Alpaca API port.
 
int getAlpacaPort () const
 Get the Alpaca API port.
 

Detailed Description

Implementation of the ASCOM Alpaca Discovery Protocol.

This class implements the UDP-based discovery protocol for ASCOM Alpaca. It listens for UDP broadcasts on the discovery port (default 32227) and responds with the Alpaca API port.

The protocol is defined at: https://github.com/DanielVanNoord/AlpacaDiscoveryTests

Definition at line 44 of file alpaca_discovery.h.

Constructor & Destructor Documentation

◆ AlpacaDiscovery()

AlpacaDiscovery::AlpacaDiscovery ( int  discoveryPort = 32227,
int  alpacaPort = 11111 
)

Constructor.

Parameters
discoveryPortThe port to listen for discovery requests (default: 32227)
alpacaPortThe port of the Alpaca API server to report in responses

Definition at line 50 of file alpaca_discovery.cpp.

◆ ~AlpacaDiscovery()

AlpacaDiscovery::~AlpacaDiscovery ( )

Destructor.

Stops the discovery server if it's running

Definition at line 59 of file alpaca_discovery.cpp.

Member Function Documentation

◆ getAlpacaPort()

int AlpacaDiscovery::getAlpacaPort ( ) const

Get the Alpaca API port.

Returns
The current Alpaca API port

Definition at line 156 of file alpaca_discovery.cpp.

◆ getDiscoveryPort()

int AlpacaDiscovery::getDiscoveryPort ( ) const

Get the discovery port.

Returns
The current discovery port

Definition at line 138 of file alpaca_discovery.cpp.

◆ isRunning()

bool AlpacaDiscovery::isRunning ( ) const

Check if the discovery server is running.

Returns
true if running, false otherwise

Definition at line 120 of file alpaca_discovery.cpp.

◆ setAlpacaPort()

void AlpacaDiscovery::setAlpacaPort ( int  port)

Set the Alpaca API port.

Parameters
portThe port of the Alpaca API server

Definition at line 143 of file alpaca_discovery.cpp.

◆ setDiscoveryPort()

void AlpacaDiscovery::setDiscoveryPort ( int  port)

Set the discovery port.

Parameters
portThe port to listen for discovery requests
Note
This will only take effect after restarting the server

Definition at line 125 of file alpaca_discovery.cpp.

◆ start()

bool AlpacaDiscovery::start ( )

Start the discovery server.

Returns
true if started successfully, false otherwise

Definition at line 68 of file alpaca_discovery.cpp.

◆ stop()

bool AlpacaDiscovery::stop ( )

Stop the discovery server.

Returns
true if stopped successfully, false otherwise

Definition at line 92 of file alpaca_discovery.cpp.


The documentation for this class was generated from the following files: