iOS Implementation of BLE GATT
You can demonstrate the operation of the VTAP PRO GATT server with an iPhone or iPad using a free BLE scanner app for iOS. (We have tried BLE Scanner 4.0 from bluepixel technologies, although there are a number of other similar apps that allow BLE device services to be explored).
Use the app to can scan for BLE devices and see the name that they advertise. (This will be the VTAP serial number, unless it is overridden by a BTServerName setting in the config.txt file on your VTAP reader). You can connect to the peripheral device and see its advertisement data and services. You can then explore the custom service (D0F0) and view the three custom attributes as described under VTAP BLE GATT custom service. The BLE scanner app may not show you the full JSON payload or allow you to easily write a complete JSON action response, but it demonstrates how the BLE server works and what is possible from your own app under iOS.
To implement this ability within your own iOS app, you will use the CoreBluetooth API as described here:
Start by creating a CBCentralManager class instance and calling scanForPeripherals. You can find devices advertising the service UUID D0F0.
You can override the CBCentralManager didDiscover method, to receive notifications of any matching devices and their advertisement data. The advertisement data will contain the VTAP serial number as the device local name (unless it is overridden by a BTServerName setting in the config.txt file on your VTAP reader).
When your app finds the VTAP PRO reader that it wants to connect to, it can call the CBCentralManager connect method and expect your supplied didConnect override to be called, receiving a CBPeripheral object.
With the CBPeripheral object you can call the discoverServices method and expect your supplied didDiscoverServices method to be called with the single D0F0. You can call the CBPeripheral discoverCharacteristics method to find the exposed characteristics and use the CBPeripheral setNotifyValue method to receive updates whenever the VTAP receive characteristic (with UUID D0F2) value changes. You can then use the CBPeripheral readValueForCharacteristic and writeValue:data for characteristic methods to read the tap data payload JSON blob and, optionally, write the action response JSON blob back to the VTAP PRO reader.