00001
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _RA_PL_COMM_H
00020 #define _RA_PL_COMM_H
00021
00022 #ifdef __cplusplus
00023 extern "C" {
00024 #endif
00025
00026 #include <ra.h>
00027
00028
00029 #define MAX_SIGNAL_NAME 250
00030 typedef void *dest_handle;
00031
00038 struct slot_info
00039 {
00040 plugin_handle plugin;
00041 dest_handle dest;
00042 };
00043
00044
00045
00053 struct signal
00054 {
00055 char name[MAX_SIGNAL_NAME];
00056
00057 int num_slots;
00058 struct slot_info *slot;
00059 };
00060
00061
00068 struct plugin_comm
00069 {
00070 int num_signals;
00071 struct signal *sig;
00072 };
00073
00074
00075 #define PARA_CHAR 0
00076 #define PARA_BYTE 1
00077 #define PARA_SHORT 2
00078 #define PARA_UNSIGNED_SHORT 3
00079 #define PARA_INT 4
00080 #define PARA_UNSIGNED_INT 5
00081 #define PARA_LONG 6
00082 #define PARA_UNSIGNED_LONG 7
00083 #define PARA_FLOAT 8
00084 #define PARA_DOUBLE 9
00085 #define PARA_CHAR_POINTER 10
00086 #define PARA_BYTE_POINTER 11
00087 #define PARA_SHORT_POINTER 12
00088 #define PARA_UNSIGNED_SHORT_POINTER 13
00089 #define PARA_INT_POINTER 14
00090 #define PARA_UNSIGNED_INT_POINTER 15
00091 #define PARA_LONG_POINTER 16
00092 #define PARA_UNSIGNED_LONG_POINTER 17
00093 #define PARA_FLOAT_POINTER 18
00094 #define PARA_DOUBLE_POINTER 19
00095 #define PARA_VOID_POINTER 20
00096
00097
00098
00099 struct comm_para
00100 {
00101 int type;
00102 union
00103 {
00104 char c;
00105 unsigned char b;
00106 short int sn;
00107 unsigned short int usn;
00108 int n;
00109 unsigned int un;
00110 long l;
00111 unsigned long ul;
00112 float f;
00113 double d;
00114
00115 char *pc;
00116 unsigned char *pb;
00117 short int *psn;
00118 unsigned short int *pusn;
00119 int *pn;
00120 unsigned int *pun;
00121 long *pl;
00122 unsigned long *pul;
00123 float *pf;
00124 double *pd;
00125 void *pv;
00126 }
00127 v;
00128 };
00129
00130
00131
00132
00133 LIBRAAPI int ra_comm_add(meas_handle mh, plugin_handle p, dest_handle dh, const char *sig_name);
00134 LIBRAAPI void ra_comm_del(meas_handle mh, dest_handle dh, const char *sig_name);
00135 LIBRAAPI void ra_comm_emit(meas_handle mh, const char *sender, const char *sig_name, int num_para, struct comm_para *p);
00136
00137
00138 struct signal *find_signal(struct plugin_comm *plc, const char *sig_name);
00139 struct signal *add_signal(struct plugin_comm *plc, const char *sig_name);
00140 int find_slot(struct signal *sig, dest_handle dh);
00141
00142 #ifdef __cplusplus
00143 }
00144 #endif
00145
00146 #endif