Connecting to the IDTECH VP3300 Bluetooth Reader faster while using the iOS framework
Quest Mobile SDK's
The initBluetoothSearch initializer on the ClearentConnection object will perform a Bluetooth scan with the following:
Because this is a Bluetooth scan it’s likely you will not get the final results (via the public delegate callback method called BluetoothDevices) until the scan times out at 10 seconds.
This latency can contribute to a poor user experience especially if you have to scan with every transaction. The advantage of using the 60ms Bluetooth advertising interval (which makes the Bluetooth reader “extremely chatty” in the Bluetooth spectrum) is negated.
To decrease latency, your application should be aware of which reader it is connecting to. The goal is to cache the reader info to use later. Once you connect, get the friendly name by calling the device_getBLEFriendlyName method on the Clearent_VP3300 object. The other option is to call the config_getSerialNumber method.
If you have the friendly name now you can use a different initializer on the ClearentConnection object called initBluetoothWithFriendlyName. The scanning logic likes it when a reader is known in advance and will stop scanning the moment it finds the device.
If for some reason the friendly name cannot be determined, you can identify the last 5 digits of the device serial number from the config_getSerialNumber. With this information you can use the initializer initBluetoothWithLast5 on the ClearentConnection object. The scan logic will take the known prefix of IDTECH-VP3300- and add the last 5 to the end. It will then stop scanning the moment it finds this friendly name.
If you decide to do this keep in mind you now have stored a piece of data that will probably need to be exposed to the user, or you will need to provide some other means of giving the user the option to “Forget Device” in case they end up with a second reader within range they would like to connect to.
Here are a couple of ideas that would take longer to implement but we’ve seen other apps do this.