Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

tacShMsgQ.h

Go to the documentation of this file.
00001 /*******************************************************************************
00002 * E.S.O. - VLT project
00003 *
00004 * "@(#) $Id: tacShMsgQ.h,v 1.38 2003/11/27 21:36:53 vltsccm Exp $"
00005 *
00006 * who       when      what
00007 * --------  --------  ----------------------------------------------
00008 * bbauvir   26/12/02  Build inter CPU communications on top of new MsgQ design
00009 * bbauvir   12/06/02  Correct dynamic MsgQ init for 1 CPU configuration
00010 * bbauvir   21/03/01  Created
00011 */
00012 
00013 #ifndef TAC_SHMSGQ_H
00014 #define TAC_SHMSGQ_H
00015 
00016 /**************************************************************************
00017  *  tacShMsgQ.h - This file provides the interface to the Inter CPU (process)
00018  *              Messaging system.
00019  *
00020  *------------------------------------------------------------------------
00021  */
00022 
00023 /* 
00024  * System Headers
00025  */
00026 
00027 /* 
00028  * Local Headers
00029  */
00030 
00031 #include "tacTypes.h"
00032 #include "tacDefines.h"
00033 
00034 /*
00035  * Constants
00036  */
00037 
00038 typedef enum {
00039 
00040   /*
00041    * Standard commands
00042    */
00043 
00044   tacSHMSG_STD_INIT = 0,
00045   tacSHMSG_STD_STANDBY,
00046   tacSHMSG_STD_ONLINE,
00047   tacSHMSG_STD_STOP,
00048   tacSHMSG_STD_OFF,
00049   tacSHMSG_STD_EXIT,
00050   tacSHMSG_STD_STATE,
00051   tacSHMSG_STD_STATUS,
00052   tacSHMSG_STD_SIMULAT,
00053   tacSHMSG_STD_STOPSIM,
00054   tacSHMSG_STD_VERBOSE,
00055   tacSHMSG_STD_VERSION,
00056   tacSHMSG_STD_SELFTST,
00057   tacSHMSG_STD_TEST,
00058 
00059   /*
00060    * Messages Server -> RTController
00061    */
00062 
00063   tacSHMSG_CONFIG_RTC,
00064   tacSHMSG_ADD_BLOCK,
00065   tacSHMSG_ADD_LINK,
00066   tacSHMSG_CHANGE_BLOCK_PARAM,
00067   tacSHMSG_DELETE_BLOCK,
00068   tacSHMSG_DELETE_LINK,
00069   tacSHMSG_RESET_ALGORITHM,
00070   tacSHMSG_CLEAR_ALGORITHM,
00071   tacSHMSG_REPORT_CONFIG,
00072 
00073   /*
00074    * Messages Server <- RTController
00075    */
00076 
00077   tacSHMSG_REPORT_SYNCHRO,
00078   tacSHMSG_REPORT_BLOCK,
00079   tacSHMSG_REPORT_LINK,
00080   tacSHMSG_REPORT_ERROR,
00081   tacSHMSG_HEARTBEAT,
00082   tacSHMSG_MONITOR_DATA,
00083   tacSHMSG_TRANSFER_DATA,
00084   tacSHMSG_ADD_PROBE,
00085   tacSHMSG_REMOVE_PROBE,
00086   tacSHMSG_ADD_MONITOR,    /* VLTSW20030194 */
00087   tacSHMSG_REMOVE_MONITOR,
00088 }tacSHMSG_TYPE;
00089 
00090 typedef enum {
00091   tacSHMSGQ_REQUEST = 0,
00092   tacSHMSGQ_REPLY,
00093   tacSHMSGQ_BG_INFO,
00094   tacSHMSGQ_DATA_TRANSFER,
00095   tacSHMSGQ_MAX_QUEUE_NUMBER,
00096 }tacSHMSGQ_TYPE;
00097 
00098 /* 
00099  * Types
00100  */
00101 
00102 typedef struct {
00103   char name[tacMAX_NAME_SIZE];
00104   tacSTATE start;
00105 }tacSHMSG_CONFIG;
00106 
00107 typedef struct {
00108   tacSTATE state;
00109 }tacSHMSG_STATE;
00110 
00111 typedef tacPARAM tacSHMSG_PARAM;
00112 
00113 typedef struct {
00114   char type[tacMAX_NAME_SIZE];
00115   char name[tacMAX_NAME_SIZE];
00116   tacSHMSG_PARAM parameter;
00117 }tacSHMSG_BLOCK;
00118 
00119 typedef struct {
00120   char name[tacMAX_NAME_SIZE];
00121   unsigned long port;
00122 }tacSHMSG_LINK_BLOCK_INFO;
00123 
00124 typedef struct {
00125   char name[tacMAX_NAME_SIZE];
00126   tacSHMSG_LINK_BLOCK_INFO srcBlock;
00127   tacSHMSG_LINK_BLOCK_INFO dstBlock;
00128 }tacSHMSG_LINK;
00129 
00130 typedef struct {
00131   tacERROR code;
00132 }tacSHMSG_ERROR;
00133 
00134 typedef struct {
00135   tacSYNCHRO_TYPE type;
00136   double samplingPeriod;
00137 }tacSHMSG_SYNCHRO;
00138 
00139 typedef struct {
00140   char name[tacMAX_NAME_SIZE];    /* Once at block creation */
00141   tacDATA data;
00142 }tacSHMSG_DATA;
00143 
00144 typedef struct {
00145   tacSHMSG_TYPE type;
00146   int reply; /* VLTSW20010700 - Post message and return directly */
00147   union {
00148     tacSHMSG_CONFIG config;
00149     tacSHMSG_STATE state;
00150     tacSHMSG_BLOCK block;
00151     tacSHMSG_LINK link;
00152     tacSHMSG_ERROR error;
00153     tacSHMSG_SYNCHRO synchro;
00154     tacSHMSG_DATA monitor;
00155   } msgBody;
00156 }tacSHMSG;
00157 
00158 /*
00159  * Global variables
00160  */
00161 
00162 /*
00163  * Functions
00164  */
00165 
00166 /*
00167  * Master -> Slave CPU (process)
00168  */
00169 
00170 STATUS tacShMsgQRetrieveRequest(tacSHMSG* pMsg);
00171 STATUS tacShMsgQSendRequest(tacSHMSG* pMsg);
00172 
00173 /*
00174  * Slave -> Master CPU (process)
00175  */
00176 
00177 STATUS tacShMsgQRetrieveReply(tacSHMSG* pMsg);
00178 STATUS tacShMsgQSendReply(tacSHMSG* pMsg);
00179 
00180 /*
00181  * Slave -> Master CPU (process) ... Bg activity
00182  */
00183 
00184 STATUS tacShMsgQRetrieveBgInfo(tacSHMSG* pMsg);
00185 STATUS tacShMsgQSendBgInfo(tacSHMSG* pMsg);
00186 
00187 /*
00188  * Slave -> Master CPU (process) ... Fast data transfer
00189  */
00190 
00191 STATUS tacShMsgQRetrieveDataSample(tacSHMSG* pMsg);
00192 STATUS tacShMsgQSendDataSample(tacSHMSG* pMsg);
00193 
00194 #endif 

Generated on Wed Dec 3 14:52:20 2003 for ATCS API by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001