BayEOS-PHP
 All Data Structures Namespaces Files Functions Variables Pages
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
Definition: testPHP.php:11
$frame
Definition: testPHP.php:14
$xbee
Definition: testPHP.php:4
Definition: phpXBee.php:26