Hello I do hope someone can help me with this question as i thought it would be easy at first! I'm a studying EE student who is not that good with code but trying!
Let me tell you my goal at the end of this.....
I would like to be able to open an app on the iPhone and then execute a bit of code to send a message, all via Bluetooth.
I would like to be able to pair this small Bluetooth device to the iPhone only once and be able for it to be in sleep mode (500 nano amps :D awesome) and when I turn it on (via a small switch) it will open an app and send that message. (the app is already done, you just have to press a button on the app in order to send the message, that's why I would like to use a Bluetooth device so you don't have to have the app open at all times!)
Sorry for the long paragraph but I need help! I have the Bluegiga BLE113 dev kit and im overwhelmed with all the information they give you! But I don't see anywhere where I connect to the iPhone and do what I want to do.
Has anyone done this before, can you steer me in the right direction?
As long as the person downloading the app has previously opened the app and they've agreed to backgrounding capabilities, then yes you can send the message in the background (if already connected). However, you cannot force your app into the foreground on a non-jailbroken iOS device.
Check out the BLE Transfer App sample code to get you started.
I guess what you need is:
connectPeripheral:options:
)connectPeripheral:options:
immediatelyThis is just an outline and you need to know lots of small things to get it right. I suggest you try to go ahead and implement piece by piece and if you get stuck, ask a new questions. As @tdevoy suggested, the BTLE Transfer App is a good starting point. The Heart Rate Monitor is also a good source of info (OSX API is the same as the iOS).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With