2021-01-06 01:27 AM
Hi I using bluenrg2 m2sp chip as pheripheral role and st ble sensor App as a Central , i need to sent notification from peripheral to Central whenever event occur , con you share information , which api i need to use in order to sent notification from peripheral to client.
Manukumar
2021-01-11 08:32 PM
You will need to initialize the characteristic with Notification property (ACI: ACI_GATT_ADD_CHAR()) - CHAR_PROP_NOTIFY
BLE stack will then generate notifications whenever the GATT attribute is modified to the subscribed devices (your Central device).
In the GATT server (peripheral device here), you may use ACI_GATT_UPDATE_CHAR_VALUE_EXT() to modify an attribute and send a notification.
2021-02-04 08:05 AM
Hi Winifred Thanks for replay ,
Winfried i found one situation were ble chip going hang mode , the detailed situation i explained below .
Here i using Bluenrg2-m2sp as peripheral role and st ble Sensor app Acts like a central
i Created one Service As notification service and one characteristics' as notification characteristic,.
the issue occur below situation .
in other Service like data service and data characteristic , when Read data validation characteristic i am performing some data validation .
if data validation is wrong i trying to sent notification for client ,
during this scenario i using existing notification characteristic, if i sent the data through this characteristic chip will hang . there is no response . i need to restart ble chip
Here may know the reason .
Note : here i am not using data validation characteristic acts like notification . just i trying to use existing notification characteristic.
2021-02-08 08:33 PM
This kind of scenario looks OK to me.
Maybe there is some dead lock in the application firmware?
You may attach a debugger to check the real status of the embedded MCU.
2021-03-08 09:13 AM
Hi Winfred thanks for Replay ,
Winfried I Enable the Notification , using characteristics property with notify and characteristic length type is variable length , here i found the issue when i tries to send the variable length data from 1-20 , bytes its working fine , if variable length greater than 20 bytes , its sending only 20 bytes , may know the reason for this ,
if you provide have any same syntax for sending variable length notification its helpful for me .
Reads
Manukumar
2021-03-09 05:21 PM
By default ATT_MTU value is 23 bytes, which determines the maximum attribute size when performing notification to 23 - 3 = 20.
Please try to enlarge ATT_MTU.
The MTU is set in the parameters during initialization with BlueNRG_Stack_Initialization(),
The client and server exchange the MTU size with:
tBleStatus aci_gatt_exchange_config(uint16_t Connection_Handle);
In response to an exchange MTU request, the aci_att_exchange_mtu_resp_event() callback is triggered, and Server_RX_MTU specifies the agreed MTU value.
void aci_att_exchange_mtu_resp_event(uint16_t Connection_Handle, uint16_t Server_RX_MTU);
2021-03-11 06:38 AM
Thanks Winfred your Replay , I will try to enlarge and test , i tried to use gatt api to enlarge ATT _MTU (because st ble acts as network co -processor and communicate host controller through uart ,) i did not find proper api , can you suggest me which api i need to use .
Regards
Manukumar
2023-08-26 11:10 AM - edited 2023-08-26 11:24 AM
In my code, aci_att_exchange_mtu_resp_event() callback never gets triggered. I found the __weak function and implemented it like
void aci_att_exchange_mtu_resp_event( uint16_t Connection_Handle, uint16_t Server_RX_MTU ){}
Am I missing something? I thought the callback functions worked just like that, but it does not get called.