Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

There are two phases to a

...

Bluetooth device:

...

pair and connect.

...

Pair links a BLE device to a phone.

...

Connect allows communication.


When you have a brand new VP3300, the device pairs the first time you

...

use it

...

.

...

This is when the iPhone finds the VP3300, assigns a unique UUID, and then pairs to it

...

; after that, the phone and device can communicate

...

.

...

After

...

pairing, the device appears in the iPhone

...

's Bluetooth settings.

...

Anytime your phone is near that device, the iPhone automatically pairs.

...

 This means you cannot use that device on another iPhone if your iPhone is nearby

...

because your

...

iPhone is already paired.

...

To use that VP3300 on another device, you either need to make sure

...

your iPhone is no where near the reader,

...

turned off, or

...

you must go into your iPhone's Bluetooth settings and unpair the reader (note: although you cannot pair a phone and reader from the Bluetooth control panel, you can unpair the two using the Bluetooth control panel).


When you start your application, search your

...

settings to see if you have ever connected to a VP3300 before.

...

If it's the first time

...

, you

...

must connect to a VP3300.

...

Because the VP3300

...

does not have a

...

Bluetooth name

...

applied, you

...

must scan the area for

...

Bluetooth devices.

  1. First,

...

  1. set the friendly name to

...

  1. an empty value by executing device_setBLEFriendlyName with a

...

  1. an empty string for the name.
  2. Next, do a search for BLE devices by calling device_enableBLEDeviceSearch, passing nil as a identifier.

...

  1. Because there is no BLE friendly name set, nothing will be paired. But while

...

  1. the phone is searching, the SDK is reporting

...

  1. all the devices it is finding in the area

...

  1. back to the deviceMessages delegate; it is reporting back "BLE DEVICE FOUND:" followed by device names.
  2. The application needs to collect all these names it finds.

...

  1. After the application thinks it has found all available names (

...

  1. let the scanning happen for 20 seconds or so),

...

  1. execute device_disableBLEDeviceSearch

...

  1. to stop the phone from draining the battery continuously scanning

...

  1. .

...

  1. The application now must present those

...

  1. names to the user and have them pick a device to connect to.

...

  1. After the application knows what device to connect to, it passes that device name to device_setBLEFriendlyName.
  2. Now the application asks the SDK to scan again, calling device_enableBLEDeviceSearch

...

  1. and passing nil as a identifier. This time, it

...

  1. connects to the device with that matching name.

...

  1. After connecting, the application asks the SDK what NSUUID the Apple device assigned to our VP3300 by calling device_connectedBLEDevice. This

...

  1. returns the device's UUID.

...

  1. The application must store this number in memory

...

  1. when you quit your

...

  1. application, and can then

...

  1. execute device_disconnectBLE.
  2. The next day, when the

...

  1. application starts,

...

  1. it will see there is a VP3300 UUID in memory already (the

...

  1. application has previously paired with a VP3300), so now, on

...

  1. application startup,

...

  1. the app executes device_enableBLEDeviceSearch

...

  1. and passes the UUID.

...

  1. The

...

  1. application will automatically reconnect to the device from now on by doing this on each startup

...

  1. .