nerves-hub / nerves_hub_link

Connect devices to NervesHub via a Phoenix channel
https://hex.pm/packages/nerves_hub_link
Apache License 2.0
36 stars 18 forks source link

Send connection types to NervesHub #118

Open oestrich opened 1 year ago

oestrich commented 1 year ago

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.

oestrich commented 1 year ago

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.