/* **CMS**=C_INC ============================================================================= Abs: Common PC <--> VAX message structure definitions for PC Knobs. Copied from pkpvmsgs.h and pkvmsg_p.h Name: drvKnobScpAlpha.h Prev: slc_macr.hc vmsstat_t pkparams.hc LEGEND_SIZE Auth: 18-Oct-1995, Robert C. Sass (RCS) Rev: 07-Dec-1995, Ron Chestnut (RON) ----------------------------------------------------------------------------- Mod: ============================================================================= */ /* ** For message structure names and functions, 'tv' means TO VAX and ** 'fv' means FROM VAX. This is a PC-centric file. ** ** Function codes for all of the PC <--> VAX messages. */ #ifndef DRV_KNOB_SCP_ALPHA_H /* guard macro */ #define DRV_KNOB_SCP_ALPHA_H /* guard macro */ #ifdef __cplusplus extern "C" { #endif //#include "drvKnobScp.h" //#include "drvKnobScpMsgAlpha.h" #define FVATTACH 1 /* Attach a point to a knob */ #define FVDETACH 2 /* Detach a point from a knob */ #define FVLEGEND 3 /* Update a knob legend */ #define TVACK 4 /* Ack for FVATTACH & FVDETACH */ #define TVTURNS 5 /* An attached knob has been turned */ #define FVHEART 6 /* Check if PC is alive */ #define TVHEART 7 /* Response if alive */ #define PCPORT 2001 /* Our "known" port; A PC Odyssey */ #define MAX_VAX_MSG 100 /* Max length PC <--> VAX msg length */ /* ** Common header for fvlegend & tvturns message structs. It has the message ** code, knob ID info and the VAX assigned sequence number. Since we're ** using the UDP/IP protocol, the sequence number is used to check for ** messages received out of sequence. */ typedef struct /* Header for */ { char code; /* Message type code */ char line; /* RS485 line number 0 based */ char box; /* Box number on line */ char knob; /* relative knob number 0 based */ unsigned long seqnum; /* Sequence number assigned by VAX */ }pvhead_ts; /* ** Common structure for the attach, detach and legend update messages ** since all must update the knob legend. The legend may be variable ** length with size nbytes. */ typedef struct /* FVATTACH/FVDETACH/FVLEGEND msgs */ { pvhead_ts pvhead_s; /* PC/VAX Message header */ char offset; /* Starting character offset */ char nbytes; /* # valid bytes in legend */ char legend[LEGEND_SIZE]; /* chars to write to LEDs */ }fvlegend_ts; /* ** The turns message is sent to the VAX when the PC detects a knob turn ** on an attached knob. */ typedef struct /* TVTURNS Report knob turns */ { pvhead_ts pvhead_s; /* PC/VAX message header */ vmsstat_t vmsstat; /* Acknowledgement status */ int2 turns; /* Turn count since last read */ int2u sstatus; /* Serial status returned by PC */ }tvturns_ts; /* ** Acknowledge structure for the attach & detach messages. */ typedef struct /* TVACK msg to FVATTACH & FVDETACH */ { pvhead_ts pvhead_s; /* PC/VAX message header */ vmsstat_t vmsstat; /* Acknowledgement status */ char acode; /* Message code for which this is the ack */ int2u sstatus; /* Serial status returned by PC */ }tvack_ts; /* ** Heartbeat message sent by any VAX process to check on this Knobs ** PC's health. */ typedef struct /* FVHEART heartbeat check */ { char code; /* Message type code */ }fvheart_ts; /* ** Response to the above message, */ typedef struct /* TVHEART ack for FVHEART msg */ { char code; /* Message type code */ vmsstat_t vmsstat; /* status */ }tvheart_ts; int PKVmsg_Init (int *socknum_p, struct sockaddr_in *sockaddr_ps); int PKVmsg_Recv (int socknum, struct sockaddr_in *fromsock_ps, charu *omsg_p, int *omsglen_p); void PKVmsg_FVAttach (knob_ts *knob_ps, box_ts *box_ps,//charu firstcpu, fvlegend_ts *fvattach_ps, const char *node, int socknum, struct sockaddr_in *insock_ps); void PKVmsg_FVDetach (knob_ts *knob_ps, box_ts *box_ps,//charu firstcpu, fvlegend_ts *fvattach_ps, const char *node, int socknum, struct sockaddr_in *insock_ps); void PKVmsg_Legend_Update (knob_ts *knob_ps, box_ts *box_ps, //charu firstcpu, fvlegend_ts *fvlegend_ps, const char *node, int socknum, struct sockaddr_in *insock_ps); void PKVmsg_TVAck (int socknum, struct sockaddr_in *outsock_ps, pvhead_ts *pvhead_ps, unsigned sstatus, vmsstat_t iss); void PKVmsg_TVTurns (knob_ts *knob_ps, box_ts *box_ps, const char *node, char iline, char ibox, int socknum); void PKVmsg_TVHeart (int socknum, struct sockaddr_in *outsock_ps); #ifdef __cplusplus }; #endif #endif /* DRV_KNOB_SCP_ALPHA_H guard macro */