Prepare Write Functionality on BLE KW41Z

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

Prepare Write Functionality on BLE KW41Z

1,710 Views
ashish_patel
Contributor II

Hi,

Please provide the details for the prepare write functionality on BLE KW41Z chipset?

How to configure this event or register callback for prepare write event?

How could i receive event and also respond this prepare write event?

Please let me know as soon as possible.

Thanks in Advance.

Thanks...

Ashish

Labels (1)
Tags (1)
4 Replies

1,147 Views
ashish_patel
Contributor II

Hi Gerardo,

I am testing my services development on PTS test tool. The device is configured for GATT Server on the user-defined demo. The PTS dongle is GATT Client and It will perform operations automatically.

I have registered att read and different kind of write events and also receiving each event except the long write characteristic so I was looking for any other method to register this event.

But fortunately, the problem identified by one your colleague that the peripheral library doesn't have this functionality because it is not a full library.

Thanks for your all efforts to resolve this problem.

Thanks...

Ashish

1,148 Views
ashish_patel
Contributor II

Hi Gerardo,

Thanks for your response.

I am testing reliable write functionality of ble server role using test tool which generate the prepare write request but getting error response as shown below.

************************ Prepare write request ***********************************

Send Event: ATT!ATT_PREPARE_WRITE_REQ{
lcid=0x0040,
attributeHandle=0x003A,
valueOffset=0x0000,
length=0x000D,
{
partAttributeValue=0x616E69684320676E696A696542
}
}

*********************** Prepare write response ****************************************
Receive Event: ATT?ATT_PREPARE_WRITE_CFM{
lcid=0x0040,
attributeHandle=0x0000,
valueOffset=0x0000,
length=0x0000,
result=0x0006
}

ATT Prepare Write returned an error.

*******************************************************************************************

As you said above This response from ble stack internally and we need not to do anything in application firmware.

Could you please describe that how i can avoid this error or successful write operation on it?

Below is the setting for above characteristic, which gives error.  

Characteristic properties : gGattCharPropRead_c | gGattCharPropExtendedProperties_c | gGattCharPropWrite_c 

Characteristic size is 128 bytes

Descriptor for gBleSig_CharExtndPrprtsDescriptor_d and reliable write is enabled.

Could you please provide details for how server will get the long characteristic write event in application? or it would be better if is there any working example is available for it ?

Please let me know if you want more information on it.

Thanks...

Ashish

0 Kudos

1,148 Views
gerardo_rodriguez
NXP Employee
NXP Employee

Hello Ashish,

Can you provide more details of your setup so I can better understand your use case?

I understand you have a device running a GATT server. What demo application is it running?

What are you using as the GATT client? Is it test tool communicating with another device running the FSCI black box? If so, let me know the list of commands that you are using.

I believe the section 5.2.3 Attribute write notifications from the same document covers your use case and explains how to register an attribute so it generates an event to the GATT server callback when a long characteristic is written.

Regards,

Gerardo

0 Kudos

1,147 Views
gerardo_rodriguez
NXP Employee
NXP Employee

Hello Ashish Patel,

The Prepare Write Request/Response are the attribute protocol PDUs used by the Write Long Characteristic Values or Reliable Writes sub-procedures of the Characteristic Value Write procedure. Refer to Table 4.2: GATT Procedure mapping to ATT protocol opcodes from the BLE core specification v4.2:

pastedImage_5.png

The KW41 BLE host stack will handle automatically the Prepare Write Requests and Responses when a long characteristic is being written. For information on how to register a procedure callback in your application and how to use the characteristic write procedure refer to the 5.1.4.4 Characteristic write procedure section of the BLE Application Developer's Guide.pdf document located at "<KW41 SDK>\docs\wireless\Bluetooth\".

Please let me know if you have any question.

Regards,

Gerardo

0 Kudos