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.

GATT_Notification works, GATTServApp_ProcessCharCfg does not.

Other Parts Discussed in Thread: CC2541

Hi,

using cc2541 as a slave / server. I defined a new profile with a 20 byte large characteristic. On the Characteristic Declaration I set the read / write / write_no_rsp / notify / indicate property. Master enables notification.

The Profile Attributes Table is very similar to the simplekeys Profile Attributes Table. I'm using this profile to transfere a quantity of data (1-200 bytes).

When my ReadAttrCB is called and the bytes to send are > 20 bytes, I want to send one or more notifications including the remaining bytes.

bStatus_t GeberitFrame_SetParameter(uint8 param, uint8 len, void* pValue) {

  osal_memcpy(&frameCharacteristic[0], pValue, len)

  if(GATTServApp_ProcessCharCfg(frameCharacteristicClientConfig,
                                      &frameCharacteristic[0],
                                      FALSE,
                                      frameAttrTbl,
                                      GATT_NUM_ATTRS(frameAttrTbl),
                                      INVALID_TASK_ID) == SUCCESS) {
    ret = SUCCESS;
  } else {
      ret = FAILURE;
  }
}

The return value of GATTServApp_ProcessCharCfg is SUCCES, but the data sent is corrupted (receiving the notification but the received bytes totally differ from the bytes I wanted to send).

Using GATT_Notification(0, &noti, FALSE) works well.

attHandleValueNoti_t noti;
osal_memcpy(noti.value, pValue, len); noti.handle = 0x03; noti.len = 20; GATT_Notification(0, &noti, FALSE)

What could be the reason for that?

greetings

  • Hello Elias,

    Have you confirmed, with the debugger, that your len & pValue params are correct when sending < 20 bytes? The last example you have shows a 20 byte notification, but you indicated you are sending < 20 bytes on the final notification.

    Best wishes