4 require
'BayEOSGatewayClient.php';
9 $config=parse_ini_file(
'/etc/bayeos-qli.ini');
13 for($i=0;$i<count(
$config[
'device']);$i++){
21 private $read_error_count;
24 $defaults=array(
'data_type'=>0x41,
25 'datetime_format'=>
'd.m.Y H:M:S',
28 'tz'=>date_default_timezone_get());
29 while(list($key,$value)=each($defaults)){
31 echo
"Option '$key' not set using default: ".(is_array($value)?implode(
', ',$value):$value).
"\n";
41 $this->qli->confDefaults($this->
getOption(
'device'));
42 $this->qli->confBaudRate($this->
getOption(
'baud'));
43 if($this->qli->open()===FALSE)
44 die(
"Could not open qli device");
49 if(
$data=$this->qli->getFrame()){
50 $this->read_error_count=0;
53 $this->read_error_count++;
54 if($this->read_error_count>2){
57 $this->read_error_count=0;
__construct($names, $options)
getOption($key, $default='')
if(!isset($config['names'])) else $names