I am currently working on a project involving interaction with Bluetooth Low Energy tag and iPhone. I want to know how I could register a key pressed on the bluetooth tag on the iPhone. i.e When a user presses a key on the tag, the app on the iPhone should be able to recognize and perform a certain function (say emit a sound).
I am using a Texas Instruments 2540 tag and was referrring to their sample code. In their code,
A key press notification has to be enabled. When a key is pressed on the tag, the corresponding service and characteristics UUID value gets updated. In the app, the 'didUpdateValueForCharacteristic" delegate method gets called and appropriate functions can be called.
However, the company designing the bluetooth tag insists that a service be created on the iPhone app (iPhone acting as a Bluetooth server) and the bluetooth tag will alert the iPhone acting as a client.
My code excerpt is
define Key_Press_Notification_Service 0xFFE0
define Key_Press_Notification_Characterisitc 0xFFEA-(void) enableButtons:(CBPeripheral *)p
{
[self notification: Key_Press_Notification_Service characteristicUUID:Key_Press_Notification_CharacterisitcUUID p:p on:YES];
}// -(void) notification... Method
// - (void)peripheral:(CBPeripheral *)peripheral didUpdateValueForCharacteristic.. Method
Can you help me on whether this is possible ?
And how I could register a key pressed from the BlueTooth tag to be identified on the iPhone ?