Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get list of connected devices #241

Closed
drtrigon opened this issue Aug 8, 2018 · 6 comments
Closed

Get list of connected devices #241

drtrigon opened this issue Aug 8, 2018 · 6 comments
Labels

Comments

@drtrigon
Copy link
Contributor

drtrigon commented Aug 8, 2018

I found https://github.com/gioblu/PJON/blob/master/documentation/addressing.md#dynamic-addressing and am wondering whether I can use bus.check_slaves_presence(); also on a bus with fixed ids? Does it work on LUDP also? A quick try resulted in error like:

../../../../../../libraries/PJON/src/PJONMaster.h:62:30: error: expected type-specifier before ‘SoftwareBitBang’
template

Would automatic listing of device ids for fixed ids be possible?

@gioblu
Copy link
Owner

gioblu commented Aug 10, 2018

Ciao @drtrigon the listing of available devices with static addressing is a feature that should be added on top and is not provided by the PJON class, primarily not to affect memory footprint. How this should be implemented depends on the limitations of the data-link or the set of data-links used (if master-slave request-response based or multi-master cyclic broadcast request-response based).

@drtrigon
Copy link
Contributor Author

Does that mean the dynamic addressing (or parts of it) can not be (re)used for this?

@gioblu
Copy link
Owner

gioblu commented Aug 14, 2018

Yes absolutely, you could implement on top whatever system is required for you to reach your goal, and yes you could also be inspired by the dynamic addressing implementation.

@drtrigon
Copy link
Contributor Author

I will have a look at this, thanks! My naive first approach would be to use e.g. PJON_BROADCAST as mentioned in https://github.com/gioblu/PJON/blob/master/documentation/data-transmission.md and #40.

@drtrigon
Copy link
Contributor Author

drtrigon commented Sep 2, 2018

Is it possible to have all devices answer to broadcasted message? In a way that the answers do not collide?

@mxbranson
Copy link
Contributor

All devices will receive broadcast messages.
Stick your message processing code in your receiver function and look for packet_info.receiver_id to check if its a zero.
You can also use ports to specify different message types and decode the payload based on the packets port.

@gioblu gioblu closed this as completed Jun 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants