UNABLE TO NOTIFY LARGE DATA

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
3 posts / 0 new
Last post
Utkarash
Offline
Last seen:9 months 2 weeks ago
Joined:2019-01-18 06:36
UNABLE TO NOTIFY LARGE DATA

Hello All,

I have used BLE peripheral example as reference where i have addded one characteristics in which i want to exchange data of around 180 bytes.

I am able to send 180 bytes of data to mobile application (tested on BLE Scanner for iOS and nrf Connect for Andriod) ,

However, when i want to notify the same data using app i am not able to get correct data in one shot,

That is in firmware i made a provision that when i receive a certain command from BLE application the firmware should reply with these 180 bytes of data,

but when i check this in application i get only half data and then when i renotify the data comes correctly.

So please help me soo that i can get this data correct and full in one shot,

I have attached images for reference below

Please Help at the earliest.

Thanks and Regards

Utkarash

Attachment:
Device:
PM_Dialog
Offline
Last seen:16 hours 33 min ago
Staff
Joined:2018-02-08 11:03
Hi Utkarash,

Hi Utkarash,

If you check the page 2 from your attached file (“Half data receive”), you will see that you get 20 bytes which is expected. Regarding the notifications, the number of bytes that a device can send over notification of a characteristic is limited by the MTU (Maximum Transfer Unit), the MTU by default is limited in 23 bytes including the ATT layer overhead, so the payload of a notification is 20 bytes. By increasing the MTU size that means that you can send more bytes over one notification, so in your case the maximum transfer unit should be the amount of bytes you would like to send + 3 extra bytes. You should change the .max_mtu of the user_gapm_conf structure of the user_config.h header file. After doing that in order to perform the exchange with the central you should send the GATTC_EXC_MTU_CMD when you have a connection (in the user_on_connection) and the 580 will perform the exchange. There is no API implemented that does this but you can use the snippet below:

static void user_gattc_exc_mtu_cmd(uint8_t conidx)

{

struct gattc_exc_mtu_cmd *厘米d = KE_MSG_ALLOC(GATTC_EXC_MTU_CMD,

KE_BUILD_ID(TASK_GATTC, conidx), TASK_APP,

gattc_exc_mtu_cmd);

cmd->req_type = GATTC_MTU_EXCH;

ke_msg_send(cmd);

}

Thanks, PM_Dialog

Utkarash
Offline
Last seen:9 months 2 weeks ago
Joined:2019-01-18 06:36
感谢你的回复,

感谢你的回复,

I will try out changes as per your suggestion.

Thanks and Regards

Utkarash