Getting data from xap messages
I'm afraid I'm struggling with xap messages again.
I'm feeding temperature data into xap-serial and I can see the xap messages on xfx viewer as follows
xap-header
{
v=12
hop=1
uid=FF00D500
class=Serial.Comms
source=dbzoo.livebox.Serial
}
Serial.Received
{
port=/dev/ttyUSB1
data=20.0
}
Unfortunately when I apply a filter like:
f:add ("xap-header","source","dbzoo.livebox.Serial")
f:add("xap-header","class","Serial.Comms")
and then in my callback function I try to use
frame:getValue("Serial.Received","data")
to extract the data element but it returns a nil value.
What should my callback function be looking for?
Allan
You should also include PORT otherwise if you ever attach a jeenode your program is going to get bombed with serial message from other sources. I know you only have one at the moment but its best to cover your bases.
I thought I made a change in that API call to be case agnostic in builds >302 ? What build are you on?
http://code.google.com/p/livebox-hah/source/detail?r=364
Brett