Is it possible to stream music over a bluetooth p2p connection using iPhones - iphone

I am trying to connect multiple iPhones using bluetooth. I was thinking of having a server/client system. I just want to know upto how many devices can be connected using bluetooth? I am not able to find a reliable answer online.
Also If you know of any good tutorials regarding this it would great if you could point me to it.
Thanks
AC

A single Bluetooth device can connect with upto 7 devices in a piconet. If a device can do scatternet it can be connected to even more devices..
Application level connection can happen only if both devices supports the required profiles and corresponding role.
If you are trying to stream music , the profile to be used is A2DP , one device will need to be the A2DP source and other A2DP sink,
In case of Iphone it supports only A2DP source. So 2 iPhone will not connect with each other.

you can implement the bluetooth profile for this (A2DP), the big issue here is not the music streaming but the roles, you iPhones are going to play, for instance, you can be a "sound-source" and transfer audio to a "sound-sink" device, those roles have to be previously defined on the handshake and paring action, furthermore, if you are able to browse the properties of an iPhone you will get what port and what roles are supported, sadly muss I said, there is no sink role supported jet for iPhones, so the most that you can get till now is stream audio from iPhone to another bt capable device (speakers, pc, headset unit, etc) more info can be reached on the official bluetooth web site and what iOS until now supports.

Related

What can MFI enable?

I'm trying to determine what functionality I can add to a BT accessory by paying for the MFI authentication coprocessor. For example, could I...
A. Pass location data to the accessory?
B. Push incoming SMS messages to the accessory?
C. Launch my app on the phone from the accessory?
As Dennis mentioned, all information regarding the MFi program is covered under a VERY water tight NDA. However, what can be said is that all devices that connect to the iPad through Bluetooth or the docking connector port are accessed through the External Accessory framework. Documentation on the External Accessory framework is easily accessibly from Apple's documentation pages and can also be easily googled.
Communication with devices through the External Accessory framework is fairly simple once you've established a connection with a device. In short, the process is to find the desired connected accessory from an array of devices, establish a connection session and the session object contains a input and output stream. Data by creating a delegate that with the device and finally, monitor the associated input and output streams which you use to communicate with the device.
Again, the majority of the information associated with MFi is tightly sealed. However, as far as connecting to devices (that you have the right to connect to) is simple, well documented and is easily searchable since the framework is part of the standard, iOS library.
One other note on Bluetooth. There is also a Core Bluetooth framework that is available with iOS 5.0 and up. This is a much simpler framework that you can use to discover and auto pair with Bluetooth Low-Energy devices (which are part of the new Bluetooth 4.0 spec.)
If you are planning on making an iPad application or desire to have a fairly high level of backwards compatibility with earlier iOS devices, I wouldn't recommend using the new CoreBluetooth framework. The reason is because only the iPhone 4S and the soon to be released "New iPad" have the necessary Bluetooth chipset to connect with Bluetooth LE devices.
All Mfi information is under NDA.
It dosent cost anything to sign up and get access to the information , you can do it here.
https://developer.apple.com/programs/mfi/

Communication between iOS app in one Wi-Fi network w/o server

I need to communicate my app with 2 devices. A restriction is that I can't use a server but all iOS devices will be in one Wi-Fi network. What options do I have? How I can send a message to another copy of my app running on another device?
I dont know whether its a correct approach or not but as you cannot use server,so the approach i can think of is we can create a socket connection using TCP/IP or UDP(based on reliability) for data exchange.
I dont think you can communicate between 2 devices running the same application without having some kind of server application in-between.
Even if you could find the other device over the WIFI I dont think you can tell if the other device is running the app or not.
I think you may be referring to MultipeerConnectivity
The Multipeer Connectivity framework provides support for discovering
services provided by nearby iOS devices using infrastructure Wi-Fi
networks, peer-to-peer Wi-Fi, and Bluetooth personal area networks and
subsequently communicating with those services by sending
message-based data, streaming data, and resources (such as files).
Source: https://developer.apple.com/library/ios/documentation/MultipeerConnectivity/Reference/MultipeerConnectivityFramework/
Apple Sample:
https://developer.apple.com/library/ios/samplecode/MultipeerGroupChat/Introduction/Intro.html

iPhone Bluetooth application to connect to a Bluetooth printer

Has anybody succeeded in developing a bluetooth application on the iPhone that prints to a Bluetooth printer?
I have been investigating the feasibility of developing an iPhone application that could print to a Bluetooth-enabled printer. I've gone through the most of the postings in this thread and was confused by the mail exchanges.
As per my analysis:
Gamekit - can be used for bluetooth connectivity between iPhones and IPods ONLY
Bonjour - can be used for wi-fi connectivity between iPhones/IPods and bonjour-enabled printer
We can use an external accessory to connect to a third party Bluetooth-enabled printer provided the 3rd-party printer complies with the necessary regulations from Apple (registering for either “Made for iPod”/ “Works with iPhone”, and also customizing their printer with specific hardware/software, etc.)
Could someone please share their experiences?
You want their external accessory framework. Not GameKit. Happy coding!
The External Accessory framework provides support for communicating with external hardware connected to an iPhone OS–based device through the 30-pin dock connector or wirelessly using Bluetooth.
(This is exactly what you were looking for)
To detect and connect to external devices ExternalAccessoryFramework should be used.Me too developing an application for connecting iphone to other hardware devices via bluetooth .A'm facing the problem with the protocol.The protocol should be the hardware supported ones and the protocol should be given in the info plist file..
Happy coding.
You can want to try this Bluetooth printer, which is Apple MFI approved
http://www.bluebamboo.com/other_file/P25i%20Datasheet%20%28EN%29%20v1.0%2009-Oct-2011.pdf
I would bet that you would need to use Bonjour and Wi-Fi for this application. The bluetooth hardware is restricted to gameplay from what I've seen.
well i have sucsessfully accomplished bt printing on a customers I-phone both devices have to be in discovery mode to do so and then the combination wireless and bt will allow only photo printing though otherwise you will need an app

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.

GKPeerPickerController and GKSession

we can connect by bluetooth only iPodtouch or iPhone using GKSession and GKPeerPickerController right ? , or can we connect other bluetooth device ?
Bluetooth communication using GameKit (GKPeerPickerController and GKSession) is limited to iPhoneOS devices.
You can also use the internet instead of bluetooth, but once again, you are still limited to iPhoneOS devices.
If you are interested in using External Accessories, I suggest you check out Apple's Documentation on the matter. Their documentation states that:
Accessories can be physically connected to the device through the 30-pin dock connector or wirelessly using Bluetooth.
This still will not enable you to play games between devices that aren't iPhoneOS, as you need the iPhoneOS, and it's GameKit framework on both ends. If you are interested in setting such a thing up, you will have to look into managing it manually.
I would strongly advise against using bluetooth, as it's buggy, slow, and has a short range. Peer to peer Wifi or LAN play will be your best bets. I suggest looking into using Bonjour of you're using LAN play. Here are two tutorials (one, two) on using Bonjour. Happy gaming!
the last i heard, bluetooth is 'crippled' on the iphone meaning you can only transfer data via bluetooth to another device with an Apple approved bluetooth chip in it. check out the apple docs for developing 'accessories'.