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: Discovery question






<head>

<style type="text/css">
<!--

/* start of attachment style */
.ygrp-photo-title{
clear: both;
font-size: smaller;
height: 15px;
overflow: hidden;
text-align: center;
width: 75px;
}
div.ygrp-photo{
background-position: center;
background-repeat: no-repeat;
background-color: white;
border: 1px solid black;
height: 62px;
width: 62px;
}

div.photo-title
a,
div.photo-title a:active,
div.photo-title a:hover,
div.photo-title a:visited {
text-decoration: none;
}

div.attach-table div.attach-row {
clear: both;
}

div.attach-table div.attach-row div {
float: left;
/* margin: 2px;*/
}

p {
clear: both;
padding: 15px 0 3px 0;
overflow: hidden;
}

div.ygrp-file {
width: 30px;
valign: middle;
}
div.attach-table div.attach-row div div a {
text-decoration: none;
}

div.attach-table div.attach-row div div span {
font-weight: normal;
}

div.ygrp-file-title {
font-weight: bold;
}
/* end of attachment style */
-->
</style>
</head>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">


<!-- **begin egp html banner** -->

<br><br>

<!-- **end egp html banner** -->



Hi Neil and welcome...<br>
<br>
The BSC schema in xAP is the fullest in terms of supporting a discovery
mode.&nbsp; In fact you can typically discover the name and state of
every
BSC endpoint on a xAP network within one minute.<br>
<br>
Basically in xAP every device sends a heartbeat and typically, although
not mandatory,&nbsp; this at 60 second intervals. This means that a
listener
becomes aware of all xAP 'parent' devices / applications on your
network, by name, within one minute.&nbsp; Now if a device is using the
BSC
schema then it likely it has additional endpoints within the device eg
an input/output board might have 8 inputs and 8 outputs so 16 'sub'
addresses. These can be named as you like as long as they are unique
and the sub address is appended to its parent device address using a
:&lt;sub address&gt;<br>
<br>
Parent Device<br>
ACME.Controller.Security<br>
<br>
Endpoints&nbsp; &nbsp;&nbsp; <br>
ACME.Controller.Security:Input.1<br>
ACME.Controller.Security:PIR.Kitchen<br>
ACME.Controller.Security:Output.5<br>
ACME.Controller.Security:Output.Bells<br>
etc<br>
<br>
Every sub address will report its status 'on demand', 'on change' or
'periodically'.&nbsp; The period of the reporting is again down to the
developer of the device/application but is typically 10
minutes.&nbsp;&nbsp;
Hence every end nodes' name and state can be discovered passively
within 10 minutes by just listening to the network for xAPBSC.info
messages.&nbsp; <br>
<br>
Sometimes this is often not as fast as you would like and so another
method is to 'query' the state of all the endpoints.&nbsp; An approach
I use
at startup is to listen for new heartbeats and then as soon as you find
a new device you send a xAPBSC.query message targeted at all endpoints
within that device, using the '&gt;' sub address. . If the device
supports the BSC schema it will immediately respond with a series of
messages, one for each of its endpoints - so the example device above
would respond with 16 messages.&nbsp;&nbsp; Each message clearly
identifies the
name of the endpoint and its current state.<br>
<br>
xap-header<br>
{<br>
...<br>
class=<b>xapbsc.query</b><br>
target=ACME.Controller.Security<b>:&gt;</b><br>
}<br>
request<br>
{<br>
ID=*&nbsp; <br>
}<br>
<br>
BTW The request body is just a dummy as all xAP messages must contain a
named body and actually the ID=*&nbsp; within this is not required but
I
recommend you do it this way for future compatability,&nbsp; * means
everything.&nbsp; Also the &gt; after the : at the end of the
target address
means 'match everything from here onwards'&nbsp; in the address ie
every
subadress/endpoint.<br>
<br>
<br>
... so every endpoint will respond individually with a message like
this..<br>
<br>
xap-header<br>
{<br>
....<br>
UID=FF.1234:<b>0A</b><br>
source=ACME.Controller.Security:<b>Output.Bells</b><br>
class=xAPBSC.info<br>
}<br>
output.state<br>
{<br>
state=off<br>
}<br>
<br>
So you will see that we can now deduce the name and state of every
endpoint within a device and wether it is an input or output, (only
outputs are controllable by xAP.&nbsp;&nbsp; Also, should you
require it,&nbsp; you
have the numerical&nbsp; 'ID' for the endpoint which are the hex digits
after the : in the UID value, 0A in the above.&nbsp; In the older xAP
v1.2
it is just the last two digits of the UID.&nbsp; <br>
<br>
This clear identification of the parent device and each of the
endpoints within it, by the use of sub addresses,&nbsp; is a great
feature
of xAP, and absent in xPL.&nbsp; Also if you have chosen to carefully
name
your endpoints in a hierarchical fashion then you can selectively ask
subsets of your endpoints to respond eg<br>
target=ACME.Controller.Security:Output.&gt;&nbsp;&nbsp; might
ask just your
outputs to respond.<br>
<br>
You might also deduce that at startup you could issue the following
command to solicit responses immediately from every BSC parent device
and every endpoint within it.<br>
<br>
xap-header<br>
{<br>
...<br>
class= xapbsc.query<br>
<b>target=&gt;:&gt;</b>&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (this means
everything)<br>
}<br>
request<br>
{<br>
ID=*<br>
}<br>
<br>
<br>
.. and indeed that would ask for everything,&nbsp; however it is not a
recommended approach as on large xAP networks it will produce
bucketloads of responses&nbsp; that can flood the network.&nbsp;
The approach of
only issuing the xapbsc.query message as you hear heartbeats spreads
the responses over the first minute.<br>
<br>
<br>
Any questions... just ask away :-)<br>
<br>
&nbsp;&nbsp; cheers Kevin<br>
<br>
<br>
<br>
<br>
<blockquote cite="mid:1248829774.2000.37394.m5@xxxxxxx"
type="cite"><br>
<meta http-equiv="Content-Type" content="text/html;
">
<meta name="Generator" content="Microsoft Word 12
(filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="Section1">
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p
class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">First
post/question<o:p></o:p></p>
<p
class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">How does the discovery process in xAP
work?<o:p></o:p></p>
<p
class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">In particular the BSC section. It
refers to this
at the beginning
of the specification and then nothing
else.<o:p></o:p></p>
<p
class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p
class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal"><span
style="font-size: 10pt; font-family: &quot;Times New
Roman&quot;,&quot;serif&quot;;">Regards,</span><span
style="font-size: 12pt; font-family: &quot;Times New
Roman&quot;,&quot;serif&quot;;"> <br>
</span><span
style="font-size: 10pt; font-family: &quot;Times New
Roman&quot;,&quot;serif&quot;;">Neil
Wrightson</span><span
style="font-size: 12pt; font-family: &quot;Times New
Roman&quot;,&quot;serif&quot;;"><br>
<span style="color: navy;">Information Technology
Division</span> <br>
</span><span
style="font-size: 10pt; font-family: &quot;Times New
Roman&quot;,&quot;serif&quot;; color: blue;">Newcastle
Weighing Services Pty. Ltd.</span><span
style="font-size: 12pt; font-family: &quot;Times New
Roman&quot;,&quot;serif&quot;;"><br>
</span><span
style="font-size: 10pt; font-family: &quot;Times New
Roman&quot;,&quot;serif&quot;;">Phone
(02) 4961 4554</span><span
style="font-size: 12pt; font-family: &quot;Times New
Roman&quot;,&quot;serif&quot;;"><br>
</span><span
style="font-size: 10pt; font-family: &quot;Times New
Roman&quot;,&quot;serif&quot;;">Fax
(02) 4962 1137</span><span
style="font-size: 12pt; font-family: &quot;Times New
Roman&quot;,&quot;serif&quot;;"><br>
</span><span
style="font-size: 10pt; font-family: &quot;Times New
Roman&quot;,&quot;serif&quot;;">Mobile
0428 50 80 50</span><span
style="font-size: 12pt; font-family: &quot;Times New
Roman&quot;,&quot;serif&quot;;"><br>
</span><span
style="font-size: 10pt; font-family: &quot;Times New
Roman&quot;,&quot;serif&quot;;">Email
<a class="moz-txt-link-abbreviated" href="mailto:neilw@xxxxxxx";>neilw@xxxxxxx</a></span><span
style="font-size: 12pt; font-family: &quot;Times New
Roman&quot;,&quot;serif&quot;;"><br>
</span><span
style="font-size: 10pt; font-family: &quot;Times New
Roman&quot;,&quot;serif&quot;;">Web
<a class="moz-txt-link-abbreviated" href="http://www.nws.com.au";>www.nws.com.au</a></span><span
style="font-size: 12pt; font-family: &quot;Times New
Roman&quot;,&quot;serif&quot;;">/it
</span><o:p></o:p></p>
</div>
</blockquote>
<br>




<!-- **begin egp html banner** -->

<br>



<br>

<!-- **end egp html banner** -->


<div width="1" style="color: white; clear:
both;"/>__._,_.___</div>

<!-- Start Recommendations -->
<!-- End Recommendations -->



<!-- **begin egp html banner** -->

<img src="http://geo.yahoo.com/serv?s=97476590/grpId=9629476/grpspId=1705007709/msgId=1977/stime=1248863497";
width="1" height="1"> <br>

<!-- **end egp html banner** -->


<!-- **begin egp html banner** -->

<br>
<div style="font-family: verdana; font-size: 77%; border-top: 1px
solid #666; padding: 5px 0;" >
Your email settings: Individual EmailTraditional <br>
<a href="http://groups.yahoo.com/group/xAP_developer/join;_ylc=X3oDMTJmMDFmbXExBF9TAzk3NDc2NTkwBGdycElkAzk2Mjk0NzYEZ3Jwc3BJZAMxNzA1MDA3NzA5BHNlYwNmdHIEc2xrA3N0bmdzBHN0aW1lAzEyNDg4NjM0OTc-";>Change
settings via the Web</a> (Yahoo! ID required) <br>
Change settings via email: <a href="mailto:xAP_developer-digest@xxxxxxx?subject=Email
Delivery: Digest">Switch delivery to Daily Digest</a>  <a
href = "mailto:xAP_developer-fullfeatured@xxxxxxx?subject=Change
Delivery Format: Fully Featured">Switch to Fully Featured</a>
<br>
<a href="http://groups.yahoo.com/group/xAP_developer;_ylc=X3oDMTJkNXFmbGppBF9TAzk3NDc2NTkwBGdycElkAzk2Mjk0NzYEZ3Jwc3BJZAMxNzA1MDA3NzA5BHNlYwNmdHIEc2xrA2hwZgRzdGltZQMxMjQ4ODYzNDk3";>
Visit Your Group
</a>
<a href="http://docs.yahoo.com/info/terms/";>
Yahoo! Groups Terms of Use
</a>
<a href="mailto:xAP_developer-unsubscribe@xxxxxxx?subject=Unsubscribe";>
Unsubscribe
</a>
<br>
</div>
<br>

<!-- **end egp html banner** -->


<div style="color: white; clear:
both;"/>__,_._,___</div>
</body>
</html>


xAP_Development Main Index | xAP_Development Thread Index | xAP_Development 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.