The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024

Latest message you have seen: Re: axc ( Get VAR in Log) ?


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

Re: I cant set the target for my xAP packet in VB.NET


  • Subject: Re: I cant set the target for my xAP packet in VB.NET
  • From: "jimfranklin63" <jimfranklin63@xxxxxxxxxxx>
  • Date: Tue, 13 Feb 2007 13:23:54 -0000

--- In xap_automation@xxxxxxx, "jimfranklin63"
<jimfranklin63@...> wrote:
>
> Hi,
> I am new to this xAP stuff, but I have got a simple vb6 app talking
> to the X10 connector, and I can turn stuff on and off ok.
>
> Ideally I'd like to write it all in VB.NET but i cant figure out
the  syntax to set the target address.


This is the fix in case anyone needs it (new to .net?)

Private Sub SendMessage(ByVal Device As String, ByVal Command As
String)
Dim xsender As New xAPSender
Dim add As New xAPTargetAddress  ' This is the target object
Dim Message As xAPMessage
Dim block As xAPMessageBlock

Message = New xAPMessage()
Message.Header = New xAPHeader()
Message.Header.Class.FullName = "xAP-X10.Request"

add.Vendor = "ERSP"    ' Set the stuff in here
add.Device = "X10"
add.Instance = "DEVPC"
Message.Header.Target = add

block = New xAPMessageBlock("xAP-X10.Request")
block.Add("command", Command)     ' <--- ON/OFF etc
block.Add("device", Device)       ' <--- A1 A2 etc

Message.AddMessageBlock(block)

xsender.Connect()
xsender.Send(Message)
xsender.Close()

-- Now that is very sad, I am even talking to myself on the
newsgroups now.








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.