php7
Richard Klingler <[email protected]>
| Newsgroups | gmane.linux.hardware.gpib.general |
|---|---|
| Message-ID | <CAD-C=v1jeUXnk=2qpW4Z4=5o=8g98XxSGu=vR0FEsraTJxjcVQ@mail.gmail.com> |
Hello
As I just moved recently to a newer machine running Debian 9 I started
debugging the php gpib module...
So far:
ibfind crashes
ibwrt times out as it always has a device number of 0
and ibrd returns nothing, though when doing some printf statements inside
ibrd function I can see that it successfully read something from my old
beloved HP 3456A (o;
ZEND_FUNCTION(ibrd)
{
/* at the moment only the traditional form is supported
$r = ibrd($ud,&$string,$count)
(read at most $count bytes into $string)
but
$r = ibrd($ud,&$string)
(read unlimited number of bytes) will be. Soon. Really.
*/
long n;
zval *z;
long len;
char *p;
long r;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"lzl", &n, &z, &len)
== FAILURE) {
return;
}
p = (unsigned char *) malloc(len + 1);
if(p == NULL) {
ibsta |= ERR;
iberr = EABO; // should be ENOMEM
RETURN_LONG(ibsta);
}
memset(p,0,len+1);
r=ibrd(n,p,len);
p[ibcnt]='\0';
ZVAL_STRINGL(z,p, ibcnt);
printf("Read %d bytes from device %d\n", ibcnt, n);
printf("Returned %s\n", p);
free(p);
RETURN_LONG(r);
}
gives me:
klingler@debian:/home2/Develop/gpib$ php dmm.php
Read 14 bytes from device 16
Returned -02.84876E+0
any ideas what has changed between 5.x and 7.x in php?
thanks in advance
richard
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linux-gpib-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-gpib-general