-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathofficebot-include.php
More file actions
55 lines (45 loc) · 1.49 KB
/
officebot-include.php
File metadata and controls
55 lines (45 loc) · 1.49 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
53
54
55
<?php
mysql_connect("localhost", "9thsense", "~FERmion") or die ("We are sorry, we have experienced database error 1043. Please email support@9thsense.com for assistance.");
mysql_select_db("9thsense") or die ("We are sorry, we have experienced database error 1151. Please email support@9thsense.com for assistance.");
openlog ("9STC", LOG_ODELAY | LOG_PID, LOG_LOCAL0);
$robotname = "robot@9thsense.com";
$receiverAddress = "receiver@9thsense.com";
$receiverName = "Receiver";
$controllerAddress = "controller@9thsense.com";
$controllerName = 'Controller';
function getRobotMessage($xmppUsername)
{
$x = mysql_escape_string($xmppUsername);
$q = " SELECT
message
FROM
driving_message_from_robot
WHERE
xmpp_username = '$x'";
$res = mysql_query($q);
if (mysql_num_rows($res))
{
$r = mysql_fetch_array($res);
$q = " UPDATE
driving_message_from_robot
SET
message = ''
WHERE xmpp_username = '$x'";
mysql_query($q);
return ($r['message']);
}
return null;
}
require_once ('xmpphp/XMPP.php');
define ('CMD_SENSORS', 0x8e);
define ('SENSOR_GROUP_ALL', 0x00); // returns all sensor values
define ('SENSOR_GROUP_LENGTH', 52);
$createPort = "/dev/ttyUSB0";
$arduinoPort = "/dev/ttyACM0";
$createActionTable = 'create_action';
$pantiltActionTable = 'pantilt_action';
$createStatusTable = 'create_status';
$timeout_time = 0.75; // timeout time in seconds
// $conn = mysql_connect($mysql_host, $mysql_user, $mysql_pass) or die;
// mysql_select_db ('officebot', $conn);
?>