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.

CC2650: GATT_READ from central to peripheral

Part Number: CC2650

Hi
I have two CC2650 launchpads and i have configured one as peripheral and created a custom service(UUID 0xBA55) and a characteristic with read and notify properties with UUID 0x2BAD.
I am trying to automatically read the characteristics' value by directly connecting to the peripheral (without button pressing). The peripheral has many services how do I read the value I want using
GATT_ReadUsingCharUUID. Once i call this function with the required parameters where do i go to get the actual value read???  in the struct

typedef struct
{
  uint16 startHandle; //!< First requested handle number (must be first field)
  uint16 endHandle;   //!< Last requested handle number
  attAttrType_t type; //!< Requested type (2 or 16 octet UUID)
} attReadByTypeReq_t;
where do i specify the UUID I want ??

i have variables which say :

// Discovered service start and end handle
static uint16_t svcStartHdl = 0;
static uint16_t svcEndHdl = 0;

// Discovered characteristic handle
static uint16_t charHdl = 0;

but i have multiple services and characteristics how do I choose the one i want? code snippets would be very helpful or links
I am using the BLE 2.2.1 SDK with TI RTOS

Thanks for all your help!!!! really appreciate it!

Ashwin Cheers!!!!

  • Hi,

    You can take look at simple_central_audio_receiver, which directly connects and discover the audio profiles.
    github.com/.../simple_central_audio_receiver
  • I have gone through the simple central audio, I am still not able to find the exact API's and method used to read the characteristic's value using the UUID.
    could you please tell me the method or some steps or some procedure?? 

    I see the handle being stored
             audioStartCharValueHandle = remoteHandles.audioStartCharValueHandle;
              audioDataCharValueHandle  = remoteHandles.audioDataCharValueHandle; with the SimpleBLECentral_SaveHandles() function

    But where do I actually get the data from? which structure contains the data ?

  • You can write to the characteristic by using GATT_WriteCharValue and then you can wait for ATT_WRITE_RSP msg sent from the server to the client.

    You can see from the case : ATT_READ_BY_TYPE_RSP in SimpleBLECentral_processGATTMsg, it discovers all the characteristic handles for the specific Service (Audio Service) and then stores it.

    You can take a look at our simplelink academy BLE custom profile to know how it works. And our software developer's guide for the software detail