Bluetooth communication between iOS and RPi 3 - ios

I'm currently working on a project that needs communication between a Raspberry Pi 3 and an iOS device.
I have achieved to pair the two devices and connect them (im using RxBluetoothKit for that) but when it comes to communication I just cant find any ressources to even guide me.
In fact I need to send a string from the RPi 3 to the iOS device and send a string from the iPhone to the RPi3
Does anyone know where i could find some help ?
I code in Swift for the app.

Related

How to broadcast to multiple iOS devices via BLE from a non-iOS device?

I am currently trying to broadcast a message to multiple iOS/Android devices from an Arduino Mega (with HM10 module) or alternatively from a Raspberry Pi Zero W.
What I've learned so far:
BLE only supports one connection at a time
iOS does not support classic Bluetooth unless MFI certified (not an option)
iOS does not support Wi-Fi direct (would solve the multi-connect problem)
Using BLE advertisements would be an option but HM10 apparently does not support advertisements over 1 byte long (need approx. 20)
Also looked into creating a WPAN from the Pi (host) because apparently there is a way (which I have not yet found) to get this to work with iOS devices
There is a straightforward library for ESP32 (GitHub Repo), does anyone have experience with that?
So, in short: BLE only connects to one device, except for advertisements which are limited on HM10 and insanely complicated on the Raspberry Pi; Wi-Fi direct is not supported by iOS
The question: Has anyone solved this problem so far? If no, are there any suggestions on what could help?
Edit: #Emil's comment got me thinking about turning the Arduino/Pi into the client and thr phonrs into slaves. This would mean that multiple phones could connect. The only problem: how do phones 'actively' connect when they are in the peripheral role?
Thanks for your help in advance.

How to connect to wifi using swift 3 in ios 9 and ios 10 devices?

As per my requirement I have to connect to a WiFi sharing device(own company product) with an iOS app. In iOS 11 I have achieved it by using NEHotspotConfigurationBut I am not able to achieve it in iOS 9 and iOS 10. WiFi device is having an ssid(fixed) and iOS app also configured with it. To connect to this device I need to use device ssid only. I have searched a lot for this solution and my findigs are
It's not possible due to security risks involved in it.
Through private api Apple80211 it is possible but you can't do this, at least not if you want to be able to publish on the App Store.
NEHotspotHelper it is possible but need to get entitlements from Apple for that need to send mail and wait till response.
Is anyone know any way like how to tackle this problem without going for third approach(above) by using only ssid in language swift 3.

How do I get data from Arduino to iPhone serially by connecting through Mac?

I am looking to play a game app that I created on my iPhone but do some of the controls through my arduino. Due to limits on what I can do, I need to connect my arduino serially (through USB cable) to my computer and then transfer the data to my iPhone to play the game. Any ideas on how I can do that?
How about using a tiny BLE-Arduino that is natively supported by iOS? For example redbearlab or rfduino controllers are arduino compatible BLE solutions which support iOS.

Bluetooth connectivity using IOS device

Hi i just want to clarify few things after i went through all the details by googling whole day.
Firstly i want to know Can we list all the devices*(including Android,blackberry etc)*using bluetooth connectivity in our ios device?
If yes how do we do??Once listing out the device can we able to connect to it*(including Android,blackberry etc)* ?According to my knowledge we cant connect to any other device using bluetooth as apple wont support.But is there any way can we connect it?Just for my knowledge purpose.
Secondly i went through framework called BluetoothManager where i saw a sample code where it displays a list of devices when bluetooth is ON, but i didnt see IOS devices listing when we use Bluetooth Manager.
So can anyone tel me For what exactly Bluetooth manager is used for and can we connect with ios device to any other Devices and tranfer files using this Framework?Is it possible?
I know about Gamkekit Framework where it is used to connect between two or more IOS devices.
But i am eager to know Other than Gamekit there are any other way where we can connect to other devices using bluetooth.
Please anyone would tel me regarding would be very helpfull for me and others as well.Looking forward to for the answers.
There are three frameworks available in iOS using which you can develop the bluetooth applications:
GameKit: This is the publicly available framework . But using this you can only establish and communicate between only two iOS device. So this framework having its own limitations .
BluetoothManager: This is private framework .I used this framework to discover the non iOS devices . I have established the connection also . But cant able to do the data exchange. I think it is still under development. For the reference you can refer this link
CoreBluetooth: This is also the public framework. This can only discover BLE enabled devices . I have successfully used this to transfer the data between the BLE enabled devices.

Bonjour not advertising over BT

I've been banging my head against this for the last week or so. I've already gone through the following resources:
StackOverflow: Bonjour over bluetooth WITHOUT Gamekit ? (3844189)
StackOverflow: How does Bonjour Over Bluetooth Work (3350094)
StackOverflow: Using iOS GameKit's “Bluetooth Bonjour” with other platforms (8070998)
Technical Q&A QA1753 -- Apple Developer
WiTap sample application
SRVResolver sample application
DNSSDObjects sample application
I'm using Mac OS 10.7, Xcode 4.5, an iPhone 4 with iOS 6, and an iPad 1 with iOS 5.1.1.
My problem is this: I am modifying an application that currently uses GameKit's peer picker to connect between an iPad and a iP{hone|od touch}. We want to modify this to use Bonjour over Bluetooth instead because we've had issues with reconnecting the devices using Gamekit if the connection is lost. I've used dns_sd.h API to some success and have gotten the service to advertise and resolve over wifi, but even though I am passing kDNSServiceFlagsIncludeP2P I am not getting any success over bluetooth.
I thought possibly Bluetooth Bonjour need a PAN established between devices already, but even pairing the iPad to the iMac and browsing for DNS-SD services gives me nothing...and the iPhone won't pair to the iPad anyway.
I just finished solving this in my own app in the last 24 hours. I used the core classes from the OS X sample app DNSSDObjects. I only had to change three lines of code to add support for bluetooth. This works great in my iOS app.
In DNSSDBrowser.m, the call to DNSServiceBrowse needs to have kDNSServiceFlagsIncludeP2P passed in for the 2nd parameter.
In DNSSDRegister.m, the call to DNSServiceRegister needs the same change.
In DNSSDService.m, the call to DNSServiceResolve also needs the same change.
If you want to limit yourself to just bluetooth, and not WiFi, then the same three lines of code should be updated so the 3rd parameter is kDNSServiceInterfaceIndexP2P instead of kDNSServiceInterfaceIndexAny.
Indeed, it looks like the kDNSServiceInterfaceIndexP2P flag won't work on OSX.
If you run the code on IOS, you'll notice that Bonjour will publish two IP Adresses: one for your local WiFi network, and an 169.xx.xx.xx adress for Bluetooth.
The same code on OSX never publishes the 169.xx.xx.xx adress, so it's only found over WiFi.

Resources