Other Parts Discussed in Thread: CC2340R5
Tool/software:
Good afternoon,
I use cc2340r5 and simplelink_lowpower_f3_sdk_8_10_01_02 .
My program is based on basic_ble with some logical modifications.
I'm trying to write a value to another device's characteristic using GATT. But when I do GATT_WriteCharValue I get to faultISR().
Here is my function to create a characteristic record query
bStatus_t GATT_API::writeCharValue(uint16_t conn_handle, uint16_t char_handle) { uint8_t* value = (uint8_t*)ICall_malloc(sizeof(uint8_t) * 2); value[0] = 7; value[1] = 0; attWriteReq_t pReq = { .handle = char_handle, .len = sizeof(value), .pValue = value, .sig = 0, .cmd = 0, }; BLEAppUtil_entityId_t taskId = BLEAppUtil_getSelfEntity(); bStatus_t status = GATT_WriteCharValue(conn_handle, &pReq, taskId); return status; }
Before that, I got the handle of the characteristic using the GATT_DiscCharsByUUID query response.
attReadByTypeRsp_t *pRsp = &(gattMsg->msg.readByTypeRsp); for (uint8_t i = 0; i < pRsp->numPairs; i++) { conn_dev_info->service_.cmd_char_handle_ = BUILD_UINT16(pRsp->pDataList[i], pRsp->pDataList[i + 1]); }
I can't figure out what I'm doing wrong with this feature entry. And it seems that there is no method of recording characteristics by UUID (although there is one for reading)