Dynamic GATT vs Static

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Dynamic GATT vs Static

622 Views
Solarhacker
Contributor II

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

 

 

0 Kudos
Reply
3 Replies

559 Views
luis_maravilla
NXP Employee
NXP Employee

Dear Darren

 

Sorry for the late response

In the creation of a GATT database dynamically, We have to make a different Initialization for the Service Declaration and use the APIs provided by gatt_db_dynamic.h

 

I would recommend checking the Bluetooth Low Energy Application Developers  Guide Chapter 7.2 for Dynamic GATT Services and Chapter 12.3 for GATT Database configuration , Here is a link Bluetooth Low Energy Application Developer’s Guide

 

Also I would recommend checking this community post, for your interest about Dynamic GATT Database.

Creating a GATT database on the BLE Server through FSCI commands - NXP Community

 

And for the latest version of FRDM-KW38 SDK, is 2.6.15

 

Best Regards

Luis

0 Kudos
Reply

591 Views
Solarhacker
Contributor II

Sorry typo on SKD version should have been 2.6.15 for SDK_2_x_FRDM-KW38

Tags (1)
0 Kudos
Reply

594 Views
luis_maravilla
NXP Employee
NXP Employee
Hello

For this subject I send a private message.

Best Regards
0 Kudos
Reply