COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
Collaboration diagram for PIC type definitions:

Classes

struct  pic_header
 
struct  pic_cmd_args0
 
struct  pic_cmd_args1
 
struct  pic_res_suchireport
 
struct  __attribute__
 
struct  pic_handle
 

Enumerations

enum  { ISC_CMD_SET_BUS ='a', ISC_CMD_GET_BUS, ISC_CMD_GET_STRG }
 

Functions

struct pic_handle __attribute__ ((__may_alias__))
 
int32_t pic_connect (char *dev, pic_handle *handle)
 Connect to PIC. More...
 
int32_t pic_disconnect (pic_handle *handle)
 Disconnect from PIC. More...
 
int32_t suchi_heater (pic_handle *handle, uint8_t number, uint8_t state)
 
int32_t suchi_shutter (pic_handle *handle, uint8_t number, uint8_t state)
 
int32_t suchi_camera (pic_handle *handle, uint8_t number, uint8_t state)
 
int32_t suchi_report (pic_handle *handle)
 
int32_t isc_power_on (pic_handle *handle, uint8_t number, uint32_t seconds)
 
int32_t isc_report (pic_handle *handle)
 
int32_t isc_put (pic_handle *handle)
 
int32_t isc_get (pic_handle *handle)
 

Detailed Description

Enumeration Type Documentation

anonymous enum
Enumerator
ISC_CMD_SET_BUS 
ISC_CMD_GET_BUS 
ISC_CMD_GET_STRG 
92 {
93  ISC_CMD_SET_BUS='a',
96 } ;
Definition: pic_lib.h:94
Definition: pic_lib.h:93
Definition: pic_lib.h:95

Function Documentation

struct pic_handle __attribute__ ( (__may_alias__)  )
int32_t pic_connect ( char *  dev,
pic_handle handle 
)

Connect to PIC.

Connect to a PIC speaking NMEA protocol, connected to the specified RS232 device, in preparation for querying it for position measurements.

Parameters
devName of RS232 character device.
handlePointer to pic_handle.
Returns
Zero, or negative error number.
41 {
42 cssl_start();
43 if (handle->serial != NULL)
44  return(PIC_ERROR_OPEN);
45 
47 cssl_setflowcontrol(handle->serial,1,0);
48 if (handle->serial == NULL)
49  return (PIC_ERROR_PORT);
50 
51 cssl_settimeout(handle->serial,1,.1);
52 
53 handle->buffer.seq = 0;
54 
55 return 0;
56 }
#define PIC_STOPBITS
Definition: pic_lib.h:58
picstruc buffer
Definition: pic_lib.h:155
int32_t cssl_start()
Definition: cssl_lib.cpp:73
#define PIC_PARITY
Definition: pic_lib.h:57
#define PIC_ERROR_OPEN
Definition: cosmos-errno.h:196
#define PIC_BAUD
Definition: pic_lib.h:55
int32_t cssl_setflowcontrol(cssl_t *serial, int rtscts, int xonxoff)
Definition: cssl_lib.cpp:389
cssl_t * serial
Definition: pic_lib.h:154
cssl_t * cssl_open(const char *fname, int baud, int bits, int parity, int stop)
Definition: cssl_lib.cpp:108
#define PIC_BITS
Definition: pic_lib.h:56
#define PIC_ERROR_PORT
Definition: cosmos-errno.h:198
int32_t cssl_settimeout(cssl_t *serial, int, double timeout)
Set read timeout.
Definition: cssl_lib.cpp:469
int32_t pic_disconnect ( pic_handle handle)

Disconnect from PIC.

Disconnect from previously connected PIC, closing associated serial device.

Parameters
handlePointer to pic_handle.
Returns
Zero, or negative error number.
65 {
66 if (handle->serial == NULL)
67  return (PIC_ERROR_CLOSED);
68 
69 cssl_close(handle->serial);
70 return 0;
71 }
#define PIC_ERROR_CLOSED
Definition: cosmos-errno.h:197
int32_t cssl_close(cssl_t *serial)
Definition: cssl_lib.cpp:197
cssl_t * serial
Definition: pic_lib.h:154
int32_t suchi_heater ( pic_handle handle,
uint8_t  number,
uint8_t  state 
)
119 {
120  if (state)
121  handle->buffer.packet.header.cmd = SUCHI_CMD_SET_HEATER_ON;
122  else
123  handle->buffer.packet.header.cmd = SUCHI_CMD_SET_HEATER_OFF;
124  handle->buffer.packet.header.flags = 0;
125  handle->buffer.packet.header.seq = handle->buffer.seq++;
126  handle->buffer.packet.header.size = sizeof(pic_cmd_args1);
127 
128  handle->buffer.packet.args_1_16.arg = number;
129 
130  pic_putframe(handle);
131 
132  return 0;
133 }
picstruc buffer
Definition: pic_lib.h:155
#define SUCHI_CMD_SET_HEATER_OFF
Definition: pic_lib.h:68
int32_t pic_putframe(pic_handle *handle)
Definition: pic_lib.cpp:97
Definition: pic_lib.h:110
#define SUCHI_CMD_SET_HEATER_ON
Definition: pic_lib.h:67
int32_t suchi_shutter ( pic_handle handle,
uint8_t  number,
uint8_t  state 
)
136 {
137  if (state)
138  handle->buffer.packet.header.cmd = SUCHI_CMD_SET_SHUTTER_OPEN;
139  else
140  handle->buffer.packet.header.cmd = SUCHI_CMD_SET_SHUTTER_CLOSED;
141  handle->buffer.packet.header.flags = 0;
142  handle->buffer.packet.header.seq = handle->buffer.seq++;
143  handle->buffer.packet.header.size = sizeof(pic_cmd_args1);
144 
145  handle->buffer.packet.args_1_16.arg = number;
146 
147  pic_putframe(handle);
148 
149  return 0;
150 }
#define SUCHI_CMD_SET_SHUTTER_CLOSED
Definition: pic_lib.h:70
picstruc buffer
Definition: pic_lib.h:155
int32_t pic_putframe(pic_handle *handle)
Definition: pic_lib.cpp:97
#define SUCHI_CMD_SET_SHUTTER_OPEN
Definition: pic_lib.h:69
Definition: pic_lib.h:110
int32_t suchi_camera ( pic_handle handle,
uint8_t  number,
uint8_t  state 
)
int32_t suchi_report ( pic_handle handle)
168 {
169  handle->buffer.packet.header.cmd = SUCHI_CMD_GET_REPORT;
170  handle->buffer.packet.header.flags = 0;
171  handle->buffer.packet.header.seq = handle->buffer.seq++;
172  handle->buffer.packet.header.size = sizeof(pic_cmd_args0);
173 
174  pic_putframe(handle);
175 
176  return 0;
177 }
picstruc buffer
Definition: pic_lib.h:155
int32_t pic_putframe(pic_handle *handle)
Definition: pic_lib.cpp:97
#define SUCHI_CMD_GET_REPORT
Definition: pic_lib.h:73
Definition: pic_lib.h:106
int32_t isc_power_on ( pic_handle handle,
uint8_t  number,
uint32_t  seconds 
)
int32_t isc_report ( pic_handle handle)
int32_t isc_put ( pic_handle handle)
int32_t isc_get ( pic_handle handle)