??? 04/15/08 09:20 Read: times |
#153350 - OK, here's an idea Responding to: ???'s previous message |
Ap Charles said:
N means any number of nodes , whose physical address isnt known, yet they knows the masters physical address . I need some effective way to find how many are present within the reach of the master .
http://www.8052.com/forumchat/read.phtml?id=153345 So, first, you will need to ensure that every slave node is assigned a globally-unique, unalterable "physical address". This in itself can be a non-trivial exercise... You could then use, say, the least-significant nibble of the "physical address" to group slaves for polling: the master would first poll for all slaves with a "physical address" ending 0; then it would poll for addresses ending 1; then it would poll for addresses ending 2; then it would poll for addresses ending 3; etc, etc... This would mean that you'd only have to deal with collisions between slaves of the same "group". When a new slave receives a poll of the correct group, it responds; If it doesn't get the right reply, it waits for a random[1] delay before responding to another poll; Once it's had the right reply, it ignores further polls. You could even allow your customers to specify which "groups" they want when buying units, so that they could optimise their network... |