How to scan and connect to Bluetooth classic for iOS in Xamarin forms? - ios

I'm trying to implement Bluetooth for my project. I was able to implement BLE but I have to go with Bluetooth classic because of some hardware issue. So for Bluetooth classic implementation I have gone through this post and I used source code from this post. But in that they are trying to connect to already paired device. But my requirement is to scan and connect to available Bluetooth classic device not BLE device. And also there should not be any pairing dialogue appearing while connecting. I even tried to check if there is any Bluetooth classic scanner application in app store for reference but I didn't find any. There are only BLE scanner application in app store. I have no clue how to proceed forward any suggestions?

iOS apps can only connect to MFi enabled Bluetooth classic devices. This is why you can't find any classic BL scanner apps. Unless your hardware contains an MFi chip from Apple you will not be able to use classic Bluetooth profiles, such as SPP, to communicate with it.

Related

Looking for an Xamarin.Forms bluetooth library for IOS that will pick up already paired devices to my iphone

I've got an existing PCL Xamarin forms app which works great. New requirement is to connect a Biocontrol Hhr3000 scanner via Bluetooth to the .ios version of my project. Workflow is, i first connect and pair the scanner to my iPhone over Bluetooth. I need a non LE (low energy) Bluetooth library which i can use to work with this. All i can find on the internet is all examples of LE Bluetooth so as it stands i cant get the iPhone to pick up the scanner via normal Bluetooth pairing.
Please point me in the right direction. I'm looking for an ios implementation thats simple like this one for android: https://acaliaro.wordpress.com/2017/02/07/connect-a-barcode-reader-to-a-xamarin-forms-app-via-bluetooth/
If the device is Mfi Certified by Apple, then you can use the External Accessory Framework to interact with the bluetooth device. If you can pair it, I have to assume it is Mfi Certified.

Connect to a Bluetooth Classic (Not LE) device on iOS, without using the External Accessory Framework

Is there a way to establish a connection from a bluetooth classic device (not LE), to an iPhone, for data exchange?
The device we are using has a bluetooth classic chip, therefore it is not possible for us to use the Core Bluetooth Framework to make the connection since Core Bluetooth supports only Bluetooth LE.
I would like to connect our device using the Hands Free Profile or the HID Profile. How would we do this in the iOS Code? What frameworks or APIs are to be used?
The external accessory framework supports only MFi compliant devices. Do we have to be a part of the MFi Program? Or is it possible to establish the connection in some other way, something that I may be missing out?
Also, jailbreaking is not an option since we wish to release the app to a larger user base while selling our hardware device. We want to enable the users to make a connection through the app to their device.

Use bluetooth in iOS application

I'm currently digging my through the nest of using Bluetooth in my iOS application and I find it quite hard to find the information I'm looking for.
Can I turn on Bluetooth from within my app or does the user have to do it manually?
Can I use the basic Bluetooth fetaures (such as Discovery, connecting and Sending Data) with other devices running Bluetooth < 4.0 (classic)
AFAIK CoreBluetooth Framework can only be used to communicate with devices running Bluetooth 4.0+. Which framework is used to communicate with Bluetooth < 4.0 devices?
Is it possible to use Bluetooth in such a way that Apple will reject my App on App Store? And which ways would that be?
Is there a difference between paired and unparied communication? Can one communicate with another device without being paried? Can pairing be initated from an app?
To give some Context to my question: I'm currently developing a part of a Home Automation Application where the App needs to communicate with an embedded device which does not yet have Wifi. It has not been decided which Bluetooth version will run on the embedded device. The same functionality will be implemented in an Android application.
Thankful for some input from some with Bluetooth experience for iOS.
you cannot turn on Bluetooth from your app. The user must do it using settings or the control center.
unless you device is MFi certified you can only communicate with Bluetooth Low Energy devices
the external accessory framework is used to communicate with MFi devices that use "classic" Bluetooth
I am not aware of any use of Core Bluetooth that will lead to app rejection. If your app supports an MFi accessory that isn't associated with your company then your app will be rejected.
you can initiate bonding (commonly known as pairing but it is actually different) by requiring encryption for an attribute. Once the bonding is complete there is no difference in how you transfer data, but the data will be encrypted over the air.

Test Bluetooth on iOS

I'd really like to start testing my iOS apps Bluetooth capabilities, but have run into a few problems:
I have a device made with a RN-42 module, but it's not the Apple version and I don't have the Apple authentication module at the moment (I ordered it, but shipping from China can take a while). I know what the messages will look like, but can't send them to my iPhone!
I can use the module with my Macbook, but not in the iOS simulator! Apple has taken down all of the documentation related to getting the iOS < 7.0 to use a separate bluetooth dongle, and my efforts have left my 6.1 simulator endlessly spinning on the bluetooth screen.
I'm new to using Bluetooth, so this may be a dumb question...
Is there a way of getting a bluetooth client device (I have a Mac, another iPhone, and an Android tab) to act as a server module that can send (and receive) Bluetooth data to my iPhone?
Client/Server as per developer.bluetooth.org
Thanks!
Not 100% sure your meaning of "server module". But in CoreBluetooth, you can use CBPeripheralManager to broadcast data to other iOS or Mac apps.
https://developer.apple.com/library/ios/documentation/CoreBluetooth/Reference/CBPeripheralManager_Class/Reference/CBPeripheralManager.html
If you're using standard Bluetooth (i.e. not Bluetooth LE or Bluetooth Smart or whatever you want to call it), you'll need to enroll in the MFI program or work with an MFI certified device (such as a Redpark cable) and use the External Accessories library provided by Apple. If you're using Bluetooth LE, you can use the Core Bluetooth library provided by Apple. If you fall into neither of those cases, sorry, you can't use Bluetooth on iOS.

Arduino and iPhone connection with Bluetooth 3.0

I would like to build an app that requires bluetooth connection. The Bluetooth HC05 module is connected to Arduino. I want to know what framework (or other related things) that I need to build an app that can connect to this Bluetooth module.
Still have no idea how to start. Anyone could help?
Unfortunately the answer might be "you can't do that".
iOS only supports the following Bluetooth profiles: HFP, PBAP, A2DP, AVRCP, PAN, HID and MAP. None of those can be used inside an app to communicate to your Arduino.
For the useful profiles like Serial Port Profile (SPP) and all arbitrary bluetooth communication you have to add an authentication chip to your Arduino. Unfortunately you can't buy these chips unless you have a MFi membership. And you won't get into the MFi program unless you are a company with a concrete product (mass market scale) in mind.
Fortunately, we now have Bluetooth Low Energy. Bluetooth LE can easily be used in iOS apps, without all the MFi hassle. So you should get a Bluetooth 4.0 module for your Arduino.
The framework that is used for Bluetooth 4.0 communication is called CoreBluetooth. You will find documentation, sample code and WWDC videos in the iOS Developer Center. Start with the Core Bluetooth Programming Guide

Resources