-
Notifications
You must be signed in to change notification settings - Fork 1
/
pk.h
104 lines (72 loc) · 1.71 KB
/
pk.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#pragma once
/*** Generic packet ***/
struct pk_s {
int size;
char *buffer;
// in-buffer data
int *d_magic;
int *d_packet_id;
int *d_payload_size;
int *d_time;
int *d_status;
};
/*** Packet 01, Client to Server, Login ***/
struct pk_c_01_s {
int size;
char *buffer;
// in-buffer data
int *d_magic;
int *d_packet_id;
int *d_payload_size;
int *d_time;
char *d_username; // data username
char *d_password; // data password
};
/*** Packet 01, Server to Client, Login Response ***/
struct pk_s_01_s {
int size;
char *buffer;
// in-buffer data
int *d_magic;
int *d_packet_id;
int *d_payload_size;
int *d_time;
char *d_name; // DVR Name
char *d_vdef; // DVR Video definition (960H)
};
/*** Packet 03, Client to Server, Video control ***/
struct pk_c_03_s {
int size;
char *buffer;
// in-buffer data
int *d_magic;
int *d_packet_id;
int *d_payload_size;
int *d_time;
int *d_control; // Control variable, use currently unknown
};
/*** Packet 03, Server to Client, Video ***/
struct pk_s_03_s {
int size;
char *buffer;
// in-buffer data
int *d_magic;
int *d_packet_id;
int *d_payload_size;
int *d_time;
char *d_type_str; // type string, 4 characters
char *d_video_type; // video type string, usually 4 characters/'H264'
int *d_video_payload_size; // video payload size
int *d_max_channels;
int *d_channel_id;
int *d_current_time;
char *d_video_payload;
};
/*** Method declarations ***/
void pk_s_init(struct pk_s *);
void pk_s_destroy(void *);
struct pk_s *pk_s_read(int);
void pk_c_01_s_new(struct pk_c_01_s *);
void pk_s_01_s_init(struct pk_s_01_s *);
void pk_c_03_s_new(struct pk_c_03_s *);
void pk_s_03_s_init(struct pk_s_03_s *);