Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS receive data from bluetooth and then send information to a database on another server through wi-fi

Which libraries should I look into for the following tasks?

  1. I want to receive a string from another device via Bluetooth (this will require looking at a list of nearby devices and choosing the right one.
  2. I then want to send the String to a database via Wi-fi

This is a simple version of what I actually want to do, but I need to know how to do those things first. Also, any design tips would be greatly appreciated (like having multiple screens, which classes to write, etc).

like image 655
Aneem Avatar asked Feb 03 '12 16:02

Aneem


People also ask

Can Bluetooth transmit data?

Data is transmitted between Bluetooth-enabled devices in packets that are positioned in these slots. Frequency hopping takes place between the transmission or reception of packets, so the packets that make up one transmission may be sent over different frequencies within the ISM band.

Can you share data through Bluetooth on iPhone?

Make sure both your iPhone and the device you want to send a file to are near each other and have Bluetooth turned on. You can only use AirDrop to send files to other Apple devices. You cannot use AirDrop to send files to Android devices or Windows computers.

How do I remotely control a Bluetooth device?

Load the web app on your laptop or android device in the Chrome browser. Turn on Bluetooth on your smartphone or laptop. Click on the “Connect” button which will trigger device scanning. After connecting, you can see the device's CPU information and will be able to toggle the LED on or off.


2 Answers

If you mean receive a string from another iOS device, the statement here about needing to be a part of the "Made For iPod" program is incorrect. This would be required if you mean you are trying to build an accessory for iPhone, iPad, or iPod.

The easiest way to "discover" other iOS devices (running your app) and transfer data between them is GKSession from the GameKit Framework. Beam It! is pretty good example code for this.

Once you initialize a GKSession just set a GKSessionDelegate and set the session's available property to YES. Check out the four required GKSessionDelegate methods and the Beam It! sample code.

http://arctouch.com/beamit/ //Beam It! code

like image 38
RyanM Avatar answered Oct 30 '22 08:10

RyanM


The ordinary iOS Bluetooth APIs are only available if you enter into Apple's "Made for iPod" program. See MFi Program

If your device can use the newer "low energy" Bluetooth LE, you can look in the corebluetooth framework

There is an example of a Bluetooth LE heart rate monitor program here.

For WiFi, you can use any of several APIs from Apple and others: Berkeley unix sockets, NSURLConnection, CFNetwork, AsyncSocket, etc.

like image 123
EricS Avatar answered Oct 30 '22 06:10

EricS