Sending Temperature and CapSense using a Custom Event

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
cayuc_1568091
Level 2
Level 2
First like received

I'm sending temperature data using DieTemp over a Custom Event bluetooth connection. I have generated the same process for sending CapSense proximity data but it seems that when I click "Notify" on the CySmart mobile app I am only able to see the temperature data. Is there a sequencing issue? Is the stack busy sending temperature data? 

0 Likes
1 Solution
Anonymous
Not applicable

Hi,

   

In your BLE Component settings -> Profile -> Plant -> Temperature, set the type as uint8[] instead of uint8.

   

Also, set the length as 2 instead of 1.

   

Regards,

   

- Madhu Sudhan

View solution in original post

0 Likes
5 Replies
Anonymous
Not applicable

Hi,

   

In your BLE Component settings -> Profile -> Plant -> Temperature, set the type as uint8[] instead of uint8.

   

Also, set the length as 2 instead of 1.

   

Regards,

   

- Madhu Sudhan

0 Likes
lock attach
Attachments are accessible only for community members.

Hi, 

   

 

   

I've tried that and no notifications are coming up for the CapSense / 2nd characteristic. Do I need to change something in main.c to also change the type of the field? 

   

 

   

(why does changing the field allow for two notifications to be sent?)

0 Likes

I fixed the problem - the code in my BLE C file did not allow for notifications to be sent for the CapSense data. 

Anonymous
Not applicable


Hello, I have a similar problem. I have a service with two characteristics ( temperature and humidity) and I created an android application to receive data from the characteristics, but I can not get one of them .

   

 

   

This is the feature that if it works (temperature):

   


cbtemp.setOnClickListener(new View.OnClickListener() { //CheckBox temperature

   

@Override

   

public void onClick(View view) {

   

boolean isChecked = ((CheckBox) view).isChecked();

   

if (isChecked) {

  BluetoothGattService mCustomService=mBluetoothLeService.getServices();

   

  BluetoothGattCharacteristic mCustomCharacteristic = mCustomService.getCharacteristic(UUID.fromString("00000002-0000-1000-   8000-00805f9b34fb"));   //UUID characteristic temperature

   

  final int charaProp = mCustomCharacteristic.getProperties();

   

  if ((charaProp | BluetoothGattCharacteristic.PROPERTY_READ) > 0) {

   

    if (mNotifyCharacteristic != null) {

   

      mBluetoothLeService.setCharacteristicNotification(mNotifyCharacteristic, false);

   

      mNotifyCharacteristic = null;

   

      }

   

mBluetoothLeService.readCharacteristic(mCustomCharacteristic); }

   

if ((charaProp | BluetoothGattCharacteristic.PROPERTY_NOTIFY) > 0) {

   

    mNotifyCharacteristic = mCustomCharacteristic;

   

    mBluetoothLeService.setCharacteristicNotification(mCustomCharacteristic, true); }

}

   

});

where getservices() function is :

public BluetoothGattService getServices(){

   

return mBluetoothGatt.getService(UUID.fromString("00000001-0000-1000-8000-00805f9b34fb"));  //UUID Service

   

}

   


For the characteristic humidity I do the same procedure but using the corresponding UUID (00000003-0000-1000-   8000-00805f9b34fb) but by clicking on the checkbox to activate it tells me :

   

java.lang.NullPointerException : Attempt to invoke virtual method ' int android.bluetooth.BluetoothGattCharacteristic.getProperties () ' on a null object reference

   


I'm really lost and not to do more . Thank you
 

0 Likes
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received
        Jesús please post your program. Also have you checked the function using the dongle to see what it is sending?   
0 Likes