One of the few things I really like about my Blackberry was the red blinky light that let me know if anything new happened. The iPhone is a great device, but it is easy miss that you have a new email or text. Apple has create a centralized place to collect all of these new things you might want to know about, called the Notification Center. However, there is still no red blinky light. If you miss the screen turning on when something comes in, you wouldn’t know that you had anything new.
Apple has added something that can help fix this, Apple Notification Center Services (ANCS). This allows for devices to connect over Bluetooth LE (BLE), also known as Bluetooth Smart, and receive notifications from the iOS device. It is in iOS 7.0 and most recent iPhones and iPads. ANCS is behind a lot of the new smart watches and fitness bands that do stuff when you have a new email. All this is great, but wouldn’t it be fun if you could do something really big when you get something new?
I thought it would, so I looked for a way to build a Arduino power device that would connect to iOS ANCS. There is a BLE Arduino shield that plugs right in and comes with lots of great code. AdaFruit also has a BLE Breakout Board. They are both based on the great nRF 8001 Chip from Nordic Semiconductor. They provide an Arduino library for their chip and a free software package that makes it easy to configure the features of the chip.
I also came across some great ANCS code for AVRs & Arduinos that was 95% there. I updated it the be compatible with the latest version of the Noridc library, made it easier to pair and rolled it into an Arduino library. I am going to work on getting my code Pulled back up, but until then use my branch to pull down the latest updates.
Things are still a little messy, but the overall functionality seems to be pretty stable. You pair the devices once and after that, they automatically join. That alone could be used for some cool functionality. It would be easy to build a box that automatically unlocks when you are near-by or have it play a trumpet sound. This part about ANCS compared to other BLE profiles, is that it works natively and doesn’t require any Apps to be installed on the iOS device. With the BLE Proximity stuff, you need to have an App running on the device to make the initial connection.
Of course the reason for going through this trouble is to get notifications. ANCS pass along all of the Notifications from iOS, including 3rd party ones. You can filter them based on type or source, so you can have a different response depending on what it is. For example, you could do something really annoying for incoming calls, but more subtle for a Twitter mention.
The library works arounds Call Backs and will call the function you specify when a device Connects/Disconnects and sends a Notification.
I have included an example I am working on that displays Notifications on an LCD and turns on the Backlight.
Memory is a problem, so I have some notification fields turned off in order to have a smaller cache.
Also, is Notif a good name? Any thoughts on a better one for the library?