dashboardshm.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #ifndef DASHBOARDSHM_H
  2. #define DASHBOARDSHM_H
  3. #include <stdbool.h>
  4. #include <sys/types.h>
  5. #include <sys/shm.h>
  6. #include <sys/ipc.h>
  7. #include <stdlib.h>
  8. #include <stdio.h>
  9. #pragma pack(1)
  10. typedef struct{
  11. int AlarmStatus;
  12. char Time[40];
  13. double Value;
  14. } YtPointValue;
  15. typedef struct{
  16. unsigned char Enabled;
  17. int BusAddr;
  18. int PointType;
  19. int AlarmType;
  20. int IsKeyPoint;
  21. int AlarmStatus;
  22. char Time[40];
  23. double Value;
  24. char PointName[240];
  25. YtPointValue pointvaluelist[10];
  26. } YtPoint;
  27. typedef struct{
  28. unsigned char Enabled;
  29. char DeviceID[40];
  30. char DeviceName[250];
  31. char DeviceTypeID[40];
  32. char DeviceType[240];
  33. char DeviceStatusNote[250];
  34. int DeviceStatus;
  35. uint UpTime;
  36. YtPoint DevicePoint[256];
  37. } YtDevice;
  38. typedef struct{
  39. unsigned char Enabled;
  40. char StationID[40];
  41. char StationName[250];
  42. char StationStatusNote[250];
  43. int StationStatus;
  44. int DeviceCount;
  45. int DeviceAlarm;
  46. int DeviceFault;
  47. char LastCommTime[40];
  48. YtDevice StationDevice[128];
  49. } YtStation;
  50. typedef struct{
  51. int StationCount;
  52. YtStation station[16];
  53. } YtStationCount;
  54. #pragma pack()
  55. #define MEM_PATH "/"
  56. #define MEM_PORT 5222
  57. #endif // DASHBOARDSHM_H