plugboard trouble
hello
this simple script
module(...,package.seeall)
require("xap")
require("xap.bsc")
info = {version="0.04", description="HAH LCD Clock"}
function init()
xap.Timer(doclock, 5):start()
end
function doclock()
bsc.sendText("dbzoo.dockstar.Controller:lcd", os.date("%H:%M:%S"))
end
output this bad xap message !!
why ?
thanks for your help
xap-header
{
uid=FF00D800
source=dbzoo.dockstar.Plugboard
hop=1
class=xAPBSC.cmd
target=dbzoo.dockstar.Controller:lcd
v=12
}
output.state.1
{
id=*
text=21:04:17
state=on
}
Vincent,
The bug is in the HomeSeer xAP parser. I quote from the xAP specification
http://www.xapautomation.org/index.php?title=Protocol_definition#Message...
"The order of name, value pairs in the message block is not significant. Name-Value Pair Definition"
I object to having to put code in place to workaround somebody else's BAD implementation of the specification, contact the HomeSeer forums and tell them their xAP parser sucks or point me at the code and I'll rewrite it.
LUA produces a non-deterministic payload for the xAP message, it does not define any order for its block elements, which is allowed by the specification.
xAP interoperability works when everybody adheres to the specification.
Brett
I have made a commit to the portable distribution so that you can workaround HomeSeers xAP bug. It is not enabled by default and requires a minor edit to put in place. The code change is in the Frame class for the tostring() function implementation.
Details of the change can be seen here: http://code.google.com/p/livebox-hah/source/detail?r=615
I would however ask that you follow up with HomeSeer as its their bug.
Brett
Vincent, Glad that workaround got you moving whilst you wait for the HomeSeer boys to fix their code. Did you raise the problem with them? If not then I will. They need to know about it.
Brett
Vincent,
I ran your script and I saw no bad packet. Why do you say its bad?
This script is a modified version of /etc_ro_fs/plugboard/samples/clockApplet.lua
My xFxViewer v3 saw the packet and did not flag it in anyway as being bad.
Please explain your error in more detail.
Brett