I'm using the SensorTag code and the SensorTag App from TI to understand how the whole Bluetooth LE system is working. Out of the box this all seems to work as expected.
Now I'm investigating how the Pairing/Bonding works. I'm using the accelerometer.c code as my example for this; I'm assuming this is typical and will represent how authentication works. If I change the Service and Characteristics read permissions to GATT_PERMIT_AUTHEN_READ, this triggers the iPhone to prompt for the pairing passcode; if I enter the passcode this all seems to work OK, and I can read the Characteristics without any problems.
However, if I change the write permissions to GATT_PERMIT_AUTHEN_WRITE, things seem to get stuck or lost... The iPhone App executes the writeValue:forCharacteristic:type method but the delegate method peripheral:didWriteValueForCharacteristic:error: never gets called (this method is always called when using the GATT_PERMIT_WRITE permissions on the SensorTag). I can still read the GATT_PERMIT_AUTHEN_READ characteristics so it appears things are Paired OK.
On the SensorTag the acc_WriteAttrCB() function never gets called for the characteristics with GATT_PERMIT_AUTHEN_WRITE permissions. If this is GATT_PERMIT_WRITE instead, then the acc_WriteAttrCB() function is always called.
Is there some configuration I could be missing on the SensorTag to enable authenticated writes? (Authenticated reads seem to be working fine).
Are there any known issues with this feature when using iOS6?
How can I get more debug information out of the SensorTag code? I've been digging around but it looks like the acc_WriteAttrCB() function is called directly from the protocol stack binary; I'm not sure what else I could be checking to understand what is going wrong... Any suggestions on how to debug what is happening would be great...
Thanks for your help
Mike