iDevices
Forum Documentation
Buy Now

Navigation

    Sweetblue Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Groups
    1. Home
    2. Recent
    • All categories
    • Announcements
    • General Discussion
    • Blogs
    • Sample Apps
    • All Topics
    • New Topics
    • Watched Topics
    • Unreplied Topics

    • J

      API KEY unavailable
      General Discussion • • jastrada

      1
      0
      Votes
      1
      Posts
      90
      Views

      No one has replied

    • How does ConnectionLostPlease.persistIf work compared to autoconnect?
      General Discussion • • AlejandroHCruz

      7
      0
      Votes
      7
      Posts
      549
      Views

      @ryanbis Ah! Alright, everything's clear now. That was the confusion
    • B

      Background scan times out on S10 (maybe other Samsungs)
      General Discussion • • blawlor

      3
      0
      Votes
      3
      Posts
      705
      Views

      @blawlor Funny enough, I'm seeing this behavior despite using a foreground service to scan. So in theory I shouldn't need the background location permission. Have you seen something like that too?
    • Foretting a device's characteristics
      General Discussion • • AlejandroHCruz

      6
      0
      Votes
      6
      Posts
      394
      Views

      @ryanbis Perfect! Thanks a lot. This is great.
    • Bonding with autoBondFixes set to true deletes all Bluetooth devices from Sony phones
      General Discussion • • AlejandroHCruz

      14
      0
      Votes
      14
      Posts
      1293
      Views

      R

      @alejandrohcruz Set autoBondFixes to false.
    • E

      App crashing when SweetBlue dependency is added
      General Discussion • • EarlyWild

      2
      0
      Votes
      2
      Posts
      590
      Views

      E

      Issue solved... make sure to add Java 8 compatibility to project. compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 }
    • M

      Cannot get read/notify when connected to more than two devices.
      General Discussion • • mcgkc55

      3
      0
      Votes
      3
      Posts
      650
      Views

      M

      Thanks for getting back with me. It appears I get the same results using the Toolbox app, but did notice something interesting. My flow using Toolbox app after having connected to two devices Turn device 1 on. Wait for button to turn green and say "Disconnect". Usually takes about 5-10 seconds I'm able to get notify values Turn device off. Wait for button to turn white and say "Connect" ========= Turn device 2 on. Wait for button to turn green and say "Disconnect". Usually takes about 5-10 seconds. I'm able to get notify values Turn device off. Wait for button to turn white and say "Connect" This is pretty consistent. I can do this multiple times with the same result, but sometimes when I turn a device on, it's button will not turn green even after waiting for over a minute. But as soon as I turn on another device (two devices are now on), both devices will connect and buttons will turn green. When a third device is added, the only way I can get a device to connect and turn green, is to turn on another device too. This is pretty consistent with results I'm seeing with Sweetblue in our app. We try to connect to devices use a ReconnectFilter val deviceReconnectFilter = object : DeviceReconnectFilter { override fun onConnectFailed(connectFailEvent: DeviceReconnectFilter.ConnectFailEvent): ConnectFailPlease { return ConnectFailPlease.retry() } override fun onConnectionLost(connectionLostEvent: ConnectionLostEvent): ConnectionLostPlease { return ConnectionLostPlease.retryIn(Interval.secs(3.0) ) } } So our app is continuously trying to connect to devices it knows about. When device is turned on ConnectionEvent is triggered and we start getting data. When the device is turned off, onConnectionLost is fired and we start continuously trying to reconnect. Is there another way we should be trying to handle continuously being connected to a device?
    • M

      multiple calls per second for onConnectionLost of DeviceReconnectFilter
      General Discussion • • mcgkc55

      2
      0
      Votes
      2
      Posts
      516
      Views

      R

      No, it's not supposed to fire that much. Looks like you found a bug, thanks for pointing it out. We'll make sure to get this fixed for the next release.
    • R

      Trial Key not working in Android library package
      General Discussion • • rhilse

      4
      0
      Votes
      4
      Posts
      904
      Views

      R

      Managed it to make it work. What you need is the application id, not the package name. Very confusing.
    • Best practices for saving battery life
      General Discussion • • AlejandroHCruz

      4
      0
      Votes
      4
      Posts
      931
      Views

      R

      To be honest, it's been a while since I've dug deep into the numbers for connection interval. I would think 100ms would be good, just make sure to test like crazy :).
    • Interacting with device that's already connected to the OS
      General Discussion • • AlejandroHCruz

      10
      0
      Votes
      10
      Posts
      3020
      Views

      @caeduk interesting, I didn't know that you can do that if you scan without filters. We can probably look into their source code and find more hints i.e. see under which conditions they trigger that notification to ask the user if they want to debug the connection
    • E

      Are there any sample projects that besides the SweetBlue v2 toolbox found on github?
      General Discussion • • Eheartlyanderson

      3
      1
      Votes
      3
      Posts
      1340
      Views

      V

      There is nothing in sample apps. Any possibility of it in being released in future ?.
    • Disconnection issues while bonded on Huawei & Honor devices
      General Discussion • • AlejandroHCruz

      11
      0
      Votes
      11
      Posts
      2111
      Views

      Thank you for your replies. It is interesting that you got different results than me. On my undersanding, turning off the Bluetooth adapter definitely terminates the connection and thus the device can be used again for further scanning/connection. I've been trying out a bunch of different things. Sometimes, when the device is stuck on this state, I am able to retrieve the device from the regular getDevice(String macAddress) method. And then I can establish a connection, verify the BONDED state, read the standard Device Information Service, and even enable some BleNotify. However, I am not able to negotiate the MTU as the operation fails with a REMOTE_GATT_FAILURE due to “no resources”. I'll activate autoNegotiateMtuOnReconnect and try again tomorrow, maybe you have some magic in there or I'm doing something wrong. Other than that, I think I'll use the getDevices_bonded() function, filter for the device, and unbond it. Then connect again. That seems to work on the Toolbox V3 app and does not retrigger a bonding notification for some reason.
    • Explicit disconnect triggers automatic reconnect?
      General Discussion • • AlejandroHCruz

      15
      0
      Votes
      15
      Posts
      4549
      Views

      R

      Undiscover will disconnect, but will not explicitly unbond.
    • M

      Prevent reconnect regardless of disconnect reason
      General Discussion • • mkurtz

      17
      0
      Votes
      17
      Posts
      4903
      Views

      R

      @caeduk Please post a new topic with specific steps to reproduce the issue you're having so we can investigate it on our end.
    • Native state doesn't match reported state
      General Discussion • • AlejandroHCruz

      3
      0
      Votes
      3
      Posts
      1048
      Views

      C

      I found your post here https://forum.sweetblue.io/topic/12/explicit-disconnect-triggers-automatic-reconnect and I was actually able to make it work, but it's tricky
    • B

      Increasing speed on an OTA transaction
      General Discussion • • benp

      18
      0
      Votes
      18
      Posts
      4183
      Views

      @benp thanks a lot, will check it out!
    • B

      Bluetooth connections servered by the OS get the power back to SweetBlue
      General Discussion • • Bjoern_ilockit

      5
      0
      Votes
      5
      Posts
      1508
      Views

      B

      @alejandrohcruz said in Bluetooth connections servered by the OS get the power back to SweetBlue: Are you enabling the autoConnect parameter? Also, from what I've seen, Android OS does not reconnect to bonded devices, except for A2DP ones… However, if that is happening, maybe you could disconnect/unbond when you notice that the device is stuck or when your service gets killed? Hope Hey, the autoConnect parameter is not enabled. Yes I can do disconnect/unbond the device, the problem is that the user has to open the app, because we don't get any response in the background when the Android OS controls the connection and kills our app. Currently we have a little workaround in our device that kicks the smartphone after 2 seconds in a set up state, because we found out when Android OS tries to reconnect, it get stuck in this state. So we can handle it from our device and get the control back. Edit: Is there a chance to disconnect to a device when the Android OS has the control of the connection ? Like to use the native Android LE methods ? Because if you use the SweetBlue disconnect or shutdown methods the connection is still there..
    • Link the source code of v3 to Android Studio
      General Discussion • • AlejandroHCruz

      2
      0
      Votes
      2
      Posts
      1309
      Views

      Hi, any updates or plans on this? It would still be very meaningful. Thanks!
    • Android Q Support
      General Discussion • • AlejandroHCruz

      5
      0
      Votes
      5
      Posts
      1818
      Views

      Hi, any updates on the Android Q testing? The APIs are now final on the Android SDK. Thanks!