-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient_camera_controller.php
More file actions
52 lines (46 loc) · 1.28 KB
/
client_camera_controller.php
File metadata and controls
52 lines (46 loc) · 1.28 KB
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
<?php
$file = "data/record_state.txt";
$serverkey = "cameracontroller";
$clientkey = $_GET["authkey"];
$method = $_GET["method"];
$text = $_GET["text"];
if(strcmp($serverkey, $clientkey) == 0){
if(strcmp($method, "STATE") == 0){
echo("True");
}
if(strcmp($method, "START_RECORD") == 0){
echo("START");
$handlewriter = fopen($file, "w");
fwrite($handlewriter, "true");
fclose($handlewriter);
}
if(strcmp($method, "STOP_RECORD") == 0){
echo("STOP");
$handlewriter = fopen($file, "w");
fwrite($handlewriter, "false");
fclose($handlewriter);
}
if(strcmp($method, "DOWNLOAD") == 0){
echo("STOP");
$handlewriter = fopen($file ,"w");
fwrite($handlewriter, "download");
fclose($handlewriter);
}
if(strcmp($method, "SUMMARY") == 0){
$handlereader = fopen("data/message.txt", "r");
echo (fread($handlereader, filesize("data/message.txt")));
fclose($handlereader);
}
if(strcmp($method, "GET") == 0){
$handlereader = fopen($file, "r");
echo (fread($handlereader, filesize($file)));
fclose($handlereader);
}
if(strcmp($method, "STD") == 0){
$handlewriter = fopen("data/message.txt", "w")or die("hik");
fwrite($handlewriter, $text);
fclose($handlewriter);
echo("hi");
}
}
?>