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: Help with bsc



--------------000807040806060904090705
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi Ian,
I've written some BSC code for the PIC, so may be able to help.

> I am trying to write some code for a Pic based unit which has 16
> inputs and 16 outputs (sort of). I want the code to be as simply as
> possible and not take up too much room in the Pic. I have been looking
> at the UID field which makes sense. However, it appears the UID field
> in a header refers to the source and not the target. To decode an XAP
> message targeted at my device am I correct in thinking I need to
> capture and match the target line. If so this is not an issue if I
> only need to match to the device i.e. gforce9.lighting.upstairs:>
and
> then use the body to identify which sub address is being targeted. But
> do I have to implement the matching of all the sub addresses on the
> target line i.e. gforce9.lighting.upstairs:output1.
>
The UID is from the source in the message you receive. Whether you use
it or not is up to your implementation - in mine I don't inspect the UID.

In the messages you generate then you need to create a UID for each
endpoint.

Yes, you'll need to do all of the standard xAP address message matching,
including checking for errors where the endpoint in the target doesn't
match the ID= field in the message and the wildcard matches. In your
example gforce9.lighting.upstairs:output1 may be ID=1 in the message
body, depending on how you map the subaddress to the ID= node(endpoint)
id. If your base UID where FF123400 then your source address (the one
you send) relating to node 1 would be FF123401.


>
>
> Again I can do this if the sub addresses are only output01 to output16
> and the same for the inputs. It would very much eat up my code space
> if this can be changed to any name though. I understand it is not as
> user friendly to say: output01 as apposed to: bedroom.light1 but as I
> said code space is vanishing fast.
>
Are you using PIC18F's? I have an Ethernet implementation of an LCD
lightswitch, including 3 level 4x20 LCD buffer in a PIC18F452. The xAP
Netiom runs in a PIC18F4525. Should be enough RAM for a small table of
mappings in an 18Fxxxx.

Do you even need friendly names for the subaddresses? 01,02,03, etc are
just as good given you'll probably be putting them in/out of a BSC mapper.

>
>
> I also need to know the maximum length the target field can be in
> total and for each segment. I am sure it must be in the doc's but I
> couldn't find it. I am also unclear on the exact makeup of the address
> field, I understand the usual makeup of the address as a.b.c followed
> sometimes by :d but I also see a.b.c.d and also a.b.c:d.e. What is the
> maximum number of sections (full stops) and is everything d and
> onwards taken to be a sub address.
>
128 bytes is the maximum length of an address line - but even that's a
bit long in a small PIC. However, there are some implementations with
Dallas serial numbers as part of the address........... so even if you
can't handle that length you'll either need to filter in the serial
bridge or handle the error gracefully.

You'll probably want to read the xAP specs again - they are pretty clear
on the a.b.c:d  etc addresses.
For example, in my .NET DMX implementation I have:

mmwave.dmx512.g8kmh_p4:house.upperfloor.bedrooom1.wall1

Which allows control at many levels - I can turn on/off or dim all of
the house lights with a simple command, or just the bedroom, or just one
light.

There are currently 48 DMX channels in the house, so you'll see why it
is useful.
>
>
>
> Sorry for all the questions but I have got a basic parser section
> working and I would like to finish it off but I don't want to head off
> in the wrong direction.
>
I took me a while to get to grips with BSC, check the developer archives!

Lehane

--------------000807040806060904090705
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">


Hi Ian,<br>
I've written some BSC code for the PIC, so may be able to help.<br>
<br>
<blockquote
cite="mid1964797EF65B7C42877FDA720CA68CDB0E71EE@xxxxxxx"
type="cite">
<div class="Section1">
<p class="MsoNormal"><font face="Arial"
size="2"><span
style="font-size: 10pt; font-family: Arial;">I am trying to
write some
code for a Pic based unit which
has 16 inputs and 16 outputs (sort of). I want the code to be as simply
as
possible and not take up too much room in the Pic. I have been looking
at the
UID field which makes sense. However, it appears the UID field in a
header
refers to the source and not the target. To decode an XAP message
targeted at
my device am I correct in thinking I need to capture and match the
target line.
If so this is not an issue if I only need to match to the device i.e.
gforce9.lighting.upstairs:&gt; and then use the body to identify which
sub
address is being targeted. But do I have to implement the matching of
all the sub
addresses on the target line i.e.
gforce9.lighting.upstairs:output1.<o:p></o:p></span></font></p>
</div>
</blockquote>
The UID is from the source in the message you receive. Whether you use
it or not is up to your implementation - in mine I don't inspect the
UID.<br>
<br>
In the messages you generate then you need to create a UID for each
endpoint.<br>
<br>
Yes, you'll need to do all of the standard xAP address message
matching, including checking for errors where the endpoint in the
target doesn't match the ID= field in the message and the wildcard
matches. In your example <font face="Arial"
size="2"><span
style="font-size: 10pt; font-family:
Arial;">gforce9.lighting.upstairs:output1
may be ID=1 in the message body, depending on how you map the
subaddress to the ID= node(endpoint) id. If your base UID where
FF123400 then your source address (the one you send) relating to node 1
would be FF123401.<br>
<br>
<br>
</span></font>
<blockquote
cite="mid1964797EF65B7C42877FDA720CA68CDB0E71EE@xxxxxxx"
type="cite">
<div class="Section1">
<p class="MsoNormal"><font face="Arial"
size="2"><span
style="font-size: 10pt; font-family:
Arial;"><o:p>&nbsp;</o:p></span></font></p>
<p class="MsoNormal"><font face="Arial"
size="2"><span
style="font-size: 10pt; font-family: Arial;">Again I can do
this if
the sub addresses are only output01
to output16 and the same for the inputs. It would very much eat up my
code
space if this can be changed to any name though. I understand it is not
as user
friendly to say: output01 as apposed to: bedroom.light1 but as I said
code
space is vanishing fast.</span></font></p>
</div>
</blockquote>
Are you using PIC18F's? I have an Ethernet implementation of an LCD
lightswitch, including 3 level 4x20 LCD buffer in a PIC18F452. The
xAP&nbsp;
Netiom runs in a PIC18F4525. Should be enough RAM for a small table of
mappings in an 18Fxxxx.<br>
<br>
Do you even need friendly names for the subaddresses? 01,02,03, etc are
just as good given you'll probably be putting them in/out of a BSC
mapper.<br>
<br>
<blockquote
cite="mid1964797EF65B7C42877FDA720CA68CDB0E71EE@xxxxxxx"
type="cite">
<div class="Section1">
<p class="MsoNormal"><font face="Arial"
size="2"><span
style="font-size: 10pt; font-family:
Arial;"><o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Arial"
size="2"><span
style="font-size: 10pt; font-family:
Arial;"><o:p>&nbsp;</o:p></span></font></p>
<p class="MsoNormal"><font face="Arial"
size="2"><span
style="font-size: 10pt; font-family: Arial;">I also need to
know the
maximum length the target field can
be in total and for each segment. I am sure it must be in the
doc&#8217;s but
I
couldn&#8217;t find it. I am also unclear on the exact makeup of the
address
field, I understand the usual makeup of the address as a.b.c followed
sometimes
by :d but I also see a.b.c.d and also a.b.c:d.e. What is the maximum
number of
sections (full stops) and is everything d and onwards taken to be a sub
address.</span></font></p>
</div>
</blockquote>
128 bytes is the maximum length of an address line - but even that's a
bit long in a small PIC. However, there are some implementations with
Dallas serial numbers as part of the address........... so even if you
can't handle that length you'll either need to filter in the serial
bridge or handle the error gracefully.<br>
<br>
You'll probably want to read the xAP specs again - they are pretty
clear on the a.b.c:d&nbsp; etc addresses.<br>
For example, in my .NET DMX implementation I have:<br>
<br>
mmwave.dmx512.g8kmh_p4:house.upperfloor.bedrooom1.wall1<br>
<br>
Which allows control at many levels - I can turn on/off or dim all of
the house lights with a simple command, or just the bedroom, or just
one light.<br>
<br>
There are currently 48 DMX channels in the house, so you'll see why it
is useful.<br>
<blockquote
cite="mid1964797EF65B7C42877FDA720CA68CDB0E71EE@xxxxxxx"
type="cite">
<div class="Section1">
<p class="MsoNormal"><font face="Arial"
size="2"><span
style="font-size: 10pt; font-family:
Arial;"><o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Arial"
size="2"><span
style="font-size: 10pt; font-family:
Arial;"><o:p>&nbsp;</o:p></span></font></p>
<p class="MsoNormal"><font face="Arial"
size="2"><span
style="font-size: 10pt; font-family: Arial;">Sorry for all the
questions but I have got a basic parser
section working and I would like to finish it off but I don&#8217;t
want to
head
off in the wrong
direction.<o:p></o:p></span></font></p>
</div>
</blockquote>
I took me a while to get to grips with BSC, check the developer
archives!<br>
<br>
Lehane



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

<br><br>
<div style="width:500px; text-align:right; margin-bottom:1px;
color:#909090;">
<tt>SPONSORED LINKS</tt>
</div>
<table bgcolor=#e0ecee cellspacing="13"
cellpadding="0" width=500px>
<tr valign=top>
<td style="width:25%;">
<tt><a href="http://groups.yahoo.com/gads?t=ms&k=Workflow+automation&w1=Workflow+automation&w2=Automation+equipment&w3=Industrial+automation&w4=Test+automation&w5=Sales+automation&w6=Factory+automation&c=6&s=145&.sig=F4tRNBO_G_ZzajQmbmwe7Q";>Workflow
automation</a></tt>
</td>
<td style="width:25%;">
<tt><a href="http://groups.yahoo.com/gads?t=ms&k=Automation+equipment&w1=Workflow+automation&w2=Automation+equipment&w3=Industrial+automation&w4=Test+automation&w5=Sales+automation&w6=Factory+automation&c=6&s=145&.sig=9-eliEiH2rHCvwCe6xpvLw";>Automation
equipment</a></tt>
</td>
<td style="width:25%;">
<tt><a href="http://groups.yahoo.com/gads?t=ms&k=Industrial+automation&w1=Workflow+automation&w2=Automation+equipment&w3=Industrial+automation&w4=Test+automation&w5=Sales+automation&w6=Factory+automation&c=6&s=145&.sig=xI5A0mNmlPHiPI__bxZwUQ";>Industrial
automation</a></tt>
</td>
</tr>
<tr valign=top>
<td style="width:25%;">
<tt><a href="http://groups.yahoo.com/gads?t=ms&k=Test+automation&w1=Workflow+automation&w2=Automation+equipment&w3=Industrial+automation&w4=Test+automation&w5=Sales+automation&w6=Factory+automation&c=6&s=145&.sig=babdTZ-cZ8AbgxQRUJqztw";>Test
automation</a></tt>
</td>
<td style="width:25%;">
<tt><a href="http://groups.yahoo.com/gads?t=ms&k=Sales+automation&w1=Workflow+automation&w2=Automation+equipment&w3=Industrial+automation&w4=Test+automation&w5=Sales+automation&w6=Factory+automation&c=6&s=145&.sig=-x7c78RB2nUpuPBRifr1YA";>Sales
automation</a></tt>
</td>
<td style="width:25%;">
<tt><a href="http://groups.yahoo.com/gads?t=ms&k=Factory+automation&w1=Workflow+automation&w2=Automation+equipment&w3=Industrial+automation&w4=Test+automation&w5=Sales+automation&w6=Factory+automation&c=6&s=145&.sig=zQtSND_pDmyn0UaMn4LPgQ";>Factory
automation</a></tt>
</td>
</tr>
</tr>
</table>

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



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

<br>
<div style="text-align:center; color:#909090;
width:500px;">
<hr style="border-bottom:1px; width:500px;
text-align:left;">
<tt>YAHOO! GROUPS LINKS</tt>
</div>
<br>
<ul>
<tt><li type=square>&nbsp;Visit your group "<a
href="http://groups.yahoo.com/group/xap_automation";>xap_automation</a>"
on the web.<br>&nbsp;</tt>
<tt><li type=square>&nbsp;To unsubscribe from this group,
send an email to:<br>&nbsp;<a href="mailto:xap_automation-unsubscribe@xxxxxxx?subject=Unsubscribe";>xap_automation-unsubscribe@xxxxxxx</a><br>&nbsp;</tt>
<tt><li type=square>&nbsp;Your use of Yahoo! Groups is
subject to the <a href="http://docs.yahoo.com/info/terms/";>Yahoo!
Terms of Service</a>.</tt>
</ul>
<br>
<div style="text-align:center; color:#909090;
width:500px;">
<hr style="border-bottom:1px; width:500px;
text-align:left;">
</div>
</br>

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


</body>
</html>

--------------000807040806060904090705--




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.