![]() |
IDTech iOS SDK Guide
1.1.166.045
API reference for NEO2
|
The SDK has the ability to scan the area for BLE devices, and present an UIAlertView to allow user selection of a found device.
The SDK must be told which device to filter for, how long to search for devices before presenting results, and what delegate to send the results to.
To accomplish this, you define the Service Characteristic of the NEO2, define your class as the delegate, and then enable the SDK device search. NOTE: The VP3600 does not have Service Characteristics you can filter for. For the VP3600, you must not define a service characteristic when using Automatic Location
First, make sure your class is defined as a delegate for the SDK
Then execute the following code. In this example, we are asking SDK to search for 2 seconds for all NEO2 in the vacinity
After the scan is complete, the SDK will return the alertView to the bluetoothPickerAlert. You simply show this view:
Any device selected in that UIAlertView will be automatically connected. There is no further coding needed to process the selection, as the SDK is the delegate for that UIAlertView and will automtically process the selection.