Connecting an iPhone app to a PC app via Bluetooth - ios

I am currently researching the possibilities of connecting an iPhone app to a windows app via Bluetooth.
The Windows App is written in C# and uses Serial ports to transfer Data. Windows allow me to connect a serial port to Bluetooth. This setup allows communication via Serial over Bluetooth.
I know this setup works because I have managed to communicate with this setup from an Android phone.
I don't seem to be able to do the same with an iPhone 5s (I can't even seem to pair the iPhone to the Windows PC). I haven't been able to test this with a more recent iPhone, but I don't expect it to work either since it's an Apple device with a Windows machine.
I've done some research regarding the possibilities of connecting an iPhone to something else (like a PC) over Bluetooth, and it doesn't seem to be possible.
I have found this SO answer which seems to say that I cannot use Bluetooth Classic to connect an iPhone to a PC.
Since I can't seem to be able to use Bluetooth Classic, I have also tried to use BLE, but I haven't worked out how to simulate the PC as a "peripheral device" to connect to it from the iPhone. I don't even know if that's possible.
So basically my questions are:
1) Is it possible to communicate via Bluetooth between an iPhone and a PC?
2) Would it be possible to use some sort of adapter for the iPhone to connect to the PC (For example, an Arduino with a Bluetooth chip, acting as a BLE peripheral, and sending the data to the PC?)
3) What alternative would I have to this? I know WiFi might work, but I am uncertain if the PC running the app will be network enabled when the project goes live.

You can connect an iPhone with PC over Bluetooth using BLE.
I tried with Linux machine (Ubuntu 16.04 with BLE dongle 4.0) which acts as BLE Peripheral and iPhone 8 with BLE 5.0 as central application. Both could able to successfully communicate using custom GATT service that we developed. The throughput i observed here was 2.5 kiloBytes per sec.
If you are so specific on Windows to act as BLE Peripheral, then i believe there are apps available in Windows store to download which enables Windows PC to act as peripheral. Once peripheral mode is enabled, you can always communicate to this over BLE using iPhone [recommended latest phones]. But you need to try this out.

Related

Communicate iOS with ODB 2

I need to create an app read info from the ODB2 device installed in a car and show the data to the user but in a "funny" way. So I need to read the data and connect the phone to internet simultaneously.
I found this questions:How to communicate with OBD II using bluetooth or wifi using iphone , but is from 2014, maybe now there is something.
I've been looking for an ODB2 device that can communicates with iOS via Bluetooth.
I found a couple of devices that can do the trick (like viecar or bluedriver), but using their own apps. Also, I found some devices that can talk with iOS via WiFi, but it would be annoying to be connecting your device to WiFi, then turning off WiFi and using mobile data again...
So my questions is:
Is it there any way to communicates via bluetooth with an ODB2 devices? Or better said, is it there any ODB2 device that can be used via Bluetooth with iOS?

Why iOS devices running BLE GATT Service in peripheral mode are not discovered in Windows (and Windows RT) 8 & 8.1

I have used the Heart Rate Monitor sample application C# and modified it to look for my custom profile that the iPhone is advertising. I double checked if the iPhone Peripheral is working using a Mac configured as central and android device also as central. The android device is not connecting to it because of an issue in andoid api but it can see the service.
I paired successfully the two devices (iOS and Windows, iOS and WindowsRT) and they are connected. I also restarted the Bluetooth on the both devices and reconnected them multiple times before debugging.
The windows 8 Heart Rate Monitor sample and the windows 8.1 Heart Rate Monitor sample doesn't discover the iPhone device service with the given uuid. I also tried to leave the UUID to the default one and mimic the Heart rate peripheral using iOS but with same outcome.
I even tried to connect to every BLENUM device that findAllAsync() discovers and none of them provide the configured custom service.
Multiple solution proposals are welcome, the support for Windows BLE is next to nothing.
After working on BLE for a while i found out this:
Keep the advertised data shorter than 26bytes (36 including the name), otherwise it will not show in the findAllAsync() result.

iOS to Mac OS X [core] bluetooth data transfer

My objective here is to create a connection between a device running iOS to a device running Mac OS X, via bluetooth. I know that I might be able to use CoreBluetooth for this but I don't understand how since I don't see a method to setup a service on the iOS device and broadcast it as an available service for a device running Mac OS X. In other words, I simply want to setup a connection to get the iOS device to send data to the Mac OS X device. Also, how would I go about to specify how to setup properties of the service. I've tried researching this stuff but most of the documentation makes little sense to me. The data transfer is small so bluetooth is good enough for the job. I'm trying to avoid Bonjour for this, and the Game center framework for P2P since OS X can't handle that (I think).
In iOS6 the iPhone 4S, 5 and New iPad can work both as Peripheral and as Central in Bluetooth Smart / Low Energy mode.
Try downloading "LightBlue" APP from APP Store. It let's you put the iPhone4S or 5 into Peripheral mode with random Services which you can then read from the Mac (if you have a newer one with BT Low Energy, I use the Retina for that but also the new iMac and Mac Mini got BT Low Energy).
You are correct that Core Bluetooth only give access to Bluetooth Low Energy which doesn't allow for the MFI chip.
Just ran across this today... and just wanted to give another answer to anyone needing to communicate to a non-Bluetooth LE device from your Mac.
The way to go is with IOBluetooth, and IOBluetoothUI.
They are both frameworks for the Mac, and they allow you to communicate with both old bluetooth, and Bluetooth LE 4.0, I believe. Also, I'm pretty positive you can act as a Central and Peripheral Device using this framework.

ExternalAcessory Framework for iOS: using the iphone as a usb device

I'm looking into the iOS sdk for examples of the ExternalAccessory framework to use the iphone/ipad as an USB device that can be plugged into a PC or Mac and present as external device (like a midi controller or something else)
The App i want to create requires connecting to a host (PC or Mac) the iphone via USB or bluetooth and present to the host a functionality. How can i implement this?
You'll probably have an easier time connecting via WiFi. You need to be part of the Apple Made for iPhone program, which is not easy to get into, to use Bluetooth or the dock connector to talk to peripherals. There's no such restriction on the use of WiFi. Also, you'll find a lot more helpful examples of connecting via WiFi on the web.
CoreMIDI is the appropriate API for emulating a MIDI device, which may be possible over USB using Apples Camera Connection kit.

iOS app communicate with an app running in OSX via usb cable connection

Does iOS SDK provide a way to let iOS app talk to app running in OSX/Windows via usb cable connection?
Or, socket is the only option?
If you want to interact with an OS X program from iOS via USB, the PeerTalk lib seems to provide a convenient way to do so (without having to join the MFi program).
According to the github page, PeerTalk
Provides you with USB device attach/detach events and attached device's info
Can connect to TCP services on supported attached devices (e.g. an iPhone), bridging the communication over USB transport
Offers a higher-level API (PTChannel and PTProtocol) for convenient implementations.
[is] Tested and designed for libdispatch (aka Grand Central Dispatch).
It also
has successfully been released on both the iOS and OS X app store.
A great example is Duet Display which is a fantastic piece of software allowing you to use your iDevice as an extra display for your Mac using the Lightning or 30-pin cable. [...]
Communication via USB cable is possible but everything is under strict MFi NDA.
One link that might interest you:
Microchip: 3-step Approach to Develop iPod®, iPhone® and iPad® Accessories
Some more information on Apple MFi program
There are no fees to enter the program but you will have to fill out some 'paperwork'.

Resources