Instrument Neutral Distributed Interface INDI  1.9.5
Macros | Functions | Variables
trutech_wheel.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <cstring>
#include <stdarg.h>
#include <cmath>
#include <unistd.h>
#include <ctime>
#include <fcntl.h>
#include <cerrno>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
#include "indidevapi.h"
#include "eventloop.h"
#include "indicom.h"

Go to the source code of this file.

Macros

#define mydev   "TruTech Wheel"
 
#define MAIN_GROUP   "Main Control"
 
#define currentFilter   FilterPositionN[0].value
 
#define POLLMS   3000
 
#define DEFAULT_FILTER_COUNT   5
 
#define MAX_FILTER_COUNT   10
 
#define ERRMSG_SIZE   1024
 
#define CMD_SIZE   5
 
#define CMD_JUNK   64
 
#define CMD_RESP   15
 
#define FILTER_TIMEOUT   15 /* 15 Seconds before timeout */
 
#define FIRST_FILTER   1
 
#define DEBUG_ON   0
 
#define SIMULATION_ON   0
 

Functions

void ISInit (void)
 
void getBasicData (void)
 
void ISPoll (void *)
 
void handleExposure (void *)
 
void connectFilter (void)
 
int manageDefaults (char errmsg[])
 
int checkPowerS (ISwitchVectorProperty *sp)
 
int checkPowerN (INumberVectorProperty *np)
 
int checkPowerT (ITextVectorProperty *tp)
 
int getOnSwitch (ISwitchVectorProperty *sp)
 
int isFilterConnected (void)
 
void ISGetProperties (const char *dev)
 Get Device Properties. More...
 
void ISNewBLOB (const char *dev, const char *name, int sizes[], int blobsizes[], char *blobs[], char *formats[], char *names[], int n)
 Update data of an existing blob vector property. More...
 
void ISSnoopDevice (XMLEle *root)
 Function defined by Drivers that is called when another Driver it is snooping (by having previously called IDSnoopDevice()) sent any INDI message. More...
 
void ISNewSwitch (const char *dev, const char *name, ISState *states, char *names[], int n)
 Update the value of an existing switch vector property. More...
 
void ISNewText (const char *dev, const char *name, char *texts[], char *names[], int n)
 Update the value of an existing text vector property. More...
 
void ISNewNumber (const char *dev, const char *name, double values[], char *names[], int n)
 

Variables

const unsigned char COMM_PRE = 0x01
 
const unsigned char COMM_INIT = 0xA5
 
const unsigned char COMM_FILL = 0x20
 

Macro Definition Documentation

◆ CMD_JUNK

#define CMD_JUNK   64

Definition at line 66 of file trutech_wheel.c.

◆ CMD_RESP

#define CMD_RESP   15

Definition at line 67 of file trutech_wheel.c.

◆ CMD_SIZE

#define CMD_SIZE   5

Definition at line 65 of file trutech_wheel.c.

◆ currentFilter

#define currentFilter   FilterPositionN[0].value

Definition at line 59 of file trutech_wheel.c.

◆ DEBUG_ON

#define DEBUG_ON   0

Definition at line 72 of file trutech_wheel.c.

◆ DEFAULT_FILTER_COUNT

#define DEFAULT_FILTER_COUNT   5

Definition at line 61 of file trutech_wheel.c.

◆ ERRMSG_SIZE

#define ERRMSG_SIZE   1024

Definition at line 63 of file trutech_wheel.c.

◆ FILTER_TIMEOUT

#define FILTER_TIMEOUT   15 /* 15 Seconds before timeout */

Definition at line 69 of file trutech_wheel.c.

◆ FIRST_FILTER

#define FIRST_FILTER   1

Definition at line 70 of file trutech_wheel.c.

◆ MAIN_GROUP

#define MAIN_GROUP   "Main Control"

Definition at line 58 of file trutech_wheel.c.

◆ MAX_FILTER_COUNT

#define MAX_FILTER_COUNT   10

Definition at line 62 of file trutech_wheel.c.

◆ mydev

#define mydev   "TruTech Wheel"

Definition at line 57 of file trutech_wheel.c.

◆ POLLMS

#define POLLMS   3000

Definition at line 60 of file trutech_wheel.c.

◆ SIMULATION_ON

#define SIMULATION_ON   0

Definition at line 73 of file trutech_wheel.c.

Function Documentation

◆ checkPowerN()

int checkPowerN ( INumberVectorProperty np)

Definition at line 355 of file trutech_wheel.c.

◆ checkPowerS()

int checkPowerS ( ISwitchVectorProperty sp)

Definition at line 338 of file trutech_wheel.c.

◆ checkPowerT()

int checkPowerT ( ITextVectorProperty tp)

Definition at line 372 of file trutech_wheel.c.

◆ connectFilter()

void connectFilter ( void  )

Definition at line 389 of file trutech_wheel.c.

◆ getBasicData()

void getBasicData ( void  )

Definition at line 308 of file fli_wheel.c.

◆ getOnSwitch()

int getOnSwitch ( ISwitchVectorProperty sp)

Definition at line 326 of file trutech_wheel.c.

◆ handleExposure()

void handleExposure ( void *  )

◆ isFilterConnected()

int isFilterConnected ( void  )

Definition at line 445 of file trutech_wheel.c.

◆ ISGetProperties()

void ISGetProperties ( const char *  dev)

Get Device Properties.

Parameters
devthe name of the device.

This function is called by the framework whenever the driver has received a getProperties message from an INDI client. The argument

Parameters
devis either a string containing the name of the device specified within the message, or NULL if no device was specified. If the driver does not recognize the device, it should ignore the message and do nothing. If dev matches the device the driver is implementing, or dev is NULL, the driver must respond by sending one defXXX message to describe each property defined by this device, including its current (or initial) value. The recommended way to send these messages is to call the appropriate IDDef functions.

Definition at line 118 of file trutech_wheel.c.

◆ ISInit()

void ISInit ( void  )

Definition at line 105 of file trutech_wheel.c.

◆ ISNewBLOB()

void ISNewBLOB ( const char *  dev,
const char *  name,
int  sizes[],
int  blobsizes[],
char *  blobs[],
char *  formats[],
char *  names[],
int  n 
)

Update data of an existing blob vector property.

Parameters
devthe name of the device.
namethe name of the blob vector property to update.
sizesan array of base64 blob sizes in bytes before decoding.
blobsizesan array of the sizes of blobs after decoding from base64.
blobsan array of decoded data. Each blob size is found in blobsizes array.
formatsBlob data format (e.g. fits.z).
namesnames of blob members to update.
nthe number of blobs to update.
Note
You do not need to call this function, it is called by INDI when new blob values arrive from the client. e.g. BLOB element with name names[0] has data located in blobs[0] with size sizes[0] and format formats[0].

Definition at line 133 of file trutech_wheel.c.

◆ ISNewNumber()

void ISNewNumber ( const char *  dev,
const char *  name,
double  values[],
char *  names[],
int  n 
)

Definition at line 228 of file trutech_wheel.c.

◆ ISNewSwitch()

void ISNewSwitch ( const char *  dev,
const char *  name,
ISState states,
char *  names[],
int  n 
)

Update the value of an existing switch vector property.

Parameters
devthe name of the device.
namethe name of the switch vector property to update.
statesan array of switch states.
namesparallel names to the array of switch states.
nthe dimension of states[].
Note
You do not need to call this function, it is called by INDI when new switch values arrive from the client.

Definition at line 150 of file trutech_wheel.c.

◆ ISNewText()

void ISNewText ( const char *  dev,
const char *  name,
char *  texts[],
char *  names[],
int  n 
)

Update the value of an existing text vector property.

Parameters
devthe name of the device.
namethe name of the text vector property to update.
textsan array of text values.
namesparallel names to the array of text values.
nthe dimension of texts[].
Note
You do not need to call this function, it is called by INDI when new text values arrive from the client.

Definition at line 210 of file trutech_wheel.c.

◆ ISPoll()

void ISPoll ( void *  )

Definition at line 393 of file fli_wheel.c.

◆ ISSnoopDevice()

void ISSnoopDevice ( XMLEle root)

Function defined by Drivers that is called when another Driver it is snooping (by having previously called IDSnoopDevice()) sent any INDI message.

Parameters
rootThe argument contains the full message exactly as it was sent by the driver. Hint: use the IUSnoopXXX utility functions to help crack the message if it was one of setXXX or defXXX.

Definition at line 145 of file trutech_wheel.c.

◆ manageDefaults()

int manageDefaults ( char  errmsg[])

Definition at line 364 of file fli_wheel.c.

Variable Documentation

◆ COMM_FILL

const unsigned char COMM_FILL = 0x20

Definition at line 55 of file trutech_wheel.c.

◆ COMM_INIT

const unsigned char COMM_INIT = 0xA5

Definition at line 54 of file trutech_wheel.c.

◆ COMM_PRE

const unsigned char COMM_PRE = 0x01

Definition at line 53 of file trutech_wheel.c.