mirror of
https://github.com/nasa/trick.git
synced 2025-01-10 23:12:44 +00:00
94 lines
3.4 KiB
C
94 lines
3.4 KiB
C
/*******************************************************************************
|
|
* *
|
|
* Trick Simulation Environment Software *
|
|
* *
|
|
* Copyright (c) 1996,1997 LinCom Corporation, Houston, TX *
|
|
* All rights reserved. *
|
|
* *
|
|
* Copyrighted by LinCom Corporation and proprietary to it. Any unauthorized *
|
|
* use of Trick Software including source code, object code or executables is *
|
|
* strictly prohibited and LinCom assumes no liability for such actions or *
|
|
* results thereof. *
|
|
* *
|
|
* Trick Software has been developed under NASA Government Contracts and *
|
|
* access to it may be granted for Government work by the following contact: *
|
|
* *
|
|
* Contact: Charles Gott, Branch Chief *
|
|
* Simulation and Graphics Branch *
|
|
* Automation, Robotics, & Simulation Division *
|
|
* NASA, Johnson Space Center, Houston, TX *
|
|
* *
|
|
*******************************************************************************/
|
|
/*
|
|
PURPOSE:
|
|
(Allows clients to get and set Trick parameters)
|
|
PROGRAMMERS:
|
|
(((Keith Vetter) (LinCom) (September 2001) (--)))
|
|
*/
|
|
|
|
/*
|
|
* $Id: variable_server.h 646 2010-04-28 21:50:31Z lin $
|
|
*/
|
|
|
|
#ifndef _VARIABLE_SERVER_H
|
|
#define _VARIABLE_SERVER_H
|
|
|
|
#include <pthread.h>
|
|
|
|
#include "sim_services/MemoryManager/include/reference.h"
|
|
#include "trick_utils/comm/include/tc.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef struct {
|
|
REF2 ref;
|
|
double scale_factor;
|
|
double bias;
|
|
} VARIABLE_NODE;
|
|
|
|
typedef struct {
|
|
int socket ; /* ** multicast socket file descriptor */
|
|
struct sockaddr_in addr ; /* ** multicast socket info */
|
|
} MCAST_INFO;
|
|
|
|
typedef struct VARIABLE_SERVER_struct {
|
|
int enabled ;
|
|
int debug; /* ** Variable_server debugging */
|
|
int synchronous ;
|
|
double update_rate;
|
|
double next;
|
|
int binary_data;
|
|
int no_handshake;
|
|
int num_vars;
|
|
int clear_cmd;
|
|
int send_cmd;
|
|
int pause_cmd;
|
|
int exists_cmd;
|
|
int exit_cmd;
|
|
VARIABLE_NODE *vars;
|
|
|
|
int multicast_on ; /* -- flag to switch between TCdevice and multcast socket */
|
|
TCDevice * connection ;
|
|
MCAST_INFO mcast_info ;
|
|
char local_byteorder ;
|
|
|
|
pthread_t thread_id ;
|
|
} VARIABLE_SERVER;
|
|
|
|
//void *var_server(void *); /* Server thread */
|
|
//void *var_serve_init(void *); /* Initialize server */
|
|
//void exit_var_server(void *); /* Exit handler for var init server */
|
|
//void exit_var_serv_threads( void ); /* Exit handler for var init server */
|
|
|
|
int vs_mcast_init(MCAST_INFO * M, char * address , int port ) ;
|
|
//int vs_write_data(VARIABLE_SERVER * V) ;
|
|
//int vs_write_error(VARIABLE_SERVER * V, char * incoming_str , char * error_str ) ;
|
|
//int vs_format_ascii(REF2 * ref, double scale_factor, double bias, char *value) ;
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif
|