To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 2612
2611  |  2613
Subject: 
Re: bug in setting lnp host address?
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Tue, 4 Jun 2002 16:40:04 GMT
Viewed: 
4889 times
  
You are correct in stating that I shouldn't have restricted you to 16 nodes
X 16 ports. I did however, want to normalize the host address in the visible
API and user interfaces to be a small 0..N number instead of a random hex
byte value, properly aligned, etc. If you look in the current config.h in
the util/dll-src directory, you will notice CONF_LNP_HOSTADDR has been
changed from 0x80 to 8.


I will parameterize this shift-value based on the CONF_LNP_HOSTMASK
definition. Unless others object strenuously, I prefer to leave this
interface using small valued numbers.


                    /ted

"Albert Huang" <sfitw@hotmail.com> wrote in message
news:Gx60K4.MvA@lugnet.com...
> include/lnp/lnp.h  (from the cvs repository)
> 
> 114:  file://! set new LNP host address
> 115:  extern inline void lnp_set_hostaddr(unsigned char host)
> 116:  {
> 117:      lnp_hostaddr = ((host << 4) & CONF_LNP_HOSTMASK);
> 118:  }
> 
> Why is host bitshifted by 4?  This conflicts with the option of setting • the
> hostmask in config.h
> 
> for example, if someone wanted a hostmask of 11111110  (CONF_LNP_HOSTMASK • =
> 0xFE - 128 hosts, 2 ports), there is no way to use lnp_set_hostaddr to set
> almost half of the host addresses, because all the addresses you set will
> get bitshifted.
> 
> I believe it should be
> 
> 115:  extern inline void lnp_set_hostaddr(unsigned char host)
> 116:  {
> 117:      lnp_hostaddr = host & CONF_LNP_HOSTMASK;
> 118:  }
> 
> This means, of course, that you will most likely want to specify host
> addresses in hex, and will be somewhat inconvenient.
> 
> One option I can think of is just making HOSTMASK 0xF0 as part of LNP.  I
> think that 16 host addresses should be an adequate number.  I am • personally
> disagreeable with this whole sliding HOSTMASK thing *snarl* =P and would
> like to see it set on a single value.
> 
> Thoughts?
> 
> Albert
> 
> 



Message has 1 Reply:
  Re: bug in setting lnp host address?
 
you'll probably hate me for being a nitpicker.... (...) technically, you should not do any bitshifting at all. There is always the odd case when someone decides to be clever and have a hostmask with interleaved zeros. for example, a hostmask of (...) (24 years ago, 5-Jun-02, to lugnet.robotics.rcx.legos)

Message is in Reply To:
  bug in setting lnp host address?
 
include/lnp/lnp.h (from the cvs repository) 114: file://! set new LNP host address 115: extern inline void lnp_set_hostaddr(unsigned char host) 116: { 117: lnp_hostaddr = ((host << 4) & CONF_LNP_HOSTMASK); 118: } Why is host bitshifted by 4? This (...) (24 years ago, 4-Jun-02, to lugnet.robotics.rcx.legos)

6 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR