⚠️
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.
6 posts / 0 new
Last post
Marios256.
Offline
Last seen:1 year 10 months ago
Joined:2017-10-30 09:36
bytes transfered

Hello,
I am new to the ble data transfering. I am trying to send data from my da14585 to my mobile phone via reading a characteristic. When i initialiaze my array of chars over ~320 bytes, the program is stopped running. I get no warnings or errors when i build it. I would like to send 1-2 kilobytes of data.
Thank you in advance

Device:
MT_dialog
Offline
Last seen:3 months 4 days ago
Staff
Joined:2015-06-08 11:34
Hi marios256,

Hi marios256,

你想如何do that, and how exactly is that you do that when you mention that you initialize you array of chars over 320 bytes ? Perhaps your code ends up to a hardfault or in an NMI Handler, this should be easy to track if you run the device from keil and using the debugger. If you would like to have a readable characteristic the size of 250 bytes then you should declare that in the user_custs1_def.h file, for example you can try that with the ADC 2 characteristic, then if you would like to set that characteristic to a specific value you will have to send the CUSTS1_VAL_SET_REQ message with the appropriate configuration in the handle and the length field in the struct and send it, in order for the custom profile to set the value to the custom database.

Thanks MT_dialog

Marios256.
Offline
Last seen:1 year 10 months ago
Joined:2017-10-30 09:36
Hello,

Hello,
in the user_custs1_def.h file i initialized : #define DEF_USER_LED_STATE_CHAR_LEN 400 as an example. Then, in the user_custs1_impl.c I created this handler:
void app_adcval1_timer_cb_handler()
{
struct custs1_val_ntf_ind_req *req = KE_MSG_ALLOC_DYN(CUSTS1_VAL_NTF_REQ,
prf_get_task_from_id(TASK_ID_CUSTS1),
TASK_APP,
custs1_val_ntf_ind_req,
DEF_USER_LED_STATE_CHAR_LEN);
static char sample[400]="The painting is thought to be a portrait of Lisa Gherardini, the wife of Francesco del Giocondo, and is in oil on a white Lombardy poplar panel. It had been believed to have been painted between 1503 and 1506; however, Leonardo may have continued working on it as late as 1517. Recent academic work suggests that it would not have been started before 1513. It was acquired by King Francis I of Franc";
req->handle = USER_IDX_LED_STATE_VAL;
req->length = DEF_USER_LED_STATE_CHAR_LEN;

req->notification = true;
memcpy(req->value, &sample, DEF_USER_LED_STATE_CHAR_LEN);
ke_msg_send(req);}

So, when i enter debugging session and i press the run button, it is suddenly stopped. I see no warnings or errors.
Thank you a lot!

MT_dialog
Offline
Last seen:3 months 4 days ago
Staff
Joined:2015-06-08 11:34
Hi marios256,

Hi marios256,

您使用的消息是发送通知,而不是只需更改数据库中的值,以便读取它,只要发送通知,否则将修改前20个字节,除非您将MTU更改为您想要转移的大小。复制了您在BLE_APP_PERITELAL上粘贴在我身边的代码,并且一旦我启用通知并向控制点发出0x01,我就不会看到任何问题,我就不会看到任何问题,我就可以获得第一个您已粘贴并维护连接的字符串的20个字节。如果发生突然停止而不启用通知或甚至连接到设备,则此问题不是您正在执行的Mod,而是您在SDK或演示中拥有的其他内容。

Thanks MT_dialog

Marios256.
Offline
Last seen:1 year 10 months ago
Joined:2017-10-30 09:36
Good evening,

Good evening,
thank you a lot for helping me. So if I wanted to just read a characteristic transfering 1000 bytes or more what should I do?
I wrote this struct but it keeps stop running
struct sults1_val_set_req * req = ke_msg_alloc(custs1_val_set_req,prf_get_task_from_id(task_id_custs1),task_app,custs1_val_set_req);
req->handle = USER_IDX_LED_STATE_VAL;
req->length = DEF_USER_LED_STATE_CHAR_LEN;
static char sample[400]="The painting is thought to be a portrait of Lisa Gherardini, the wife of Francesco del Giocondo, and is in oil on a white Lombardy poplar panel. It had been believed to have been painted between 1503 and 1506; however, Leonardo may have continued working on it as late as 1517. Recent academic work suggests that it would not have been started before 1513. It was acquired by King Francis I of Franc";
memcpy(req->value, &sample, DEF_USER_LED_STATE_CHAR_LEN);
ke_msg_send(req);
I noticed that when i initialize in user_custs1_def.h #define DEF_USER_LED_STATE_CHAR_LEN around 350-400, the problem occurs. If i initialize it at 300, it works fine.
提前谢谢!

MT_dialog
Offline
Last seen:3 months 4 days ago
Staff
Joined:2015-06-08 11:34
Hi marios256.

Hi marios256.

Send more notifications, just send the first bulk and then after getting the confirmantion that the notification is successfully stored in the transmit buffer, send the second notification. Whenever you send a notification you will get a CUSTS1_VAL_NTF_CFM (for the custom profile), as soon as you get this you will know that the notification just send will be delivered to the central, so you can directly place the second notification.

Regarding the stop running, perhaps you hit the platform reset when you increase the size of the characteristic, try to define and increase the DB_HEAP_SZ from the da1458x_config_advanced, for example you can place a value of 2048.

Thanks MT_dialog