Subject:
|
bug in setting lnp host address?
|
Newsgroups:
|
lugnet.robotics.rcx.legos
|
Date:
|
Tue, 4 Jun 2002 05:04:44 GMT
|
Viewed:
|
1997 times
|
| |
| |
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 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 (...) (22 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
|
|
|
|