cancel
Showing results for 
Search instead for 
Did you mean: 

BLE connected event and BLE characteristic attribute modified event

ABN
Associate III

Hey!!

I have a BLE application which runs on custom server profile. There are few characteristics of a given service, where the client can modify them. I need clarifications for the below questions.

  1. Is there any event generated by the BLE stack to know whether the client device has started a request for the connection with the server.? Also want to know whether there is any API to use to get this info.?
  2. Is there any event generated by the service/characteristic if the attribute value is modified from client device?

Thanks,

Akash

9 REPLIES 9
ABN
Associate III

@Remy ISSALYS​ @Remi QUINTIN​ 

Can you guys please help me out with this??

Remy ISSALYS
ST Employee

Hello,

You can refer to AN5270 which describes all the commands and the events available.

  1. Concerning the connection event, you can look HCI_LE_CONNECTION_COMPLETE_EVENT (see HCI_LE_CONNECTION_COMPLETE_SUBEVT_CODE in the code). The ACI_HAL_GET_LINK_STATUS command returns the status of the eight Bluetooth Low Energy links managed by the device.
  2. The ACI_GATT_ATTRIBUTE_MODIFIED_EVENT (see ACI_GATT_ATTRIBUTE_MODIFIED_VSEVT_CODE in the code) is generated by the GATT server when a client modifies any attribute on the server, as consequence of one of the following GATT procedures:

• Write without response

• Signed write without response

• Write characteristic value

• Write long characteristic value - reliable write

Best Regards

ABN
Associate III

@Remy ISSALYS​ ,

Based on your inputs, I looked out for the HCI_LE_CONNECTION_COMPLETE_SUBEVT_CODE event. This event is handled in the 'SVCCTL_App_Notification' function. I had a break-point here, when the connection was made, this break-point was not hit.

Also, similar thing happened with the attribute modified value event which is handled in 'Custom_STM_Event_Handler' . The break-points I had did not hit.

The application is running on FreeRTOS. The shci_user_evt_proc(); is not called getting called after the BLE Init

Remy ISSALYS
ST Employee

Hello,

Can you describe what you want to do? Which board are you using? Is it in front of a smartphone or another board? And can you describe your use case?

Best Regards

ABN
Associate III

Hey @Remy ISSALYS​ ,

  1. I have a BLE server profile running on FreeRTOS application. The server is advertising with some custom services and characteristics. For my application when the client connects to the server, I need to display a character. The client can modify the custom characteristics with the new data. When this happens, a different character is to be displayed on the screen. This is my application.
  2. For this application a custom board is used with STM32WB55VGY controller
  3. In the actual application, the client is smart tablet. But for testing now I'm using smartphone to connect

Remy ISSALYS
ST Employee

Hello,

Try to remove the optimization in your project, you should receive the HCI_LE_CONNECTION_COMPLETE_SUBEVT_CODE event when the connection occurred unless you are using privacy or extended advertising, in the case you will receive the HCI_LE_ENHANCED_CONNECTION_COMPLETE_EVENT event.

Best Regards

ABN
Associate III

Hey @Remy ISSALYS​,

The optimization levels are set to None(-O0). And I'm not using the privacy/extended advertising.

ABN
Associate III

@Remy ISSALYS​ ,

Hello, the issue got resolved btw. This was due to not allocating enough heap memory in the IOC.

Can you suggest the minimum required heap for the BLE applications?

Thanks,

Akash

Remy ISSALYS
ST Employee

Hello,

In basic example like BLE_HeartRate the heap size is set to 0x400.

Best Regards