I'm confused. If I understand it correctly, I should specify the callback script in the OpenComPort call and Homeseer will call the callback script when data comes in. So,
e=OpenComPort("1","9600,N,8,1",1,callback.txt,"")
then I create a script called callback.txt, and replace the
sub main()
end sub
with
sub callback(data)
hs.msgbox data
end sub
and when data arrives on the com port with a crlf, it should display what arrived in a msgbox? or am I misunderstanding the way the callback subroutine works? Should I not change from sub main() to sub callback(data)? the manual is not clear on this.
e=OpenComPort("1","9600,N,8,1",1,callback.txt,"")
then I create a script called callback.txt, and replace the
sub main()
end sub
with
sub callback(data)
hs.msgbox data
end sub
and when data arrives on the com port with a crlf, it should display what arrived in a msgbox? or am I misunderstanding the way the callback subroutine works? Should I not change from sub main() to sub callback(data)? the manual is not clear on this.
Comment