I have a custom project on a FRDM-KW38 and have it working with an self developed BT App using static GATT database. For functionality reasons, the firmware needs to use dynamic GATT database. Currently I have firmware conditionally compiled to use dynamic or static GATT database. If static GATT, I receive event type = gEvtAttributeWrittenWithoutResponse_c in BleApp_GattServerCallback() as expected, when I switch to dynamic GATT on same service I receive gEvtAttributeWritten_c event type.The static and dynamic implementations are listed below.
Using ble_5-0_AE_host_cm0p_gcc and ble_kw38a4_controller_gcc libraries from SDK_2.x_FRDM-KW38 2.6.16 (575 2022-04-3.5.0)
PRIMARY_SERVICE_UUID128(SERVICE_CAN_STREAM, uuid_service_CAN_stream)
CHARACTERISTIC_UUID128(char_CAN_rx_stream, uuid_service_CAN_rx_stream, (gGattCharPropRead_c | gGattCharPropNotify_c))
VALUE_UUID128_VARLEN(VALUE_CAN_RX_STREAM, uuid_service_CAN_rx_stream, (gPermissionFlagReadable_c), gAttMaxWriteDataSize_d(gAttMaxMtu_c)
if (gBleSuccess_c == (result = GattDbDynamic_AddCharacteristicDeclarationAndValue(
gBleUuidType128_c,
(void *) &uuid_service_CAN_rx_stream,(gattCharacteristicPropertiesBitFields_t) ((uint8_t) (gGattCharPropRead_c | gGattCharPropNotify_c)),
gAttMaxWriteDataSize_d(gAttMaxMtu_c),
1,
can_rx_value,
(gattAttributePermissionsBitFields_t) ((uint8_t) gPermissionFlagReadable_c),
&handle)))
{
value_CAN_rx_stream = handle-1;
if (gBleSuccess_c != GattDbDynamic_AddCccd(&cccd_can_rx_notify))
{
panic(0,0,0,0);
}
}
The code handles the differences between ENUM based service handles and dynamic service handles. Using BT test Apps, service properties and permissions are displayed for both static and dynamic GATT databases are the same.
Is there a defect in SDK_2.x_FRDM-KW38 2.6.16 (575 2022-04-3.5.0) ? to explain this behavior ?
Is there a newer version of SDK_2.x_FRDM-KW38 2.6.16 (575 2022-04-3.5.0) ?
>Darren