AnsweredAssumed Answered

Characteristic cannot be found by GattDb_FindCharValue

Question asked by Petr Zhuvasin on Jun 8, 2018
Latest reply on Jun 18, 2018 by Gerardo Rodríguez

Hello,

 

I create a BLE application with specific UUID128 for a service & charactersistics.

My gatt_uuid128.h file looks like this

UUID128(uuid_service, 0x19, 0xB1, 0x00, 0x00, 0xE8, 0xF2, 0x53, 0x7E, 0x4F, 0x6C, 0xD1, 0x04, 0x76, 0x8A, 0x12, 0x14)

UUID128(uuid_datachar,0x14, 0x12, 0x8a, 0x76, 0x04, 0xd1, 0x6c, 0x4f, 0x7e, 0x53, 0xf2, 0xe8, 0x05, 0x00, 0xb1, 0x1)

My gatt_db.h file looks like this

PRIMARY_SERVICE_UUID128(service_r, uuid_service)
CHARACTERISTIC_UUID128(char_device_name, uuid_service, (gGattCharPropRead_c) )
VALUE_UUID128(value_device_name, uuid_service_ring, (gPermissionFlagReadable_c), 6, "cust0")
CHARACTERISTIC_UUID128(char_data, uuid_datachar, (gGattCharPropRead_c | gGattCharPropNotify_c))
VALUE_UUID128(value_data, uuid_datachar, (gPermissionFlagReadable_c),20, 0x00)

Then, in the function of a service start in custom_service.c file in a "bluetooth->profiles" directory I have such code.

uint8_t uuid_s_Array[] = {0x19, 0xB1, 0x00, 0x00, 0xE8, 0xF2, 0x53, 0x7E, 0x4F, 0x6C, 0xD1, 0x04, 0x76, 0x8A, 0x12, 0x14};
uint8_t uuid_data_Array[] = { 0x1, 0xb1, 0x00, 0x05, 0xe8, 0xf2, 0x53, 0x7e, 0x4f, 0x6c, 0xd1, 0x04, 0x76, 0x8a, 0x12, 0x14};

bleUuid_t uuidsService;
memcpy(uuidsService.uuid128,uuid_s_Array, 16);
bleUuid_t uuidDataChar;
memcpy(uuidDataChar.uuid128, uuid_data_Array, 16);

result = GattDb_FindCharValueHandleInService(serviceConfig->serviceHandle, gBleUuidType128_c, &uuidsService, &handle);

result |= GattDb_FindCharValueHandleInService(serviceConfig->serviceHandle, gBleUuidType128_c, &uuidDataChar, &handle);

For the first result, I have 0x00 a.k.a success return value, but the second one gives me 0x902 which goes for "Characterstic not found". How can I sort it out? I am running KSDK 2.0 on a KW41Z board.

 

Best regards,

Petr

Outcomes