View Full Version : xAP Support
Ron
March 5th, 2006, 07:52 PM
Guys,
I've prepared a plugin that hooks Girder into the xAP universe. Currently the backend has been written, we can receive and send messages. I have begun work on the parsing side of things and at the moment we have a first implementation of the xAP BSC 'event' and 'info' events. These are directly translated to Girder Events. We will expand this as needed. Support for your favourite device is easily added. Let me know if there is any interest for this.
For the un-initiated xAP is described more here:
http://www.xapautomation.org/
edit: Note if you want to run multi xap application on one computer you must run a separate xap-hub. (As per xAP spec)
mhwlng
March 6th, 2006, 03:09 AM
I've enabled the plugin
I'm trying to connect via UDP to port 3639 on the girder machine , but that doesn't work ?
Marcel
harleydude
March 6th, 2006, 04:53 AM
This is going to be a great addition to the Girder suite. I have installed the plug-in as well and will experiment more when I get home this evening. Below is what I have noticed so far.
I am using the HubGUI from http://www.xapframework.net/, to view active connections and the messages on the xAP network. When the xAP plugin loads I see the following error messages within HubGUI.
Error Message: Invalid name/value pairing. The length of the UID value is incorrect
Message Line#: 5 - uid=FF4300
Received From: 10.50.0.6:4815
xap-hbeat
{
v=12
hop=1
uid=FF4300
class=xap-hbeat.alive
source=promixis.girder
interval=60
port=3640
}
The error that was generated is as follows:
Problem reading xAP message.
Source: xAPMessage
Problem reading xAP message.
Invalid name/value pairing
The length of the UID value is incorrect.
KCS.xAP.Framework.xAPMessageReaderException: Problem reading xAP message. ---> KCS.xAP.Framework.xAPInvalidMessageException: Invalid name/value pairing
The length of the UID value is incorrect
at KCS.xAP.Framework.Message.xAPMessageReader.ReadHea derPair(xAPMessage message, String line)
at KCS.xAP.Framework.Message.xAPMessageReader.ReadMes sage()
--- End of inner exception stack trace ---
at KCS.xAP.Framework.Message.xAPMessageReader.ReadMes sage()
at KCS.xAP.Framework.Transport.xAPListener.OnReceive( IAsyncResult ar)
In the xap.lua file, if I change the line
xApGirderDev = xap.NewDevice('promixis.girder','promixis.girder', 'FF4300')
to
xApGirderDev = xap.NewDevice('promixis.girder','promixis.girder.t estpc','FF430000')
it likes the heartbeat, however an immediate hbeat.stop message is then sent, disconnecting the device from the hub.
Ron
March 6th, 2006, 06:43 AM
Thanks I'll investigate that one. I was using Patrick's hub, and that one worked for me.
Ron
March 6th, 2006, 06:46 AM
This one fixes the disconnect. (removed, included in the file above).
harleydude
March 6th, 2006, 07:06 AM
Yup, that got it. I am going to play with this some more in the next few days.
Will the plugin support other type of shemas, ie audio.transport, in it's current state?
Rick
Ron
March 6th, 2006, 07:16 AM
In it's current state the only schemas that it will do anything with are the BSC info and event. The others are ignored. If you need something ASAP you can have a look at the function HandleBSCEvent. Mimic it's behaviour if needed. Don't forget to 'register' you own function too with
xap.RegisterListener(HandleBSCEvent)
where you replace handlebscevent with your own function, which does not need to be inside that lua file. in fact it's best not to since we will be changing that file.
mhwlng
March 6th, 2006, 11:02 AM
I've redone my girder com server based unread (voice)mail counter to now use xAP to send it's data to girder and it works ok...
it's a simple vb 6 app that gets the unread mail count/voicemail messages from outlook and uses this ocx to send the data to the girder xAP plugin :
http://www.mi4.biz/modules.php?name=Downloads&d_op=viewdownload&cid=21
(I have installed HubGUI from here http://www.xapframework.net/modules.php?name=Content&pa=showpage&pid=8 on both pc's)
note that you still need to make the modification to xap.lua that harleydude mentions, otherwise it doesn't work.
and the girder packet parser adds an extra empty body record (see picture)
alternatively, this outlook plugin also works :
http://www.mi4.biz/modules.php?name=Downloads&d_op=viewdownload&cid=17
but it sends the individual newly arrived mail messages, not the unread mail count, which is what I needed...
Marcel
Ron
March 6th, 2006, 11:04 AM
I though I had uploaded a new lua file, let me fix the top download...
Ron
March 6th, 2006, 11:07 AM
I've seen that extra bracket, I was using tools from Patrick Lidstone to generate xap messages and when I used his send tool his own receive tool also saw this faulty data. So I assumed that his send tool was broken. I'll look at the code...
http://patrick.lidstone.net/haweb/ha/
Ron
March 6th, 2006, 11:26 AM
This has to do with their faulty handling of newline characters. The protocol calls for <LF> only. But if you send something with <CR><LF> (as windows tends to use) Particks send tool calculates the new size correctly ( from his output on the console) but sends the original lenght thus sending some junk at the end. :( I guess this is happening with the other tools out there as well.... Guess it is time to contact those authors.
harleydude
March 6th, 2006, 11:38 AM
Could you please provide an actual code snippet for the <class device>.Send(<string msg>) method.
xap.xApGirderDev.Send ???
Rick
Ron
March 6th, 2006, 12:10 PM
xap.xApGirderDev:Send("my.block.1\r{\rcool=true\r}\r")
harleydude
March 6th, 2006, 12:24 PM
Doh!!
I need to use the : instead of . oh well, still new to some of this.
I did get it to work, however here is the ouput from HubGUI
xap-header
{
v12
hop=1
uid=FF430000
class=promixis.girder
source=promixis.girder.testpc
}
my.block.1
{
cool=true
}
notice the v12 line should be v=12.
Ron
March 6th, 2006, 12:27 PM
I've updated the download at the top of the page, should fix this one. Thanks.
harleydude
March 6th, 2006, 12:39 PM
That did it. At the rate that fixes are coming out this will be ready for prime time in a day or 2 :D
mhwlng
March 6th, 2006, 01:10 PM
with the new version, the extra '}' is gone now...
But I still have to modify xap.lua from:
xap.xApGirderDev = xap.NewDevice('promixis.girder','promixis.girder,' FF430000')
to
xap.xApGirderDev = xap.NewDevice('promixis.girder','promixis.girder.s erver','FF430000')
because source must be Vendor, Device and Instance
Marcel
Ron
March 6th, 2006, 01:14 PM
Ah Sorry I missed that. FIxed in download.
harleydude
March 6th, 2006, 03:16 PM
As mentioned above, I am still kind of new to Girder.
where you replace handlebscevent with your own function, which does not need to be inside that lua file. in fact it's best not to since we will be changing that file.
How would I setup another .Lua file to handle different schemas?
Ron
March 6th, 2006, 03:19 PM
drop it into luascript/startup and start writing. Note that we'll consolidate everyones efforts into some form.
Mike C
November 3rd, 2011, 12:14 PM
any ideas on how to send this message??
xap-header
{
v=13
Hop=1
UID=FF.E2B800:0000
Class=xAP-Audio.Transport
Source=ersp.testscript.test
Target=ersp.SlimServer.>:Office
}
Audio.Transport
{
Command=Pause
}
Powered by vBulletin® Version 4.1.8 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.