Hi,
I am using CCS 6.1, CC2650dk, updating SimpleBlePeripheral for my use.
I am calling GATT_WriteCharValue as follows:
SimpleProfile_GetParameter(SIMPLEPROFILE_CHAR1, newValue_ar);
newValue32b = BUILD_UINT32(newValue_ar[1],newValue_ar[2],newValue_ar[3],newValue_ar[4]);
LCD_WRITE_STRING_VALUE("Data Wr1 : ", newValue32b,16,LCD_PAGE3);
pReq.pValue = GATT_bm_alloc(connHandle_local, ATT_WRITE_REQ, 1, NULL);
if ( pReq.pValue != NULL ) {
pReq.handle = (uint16_t) (newValue_ar[4] + 6);
pReq.len = 1;
pReq.cmd = 0;
pReq.sig = 0;
pReq.pValue[0] = 0;
status = GATT_WriteCharValue(connHandle_local, &pReq, selfEntity);
LCD_WRITE_STRING_VALUE("Data Wr Done ", connHandle_local,16,LCD_PAGE4);
if ( status != SUCCESS ) {
LCD_WRITE_STRING_VALUE("Data Wr Fail ", status,16,LCD_PAGE5);
GATT_bm_free((gattMsg_t *)&pReq, ATT_WRITE_REQ);
}
}
else {
LCD_WRITE_STRING_VALUE("Data Alloc Fail ", connHandle,16,LCD_PAGE4);
}
break;
I am getting status of 2(alloc is passing but write is not) written on the LCD. The connHandle_local is obtained when connection is made and stored in a static as follows:
static uint16_t connHandle_local = GAP_CONNHANDLE_INIT;
....
case GAPROLE_CONNECTED:
{
uint8_t peerAddress[B_ADDR_LEN];
GAPRole_GetParameter(GAPROLE_CONN_BD_ADDR, peerAddress);
GAPRole_GetParameter(GAPROLE_CONNHANDLE, &connHandle_local);