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

Disconnect status on buttons/ Already connected #16

Open
Saurabh-Sawla opened this issue Apr 5, 2021 · 4 comments
Open

Disconnect status on buttons/ Already connected #16

Saurabh-Sawla opened this issue Apr 5, 2021 · 4 comments

Comments

@Saurabh-Sawla
Copy link

Dear Team,

Thanks the FLIC button and its SDK are really useful. However, in our application for using the FLIC button we need to have 2 things which are not really related to any specific SDK. Would it be possible for you to let us know -

  1. If the disconnect status on buttons can be determined when the Flic button is not in range and how it can be detected again. This is something that we could not get from the library.
  2. Also, how would we be able to establish if a button is already connected to another device, as it can be scanned but disconnected.

If you can provide response to these queries that would be really great.

Regards,
Saurabh

@Emill
Copy link
Contributor

Emill commented Apr 5, 2021

  1. You can get the status using getConnectionState() on the button. The callbacks on your button listener will also notify you when the state changes.
  2. When you perform a scan, you will get the result RESULT_FAILED_BUTTON_ALREADY_CONNECTED_TO_OTHER_DEVICE when this happens. The button must be pressed and held at least 6 seconds however, otherwise it will not advertise this info.

Let me know if I misunderstood your questions.

@Saurabh-Sawla
Copy link
Author

Let me check for item#1. Actually we are using the react native SDK currently.

For the question 2, I would like to explain via an example -

  • Let's consider there are 2 devices A and B to which we are attempting to add the Flic button to.
  • I scanned the button into device A and then disconnected it manually from the settings.
  • Now, I scanned the button into device B and then attempt to connect the Flic button in device A again.

I want the device A to tell me that Flic button is already connected. Is it possible?

@Emill
Copy link
Contributor

Emill commented Apr 5, 2021

I want the device A to tell me that Flic button is already connected. Is it possible?

No that won't work. The Flic button doesn't advertise anything while connected (unless the user keeps the button held for at least 6 seconds), so that can't be detected. You could potentially set up some own LAN or cloud solution where you send this information to other devices running your app.

@Saurabh-Sawla
Copy link
Author

Ok Thanks. Let us check the response to your question for the item#1 for the disconnection state.

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

No branches or pull requests

2 participants