[Gridflow-cvs] [svn] commit: r3497 - /trunk/base/flow_objects.c

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Mon Apr 14 17:33:44 EDT 2008


Author: matju
Date: Mon Apr 14 17:33:42 2008
New Revision: 3497

Log:
c++ [parallel_port] is working

Modified:
    trunk/base/flow_objects.c

Modified: trunk/base/flow_objects.c
==============================================================================
--- trunk/base/flow_objects.c (original)
+++ trunk/base/flow_objects.c Mon Apr 14 17:33:42 2008
@@ -2875,16 +2875,19 @@
 }
 void ParallelPort_call(ParallelPort *self) {self->call();}
 void ParallelPort::call() {
-	ioctl(fd,LPGETFLAGS,&flags);
+	int flags;
+	if (ioctl(fd,LPGETFLAGS,&flags)<0) post("ioctl: %s",strerror(errno));
 	if (this->flags!=flags) outlet_float(bself->out[2],flags);
 	this->flags = flags;
-	ioctl(fd,LPGETSTATUS,&status);
+	int status;
+	if (ioctl(fd,LPGETSTATUS,&status)<0) post("ioctl: %s",strerror(errno));
 	if (this->status!=status) outlet_float(bself->out[1],status);
 	this->status = status;
-	if (clock) clock_delay(clock,20);
+	if (clock) clock_delay(clock,2000);
 }
 \def void initialize (string port, bool manually=0) {
 	f = fopen(port.data(),"r+");
+	if (!f) RAISE("open %s: %s",port.data(),strerror(errno));
 	fd = fileno(f);
 	status = 0xdeadbeef;
 	flags  = 0xdeadbeef;



More information about the Gridflow-cvs mailing list