⚠️
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.
7 posts / 0 new
Last post
GGQ_in
Offline
Last seen:5 months 1 week ago
加入:2019-07-23 04:41
Transmitting big data

I want DA14580 to send at least 10KB of data per second. Can it do that?

Now I have a timed reading interval of 250ms and I can transfer 1000B in one second by changing MTU to 253,

Do you have a better suggestion for the 580 to send data faster?

Thanks.

Keywords:
Device:
PM_Dialog
Offline
Last seen:6 days 18 hours ago
Staff
加入:2018-02-08 11:03
Hi GGQ_in,

Hi GGQ_in,

The amount of data that the device sends during a connection interval depends on the packets that the central allows to a peripheral to send. The payload for each packet with the standard MTU selection is 20 bytes. So each data that you send can carry up to 20 bytes. You can't control the how many packets the BLE will send during a connection interval because is up to the master of the connection. If you would like to send more than 20 bytes of data you will have to increase your MTU size, then the L2CAP will take of the rest, chop the data and fit them in more than one packets. Specifically, the number of bytes that a device can send over the air 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 is 20 bytes. By increasing the MTU size that means that you can send more bytes over the air. In your case the maximum transfer unit should be the number 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 for the MTU exchange functionality, but you can use the snippet below:

static void user_gattc_exc_mtu_cmd(uint8_t conidx) { struct gattc_exc_mtu_cmd *cmd = 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

GGQ_in
Offline
Last seen:5 months 1 week ago
加入:2019-07-23 04:41
Hi PM_Dialog,

Hi PM_Dialog,

When I tried to change MTU to 276, I found that the default attribute value type was uint8, which limited its maximum value to 255 and failed to reach the maximum value of 512, so I wanted to write a function to update the attribute value myself, but I didn't know its function structure prototype.What can I do to make the maximum value of the attribute value bigger?

我的主要目的是让580在1S内发送或读取至少10000B,同时忽略主从设备的低功耗。你有更好的计划或建议吗?

Thanks.

PM_Dialog
Offline
Last seen:6 days 18 hours ago
Staff
加入:2018-02-08 11:03
Hi GGQ_in,

Hi GGQ_in,

Can you please indicate where you found that the default attribute value type is uint8? The max size for a long characteristic is 512 bytes. The supported MTU on DA14580 can be increased up to 512 bytes. However the MTU of the connection with peer device will be the minimum of the supported MTUs of the two devices. What is the Central in your setup? Is it a mobile phone or another DA14580?

Thanks, PM_Dialog

GGQ_in
Offline
Last seen:5 months 1 week ago
加入:2019-07-23 04:41
Hi PM_Dialog,

Hi PM_Dialog,

My central device is DA14580.

attmdb_att_set_value(uint16_t handle, att_size_t length, uint8_t* value);

The value parameter in this function is the uint8_t pointer, and when I set the value of #define DEF_TEST_LONG_VALUE_CHAR_LEN to be greater than 255 and set the value of the property with the following function, the device cannot perform normal data transfer.The values of the properties in the peripheral device are increased by the timer as follows:

int i=0;

void ind_char_update_handler(void)
{

if(i < (MAX_NUM_TRA - 1))
{

dis_temp[i] = ('5');i++;

attmdb_att_set_value( (test_env.shdl + TEST_IDX_LONG_VALUE_VAL), sizeof(dis_temp), (uint8_t*)&(dis_temp));
}

app_timer_set(sa_send,task_app,10);

}

有任意hing that needs improvement?

Thanks.

GGQ_in
Offline
Last seen:5 months 1 week ago
加入:2019-07-23 04:41
Hi PM_Dialog,

Hi PM_Dialog,

Thank you for your answer.The confusion was solved when I changed the length of UUID to 16 bits.

PM_Dialog
Offline
Last seen:6 days 18 hours ago
Staff
加入:2018-02-08 11:03
Hi GGQ_in,

Hi GGQ_in,

Glad that you figured your issue out and thanks for accepting my answer.

Thanks, PM_Dialog