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: example VB.net xAP apps and docs?


  • Subject: Re: example VB.net xAP apps and docs?
  • From: "claude" <micclfr@xxxxxxxx>
  • Date: Sat, 21 Feb 2009 10:10:43 -0000

Hi Edward,

thanks for these samples as.they help very much to use the framework .

could you give other samples on filtering and sending messages, as it
will be a good start.
regards
Claude


--- In xap_automation@xxxxxxx, "Edward Pearson"
<edward.mailgroup@...> wrote:
>
> Going a little further, this enhanced reader application shows how
to start
> picking apart messages:
>
>
>
> Imports KCS.xAP.Framework.Transport
>
> Imports KCS.xAP.Framework.Message
>
>
>
> Module xAPReader
>
>
>
>     Dim WithEvents listener As New xAPHubClientListener
>
>
>
>     Sub Main()
>
>         Console.WriteLine("xAP message reader (VB.Net) - hit
return
to
> exit")
>
>         Console.WriteLine(String.Format("My address={0},
UID={1}",
> listener.Heartbeat.Source, listener.Heartbeat.UID))
>
>         listener.Start()
>
>         Console.ReadLine()
>
>     End Sub
>
>
>
>     Sub Listener_EventHandler(ByVal sender As Object, ByVal
msgEvent As
> xAPMessageEventArgs) Handles listener.eventMessageReceived
>
>
>
>         Dim msg As xAPMessage = msgEvent.Message
>
>         Dim hdr As xAPHeaderBase = msg.Header
>
>         Dim body As xAPMessageBody = msg.Body
>
>
>
>         Console.WriteLine(String.Format("Received {0} from {1},
UID
{2}",
> hdr.Class, hdr.Source, hdr.UID))
>
>
>
>         For Each block As xAPMessageBlock In body
>
>
>
>             Console.WriteLine(String.Format("    Block:
{0}",
block.Name))
>
>
>
>             For Each parameter As String In block.Keys
>
>                 Dim v As xAPPairValue = block(parameter)
>
>                 Console.WriteLine(String.Format("        {0} =
{1}",
> parameter, v.Value))
>
>             Next
>
>         Next
>
>     End Sub
>
> End Module
>
>
>
>
>
>
>
> From: xap_automation@xxxxxxx
[mailto:xap_automation@xxxxxxx]
> On Behalf Of Edward Pearson
> Sent: 16 February 2009 18:16
> To: xap_automation@xxxxxxx
> Subject: RE: [xap_automation] RE: example VB.net xAP apps and docs?
>
>
>
> Not quite "Hello World!" but this is a very simple vb.net
app that
uses xFx
> to print xAP messages to the console.
>
>
>
> Module Module1
>
>     Private WithEvents myListener As
> KCS.xAP.Framework.Transport.xAPHubClientListener
>
>
>
>     Sub Main()
>
>         myListener = New
KCS.xAP.Framework.Transport.xAPHubClientListener()
>
>         myListener.Start()
>
>         Console.ReadLine()
>
>     End Sub
>
>
>
>     Sub rcvMsg(ByVal sender As Object, ByVal eventArgs As
> KCS.xAP.Framework.Transport.xAPMessageEventArgs) Handles
> myListener.eventMessageReceived
>
>         Console.WriteLine(eventArgs.Message.ToString())
>
>     End Sub
>
> End Module
>
>
>
>
>
> From: xap_automation@xxxxxxx
[mailto:xap_automation@xxxxxxx]
> On Behalf Of Kevin Hawkins
> Sent: 16 February 2009 16:46
> To: xap_automation@xxxxxxx
> Subject: Re: [xap_automation] RE: example VB.net xAP apps and docs?
>
>
>
> I have a xAP BSC Framework - which is basically all the code you
need to
> implement a BSC device model in VB6. It originally used Patricks
OCX
> but due to the memory leak in that I swapped it to the Intranet OCX
and
> updated it to xAP v1.3 It is effectively documented within the
source
> code but it still needs a bit of attention before being 'prime
time' .
> Works though... but is in in VB6. If that's any use to you then
shout
> - but it won't just convert to a VB.Net application and I don't
want to
> get involved in doing that either as xFX is far more suitable.
>
> There are other VB6 applications around with source code
availability -
> and IIRC James has some Intranet OCX examples - the xAP bit is
> effectively all done for you by the OCX :-)
>
> Kevin
>
> Paul Gale wrote:
> >
> > Ah OK - that sounds promising - I'll take a look at it.
> >
> > Are there any code samples for xAP VB6 apps?
> >
> > Paul.
> >
> > -----Original Message-----
> > From: xap_automation@xxxxxxx
> <mailto:xap_automation%40yahoogroups.com>
> > <mailto:xap_automation%40yahoogroups.com>
> > [mailto:xap_automation@xxxxxxx
> <mailto:xap_automation%40yahoogroups.com>
> > <mailto:xap_automation%40yahoogroups.com>]
On Behalf Of Kevin
Hawkins
> > Sent: 16 February 2009 16:15
> > To: xap_automation@xxxxxxx
> <mailto:xap_automation%40yahoogroups.com>
> > <mailto:xap_automation%40yahoogroups.com>
> > Subject: Re: [xap_automation] RE: example VB.net xAP apps and
docs?
> >
> > For VB6 my recommendation would be to use James' xAP Intranet OCX
which
> > is fairly well documented on the mi4 site - Plus I have used it
so I
> > will be able to help a little there too. You could use it from
VB.Net
> > too I believe....
> >
> > K
> >
> > Paul Gale wrote:
> > >
> > >
> > >
> > > Are there any docs for the VB6 based xAP framework - that
may
at least
> > > give me an idea of how much code is needed and the
complexity,
even if
> > > xFx is reasonably different???
> > >
> > > Cheers,
> > >
> > > Paul.
> > >
> > >
> >
> > ------------------------------------
> >
> > Yahoo! Groups Links
> >
> > __________ Information from ESET NOD32 Antivirus, version of
virus
> > signature database 3856 (20090216) __________
> >
> > The message was checked by ESET NOD32 Antivirus.
> >
> > http://www.eset.com <http://www.eset.com>
> >
> >
>




------------------------------------


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.