Home › Forums › Ask the Flomies › How to turn off auto connect
Tagged: FloBLE Plus, Flomio SDK Pro, iOS
-
AuthorPosts
-
January 23, 2018 at 7:56 pm #62063
Hey all!
My use case involves having several FloBLE Pluses at an event space, each connected to one iPad. I would like to build an app that shows the FloBLE devices available to connect to, and when a user selects one in the table, the iPad will connect only with that device. Later, I would like to have a button that disconnects the iPad from it’s currently connected device and frees it up for other iPads to connect to it.
In order to execute on this plan, I need to be able to turn off the auto connect that happens when initializing the FmSessionManager. I would also need to know how to connect to a device with its UUID and also disconnect from said device. Is this possible with the Flomio SDK Pro?
Thanks!
StevenJanuary 23, 2018 at 9:11 pm #62065After playing more with the FmSessionManager singleton, I have found the stopReader() method. This definitely works for disconnecting from the reader. However, because the FmSessionManager auto connects to the first available reader, it will automatically find this reader and reconnect to it. 😛
January 24, 2018 at 7:28 am #62066Hi Steven,
There is a feature
specificDeviceUuid
on FmConfiguration that you should use, with this you can connect to a FloBLE Plus using the device uuid for exampleRR123-456789
. You can use your own core bluetooth instance to see advertised UUIDs, then initialize the SDK with that.You would use this delegate method and use the
name
parameter on the peripheral object: Apple docsA less elegant solution is to use the sticker at the back of the device and manually type it in.
Let me know if you have any more questions about this.
Scott
January 24, 2018 at 2:22 pm #62068Great idea, Scott! Why didn’t I think of that? I’ll let you know if I have any trouble with it.
– Steven
January 25, 2018 at 9:34 pm #62078Unfortunately it doesn’t look like this is a solution. Here’s an example of what gets returned when
centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber)
returns:<CBPeripheral: 0x1c03005a0, identifier = 6D7FB6BA-5332-180B-8FC7-F9F93692E107, name = ACR1255U-J1-004839, state = disconnected> -advertisementData: ["kCBAdvDataIsConnectable": 1, "kCBAdvDataServiceUUIDs": <__NSArrayM 0x1c0249ea0>( FFF0 ) , "kCBAdvDataLocalName": ACR1255U-J1-004839] -RSSI: -46
As you can see the name property is “ACR1255U-J1-004839” and not the ID that FmConfiguration will take. So right now, I’m just going to advertise what device the app is currently connected to or display “Scanning…” if it’s not connected to anything. Not perfect, but it’ll work as long as we control our power-on sequence.
June 8, 2018 at 8:21 am #63114Sorry your most recent post wasn’t responded to.
You should be able to use the last 6 characters of the aboveACR1255U-J1-004839
to connect to devices usingspecificDeviceId
.Let me know if you have any issues,
Scott -
AuthorPosts
You must be logged in to reply to this topic.