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: Serial Comms


  • Subject: Re: Serial Comms
  • From: Stuart Booth
  • Date: Tue, 21 Oct 2003 19:46:00 +0000

Re. Kevin mentioned in a SliMP3 thread:
> 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.

On Tue, 21 Oct 2003 00:24:48 +0100, "Kevin Hawkins"
<<a
href="/group/xap_automation/post?postID=loZ2d2uSu8hw_tBsTiHrR8jkgd0nkn6YozoeXg5jElo0SBmhdyjYPTswRfdLtY2IXjcSXDU4pW2t76Tp6H2tkQ">lists@u...</a>>
wrote:

>How easy would it be to churn out the app Stuart ?

No bother at all. Can I add it to the (enormous) list?

> > I'm tempted to make the stop bits an enum so I can use the value
One,
> > OneAndAHalf and Two instead.
>
>Stop=1
>Stop=1.5
>Stop=2

Okay, how about this then:

private static void TestSerialCommsSchema ()
{
xAPSerialCommsMessage msg = new xAPSerialCommsMessage ();
msg.AddMessageBlock(new xAPSerialSetupBlock (1));
msg.AddMessageBlock(new xAPSerialSendBlock (1, "Hello, World"));

xAPSerialSetupBlock setup_block = msg.SetupBlock;
setup_block.Baud = 1200;
setup_block.Stop = STOP_BITS.OneAndHalf;
setup_block.DataBits = 8;
setup_block.Parity = PARITY_TYPE.Even;
setup_block.FlowControl = FLOW_CONTROL.Hardware;

xAPSerialSendBlock send_block = msg.SendBlock;
send_block.Port = 1;
send_block.Data = "Critical Data";

xAPSender.ApplicationSender.Send(msg);
} // End of TestSerialCommsSchema

The above generates and transmits the following xAP message:

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

This way I get to control the data integrity and the rules of your
suggested xAP schema and still keep the output compact and neat.
"Stop=1.5" does look right.

Any more ideas, just shout.

S
--
Stuart Booth <<a
href="/group/xap_automation/post?postID=LZ-KzcCCuJTsdV7eLGbcDlhht5BzroDArZvnVe8StGibsK0eY84pyuCRFwZWeg6xEFehS-n9Evua6FGEhI0">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.