为ble_app_peripheral添加更多服务/特征

⚠️
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.
9个帖子/ 0新
Last post
Rajucoolsuraj.
Offline
Last seen:5 months 2 weeks ago
加入:2018-12-12 16:09
为ble_app_peripheral添加更多服务/特征

Hello Dialog,
I am experimenting with BLE_APP_PERIPHERAL and have included a service SVC4 (total 4 services) and one charactertistic (CHAR1);
On compiling the application and debugging,

1. Characteristic declaration "DECL" can be included

2.在添加特征“值”时 - 设备不通告(基于Power Profiler),但程序在调试模式下运行。

May I know the steps to make changes in SDK6.0.10 for BLE_APP_PERIPHERAL or any other to increase characteristics to atleast 10 in my SVC4 .

谢谢, looking forward for your reply ASAP.

Device:
PM_Dialog
Offline
Last seen:1 day 5 hours ago
Staff
加入:2018-02-08 11:03
Hi rajucoolsuraj,

Hi rajucoolsuraj,

The most possible reason why the device stops advertising is why the code might ger stuck somewhere. Could you please run it in debug mode and hot attached the debugger? Does the code gets stuck somewhere, for example in NMI or WDOG handler or in any assertion?

谢谢, PM_DIalog

Rajucoolsuraj.
Offline
Last seen:5 months 2 weeks ago
加入:2018-12-12 16:09
Hello Dialog,

Hello Dialog,

May I know the process on how to hot attach debugger?

谢谢

Rajucoolsuraj.
Offline
Last seen:5 months 2 weeks ago
加入:2018-12-12 16:09
[svc4_idx_svc]
[svc4_idx_svc]= {(uint8_t*)&att_decl_svc, ATT_UUID_128_LEN, PERM(RD, ENABLE), sizeof(custs1_svc4), sizeof(custs1_svc4), (uint8_t*)&custs1_svc4}, // Data Characteristic Declaration [SVC4_IDX_DATA_CHAR] = {(uint8_t*)&att_decl_char, ATT_UUID_16_LEN, PERM(RD, ENABLE), 0, 0, NULL}, // Data Characteristic Value [SVC4_IDX_DATA_VAL] = { SVC4_DATA_UUID_128, ATT_UUID_128_LEN, PERM(RD, ENABLE) sizeof(struct data_t) , 0, NULL}, // Data Characteristic Configuration descriptor [SVC4_IDX_DATA_NTF_CFG] = { (uint8_t*)&att_desc_cfg, ATT_UUID_16_LEN, PERM(RD, ENABLE) | PERM(WR, ENABLE), sizeof(uint16_t), 0, NULL}, // Data Characteristc User Description [SVC4_IDX_DATA_USER_DESC] = { (uint8_t*)&att_desc_user_desc, ATT_UUID_16_LEN, PERM(RD, ENABLE), sizeof(DEF_SVC4_DATA_USER_DESC) - 1, sizeof(DEF_SVC4_DATA_USER_DESC) - 1, DEF_SVC4_DATA_USER_DESC}, // Characteristic Declaration [SVC4_IDX_CHAR] = {(uint8_t*)&att_decl_char, ATT_UUID_16_LEN, PERM(RD, ENABLE), 0, 0, NULL}, // Characteristic Value [SVC4_IDX_VAL] = { SVC4_UUID_128, ATT_UUID_128_LEN, PERM(RD, ENABLE), DEF_SVC4_CHAR_LEN, 0, NULL}, // Characteristic User Description [SVC4_IDX_USER_DESC] = {(uint8_t*)&att_desc_user_desc, ATT_UUID_16_LEN, PERM(RD, ENABLE), sizeof(DEF_SVC4_USER_DESC) - 1, sizeof(DEF_SVC4_USER_DESC) - 1, DEF_SVC4_USER_DESC},

Hello Dialog,
There seems to be a peculiar behavior with a characteristic.

I have been trying to debug the code example above-

When CCCD is added into DB for Data Characteristic; the device does not advertise.

On commenting out the CCCD attribute of Data Char; the device begins to advertise.

为什么奇怪的行为?

问候

raju.

Rajucoolsuraj.
Offline
Last seen:5 months 2 weeks ago
加入:2018-12-12 16:09
Hello Dialog,

Hello Dialog,
The CCCD declaratio needs the right permission,
Hence, the behavior.

谢谢

raju.

PM_Dialog
Offline
Last seen:1 day 5 hours ago
Staff
加入:2018-02-08 11:03
Hi rajucoolsuraj,

Hi rajucoolsuraj,

The device stops advertising because the code gets stuck somewhere dues to the WDOG or NMI or into any assertion due to memory allocation failure. As I have mentioned in my previous post, it would be very helpful to run the firmware with the debugger hot attached. Following this way you could identify the reason why the code stacks. For example, if the reason is the WDOG expiration, the WDOG handler will be triggered. In order to learn how to attach the debugger, please read theTutorial 8: Debugging methodstutorial.

谢谢, PM_Dialog

Rajucoolsuraj.
Offline
Last seen:5 months 2 weeks ago
加入:2018-12-12 16:09
The code was configured

The code was configured incorrectly.
Its working now.
谢谢for the debugging link.

问候

raju.

PM_Dialog
Offline
Last seen:1 day 5 hours ago
Staff
加入:2018-02-08 11:03
Hi rajucoolsuraj,

Hi rajucoolsuraj,

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

谢谢, PM_Dialog

PM_Dialog
Offline
Last seen:1 day 5 hours ago
Staff
加入:2018-02-08 11:03
Hi abc1724,

Hi abc1724,

在SDK5.0.4中,有2个自定义服务可用,您可以在SDK \ BLE_STACK \ Profiles \ Custom \ Custs SDK路径下找到它们。例如,在BLE_APP_PERIALALAL示例中,仅实现自定义服务1。要添加第二个服务,您应该执行以下步骤:

  • import to your project the custs2 / custs2_task under sdk_profiles folder
  • #include "custs2.h" into user_profiles_config.h’
  • #define EXCLUDE_DLG_CUSTS2 (0) into user_modules_config.h
  • 然后,遵循自定义服务的实施1.请检查教程3:构建自定义配置文件tutorial form our support port. This might help you!

如果您想创建第三种自定义服务,则SDK没有任何规定,您应该自己完成。它不是直接实现,因为修改了SDK部分桅杆。请在Custom 1服务中找到一个教程。

https://www.dialog-seminile.com/sites/default/files/training_02_custom_profile_example_v1.2_0_0.pdf.

但是,如果您正在启动新的设计或项目,我们建议您从名为DA14531名为DA14531的最新智能障碍设备。SDK有很大改进,我们有很多代码示例和改进的文档,还有软件路线图支持。DA14580产品系列和SDK5没有任何软件路线图支持。

If you have any follow up question, I would suggest you to create a new forum thread.

谢谢, PM_Dialog