|
@@ -0,0 +1,61 @@
|
|
|
|
+#ifndef YT_EHOME_SHM_H
|
|
|
|
+#define YT_EHOME_SHM_H
|
|
|
|
+
|
|
|
|
+#include <stdbool.h>
|
|
|
|
+#include <sys/types.h>
|
|
|
|
+#include <sys/shm.h>
|
|
|
|
+#include <sys/ipc.h>
|
|
|
|
+#include <stdlib.h>
|
|
|
|
+#include <stdio.h>
|
|
|
|
+//#include <QDateTime>
|
|
|
|
+
|
|
|
|
+#define SHM_PATH "/"
|
|
|
|
+#define SHM_PORT 38808
|
|
|
|
+
|
|
|
|
+#define DEVICES_COUNT 1024
|
|
|
|
+
|
|
|
|
+#define GET_LIVE_LIST 1
|
|
|
|
+#define GET_ONLINE_LIST 2
|
|
|
|
+#define ACTIVE_LIVE 3
|
|
|
|
+
|
|
|
|
+typedef struct {
|
|
|
|
+ unsigned short YEAR;
|
|
|
|
+ unsigned char MONTH;
|
|
|
|
+ unsigned char DAY;
|
|
|
|
+ unsigned char HOUR;
|
|
|
|
+ unsigned char MINUTE;
|
|
|
|
+ unsigned char SECOND;
|
|
|
|
+ unsigned int TIMESTAMP;
|
|
|
|
+}CurrentTime,FullTime;
|
|
|
|
+
|
|
|
|
+typedef struct {
|
|
|
|
+ long LoginId;
|
|
|
|
+ long SessionId;
|
|
|
|
+ long listen_preview_handle;
|
|
|
|
+ long listen_alarm_handle;
|
|
|
|
+ long lLinkHandle;
|
|
|
|
+ long previewId;
|
|
|
|
+ unsigned short previewport;
|
|
|
|
+ unsigned short alarmport;
|
|
|
|
+ unsigned char Connected;
|
|
|
|
+ unsigned char Inited;
|
|
|
|
+ unsigned char onLined;
|
|
|
|
+ unsigned char savetmp;
|
|
|
|
+ unsigned char transed;
|
|
|
|
+ unsigned char io[16];
|
|
|
|
+ uint time[2];
|
|
|
|
+ FullTime onLinetime;
|
|
|
|
+ FullTime transtime;
|
|
|
|
+ char deviceID[64];
|
|
|
|
+ char devIp[128];
|
|
|
|
+ char filename[128];
|
|
|
|
+ char rtsppath[1024];
|
|
|
|
+ FILE *tmpfile;
|
|
|
|
+}EHomeDevice;
|
|
|
|
+
|
|
|
|
+typedef struct {
|
|
|
|
+ uint workingTime[16];
|
|
|
|
+ EHomeDevice eHomeDevice[DEVICES_COUNT];
|
|
|
|
+}MyEHomeShm;
|
|
|
|
+
|
|
|
|
+#endif // YT_EHOME_SHM_H
|