This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Is there an Android Application which works with TI keyfobdemo

Other Parts Discussed in Thread: CC2540

TI has two Bluetooth client devices - keyfob and sensor tag - although similar they have different characteristics. Is there an Android demo application which works with the keyfob. Something which turns ON the simple key press characteristic and receives notifications  in some ways similar to but much limited functionality compared to BTool,

There are a number of generic BLE demo apps but these do not set the acceptable keyfob characteristic and then receive notifications from  the keyfob (example - key press and accelerometer).

If there is an implementation for Android I would appreciate a pointer to such a demo.

  • I embarked on writing my own Android application - based on the bluetooth sample app from Google.

    I was able to enable key presses, receive receive press notifications, read battery level but I could not enable the accelerometer.

    I wrote to the following UUID (based on the accompanied documentation):

    0000ffa1-0000-1000-8000-00805f9b34fb 1   - This is the enable for accelerometer

    00002901-0000-1000-8000-00805f9b34fb    BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE. This seems to be the description or configuration value for accelerometer enable.

    However after confirming that the above two steps were performed correction, I still did not see any accelerometer notifications from the keyfob.

  • where can I find  BLE sample code for Android and iOS?

    I am using  cc2540,2541  mini dev kit with keyfob.  Are there any sample  or reference codefor that?

    Thanks

  • Note this is code for Sensor Tag.

    http://www.ti.com/tool/sensortag-sw

     There is no known Android or iOS code for Keyfob. Start with the sample code which comes with SDK API18 or download software the bluetooth org. Note these are generic software hence connect to the keyfob.

  •  

    Sanjay52975 said:

    I embarked on writing my own Android application - based on the bluetooth sample app from Google.

    I was able to enable key presses, receive receive press notifications, read battery level but I could not enable the accelerometer.

    I wrote to the following UUID (based on the accompanied documentation):

    0000ffa1-0000-1000-8000-00805f9b34fb 1   - This is the enable for accelerometer

    00002901-0000-1000-8000-00805f9b34fb    BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE. This seems to be the description or configuration value for accelerometer enable.

    However after confirming that the above two steps were performed correction, I still did not see any accelerometer notifications from the keyfob.

    Hi, I met the the same problem with you.

    I was able to successfully  write 0x01 to 0xFFA1 to enable the accelerometer, but when I clicked the characteristic with 0xFFA3(the ACCEL_X_UUID), no data was called back, even the discriptors' number and content.

    I saw from the "Low Energy CC2540/41 Mini Development Kit s Guide" that ACCEL_X_UUID's GATT Server Permission field was none, I thought this might be the reason to cause the problem which  was mensioned above,
    so I made several changes in the KeyDobDemo, but nothing happened, I still couldn't get anything about the XYZ
    characteristics.

    It really drives me crazy! I really want to know have you found the way to continue your project? (I'm sorry for my poor english...)

     

  • No, I was not able to start the accelerometer from the Android application. I was able to start via iOS but no android. I am not working on it now, but if I find solution I will let you know.

  • Hey guys,

    I just follow the tutorial from 

    https://thenewcircle.com/s/post/1553/bluetooth_smart_le_android_tutorial

    and solve the problem.

    I think the critical point is to write descriptor three times (for x, y and z).

    Additionally, it's better to wait the callback function "onDescriptorWrite", and then start the next writing descriptor process.

  • Hi Allen,

    I know what you mean. But when I write descriptor for x, y and z continuously, only one of the three "onDescriptorWrite" function can be triggered (in most cases, it's x's, and It result in only x can be refreshed). Currently, I can only solve this problem by using "Thread sleep" between them, but I don't know if there is something wrong with the compatibility of my phone and the keyfob, it takes about 2s to ensure each "onDescriptorWrite" function is triggered. Do you know a better way to solve this?

  • Hi.

    From the tutorial, I just follow these code and then activate x, y and z.

    for each x, y and z

      //Enable local notifications
      gatt.setCharacteristicNotification(characteristic, true);
      //Enabled remote notifications
      BluetoothGattDescriptor desc = characteristic.getDescriptor(CONFIG_DESCRIPTOR);
      desc.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);
      gatt.writeDescriptor(desc);

    I think it may help if you wait for the onDescriptorWrite function for each characteristic.