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

Send connection types to NervesHub #118

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

oestrich
Copy link
Contributor

Adds a callback to let the device have a hook for knowing that its connected successfully to nerves hub. This allows sending connection types up the socket after fully connected. Connection types are "ethernet", "wifi", "cellular".

There is a matching PR for Nerves Hub to save this information.

Copy link
Contributor

@fhunleth fhunleth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any concerns about this causing issues with NervesHub servers that don't support the connection type?

lib/nerves_hub_link/client.ex Outdated Show resolved Hide resolved
@oestrich
Copy link
Contributor Author

It crashes the socket if we send a message like this to NervesHub servers that don't support it. But since you have to call it in your own code, is it fine to leave as a note in the docs for send_connection_types/1? I think we could make NervesHubLink smarter with NervesHub sending capabilities on connect, but it would be a bit of work to make work how we want.

Adds a callback to let the device have a hook for knowing that its
connected successfully to nerves hub. This allows sending connection
types up the socket after fully connected. Connection types are
"ethernet", "wifi", "cellular".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants