Other Parts Discussed in Thread: CC2650
I have configured the cc2650 in ble central mode using the SimpleBleCentral project. I am using the read function to read handle from the characteristics
uint8_t status;
attReadReq_t req;
req.handle = 0x0010;
status = GATT_ReadCharValue(connHandle, &req, selfEntity);
The read is successful and the data is displayed in the SimpleBLECentral_processGATTMsg function. I can successfully print it . I want the print data to be stored in a variable so that I can use it in my program to perform certain task. I tried creating a global variable and storing the value using sprintf but it doesn't works
uint8_t scratch;
char array[20];
for (i = 0; i < length; i++)
{
//printf("%X", pMsg->msg.readRsp.pValue[i]);
scratch = pMsg->msg.readRsp.pValue[i];
sprintf(*array,"%X",scratch);
printf("array : %s \n\r",array);
}
the sprintf does not works and the program stops there. Is there any other way I could get the read data in other functions in the program.