The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

xAPSend - send xap messages: by piping, from the command line, or from file



http://www.aceshigh.net/xap/xapsend.zip

xapsend sends out pre-canned xap messages that it can receive from either
piping to it, from files, or from the command line.

disclaimer:  I'm a perl / mysql coder by trade, my vb knowledge is more
"if
it works, it works" so bugs / bad coding are to be expected :)  Let me
know
if there are any problems with it, or if anybody wants the sourcecode to
fix
/ play / make it better / etc!

requirements: It's written / bodged in the freebie vb.net downloadable from
micro$oft so I think that means it needs .net 2?  Uses the xfx framework.

testing:  I've been using it now for a day or so for
"xap-enabling" various
bits and bobs and it seems to be working fine.  There's not a great deal of
error checking that goes on, so it's important that the xap messages are
correctly formatted.

Usage:

***************************
myprog.exe  xapsend.exe /p

This accepts "piped" input where myprog.exe will output full
"raw" xap
message(s) wrapped in <xAP></xAP> tags. In the case of multiple
message,
each message should be wrapped individually in <xAP></xAP>
tags.  Either
line by line or all on one line messages can be accepted.  In the case of
all on one line then "\n" should be used to signify where line
breaks occur.

eg:

<xAP>
xap-header
{
v=12
hop=1
uid=FF969600
class=next.recording
source=ahs.gbpvr.ahspvr
}
next.recording
{
end=20060822164000
description=Animated adventures with Bob the Builder
title=Bob the Builder: Project Build It
duration=00:10:00
station=CBeebies
start=20060822163000
}
</xAP>

or:

<xAP>\nxap-header\n{\nv=12\nhop=1\nuid=FF969600\nclass=next.recording\nsource=ahs.gbpvr.ahspvr\n}\nnext.recording\n{\nend=20060822164000\ndescription=Animated
adventures with Bob the Builder\ntitle=Bob the Builder: Project Build
It\nduration=00:10:00\nstation=CBeebies\nstart=20060822163000\n}\n</xAP>\n

***************************
xapsend.exe /f:"c:\myfiles\xapmessage.xap"
xapsend.exe /f:c:\myfiles\xapmessage.xap

This will send any full "raw" xap messages found in the file
specified
wrapped in <xAP></xAP> tags.  In the case of multiple message,
each message
should be wrapped individually in <xAP></xAP> tags.

eg:

<xAP>
xap-header
{
v=12
hop=1
uid=FF969600
class=next.recording
source=ahs.gbpvr.ahspvr
}
next.recording
{
end=20060822164000
description=Animated adventures with Bob the Builder
title=Bob the Builder: Project Build It
duration=00:10:00
station=CBeebies
start=20060822163000
}
</xAP>
<xAP>
xap-header
{
v=12
hop=1
uid=FF969600
class=next.recording
source=ahs.gbpvr.ahspvr
}
next.recording
{
end=20060822164000
description=Animated adventures with Bob the Builder
title=Bob the Builder: Project Build It
duration=00:10:00
station=CBeebies
start=20060822163000
}
</xAP>

***************************
xapsend.exe /c:"<xAP></xAP>"
xapsend.exe /c:<xAP></xAP>

This accepts command line input of full "raw" xap message(s)
wrapped in
<xAP></xAP> tags.  In the case of multiple message, each
message should be
wrapped individually in <xAP></xAP> tags. "\n" should
be used to signify
where line breaks occur.

eg:

xapsend.exe
/c:<xAP>\nxap-header\n{\nv=12\nhop=1\nuid=FF969600\nclass=next.recording\nsource=ahs.gbpvr.ahspvr\n}\nnext.recording\n{\nend=20060822164000\ndescription=Animated
adventures with Bob the Builder\ntitle=Bob the Builder: Project Build
It\nduration=00:10:00\nstation=CBeebies\nstart=20060822163000\n}\n</xAP>\n

***************************



An example usage of xapsend is within GBPVR (http://www.gbpvr.com) using the
gbpvrcli utility to send out current tuner status (current
recordings/pending recordings):

"c:\program files\devnz\gbpvr\gbpvrcli.exe" /pending 4 /message
"<xAP>\nxap-header\n{{\nv=12\nhop=1\nuid=FF969600\nclass=now.recording\nsource=ahs.gbpvr.ahspvr\n}}\nnow.recording\n{{\nend={EndTime:yyyy}{EndTime:MM}{EndTime:dd}{EndTime:HH}{EndTime:mm}{EndTime:ss}\ndescription={DescriptionNoWrap}\ntitle={TitleSubtitle}\nduration={RecordingLength}\nstation={ChannelName}\nstart={StartTime:yyyy}{StartTime:MM}{StartTime:dd}{StartTime:HH}{StartTime:mm}{StartTime:ss}\n}}\n</xAP>\n"
"c:\program files\xap\xapsend\xapsend.exe" /p

The above gbpvrcli command pipes upto 4 raw xap messages containing details
of scheduled recordings to xapsend which then appear on the xap network and
are picked up by floorplan which then performs various script actions
accordingly.  I run the above command from the windows task schedular every
hour.  Seems to work ok!


Martyn



___________________________________________________________
Now you can scan emails quickly with a reading pane. Get the new Yahoo!
Mail. http://uk.docs.yahoo.com/nowyoucan.html




xAP_Automation Main Index | xAP_Automation Thread Index | xAP_Automation Home | Archives Home

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.