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.

CC2652R: About GATT_WriteCharDesc API parameters

Part Number: CC2652R

Hi.

I wondering about the parameters of GATT_WriteCharDesc() API.

 

I checked the API guide and follow but i couldn't get ATT_WRITE_RSP as return.

And my questions of parameter is

1. what is the command flag?

2. Is the pValue for notification and indication? and len would be 2?

3. If I used bonding, sig should be 1? 

Actually I call ANCS service and Notification Source.

my code is below

---------------------------------------------------------------------------------------------------

attWriteReq_t req;

req.handle = notiHandle; //> characteristic descriptor handle.
req.len = 2; //> for notified and indicated length?
req.pValue[0] = 0x01; //> for notification?
req.pValue[1] = 0x00; //> for indication?
req.sig = 0; //> for bonding or not?
req.cmd = 0; //> ???

VOID GATT_WriteCharDesc(pMsg->connHandle, &req, selfEntity);

---------------------------------------------------------------------------------------------------

Best regards,

Kim.

  • Hey Kim,

    The application will first receive a GATT_MSG_EVENT. In our examples, when this event is triggered it calls SimpleCentral_processGATTMsg. Inside this function, the ATT_WRITE_RSP is handled. Are you looking in the correct place? I just want to verify you are not expecting a return status of that API directly to be ATT_WRITE_RSP.

    The data fields you show are a part of attWriteReq_t and these fields are outlined in the specification. If interested, see v5.2 Vol 3, Part F, Section 3.3.1 for a description of the Attribute format.

    Taking a step back, you can look at the SimpleCentral_doGattWrite function for an example of this usage. When we write to a characteristic, we pass in the handle, the length (in this case the characteristic is 1 byte so we set the length to 1. We keep sig and cmd to 0 since the payload is for a characteristic write.

    If you would like to send a notification or indication, we have an example of this as well. Open the profile simple_gatt_profile.c, and you will find that SIMPLEPROFILE_CHAR4 enables notifications.

    I highly recommend reading through our Simplelink Academy modules for Bluetooth LE training on TI devices.