Skip to main content
AM.12
Associate III
January 20, 2023
Question

Client writing a value to GATT write attribute

  • January 20, 2023
  • 6 replies
  • 1203 views

Hi,

can someone help me with how to write a value to the server from the client? which API to use

Thank you,

This topic has been closed for replies.

6 replies

ST Technical Moderator
January 20, 2023

Hello @Community member​ 

Could you please precise the STM32 product you are using? STM32WB ..? Which type of server? Do you mean using host stack subsystem of Bluetooth? If so, I suggest to refer to STM32 Bluetooth Low Energy - stm32mcu

To give better visibility on the answered topics, please click on "Best answer" on the reply which solved your issue or answered your question.Best regards,FBL
AM.12
AM.12Author
Associate III
January 20, 2023

STM32WB55CU6 custom board as client and ESP32 as server, Connection between client and server done, Now i need to write a value to server from client

AM.12
AM.12Author
Associate III
January 20, 2023

I am using GAP connection and GATT attribute method

ST Technical Moderator
January 20, 2023

Hello @Community member​ 

You can refer to AN5289, section 6 Step by step design of a BLE application. Table 6. to choose the API

To give better visibility on the answered topics, please click on "Best answer" on the reply which solved your issue or answered your question.Best regards,FBL
AM.12
AM.12Author
Associate III
January 20, 2023

Thank you,

I have followed this document to establish a connection, but in the document, I didn't understand how to write attribute value to the server from the client

Remy ISSALYS
ST Technical Moderator
January 23, 2023

Hello,

To write a value from your client to your server, in case of write without response you can use ACI_GATT_WRITE_WITHOUT_RESP command and in case of write with response you can use ACI_GATT_WRITE_CHAR_VALUE command. You can look BLE_p2pServer/BLE_p2pClient examples which allow to establish a connection and exchange information between two STM32WB boards.

Best Regards