Hmmmmmm this could be interesting:
https://code.google.com/p/btstack/"Bluetooth for All!
The aim of this project is to support devices for which the OS either does not provide a Bluetooth Stack or the available stack is severely limited (e.g., on the iPhone - more than 2.5 million installations). In addition, BTstack is well suited for small, resource-constraint devices such as 8 or 16 bit embedded systems as it is highly configurable and comes with an ultra small memory footprint. A minimal configuration for an SPP server on a MSP430 can run in 32 kB FLASH and only 4 kB of RAM.
On larger POSIX systems, it provides a user-space daemon that connects to the Bluetooth modules via different Bluetooth HCI transport layers (e.g., HCI H4 UART and H5 the "Tree-Wire" protocol). Multiple applications can communicate with this daemon over different inter-process communication methods.
On embedded systems, a minimal run loop implementation allows to use BTstack without a Real Time OS (RTOS). If a RTOS is already used, BTstack can be integrated and run as a single thread. The source repository provides ports for different MSP430 development boards. Other platforms can be targeted by providing the necessary UART, CPU, and CLOCK implementations, see MSP430GettingStarted and EmbeddedSystems. Get the documentation for embedded systems: BTstack Manual v1.0.
Implementation of the Bluetooth 4.0 Low Energy specification has started and BTstack can be operated both as a single mode or a dual mode stack, see BLE.
For starters, look at the Wiki pages for an Architecture overview and the little GettingStarted example for iOS.
Quite a while ago, BTstack was presented at the Google Open Source Jam in Zurich with a focus on the iPhone.
BTstack is available under a dual license. The code provided in this repository allows for non-commercial use. Commercial use is provided by BlueKitchen GmbH."