TwiceAsNice  2019-02-18
Classes | Macros | Functions | Variables
fli_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 <netinet/in.h>
#include <netdb.h>
#include "libfli.h"
#include "indidevapi.h"
#include "eventloop.h"
#include "indicom.h"
Include dependency graph for fli_wheel.c:

Classes

struct  cam_t
 

Macros

#define mydev   "FLI Wheel"
 
#define MAIN_GROUP   "Main Control"
 
#define LAST_FILTER   14 /* Max slot index */
 
#define FIRST_FILTER   0 /* Min slot index */
 
#define currentFilter   FilterN[0].value
 
#define POLLMS   1000
 
#define LIBVERSIZ   1024
 
#define PREFIXSIZ   64
 
#define PIPEBUFSIZ   8192
 
#define FRAME_ILEN   64
 

Functions

void ISInit (void)
 Send client definitions of all properties. More...
 
void getBasicData (void)
 
void ISPoll (void *)
 Used to read periodically the data from the device. More...
 
void handleExposure (void *)
 
void connectFilter (void)
 
int findwheel (flidomain_t domain)
 
int manageDefaults (char errmsg[])
 
int checkPowerS (ISwitchVectorProperty *sp)
 
int checkPowerN (INumberVectorProperty *np)
 
int checkPowerT (ITextVectorProperty *tp)
 
int getOnSwitch (ISwitchVectorProperty *sp)
 
int isFilterConnected (void)
 
double min (void)
 
double max (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

char * me
 
int errno
 
static flidev_t fli_dev
 
static cam_tFLIWheel
 
static int portSwitchIndex
 
static int simulation
 
static int targetFilter
 
long int Domains [] = { FLIDOMAIN_USB, FLIDOMAIN_SERIAL, FLIDOMAIN_PARALLEL_PORT, FLIDOMAIN_INET }
 
static ISwitch PowerS [] = { { "CONNECT", "Connect", ISS_OFF, 0, 0 }, { "DISCONNECT", "Disconnect", ISS_ON, 0, 0 } }
 
static ISwitchVectorProperty PowerSP
 
static ISwitch PortS []
 
static ISwitchVectorProperty PortSP
 
static INumber FilterN []
 
static INumberVectorProperty FilterNP
 

Macro Definition Documentation

◆ currentFilter

#define currentFilter   FilterN[0].value

◆ FIRST_FILTER

#define FIRST_FILTER   0 /* Min slot index */

◆ FRAME_ILEN

#define FRAME_ILEN   64

◆ LAST_FILTER

#define LAST_FILTER   14 /* Max slot index */

◆ LIBVERSIZ

#define LIBVERSIZ   1024

◆ MAIN_GROUP

#define MAIN_GROUP   "Main Control"

◆ mydev

#define mydev   "FLI Wheel"

◆ PIPEBUFSIZ

#define PIPEBUFSIZ   8192

◆ POLLMS

#define POLLMS   1000

◆ PREFIXSIZ

#define PREFIXSIZ   64

Function Documentation

◆ checkPowerN()

int checkPowerN ( INumberVectorProperty np)

◆ checkPowerS()

int checkPowerS ( ISwitchVectorProperty sp)

◆ checkPowerT()

int checkPowerT ( ITextVectorProperty tp)

◆ connectFilter()

void connectFilter ( void  )

◆ findwheel()

int findwheel ( flidomain_t  domain)

◆ getBasicData()

void getBasicData ( void  )

◆ getOnSwitch()

int getOnSwitch ( ISwitchVectorProperty sp)

◆ handleExposure()

void handleExposure ( void *  )

◆ isFilterConnected()

int isFilterConnected ( void  )

◆ ISInit()

void ISInit ( void  )

Send client definitions of all properties.

◆ ISNewNumber()

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

◆ ISPoll()

void ISPoll ( void *  p)

Used to read periodically the data from the device.

Parameters
pthe AAGCloudWatcher object

◆ manageDefaults()

int manageDefaults ( char  errmsg[])

◆ max()

double max ( void  )

◆ min()

double min ( void  )

Variable Documentation

◆ Domains

◆ errno

int errno

◆ FilterN

INumber FilterN[]
static
Initial value:
= { { "FILTER_SLOT_VALUE", "Active Filter", "%2.0f", FIRST_FILTER, LAST_FILTER, 1, 0, 0, 0,
0 } }
#define LAST_FILTER
Definition: fli_wheel.c:67
#define FIRST_FILTER
Definition: fli_wheel.c:68

◆ FilterNP

INumberVectorProperty FilterNP
static
Initial value:
= { mydev, "FILTER_SLOT", "Filter", MAIN_GROUP, IP_RW, 0,
static INumber FilterN[]
Definition: fli_wheel.c:115
Definition: indiapi.h:155
#define mydev
Definition: fli_wheel.c:63
#define MAIN_GROUP
Definition: fli_wheel.c:65
Definition: indiapi.h:178
#define NARRAY(a)
Handy macro to find the number of elements in array a[].
Definition: indiapi.h:492

◆ fli_dev

flidev_t fli_dev
static

◆ FLIWheel

cam_t* FLIWheel
static

◆ me

char* me

◆ PortS

ISwitch PortS[]
static
Initial value:
= { { "USB", "", ISS_ON, 0, 0 },
{ "Serial", "", ISS_OFF, 0, 0 },
{ "Parallel", "", ISS_OFF, 0, 0 },
{ "INet", "", ISS_OFF, 0, 0 } }
Definition: indiapi.h:147
Definition: indiapi.h:146

◆ PortSP

ISwitchVectorProperty PortSP
static
Initial value:
= { mydev, "Port Type", "", MAIN_GROUP, IP_RW, ISR_1OFMANY,
0, IPS_IDLE, PortS, NARRAY(PortS), "", 0 }
Definition: indiapi.h:155
Definition: indiapi.h:166
#define mydev
Definition: fli_wheel.c:63
#define MAIN_GROUP
Definition: fli_wheel.c:65
Definition: indiapi.h:178
static ISwitch PortS[]
Definition: fli_wheel.c:107
#define NARRAY(a)
Handy macro to find the number of elements in array a[].
Definition: indiapi.h:492

◆ portSwitchIndex

int portSwitchIndex
static

◆ PowerS

ISwitch PowerS[] = { { "CONNECT", "Connect", ISS_OFF, 0, 0 }, { "DISCONNECT", "Disconnect", ISS_ON, 0, 0 } }
static

◆ PowerSP

ISwitchVectorProperty PowerSP
static
Initial value:
= { mydev, "CONNECTION", "Connection", MAIN_GROUP, IP_RW, ISR_1OFMANY,
60, IPS_IDLE, PowerS, NARRAY(PowerS), "", 0 }
static ISwitch PowerS[]
Definition: fli_wheel.c:102
Definition: indiapi.h:155
Definition: indiapi.h:166
#define mydev
Definition: fli_wheel.c:63
#define MAIN_GROUP
Definition: fli_wheel.c:65
Definition: indiapi.h:178
#define NARRAY(a)
Handy macro to find the number of elements in array a[].
Definition: indiapi.h:492

◆ simulation

int simulation
static

◆ targetFilter

int targetFilter
static