⚠️
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.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
5 posts / 0 new
Last post
amine_benamor
Offline
Last seen:1 year 5 months ago
加入:2019-05-02 11:16
通知超过20个字节

Hello,

How can I send a norification that is more than 20 bytes ? I read that it is related to the MTU size and the possible notification length is MTU - 3

I am using theSW Example: DA1468x BLE customer serviceas a start for my application and in the ble task there is a code segment where you can change the MTU size. I tried that but still I can only send 20 bytes with a notification.

Is it possible to extend the length of the notification ? and how to do that if it is possible

Thanks

amine_benamor

Device:
PM_Dialog
Offline
Last seen:2 days 15 hours ago
工作人员
加入:2018-02-08 11:03
Hi amine_benamor,

Hi amine_benamor,

In order to receive/send more than 20 bytes as you have mentioned, you should use the ble_gap_mtu_size_set() API, and set the appropriate mtu_size. Please note that this API function should be called prior to creating the attribute database of the device. This is because the device configuration is going to be modified, which will result in clearing the current attribute database (if it exists). Also, in the ble_config.h header file define the data length:

#define dg_configBLE_DATA_LENGTH_RX_MAX(251)

#define dg_configBLE_DATA_LENGTH_TX_MAX(251)

Thanks, PM_Dialog

amine_benamor
Offline
Last seen:1 year 5 months ago
加入:2019-05-02 11:16
Hello PM_Dialog,

Hello PM_Dialog,

I tried that but it did not work.

PS:I am talking about sending data as a notifications not when answering read/ write requests

Thanks

amine_benamor

PM_Dialog
Offline
Last seen:2 days 15 hours ago
工作人员
加入:2018-02-08 11:03
Hi amine_benamor,

Hi amine_benamor,

Let me check it and I’ll get back to you as soon as possible.

Thanks, PM_Dialog

PM_Dialog
Offline
Last seen:2 days 15 hours ago
工作人员
加入:2018-02-08 11:03
Hi amine_benamor,

Hi amine_benamor,

Can you please try to follow again the steps below? Which example of the SDK are you using and which SDK version?

In the ble_config.h header file:

#define dg_configBLE_DATA_LENGTH_RX_MAX(251)

#define dg_configBLE_DATA_LENGTH_TX_MAX(251)

According to the BLE specifications, you are able to send 251 bytes max in one packet. Be aware that the maximum size of the packet is related to SIG specifications and power consumption.

Use the ble_gap_mtu_size_set() API from ble_gap.h header file in order to set the MTU size that you want. Be aware that you have to call this function before the initialization of the attributes database. Otherwise, the database will be erased.

Thanks, PM_Dialog