AnsweredAssumed Answered

Can not Read/Write long attributes on GATT Client in KW41Z BLE Stack

Question asked by HUNG PHAM on Apr 5, 2020
Latest reply on May 7, 2020 by Sebastián Del Río

Hi,

 

I need to program a BLE Central using GATT Client API to read and write a characteristic with 255 bytes. After connection, getting MTU is 247.

In the BLE Application Developer's Guide saying

The GATT Client module takes care of long characteristics, whose values have a greater length than can fit in a single ATT packet, transparently by issuing repeated ATT Read Blob Request When need.

When I call API GattClient_ReadCharacteristicValue with length of 255. The stack generate error 0x04 (gBleFeatureNotSupported_c) , The feature is not supported yet.

 

      GattClient_ReadCharacteristicValue(peerDeviceId,&myCharacteristic,255);

 

For write operation API, there is a parameter that allows to transfer data more than MTU -1 size.

So when I call API GattClient_WriteCharacteristicValue with this doReliableLongCharWrites set to TRUE, the stack also generates Error = 0x04, the feature not support yet.

 

      GattClient_WriteCharacteristicValue(peerDeviceId, &myCharacteristic, 255, Value_w, FALSE, FALSE, /*Enable          Write Long attribute*/ TRUE, NULL);

 

Event, I think about calling lower API, manually handles multipe read operation with offset.

   attReadBlobRequestParams_t aRdBlobReq;
   aRdBlobReq.attributeHandle = long_char_handle;
   aRdBlobReq.valueOffset = 0;
   bleResult_t result = AttClient_SendReadBlobRequest(peerDeviceId, &aRdBlobReq);
   if (gBleSuccess_c != result)
   {
      /* Handle error */
      PRINTF("ERR: GattClient Read CharacteristicLongValue 0x%x\n\r", result);
   }
ATT_ReadBlobAttributes, it returns to error 0x04 indicates that feature unsupported.


For development environment, I uses:
- SDK_2.2.1_FRDM-KW41Z
- Bluetooth 1.2.8 lib

 

Please let me know the support of these features.

Outcomes