Hello,
i'm trying to use JSon as driver to connect to my PC.
I cannot understand the reponse i must give to the driver, in the "write" and "read" function.
Thanks for your help
public function write()
{
$res = '';
if ($this->fp)
{
fwrite($this->fp, "{".$this->item.":".$this->val."}\n");
$cnt = 0;
while ($cnt < 4 && $this->fp && !feof($this->fp))
{
$res .= fgets($this->fp, 128);
$stc = fgetc($this->fp);
if ($stc == "\4") <<--- What is "\4"?
{
if ($res=="1") <<--- What does it mean "1" ?
$ret[$this->item[0]] = $this->val;
break;
}
$res .= $stc;
$cnt++;
}
}
return $ret;
i'm trying to use JSon as driver to connect to my PC.
I cannot understand the reponse i must give to the driver, in the "write" and "read" function.
Thanks for your help
public function write()
{
$res = '';
if ($this->fp)
{
fwrite($this->fp, "{".$this->item.":".$this->val."}\n");
$cnt = 0;
while ($cnt < 4 && $this->fp && !feof($this->fp))
{
$res .= fgets($this->fp, 128);
$stc = fgetc($this->fp);
if ($stc == "\4") <<--- What is "\4"?
{
if ($res=="1") <<--- What does it mean "1" ?
$ret[$this->item[0]] = $this->val;
break;
}
$res .= $stc;
$cnt++;
}
}
return $ret;
Kommentar