Discussion:
[wish-info] c script problem.
Sergio Ramos Suárez
2004-03-16 13:30:11 UTC
Permalink
I am trying to create a c program that write a "1" on a x10 device, but
I cant. I run the program and it don't obtain any result: the device
don't turn on. But with a "echo 1 > /dev/x10/a2" it turn on.
This is the code:

const char* cadena = "1";
int i, currentstatus;

fd = open("/dev/x10/a1",O_WRONLY);

if (!(fd))
printf("No pude abrir");
else
printf("El fd es %i", fd);

write(fd, cadena, strlen(cadena));
close(fd);

Can you help me?

Thanks
Rob Raper
2004-03-16 18:16:55 UTC
Permalink
Try

const char* cadena = "1\n";

-- Rob
Subject: [wish-info] c script problem.
Date: Tue, 16 Mar 2004 13:30:11 +0000
I am trying to create a c program that write a "1" on a x10 device, but I
cant. I run the program and it don't obtain any result: the device don't
turn on. But with a "echo 1 > /dev/x10/a2" it turn on.
const char* cadena = "1";
int i, currentstatus;
fd = open("/dev/x10/a1",O_WRONLY);
if (!(fd))
printf("No pude abrir");
else
printf("El fd es %i", fd);
write(fd, cadena, strlen(cadena));
close(fd);
Can you help me?
Thanks
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
wish-info mailing list
https://lists.sourceforge.net/lists/listinfo/wish-info
_________________________________________________________________
Store more e-mails with MSN Hotmail Extra Storage – 4 plans to choose from!
http://click.atdmt.com/AVE/go/onm00200362ave/direct/01/
Sergio Ramos Suárez
2004-03-16 18:35:02 UTC
Permalink
I solved it sending "100". I tested it with a c script and a php script
and runs ok.

Thanks.
Post by Rob Raper
Try
const char* cadena = "1\n";
-- Rob
Subject: [wish-info] c script problem.
Date: Tue, 16 Mar 2004 13:30:11 +0000
I am trying to create a c program that write a "1" on a x10 device,
but I cant. I run the program and it don't obtain any result: the
device don't turn on. But with a "echo 1 > /dev/x10/a2" it turn on.
const char* cadena = "1";
int i, currentstatus;
fd = open("/dev/x10/a1",O_WRONLY);
if (!(fd))
printf("No pude abrir");
else
printf("El fd es %i", fd);
write(fd, cadena, strlen(cadena));
close(fd);
Can you help me?
Thanks
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
wish-info mailing list
https://lists.sourceforge.net/lists/listinfo/wish-info
_________________________________________________________________
Store more e-mails with MSN Hotmail Extra Storage – 4 plans to choose
from! http://click.atdmt.com/AVE/go/onm00200362ave/direct/01/
--
Sergio Ramos Suárez
***@e-pyme.com
------------------------------------------------------------------------------------------------
Desarrollos tecnológicos e-pyme - http://www.e-pyme.com
Edificio Central del Parque Científico y Tecnológico
Campus Universitario de Tafira S/N
35017 Las Palmas de Gran Canaria
Islas Canarias
España
Tfno: (+34) 928 457094
------------------------------------------------------------------------------------------------
Sistema de trabajo colaborativo IDESKTOP. http://www.idesktop.net
Scott Hiles
2004-03-16 20:28:18 UTC
Permalink
Sending 100? That shouldn't work. What this means is that I have an old
bug back in the parser. A year ago I had a bu where the parser would
truncate the last character because "echo" sends a carriage return on the
end of every command. But when you do it from a C program, you often do not
send the carriage return.

I need to look through the code. I am assuming that this is the 2.0.0 code?

Scott

----- Original Message -----
From: "Sergio Ramos Suárez" <***@e-pyme.com>
To: "Rob Raper" <***@hotmail.com>; <wish-***@lists.sourceforge.net>
Sent: Tuesday, March 16, 2004 1:35 PM
Subject: Re: [wish-info] c script problem.


I solved it sending "100". I tested it with a c script and a php script
and runs ok.

Thanks.
Post by Rob Raper
Try
const char* cadena = "1\n";
-- Rob
Subject: [wish-info] c script problem.
Date: Tue, 16 Mar 2004 13:30:11 +0000
I am trying to create a c program that write a "1" on a x10 device,
but I cant. I run the program and it don't obtain any result: the
device don't turn on. But with a "echo 1 > /dev/x10/a2" it turn on.
const char* cadena = "1";
int i, currentstatus;
fd = open("/dev/x10/a1",O_WRONLY);
if (!(fd))
printf("No pude abrir");
else
printf("El fd es %i", fd);
write(fd, cadena, strlen(cadena));
close(fd);
Can you help me?
Thanks
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
wish-info mailing list
https://lists.sourceforge.net/lists/listinfo/wish-info
_________________________________________________________________
Store more e-mails with MSN Hotmail Extra Storage – 4 plans to choose
from! http://click.atdmt.com/AVE/go/onm00200362ave/direct/01/
--
Sergio Ramos Suárez
***@e-pyme.com
----------------------------------------------------------------------------
--------------------
Desarrollos tecnológicos e-pyme - http://www.e-pyme.com
Edificio Central del Parque Científico y Tecnológico
Campus Universitario de Tafira S/N
35017 Las Palmas de Gran Canaria
Islas Canarias
España
Tfno: (+34) 928 457094
----------------------------------------------------------------------------
--------------------
Sistema de trabajo colaborativo IDESKTOP. http://www.idesktop.net



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=ick
Sergio Ramos Suárez
2004-03-17 10:16:51 UTC
Permalink
No! It is the 1.6.10 version. I am using it until you solve the problem
for compile it on my motherboard.

I tested sending "1\n" and it runs OK.

Thanks.
Post by Scott Hiles
Sending 100? That shouldn't work. What this means is that I have an old
bug back in the parser. A year ago I had a bu where the parser would
truncate the last character because "echo" sends a carriage return on the
end of every command. But when you do it from a C program, you often do not
send the carriage return.
I need to look through the code. I am assuming that this is the 2.0.0 code?
Scott
----- Original Message -----
Sent: Tuesday, March 16, 2004 1:35 PM
Subject: Re: [wish-info] c script problem.
I solved it sending "100". I tested it with a c script and a php script
and runs ok.
Thanks.
Post by Rob Raper
Try
const char* cadena = "1\n";
-- Rob
Subject: [wish-info] c script problem.
Date: Tue, 16 Mar 2004 13:30:11 +0000
I am trying to create a c program that write a "1" on a x10 device,
but I cant. I run the program and it don't obtain any result: the
device don't turn on. But with a "echo 1 > /dev/x10/a2" it turn on.
const char* cadena = "1";
int i, currentstatus;
fd = open("/dev/x10/a1",O_WRONLY);
if (!(fd))
printf("No pude abrir");
else
printf("El fd es %i", fd);
write(fd, cadena, strlen(cadena));
close(fd);
Can you help me?
Thanks
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
wish-info mailing list
https://lists.sourceforge.net/lists/listinfo/wish-info
_________________________________________________________________
Store more e-mails with MSN Hotmail Extra Storage – 4 plans to choose
from! http://click.atdmt.com/AVE/go/onm00200362ave/direct/01/
--
Sergio Ramos Suárez
***@e-pyme.com
------------------------------------------------------------------------------------------------
Desarrollos tecnológicos e-pyme - http://www.e-pyme.com
Edificio Central del Parque Científico y Tecnológico
Campus Universitario de Tafira S/N
35017 Las Palmas de Gran Canaria
Islas Canarias
España
Tfno: (+34) 928 457094
------------------------------------------------------------------------------------------------
Sistema de trabajo colaborativo IDESKTOP. http://www.idesktop.net
Loading...