2015-07-10 21:22:47 +00:00
2015-07-10 21:29:37 +00:00
# BTstack for iOS
2015-07-01 14:41:33 +00:00
2015-07-02 18:18:15 +00:00
BTstack for iOS provides an alternative Bluetooth stack for iOS devices with a public API.
2015-07-01 14:41:33 +00:00
2015-07-02 18:18:15 +00:00
It supports the following Bluetooth Classic protocols:
2015-07-01 14:41:33 +00:00
- L2CAP
- RFCOMM
- SDP
Based on these protocols, applications or daemons can implement various Bluetooth profiles.
2015-07-02 18:18:15 +00:00
Packages that already use BTstack are: BTstack GPS, Blutrol, WeBe++, and various game emulators.
2015-07-01 14:41:33 +00:00
2015-07-02 18:18:15 +00:00
Note: As BTstack directly uses the Bluetooth hardware, the iOS Bluetooth is automatically disabled for BTstack applications & services. You can always turn BTstack off in Settings->BTstack.
2015-11-13 14:04:41 +00:00
Please visit the [project page at GitHub ](https://github.com/bluekitchen/btstack/ ) for technical information and check the port/ios subfolder.
2015-07-01 14:41:33 +00:00
2015-07-10 21:29:37 +00:00
## How to develop
2015-07-10 21:16:24 +00:00
2015-07-16 18:55:37 +00:00
To write BTstack-based applications, you don't need to compile the BTstack Cydia package.
You can just install it on your JB iOS device and copy /usr/lib/libBTstack.dylib into your
project and add btstack/include to your project includes.
2015-07-10 21:16:24 +00:00
2015-07-16 18:55:37 +00:00
While it's possible to use Xcode, I highly recommend to use theos to create apps & daemons for JB iOS devices instead.
## Compile Instructions for BTstack package
2015-07-10 21:16:24 +00:00
Install the following tools:
2015-07-10 21:29:37 +00:00
* Xcode 6.4 as /Applications/Xcode.app
* Xcode 4.4.1 as /Applications/Xcode-4.4.1.app/
* [rpetrich's theos fork ](https://github.com/rpetrich/theos ) with "lippoplastic" support
2015-07-10 21:16:24 +00:00
2015-07-16 18:55:37 +00:00
Set the $THEOS environment variable to the location of the theos checkout, e.g. like:
2015-07-10 21:16:24 +00:00
export THEOS=/Projects/theos
2015-11-13 14:04:41 +00:00
Go to btstack/port/ios and run make
2015-07-10 21:16:24 +00:00
2015-11-13 14:04:41 +00:00
cd btstack/port/ios
2015-07-10 21:16:24 +00:00
make package
2015-07-16 18:55:37 +00:00
If everything went right, you'll end up with a .deb package that you could install via:
2015-07-10 21:16:24 +00:00
make install
2015-07-14 20:48:11 +00:00
## Console Examples
With THEOS set-up as before, you can compile and install a set of command line examples in the example folder:
2015-11-13 14:04:41 +00:00
cd btstack/port/ios/example
2015-07-14 20:48:11 +00:00
make
2015-07-16 18:55:37 +00:00
You can copy the created examples to your device using scp and run it from there.
2015-07-14 20:48:11 +00:00
## Wii Mote CoocaTouch example
Similar as before, you can compile the WiiMoteOpenGLDemo by running make:
2015-11-13 14:04:41 +00:00
cd btstack/port/ios/example/WiiMoteOpenGLDemo
2015-07-14 20:48:11 +00:00
make package
You'll end up with a deb file that you can install with
make install
2015-07-16 18:55:37 +00:00
Note: as with any other JB application, you need to refresh the SpringBoard icon cache on the device to make the icon show up. After SSH to your device as root, you can execute these commands:
2015-07-14 20:48:11 +00:00
su mobile
uicache
exit