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

Add connected property #54

Open
andreareginato opened this issue Jul 10, 2013 · 1 comment
Open

Add connected property #54

andreareginato opened this issue Jul 10, 2013 · 1 comment
Milestone

Comments

@andreareginato
Copy link
Contributor

Find a way to understand when a device is connected or not.

When we use MQTT it is easier. We can understand when the physical is connected or not. But, we need to set up a specific channel or service call for that, so that we can understand the mesage comes from the physical device and not from another MQTT client. As far as the MQTT physical device must be able to update the device (still he is not able to do that), if we add a property he can update, things should be fine.

And about the disconnection, we set the device as disconnected when the client who has updated the connect status, get disconnected. Think more anout and try to simplify. Maybe we can generalize and set the value on connection (theoretically there is a unique physical device) and the same for the disconnection.

For the physical devices connected in other way we need a way common way to understand if a device is or is not connected. This may come in a second moment and we should think if it is needed for devices that can't communicate when they are connected or not.

@andreareginato
Copy link
Contributor Author

We will use this property as a property that the physical device or an app can change, but at first we'll enable it only for the devices connected with MQTT. Actually the Mosca server has two funtions that can be used to check the connection of the device.

// when a client connect (we can check the username)
server.on('clientConnected')
// when a client disconnect (we can check the saved username)
server.on('clientdisconnected')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant