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]

Re: Slimp3 connector help


  • Subject: Re: Slimp3 connector help
  • From: Stuart Booth
  • Date: Mon, 20 Oct 2003 19:14:00 +0000

On Mon, 20 Oct 2003 16:30:57 +0100, "Kevin Hawkins"
<<a
href="/group/xap_automation/post?postID=Qot8bExMiPcxsGQl28eLeC_7jGMsO9eOuEfZtmoxln4pNakgv4FkLDR1EcBpkxxPv413ygiAWfw0-plUbPtfbg">lists@u...</a>>
wrote:

> I was thinking that a very simple xAP application schema could be
>devised for this that could be very useful for controlling a multitude
of
>serial based devices - eg AV amps etc that haven't got direct support.
In
>this way any HV serial command could be sent to HV (via xAP) and
received
>causing a xAP message to originate. This I am guessing would be just a
few
>lines using xAP Framework.

It certainly is! :-)))

private static void TestSerialCommsSchema ()
{
xAPSerialCommsMessage msg = new xAPSerialCommsMessage ();

msg.AddMessageBlock(new xAPSerialSetupBlock (1, 1200, 1, 8,
xAPSerialSetupBlock.PARITY_TYPE.Even,
xAPSerialSetupBlock.FLOW_CONTROL.Hardware));
msg.AddMessageBlock(new xAPSerialSendBlock (1, "Hello, World"));

xAPSerialSetupBlock setup_block = msg.SetupBlock;
// Do stuff with it

xAPSerialSendBlock send_block = msg.SendBlock;
// Do stuff with it

Console.WriteLine(msg.ToString());
} // End of TestSerialCommsSchema

Generates the following...

xap-header
{
v=12
hop=1
uid=FFABCD00
class=Serial.Comms
source=KCSoft.TestFramework.anya
}
Serial.Setup
{
parity=Even
stop=1
flow=Hardware
port=1
databits=8
baud=1200
}
Serial.Send
{
port=1
data=Hello, World
}

30mins work. Let me know if you want to change a few things in this
otherwise I can write it up in the usual way. It'll be in the next
release of xAPFramework.net for you.

I'm tempted to make the stop bits an enum so I can use the value One,
OneAndAHalf and Two instead.

S
--
Stuart Booth <<a
href="/group/xap_automation/post?postID=Jyr3YjXNk8h8v-igz2dFzy-I02LQ4slzA1JtGQ9zVnI42-SsPg6sO-g7lrzKnJfr57xzlt7ytQkhJuE7T-tTwA">stuart@x...</a>>
xAPFramework.net - a xAP software development framework for .net

<a href="http://www.xapautomation.org/";>http://www.xapautomation.org/</a>
<a href="http://www.xapframework.net/";>http://www.xapframework.net/</a>





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.