YT_EHOME_shm.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #ifndef YT_EHOME_SHM_H
  2. #define YT_EHOME_SHM_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. //#include <QDateTime>
  10. #define SHM_PATH "/"
  11. #define SHMMQ_PATH "/"
  12. #define SHM_PORT 38808
  13. #define DEVICES_COUNT 1024
  14. #define GET_LIVE_LIST 1
  15. #define GET_ONLINE_LIST 2
  16. #define ACTIVE_LIVE 3
  17. typedef struct {
  18. unsigned short YEAR;
  19. unsigned char MONTH;
  20. unsigned char DAY;
  21. unsigned char HOUR;
  22. unsigned char MINUTE;
  23. unsigned char SECOND;
  24. unsigned int TIMESTAMP;
  25. }CurrentTime,FullTime;
  26. typedef struct {
  27. long LoginId;
  28. long SessionId;
  29. long listen_preview_handle;
  30. long listen_alarm_handle;
  31. long lLinkHandle;
  32. long previewId;
  33. unsigned short previewport;
  34. unsigned short alarmport;
  35. unsigned char Connected;
  36. unsigned char Inited;
  37. unsigned char onLined;
  38. unsigned char savetmp;
  39. unsigned char transed;
  40. unsigned char io[16];
  41. uint time[2];
  42. FullTime onLinetime;
  43. FullTime transtime;
  44. char deviceID[64];
  45. char devIp[128];
  46. char filename[128];
  47. char rtsppath[1024];
  48. FILE *tmpfile;
  49. }EHomeDevice;
  50. typedef struct {
  51. FullTime alarmTime;
  52. char deviceID[64];
  53. char fileName[128];
  54. char filePath[1024];
  55. }EHomeDeviceFtp;
  56. typedef struct {
  57. uint workingTime[16];
  58. EHomeDevice eHomeDevice[DEVICES_COUNT];
  59. EHomeDeviceFtp eHomeDeviceFtp[DEVICES_COUNT];
  60. }MyEHomeShm;
  61. typedef struct{
  62. char deviceID[64];
  63. char deviceName[64];
  64. }EHomeDeviceMq;
  65. typedef struct {
  66. EHomeDeviceMq eHomeDeviceMq[DEVICES_COUNT];
  67. }MyEHomeMQShm;
  68. #endif // YT_EHOME_SHM_H