Sending text from iPhone to Windows PC via bluetooth - ios

How to send data from an iPhone app to Windows app (or service) in real-time? Ideally over Bluetooth.
Basically as I type on my iPhone app, I want that text to appear on my Windows App (with-in a second or less).
How can I go about achieving this? I'd imagine there is some center-peripheral setup I need to establish. What are the libraries to use on both sides? Have never worked with Bluetooth in the past, so kinda lost. I looked into Apple's Multi peer Connectivity but that looks like iOS-Mac specific.

I have no idea on the Windows side, on iOS you would use Core Bluetooth to configure the app as either a peripheral or a central.

Related

Bluetooth iOS Windows

I recently developed an application for a client, an app iOS, Android and windows, the mobile app acts as a controller and launches certain events on the windows application. The Windows application also shares data at random (not known to the mobile app) moments. The communication was done by TCP. And works great.
The client now wants it for bluetooth. Between Android and Windows, it's not been a problem and has been done, and works well. But iOS is sadly not the same story... The use of Bluetooth low energy seems to complicate things.
I've hunted high and low on google to find anything on communication between a .net application and a Swift application, to no avail. This surprises me that no one talks of a bluetooth communication between Windows and iOS.
My question is, very simply. Is it possible? I know very little about bluetooth and I've tried researching devices and all I find is a BeeWi device that's in our office, not my computer (I maybe need to launch something on computer first? The devices are paired)
My computer has a Bluetooth 4.0 dongle and the BLE emulator is present in the Device manager.
If this isn' possible, tell me know and put me out of my misery, otherwise give me hope!
Any additional advice is warmly welcome - Thank you all !
Beau Carrel
Windows has support for being a BLE client. Just Google it and you'll find many examples, such as https://developer.microsoft.com/en-us/windows/iot/Samples/BLEGatt2.
You need to set up iOS to be an advertising peripheral.

RS232 for iOS device

Is it possible to pair an iDevice to an rs232-bluetooth adapter for the purpose of sending serial commands like it would through an iDevice dock connector to rs232 (just like the Redpark Serial Cable does)? I ask because the company I work for is thinking of having an iDevice control one of our systems for demo. I know it doesn't relate to anything specific but any information would be greatly appreciated.
(See also iPhone to RS-232 via Bluetooth)
Bluetooth modules exists that support MFi (Made For iPhone) such as this one from connectBlue http://www.connectblue.com/products/bluetooth-products/bluetooth-modules/bluetooth-iphone-ios-accessory-module-obs414/ So the standard iPhone Bluetooth stack can make a SPP/RFCOMM connection to that device. That device could be added to a board along with RS232 level-conversion etc... And thus success.
I don't know whether someone sells such a device. The RS232 device that connectBlue sells seems not to support MFi, http://www.connectblue.com/products/bluetooth-products/bluetooth-devices/bluetooth-rugged-serial-port-adapter-rbs433/
Not really. The GameKit is one way to access bluetooth in iOS, but it is very limited in what that API allows you to do.
Depending on what you are building, you might be able to use the Apple Made for iPod program, but it's probably a long shot.
http://developer.apple.com/programs/mfi/
The best way to go is probably to design a device that connects via WiFi. I've gone this route, and it worked out well. If you must interface with something with an RS-232 interface, you might design an intermediary "adapter" that connects via WiFi to the iOS device, and via RS-232 to the other device.
If you don't have a need to distribute your app via the App Store, you can use Redpark's iOS serial cable: http://redpark.com/c2db9.html. (Disclaimer, I've never tried one, but according to someone at Redpark, jailbreaking is not required, you just can't distribute your app on the app store.)
You could design a small dongle that attaches via the dock connector, and broadcasts over bluetooth to your other device.
Or you could use WiFi instead of bluetooth... perhaps communicating over WiFi to something that's physically plugged into whatever you want to control.
I worked on a jailbroken app which used BTStack to communicate with a serial device. You might be able to use this for your demo.
If you're still looking to use bluetooth, this helped me out alot to facilitate the standard serial connection for prototyping without jailbreaking:
http://www.seeedstudio.com/depot/bleshield-based-on-bluegigas-ble112-module-p-1367.html
It works on the Bluetooth 4.0 enabled iOS devices and all of the schematic, boardfiles, firmware sources and the iOS App sources are available here:
https://github.com/michaelkroll/BLE-Shield

How can I setup peer-to-peer connections without using GKPeerPickerController?

I want people to be able to start my iOS app on their device, and anyone nearby running my app (probably bluetooth only for now) would automatically connect with each other. I've read about and used GKPeerPickerController, but I don't want the user to have to think about which device they want to connect with.
I'm just not understanding how to handle the connectivity without using GKPeerPickerController.
I am targeting iOS 5.0 with this app. Thanks!
This page goes into more detail on how this is possible, although the focus is more on using just bluetooth: http://www.iphonedevsdk.com/forum/iphone-sdk-development/40710-gamekit-api.html

IPhone Bluetooth Connectivity to Non IOS Devices

I was wondering, if there is a way to use IPhone as an HID device, with some other device like PS3. I checked out the Bluetooth specification and IOS Devices do support HID Profile. So I thought it would be easy to pair my iPhone using passkey mechanism and should be able to start using my iPhone as keyboard or mouse without much hassle. But I found very soon that this assumption is naive and I need to develop custom solution.
I was initially thinking about using GameKit framework, but I think it only works between two compatible IOS Devices. If I want to extend this capability, then I have to use iPhone External Accessory API .In my analysis, I also found that iPhone will only communicate and pair with devices that are licensed by Apple. (Made for iPhone\iPod program). Does it mean that, if I want to use iPhone with another device, I need to get that device approved by Apple. ( Which will not surprise me one bit). Also if someone could point me to more detailed documentation on this, that will also be helpful.( What is an MFI developer board ??)
I do not want a solution that needs me to jailbreak an iPhone. (or any solution that will disqualify my app by Apple).
So to summarize:
1- Please validate my findings, correct them if they are wrong?
2a- How does External Accessory API Work?
b- Can I use this to connect to third party accessories ? (or is this only for accessory developers).
3- Or is there a better solution without using External Accessory API?
Please provide supportive documentation or link if you can. Thank You.
You are unlikely to get on the External accessory program from apple unless you are a big company ( you can try, but I have read this a number of places) . iPhones use a proprietary Bluetooth interface that and hardware must also implement this interface, so not much chance of getting it to connect to any other hardware directly.
Most apps like this (Remote Mouse) for example, connect to your wifi network, and have another application installed on your computer. The iphone can then talk to this application over the wi-fi network, but not bluetooth. I would suggest that the only way I can see this would be possible to to create the server app that you install on a computer on the wi-fi network that then in turn controls the 3rd party device if there is an API that you can use from the desktop app to control the 3rd party device.
This is just what I have found when I researched about this for making an app for iPhone to control a bluetooth watch. I had to jailbreak in the end to replace the bluetooth stack on the iPhone with one that could connect to any hardware device. Not limited by apple.

Bluetooth programming in iPhone

I am planning to develop an iPhone application to transfer files/data to/from my Windows Desktop using Bluetooth.
Please let me know whether the programming interface(SDK)is available in iPhone SDK for this purpose.
In Windows Mobile, I can transfer the file either using a FTP profile or writing application on top of Serial Port Profile(RFComm).
Can anybody tell me, whether this can be possible with an iPhone by writing appropriate application. If not, please let me know alternative way to transfer files/data over bluetooth from iPhone to a Windows Desktop PC.
No, FTP or SPP bluetooth profile are not open in iPhone...
If you get into the made for ipod program, you might develop a bluetooth dongle for a computer (it can't use the normal one built into the computer as it needs a custom apple chip for encoding). This is the only method that could do something like what you want over bluetooth and get your app into the app store. You can implement a similar functionality more readily over wifi.
Yes you can. Use the Human Interface Device profile, and have your USB device pretend to be a keyboard. You can then have your app receive text input from the "keyboard". simply encode your data as ASCII encoded hex or base 64 and transmit. Whether or not your app would be allowed in the app store is a different matter.
There are 2 requirements to use iOS BT Classic for data transmission over RFCOMM.
1) You need to be enrolled in Apple MFi program.
2) The BT accessory which will be connected to iPhone needs to have a special HW chip called "MFi Coprocessor".
Both requirements need to be satisfied if you are developing FW for the BT accessory.
The latter one is required when you are coding iOS app.
BTW, you will not be able to communicate with Windows machine unless you have a BT dongle with MFi chip inside - see the second requirement.

Resources