RFduino => iOS => Topic started by: iphoneappdev on December 11, 2013, 02:11:51 PM
Hey I recently received my RFduino and I was looking to be able to use it with Apple's built in notification system. I was wondering if anyone had any insight into this. There seems to be very little documentation over this online.
It doesn't appear to be possible with the current RFduino API.
The provided API only appears to support RFDuino's own Service, configuring advertisement data, and iBeacons. There don't appear to be any hooks for accessing another service (like ANCS).
My understanding is that ANCS is where the iOS device acts as a BLE peripheral and some other BLE central device connects to it to receive notifications. At the moment I believe RFduino only supports the BLE "peripheral" role, so it cannot initiate a connection to an iOS device for the purpose of ANCS.
Just a minor clarification on terms:
In ANCS the iOS device is the server and another device is the client. A server owns the information that the client wants to interact with, like text message notifications. Since the RFduino's current service also acts as a server, not a client, it isn't able to act as a client to ANCS.
The terms Central/Master designates the device that controls the timing of the radio communication whereas Peripheral/Slave refers to the other device. Initially the Central does the listening and the peripheral does the advertising. Once they've connected they are in a Master/Slave relationship. I believe that in ANCS the iOS device is still the Master (controlling radio timing), but it "serves" the data to the Peripheral, which acts as the client. Note that "Central" and "Peripheral" refer to roles that devices can have. The terms Central and Peripheral are used when devices will establish a connection. There are also roles called Broadcaster and Observer.
I don't mean to be pedantic, but BLE is littered with terms with subtle differences. It can certainly be confusing.
I did some further reading about ANCS and I see I misspoke.
The typical BLE pattern is that the peripheral runs a GATT server and central runs the GATT client, but for ANCS it appears they use a less common option where the GATT roles are reversed. I'd seen mention of the ability for peripherals to act as GATT clients but wasn't aware ANCS was using it.
With RFduino the ANCS support is doubly hopeless then: Not only is there no API for acting as a GATT client, you (mostly) can't even control how it acts as a GATT server.
@bsiever is right about IOS device being GATT server and RFduino as GATT client. Actually, the lack of BLE Stack Soft Device API header file is the problem. But, it is no longer so anymore.
You just have to do this
1. Go to sketch>include library>manage libraries>
2. Install BLEPeripheral
Alternative, you can find the library at github.
There included an example for IOS ANCS. Make sure you modified the pin number settings correcting.
#define BLE_REQ -1
#define BLE_RDY -1
#define BLE_RST -1
I have tested to be working fine.
What APP is needed on the iOS to use with the BLEPehripheral example ANCS sketch?
Or, if built-in what procedure to use to test this stuff out.
No IOS App needed. Just a simple Sketch will do. You peripheral just subscribed to the service. If you use IOS nrf Connect tool you should be able to see the advertised SolicitedService UUID prior to pairing the device. Nevertheless, you do need to manage the service data to make it meaningful functions. Of course, if you need to provide user option to manage the data filter, you will definitely need an IOS app to do that. That is another level development. But for simple example e.g. blinking LED for incoming call, you don't need that. If I have time, I will post one tutorial in Hackster.io. The BLEPeripheral library has included an ANCS template as an example. I just develop based on that. Pretty easy...