BayEOS-PHP
Main Page
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Pages
bayeos-xbee-router-php
testPHP.php
Go to the documentation of this file.
1
<?php
2
require
'phpXBee.php'
;
3
4
$xbee
=
new
XBee
();
5
$xbee
->confDefaults();
6
$xbee
->confBaudRate(38400);
7
$xbee
->deviceSet(
"/dev/ttyUSB0"
);
8
$xbee
->open();
9
//$xbee_panid=$xbee->getPANID();
10
11
$package
=
"7E 00 04 08 01 4D 59 50"
;
12
//$package="7E 00 04 08 01 49 44 69";
13
$package
=explode(
" "
,
$package
);
14
$frame
=
''
;
15
for
($i=0;$i<count(
$package
);$i++){
16
$frame
.=pack(
'C'
,hexdec(
$package
[$i]));
17
}
18
19
//echo "Send:".array_pop(unpack('H*',$frame))."\n";
20
$xbee
->sendMessage(
$frame
);
21
22
echo
$xbee
->getPANID().
"\n"
;
23
24
?>
$package
$package
Definition:
testPHP.php:11
$frame
$frame
Definition:
testPHP.php:14
$xbee
$xbee
Definition:
testPHP.php:4
XBee
Definition:
phpXBee.php:26
Generated on Wed Jul 22 2015 13:09:58 for BayEOS-PHP by
1.8.6