Accessing Bluetooth via Bonjour/GameKit from the iPhone SDK simulator (circa 3.1.3) - iphone

I'm in the process of getting hardware for an iPhone prototype, and I'm wondering if it's possible to access bluetooth (ExternalAccessory, Bonjour or GameKit) exposed by development box (eg. a macbook) using the SDK's simulator as of the latest version (3.1.3 at the time of writing)
Before I get any answers on the subject, I accept that I will need an iPhone for the actual development - this is simply a prototype.

I'm not sure I understand your question entirely.
I can state that in iOS (as of May 2011) the only access you have to bonjour is through the Gamekit functionality. That functionality is fairly robust, but (for instance) you will not be able to create a BT based bonjour service that other non-iOS BT enabled devices can find.
On the simulator, even if the underlying device HAS bluetooth capabilities, you will NOT be able to perform "real" bluetooth operations. Instead the simulator will simulate some capabilities, and ignore others. You really do need multiple devices to load your code onto and run, in order to test out BT code.

Bluetooth connectivity is inaccessible using the Simulator. If WiFi is good enough for you, that works with Bonjour and GameKit on the Simulator as well. Otherwise, just like for the accelerometer and several other components of the device, you will need an actual device.

Related

How to discover another device without using Gamekit, EAaccessory and core Bluetooth framework in iOS?

I want to detect the device without using GameKit framework, EAaccessory framework & core Bluetooth framework. Since the device which i want to discover doesn't have BLE.
Can it possible in iOS ?
You will need to be in control of your device, otherwise there is no way.
If you're controlling your other device, you can setup Bonjour on it. Beware this is not an easy walk - neither on the device's side nor on the iOS side.
The Apple docs (https://developer.apple.com/bonjour) don't help too much, but https://github.com/tolo/HHServices might help you get started with the iOS side. (It's designed for iOS to iOS over Bluetooth, but the code should also work with WiFi with minor modifications. It will not work with Non-MFI Bluetooth devices.) For the device side, you might want to have a look at http://jmdns.sourceforge.net.

How can I connect an iOS device to non iOS device (Arduino devices) via Bluetooth?

After searching on Google, I found that people say it's only possible to connect an iOS device with a non iOS device with the 'MFi program'. Is that true?
My project is mainly focused on sending and receiving information with the Arduino device via Bluetooth directly.
Is communication between iOS and non iOS devices without jailbreak possible? If yes, is there a reference?
(I viewed Stack Overflow question How can an iPhone access another non-iPhone device over wireless or Bluetooth?.)
As I stated in the above-linked question, general Bluetooth communication to external devices on non-jailbroken iOS devices is restricted to MFi-compliant Bluetooth hardware.
However, newer iOS devices (iPhone 4S, new iPad) are capable of Bluetooth 4.0 LE communication with external devices without the need for those devices to be MFi-compliant. This interaction is done through the new Core Bluetooth framework, which lets you send and receive arbitrary data to and from Bluetooth LE devices. This only works with those listed newer iOS devices, though.
Tim points out an interesting hack that you might be able to get away with in making your device appear like a Bluetooth HID keyboard. Devices like this barcode scanner have special modes to appear as HID devices to iOS. You might be able to pull something together based on this, but all data transfer will be one-way from your device, and it looks like this will require entering that data into text fields as if you had a keyboard connected.
Alasdair Alan's "iOS Sensor Apps with Arduino" is a good resource to look at. I've used Wifi with another microprocessor (mbed) but not sure about bluetooth. Alasdair is active on Twitter and he usually is kind enough to answer questions.

Sending data via bluetooth on Iphone (iOS 5.x)

I have been searching and searching, but found nothing yet. Is it really true that there isn't a straightforward way to establish a BT connection from my iPhone to another (3rd party) BT device, i.e. an audio receiver. I know this is possible through the OS (I own a Belkin BT music receiver that works this way - it appears in Settings and from there I can connect to it). Note that I am not interested in pairing to iOS-devices, but an iPhone and my custom made hardware.
I've managed to find Google's BTStack at code.google.com, iBlueNova, Celeste and more, which all must be run through Cydia or similar and also I stumbled upon Apple's MFI-program, which seems fairly complicated.
Does anyone have any experience with bluetooth and iOS, if so, how and where do I get started?
If one might be interested, the project I am developing involves a piece of hardware with a BT device attached on it. The app should be able to send simple commands via bluetooth (basically just ASCII characters) to the device, which will react depending on what it receives.
If you are developing accessories that need to connect to iOS devices and want to use your own communication mechanism then your only option is to join the Apple MFi program.

Best platform for Bluetooth Applications

Which Mobile Application platform do developers prefer for Bluetooth Based application development ?
What do developers think on the current available API's on these platforms ? Does it meet most of your needs ?
What kinds of APIs / capabilities for applications would you like to see.
The iPhone is a bit locked down for general Bluetooth connections. Between iPhones it's easy, using GameKit. Between iPhone and headset is also, as I understand it, easy. But when it comes to talking to an arbitrary device over BT you need to use the External Accessory framework. This is fine and easy to use, but you need to be connecting to an Apple-licensed device. For the project I've been working on, this was fine because we control the BT device that we're connecting to. But in other cases, this limitation could be a serious negative.

How can an iPhone access another non-iPhone device over wireless or Bluetooth?

I'm trying to figure out if an iPhone can connect to another non-iPhone device over wireless or Bluetooth and have seen conflicting information. Much of what I've found was before version 3.0 of the SDK came out, when it certainly wasn't possible. Looking at Stack Overflow questions, like Can the iPhone 3.0 SDK provide full access to Bluetooth devices (headsets)? mention you can't connect to an arbitrary device unless if it's part of the "Works for iPhone" device. Do I need hardware that is part of this program?
Looking through the Apple documentation, Peer-to-Peer Connectivity, it mentions connecting two iPhones, not an iPhone to another Bluetooth device. Then there are articles like iPhone SDK focus: Bluetooth enhancements that includes this quote
...and with the newly-announced "standard support" should allow file transfer between the iPhone and a computer, as well as between nearby iPhones
Another Stack Overflow question, GameKit in iPhone SDK 3.0, mentions Bonjour, and the Apple documentation for Bonjour talks about connecting to Bonjour devices, but can an iPhone connect to any Bonjour device? Does it have to have a Wi-Fi connection, or can it use Bluetooth?
Even if I could use Bluetooth to connect to another device, it won't be available on first generation iPhones and iTouches, I believe. Is that correct? I'm thinking of an iPhone application that would need to communicate with other non-iPhone devices in the area, probably using Bluetooth, but possibly a direct wireless connection. What are the possibilities and limitations of this approach? Is it not possible to have an iPhone connect to an arbitrary Bluetooth device? Does the other device have to be on a wireless Bonjour network that? I'm trying to figure out if it's even possible for this to work or if it's not worth the effort.
The only way to communicate with other Bluetooth devices via the External Accessory framework in iPhone OS 3.0 is if they are in the Made for iPod accessory program. Even though they communicate through standard Bluetooth connections, accessories need special hardware in order to process the data stream coming from the iPhone / iPod touch. Unfortunately, this means that your idea of communicating with generic Bluetooth devices won't work on iPhone OS 3.0.
If the devices you want to talk to are Bonjour-discoverable via Wi-Fi, they don't need to be part of the Made for iPod program. However, that doesn't sound like your case.
Third-party developers in the near future may produce dongles that connect through the 30-pin dock port and give access to existing Bluetooth devices. If these developers opened up their communication protocol, that might enable your goal of communicating with these devices.
You can use NSStream for opening IPv4/IPv6 sockets on the iPhone. The devices to which you're connecting do not have to be iPhones or use Wi-Fi necessarily. Because of how network communication protocols are laid out, you simply don't have to care what kind of device your iPhone is communicating with.
Bonjour, on the other hand, uses NSStream internally. It's basically a nifty little wrapper which allows for auto-discovery. You need the Bonjour protocol installed on all devices which you want to participate in the auto-discovery process. There is even an implementation for Windows.
As part of the iPhone OS 3.0 SDK, Apple announced the ability to control hardware accessories through either Bluetooth or the dock connector. The dock connector supports standard protocols (that is, play, pause, etc.) as well as any custom protocols the developer wants to implement.
As far as connecting via Bluetooth, you can talk to other iPhones or other devices. For example, you can use stereo Bluetooth to connect compatible Bluetooth stereo headphones, car kits, or other accessories.
As far as what devices support Bluetooth communication, everything except the first generation iPod Touch should be okay.
See also Apple's page on iPhone OS accessories.