Post 3 made on Sunday June 13, 2010 at 09:56 |
pjjameso Long Time Member |
Joined: Posts: | April 2008 73 |
|
|
Ive modified the code and it is working. One problem I realized was my fault was that I was looking at Barry's Debugger screen and seeing a - for the responce. Just figured I had coded something wrong, but low and behold when I opend the log it shows (ACK)(CR) just as hoped. Next step is to test for that responce in prontoscript and execute a follow on fuction.
var debug = true; System.setDebugMask(debug ? 9 : 0);
var e,s; e = CF.extender[0];
if (!e) { System.print("Extender 0 is not defined"); } else { s = e.serial[3]; if (!s) { System.print("Extender 0 is not a serial extender"); } else { s.bitrate = 9600; s.databits = 8; s.parity = 0; s.stopbits = 1; } }
var receive = "No Responce Yet";
CF.widget("status").label = receive;
s.onData = function (v) {CF.widget("status").label = "String Received"};
s.match("\x02","\x06\x0D",250);
s.onTimeout = function(v) { System.print("Smarthome timeout"); } s.onError = function(e) { System.print("Smarthome " + e); }
|
|
Paul |
|