0

I have RFID reader, which is not LE device.

https://www.tsl.com/products/1153-bluetooth-wearable-uhf-rfid-reader

I'm trying to write an iOS application, scan this device and connect it using swift CoreBluetooth library but my App finds everything besides this device. How is it possible to scan this reader?

import UIKit
import CoreBluetooth

class ViewController: UIViewController, CBCentralManagerDelegate {

    var manager: CBCentralManager!

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.

        manager = CBCentralManager(delegate: self, queue: nil)
    }

    func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) {
        print(peripheral)
    }

    func centralManagerDidUpdateState(_ central: CBCentralManager) {
        switch central.state {
        case .unknown:
            break;
        case .poweredOff:
            break;
        case .poweredOn:
            manager.scanForPeripherals(withServices: nil)
            break;
        case .resetting:
            break;
        case .unauthorized:
            break;
        case .unsupported:
            break;
        default:
            break;
        }
    }
}
Leri Gogsadze
  • 114
  • 1
  • 8

2 Answers2

2

That device states that is MFi certified and uses the SPP profile, not the BLE GATT profile. This means that you will need to use the External Accessory Framework, not Core Bluetooth, to communicate with it.

You will need to the manufacturer provided iOS SDK for the device. If they do and you want to release your app on the App Store then they will also need to approve your app and supply some paperwork to Apple.

The device says that it also supports the HID profile, so perhaps you could just treat it as a keyboard; This doesn't require any code but isn't the best user experience.

Paulw11
  • 108,386
  • 14
  • 159
  • 186
  • Thank you for your reply. I have already build APK for Android. Will it be also necessary to contact the manufacturer to release APK on the Play Store? – Leri Gogsadze Jul 02 '19 at 06:53
  • No, Android/Google doesn't restrict the use of SPP. Apple requires the MFi licensee to approve your app's use of their peripheral's identifier. – Paulw11 Jul 02 '19 at 06:54
  • I have implemented your advice about writing my App using External Accessory Framework but when my device scans NFC tags, input stream reader delegate doesn't fire. I have posted a new question https://stackoverflow.com/questions/56988131/easession-stream-function-doesnt-fire here. Can you help me? – Leri Gogsadze Jul 12 '19 at 11:57
-2

You need to use CoreNFC to read RFID tags. No need to use CoreBluetooth at all.

https://developer.apple.com/documentation/corenfc

Aaron
  • 2,403
  • 1
  • 24
  • 25