In the last update, I used a free app called Bluefruit LE Connect to facilitate the wireless communication between an iPhone and an Arduino over BLE. It’s a great little app for testing and you could conceivably use it in your project if you don’t require a custom interface, but if you need more control over the software side of things, you’re going to want to write your own app. For me, I’m ultimately curious about having a game talk to custom hardware so I made my next goal to develop an app in Unity that talks to Arduino through BLE.
Unity doesn’t have any native, built-in methods to handle BLE connections – but fortunately, that’s where the Unity Asset Store comes in. I found a great package called Bluetooth LE for iOS and Android. It’s lightweight, has clear examples and well written documentation, but it’s the developer support alone that makes the $10 a complete steal. Here’s why: testing BLE is cumbersome. It’s not something you can simulate in the Unity IDE so you end up having to create a build each time you want to try something out on the mobile device. Each time Unity compiles to Xcode, it recompiles everything, so you end up having to sit through ~5 minute builds each time you’re fumbling around trying to find that one line of code that might be wrong. I was banging my head against the wall several times but Tony patiently looked at my C# scripts + Xcode logs and helped clue me in on more than one occassion. Do check it out!