cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB5MMG read characterisitc

matteverze
Associate III

Hi, I want to make a simple application with an STM32WB5MMG that exposes a characteristic which I can read. I created the service and the characteristic, and I enabled the CHAR_PROP_READ property. In custom_app.c, I then use Custom_STM_App_Update_Char to update the value under the CUSTOM_STM_FW_VER_READ_EVT case branch. However, I can't read the correct value—it always returns 0.

I also tried enabling the GATT_NOTIFY_READ_REQ_AND_WAIT_FOR_APPL_RESP property, but from the debugger, I see that it doesn't even enter the void Custom_STM_App_Notification(Custom_STM_App_Notification_evt_t *pNotification) function.

Can someone help me?

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
matteverze
Associate III

Solution founded.

In custom_stm.c > Custom_STM_Event_Handler() > case ACI_GATT_READ_PERMIT_REQ_VSEVT_CODE 

add:

/*USER CODE BEGIN CUSTOM_STM_Service_1_Char_1_ACI_GATT_READ_PERMIT_REQ_VSEVT_CODE_1 */

Notification.Custom_Evt_Opcode = CUSTOM_STM_FW_VER_READ_EVT;

Custom_STM_App_Notification(&Notification);

/*USER CODE END CUSTOM_STM_Service_1_Char_1_ACI_GATT_READ_PERMIT_REQ_VSEVT_CODE_1*/

View solution in original post

1 REPLY 1
matteverze
Associate III

Solution founded.

In custom_stm.c > Custom_STM_Event_Handler() > case ACI_GATT_READ_PERMIT_REQ_VSEVT_CODE 

add:

/*USER CODE BEGIN CUSTOM_STM_Service_1_Char_1_ACI_GATT_READ_PERMIT_REQ_VSEVT_CODE_1 */

Notification.Custom_Evt_Opcode = CUSTOM_STM_FW_VER_READ_EVT;

Custom_STM_App_Notification(&Notification);

/*USER CODE END CUSTOM_STM_Service_1_Char_1_ACI_GATT_READ_PERMIT_REQ_VSEVT_CODE_1*/