Multipeer Connectivity range and non ios device - ios

I just started coding Multipeer connectivity with objective c in xcode. I have a few questions about the basics.
What is the range with Multipeer Connectivity? So if I make a chat program, will the two devices only be able to communicate if they are on the wifi network, or will they still be able to communicate if they are across the globe?
Will the program work with an ios device and a non ios device, so they can send each other messages? If yes, are there any extra methods or code that I need to add?
Thanks

As far as I understand MPC works over bluetooth and wifi- so if you are on a home wifi network, or a University campus network, your peers should be able to see one another. MPCis not for using across the globe that I know of...
This is an iOS technology only, iBeacon works across multiple platforms (iOS, android).
But, depending on what you want, you could make your app use internet to go across the globe, and you might be able to use straight bluetooth to connecto to a non-iOS device, then hook into MPC.

I would like to add to Keith's answer above that MPC supports peer-to-peer Wifi as well. This means that the devices involved don't need to be connected to an access point to talk to each other.
Also, the framework protects the developer (and end user) from the underlying technology (bluetooth, WIFI, P2P WIFI) used. In a given "session" between any number of devices (currently only up to 8 supported), each device could be using a different technology to talk to the others.

Related

Two parallel iAP Bluetooth Connections

Is it possible to have two iAP Blueetooth connections open from a single iOS device (iPhone)? I know that you can be connected to more than one bluetooth device on the OS level. But will I be able to send/receive data on two parallel bluetooth connection (to two different devices) from my iPhone.
Can I talk to a device that only offers RFCOMM/SPP via the ExternalAccessory framework? These answers do not seem to give a definitive answer to that question.

Does iOS Multipeer connectivity work with non-smartphone devices?

Our guys in the field use equipment that have wifi and Bluetooth connectivity. One of our users has been using a non-iPhone (I guess Android) to transfer files between his phone and the equipment through Bluetooth. However, in switching our users to iPhones to use other enterprise apps we have discovered what some of you already know: iOS's Bluetooth connectivity is severely limited (i.e. no SPP protocol).
The equipment also communicates via wifi, so I was wondering if it's possible to create an app using iOS Multipeer connectivity to solve the Bluetooth problem. All I am finding about this, though, doesn't show anything but phone-to-phone multipeer connections, and not phone-to-machine multipeer connections.
At this point I know nothing about how the field equipment works; that's something I'll have to learn if we decide to pursue this. But assuming that it is capable of discovering wifi networks, would it be able to see the iPhone's network without needing any special software?
Or would I be wasting my time trying to figure this out?
Thanks!
If the equipment is using Bluetooth SPP then unless it is MFi certified you can pretty much forget about connecting to it from iOS. Multipeer connectivity won't do it, that's for sure.
WiFi may be a possibility - you need to get the iPhone and the equipment on the same WiFi network - you can't do this via an app though - you would need to use the WiFi settings in iOS - You will need to learn more about the equipment to see if that is possible.
Short answer: no. Only iOS 7.0+ or MacOS Yosemite+
MultipeerConnectivity is a framework for iOS and Mac OS. To send data using it, you need both devices to have iOS or MacOS with MultipeerConnectivity. You don't have any network-related parameters like "I prefer using bluetooth or wi-fi", it was designed to "just work out of box with simple goal - discover and connect other devices with MultipeerConnectivity.
It means that you can't send data from iPhone with MC to Android or Symbian or old iPhone with iOS <7 etc.
Before iOS7 you could use GameKit, but the logic is the same: both peers need to use GameKit.
If your custom equipment does not have iOS - you need to use lower-level API, and your options include generic Bonjour (NSNetService on iOS device and something Bonjour-compatible on custom device) or CoreBluetooth (obviously bluetooth-only, no wi-fi peer-to-peer) on the lowest level, using sockets and so on.

Serial or HID (usb) Communication in iOS (iPhone/iPad)

I want to get data from glucose meter devices by connecting into iPhone or iPad devices. I have different vendors glucose meters some uses simple HID interface for communicate and other uses serial communication.
These are the two possible ways of communication:
USB to 30-Pin connector.
3.5 jack to 30-Pin Connector.
USB or 3.5 jack will be connected to glucose meter and 30 pin connector will be attached with iDevice.
After having hours of research I did not find much help on internet for iOS specific.
I do find ORSSerialPort but I think it is for OS X apps only.
There is RedPark serial Cable but that is for RS232 to 30-Pin communication and secondly that can be only used in internal projects. I want to sell my application on Apple Store.
Someone also was discussing about using IOKit framework. We can communicate with iDevie but that is private framework.
Someone help me with this issue or let me know if that is even possible in iOS application.
Do Apple have any consideration on this type of working?
An iOS device can talk to external devices by following means of communications only:
Wifi
Bluetooth
GPRS &
GSM
USB (Don't exactly know what it is called)
There is no possible way to have RS232 serial port communication with iOS device.
Now What are the options left then?
Get a communication convertor in between your external device & iOS device. It can be
Serial to ethernet adapter
serial to USB adapter etc.
Embedd a wifi/bluetooth module in the external device (If it is being manufactured by you/your firm)
Have something with USB cable & mfi .(Never worked on this, but have seen stuff working with this). By something I meant, register your external device under MFI license & implement USB between devices (Again lack of clarity about USB stuff). Menwhile, I would appreciate edits on my answer by people who might improve it with USB stuff.
Update:
I visited the site of your vendor "glooko". I could not find any clue about them having any libraries for developers. So according to my opinion, they have kept their library private. They don't want you to develop apps based on their communication protocol. If you still need to develop apps for them, contact them here & let them know about your zeal.. M sure they will give you their private code. Anyhow, you don't need to register for any MFI or anything now. What you need is just the code they are using for communication & about that, nobody other than them can help you. So, all the best .. :)
Update 2:
What I understood from your updated question is, you want to create an iOS application that works with various Glucose meters, from different vendors. In a way you can call it as "universal Glucose meter app"
The short and straight answer for this is .."You Can't" . But wait, apple is not responsible for this. Neither it is impossible.
Let me tell you why. When you want your application to talk with a hardware device, there must be a communication channel between you too. You are well aware of those two options available. now, if your app must run on iDevices, the communication channel cables must be registered for mfi. Here that is also not the issue.
What is the issue then?
Different vendons don't generally follow the same communication protocols between their hardware & softwares. What happens if a german commander commands to indian soldier. Obviously, nobody will understand.
So, to achieve your objective, the only way is, you have to include SDK provided by each supported vendors in your app. Let me know if you are not yet clear..:)
There is a device called Lightning Serial Cable, the link is following.Take a look at their SDK.
http://redpark.com/lightning-serial-cable-l2-db9v/
It seems work with your application. I'm also looking for the solution that iOS device can talk to another device via serial port. In PC world, all PC has USB ports, so there is large amount of USB to serial port devices and vendors, such as FTDI and Prolific. I don't know if similar situation happens in iOS world.
Unless you join the Made For iPhone program you can not directly connect anything to an iOS device unless you use Bluetooth or TCP/IP.

Peer-to-peer network over wifi in iOS

I've been at this for a few days now, and can't seem to find a solution. I want to create a peer to peer network over wifi on iOS. All open source code seems to be supporting running a server or being a client, but there's no code built to support being both - a peer. Is anybody aware of a way I can do this?
iOS 7 adds the Multipeer Connectivity Framework for exactly this purpose.
Have you thought of using Apple's GameKit framework? I've used it in the past for some simple communication between devices. It's really simple and can get you out of the gate quickly. This looks like a good tutorial.
I think Open Peer is the right solution. It provides real direct peer-to-peer connection between devices without the need of a centralised server. Check out this introductory video.
You cannot create a wi-fi network programmatically in iOS using current APIs. GameKit offers some APIs to do so over bluetooth however.
If you wish to implement a custom solution using CocoaHTTPServer, be aware that you will still not be able to create a direct wi-fi connection, you will simply be able to connect devices on the same (pre-existing) wi-fi network.
Ad-hoc peer to peer Wi-Fi (such as 802.11s) in iOS is still a few years off. Maybe iOSX ;)
iOS supports the Multipeer Connectivity framework which enables iOS devices to talk to each other over Bluetooth, infrastructure (with a router) WiFi, or P2P.
It does not, however, provide a way to explicitly use P2P. There is a layer of abstraction away from how any of a device's peers (other iOS devices) are connected, and it does not currently allow for non-iOS devices to be connected.

What is the simplest way to connect a device to an iPad from an application?

I am working on a major product release for my company. We are designing a new device that we would like to integrate into an iOS app. (FYI, we have recently been accepted into the Apple MFi program so we are past that step.)
What we desire is to create a hardware/software eco-system where our users can start our iPad app (yes, it is specific to the iPad and the not iPhone or iPod Touch devices) and the application will automatically discover and link up with any close-proximity hardware that we've developed.
This means that I will need to implement some form of device connection process on both the iPad and within the hardware.
Is there any way to code automatic connectivity to a Bluetooth device from within an iOS application?
I am aware of the Core Bluetooth Framework which has this capability, however, it only works with the new iPhone 4S. That's not an option.
I've also researched about the External Accessory Framework, which can be used to connect to external devices whether they are connected via the iPod port or Bluetooth. This is an option but, if my understanding is correct, our hardware must already be paired with iPad before the iOS software can connect to it. This is less than preferable because although many of our devices may not be in immediate vicinity at one point in time, our customers could potentially own 100's devices that they may desire to connect to with our software.
What are my reasonable options or alternatives? The end goal is to provide a very easy means for our users to be able to connect to our devices, from within our software, on an iPad.
NOTE: I MUST NOT jailbreak the iPad or break any Apple TOS agreements.
UPDATE (3-7-2012) I saw today that the 'New iPad' (as it is being officially called) will be Bluetooth 4.0 capable. I assume this means that this iPad device will be able to use the Core Bluetooth Framework. This doesn't immediately solve my problem because we do want remain compatible with at least the "last generation" iPad device, but this is worth pointing out for others who may be looking for such an answer.
You cannot connect an iOS device to a bluetooth device without pairing first. It is purposely built that way by Apple to reduce the likelihood that someone could connect a bluetooth device without the user knowing about it. If pairing each device is unacceptable (and it sounds like it is), and you don't want to develop a dongle, the only remaining path I can see is to make your devices capable of relaying data between them like a mesh network. That way the user would only have to pair with a single device, and that paired unit would relay communications between the other devices and the iPad.
One of your alternatives would be going WiFi (AdHoc or Infrastructure) with Bonjour. For example you would be able to detect the device nearby (if it is maintaining it's own AdHoc then by SSID; if it's in infrastructure network then by service being announced). One big drawback would be that you couldn't connect directly (from app) to the device's network - user would have to do it manually.
As for BT: big drawback is lack of a serial protocol (not implemented in iPhone/iPod/iPad).

Resources