-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_remote.php
59 lines (49 loc) · 2.11 KB
/
test_remote.php
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
<html>
<head>
<?php
/* this page is for test local DB
Copyright (c) 2017 Marco Sillano. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
$d=dirname(__FILE__);
require_once ("$d/irp_commonSQL.php");
require_once ("$d/irp_remotedb_tools.php");
$devices = getDevicesOptionList(null,null,'visible');
echo StyleSheet();
$message ='';
$page='-1';
?>
</head>
<body>
<h1> Simulate remote control </h1>
<hr>
<div class='note'>
This 'proof of concept' can simulate any remote control present on remoteDB, sending the commands you choose.
It requires an Arduino, talking via serial to php: I use here the free version of <a href='http://www.thebyteworks.com'>PHP Serial extension</a>, ok to do tests, but having some limits:
<ul><li>random delays on function calls: <i>you must wait.</i>
<li>limit to 1000 bytes: <i>shutdown and restart the server before any test.</i>
</ul>
For real applications you must use a better communication tool: I use the USBphpTunnel (<a href='https://sourceforge.net/projects/usbphptunnel/'>sourceforge</a>) that solves all connection problems, or you can use an Arduino-yun.
</div>
<hr>
<form action = 'USR_simremote.php' mode='GET'>
Device:
<select name='device'>
<?php echo $devices; ?>
</select><br><br>
<hr>
<input type ='submit' name= 'toRemote' value='Go >> '>
</form>
<hr>
<center><<< <a href="javascript:history.go(<?php echo $page; ?>)" >Back</a> </center>
</body></head>