-
-
Notifications
You must be signed in to change notification settings - Fork 503
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
core: add is_connected interface #97
Conversation
This adds a sync interface for the connection status of a device. It is basically the same information as also covered by the async methods on_discover and on_timeout.
bool is_connected() const; | ||
|
||
/** | ||
* @brief Returns true if a device is currently connected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be "Returns true if the specified device is currently connected."
This allows you to test from a DroneCore object whether you have exactly one object connected or if a particular UUID is connected. It does what it says.
My problem with this is that I don't know if it allows us to sensibly handle the case where we disconnect and reconnect (both with 1 and multiple devices). We need to work out how we would do that in order to decide whether connection information needs to be testable from the |
Whenever you only expect one device, so most of the time I'd say.
I agree that |
If I know I'm only ever going to get one device, test seems a little pointless. |
Just to be sure and to know it is connected. |
I'm merging this for now. We can change it again later. |
OK. Thanks! |
This adds a sync interface for the connection status of a device. It is
basically the same information as also covered by the async methods
on_discover and on_timeout.
Closes #56.