00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef _PACKET_H_
00030 #define _PACKET_H_
00031 #include "definitions.h"
00032 #pragma pack(1)
00033 typedef struct {
00034 unsigned char chain_byte;
00035 unsigned char type;
00036 unsigned char device_index[sizeof(int)];
00037 unsigned char priority [sizeof(int)];
00038 unsigned char var_index [sizeof(int)];
00039 unsigned char t_length [sizeof(int)];
00040 unsigned char data_length [sizeof(int)];
00041 unsigned char channel [sizeof(int)];
00042 unsigned char buffer [DATA_PACKET_SIZE];
00043 } dataPacket;
00044 #pragma pack()
00045 #define FULL_P_SIZE sizeof(dataPacket) //total size of packet data+header
00046
00047
00048
00049
00050
00051
00052 #pragma pack(1) //byte alignment
00053 typedef struct {
00054 unsigned char command;
00055 unsigned char name[MAX_NAME_LENGTH];
00056 unsigned char data[sizeof(int)];
00057 unsigned char data_high;
00058 unsigned char error_msg[ERR_MSG_LENGTH];
00059 } command_packet;
00060 #pragma pack()
00061
00062 #define CPACKETSIZE sizeof(command_packet)
00063
00064
00065
00066
00067
00068
00069
00070
00071 #pragma pack(1)
00072 typedef struct {
00073 unsigned char length;
00074 unsigned char type;
00075 unsigned char status;
00076 unsigned char enabled;
00077 unsigned char device_name[MAX_DEVICE_NAME_LENGTH];
00078 unsigned char var_name [MAX_NAME_LENGTH];
00079 unsigned char value [MAX_VAR_LENGTH];
00080 } devDataPacket;
00081 #pragma pack()
00082
00083 #define DPACKETSIZE sizeof(devDataPacket)
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094 typedef struct {
00095 int pminx;
00096 int pminy;
00097 int pleftborder;
00098 int pupperborder;
00099 int pdefsizex;
00100 int pdefsizey;
00101 int xticks;
00102 int yticks;
00103 int ticksize;
00104 int tickpos;
00105 int tickposx;
00106 int as_interval;
00107 double yupper;
00108 double ylower;
00109 bool hgridlines;
00110 bool vgridlines;
00111 bool autoscale;
00112 } PlotSettings;
00113
00114 #endif